Commit 60a046a3 authored by Amit Kumar's avatar Amit Kumar
Browse files

Add android.mk

parent fd9ee901
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := BlissLauncherO
LOCAL_CERTIFICATE := platform
LOCAL_DEX_PREOPT := false
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_MANIFEST_FILE := app/src/main/AndroidManifest.xml
LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/app/src/main/res/
ifeq ($(TARGET_BUILD_APPS),)
LOCAL_RESOURCE_DIR += frameworks/support/v7/appcompat/res
LOCAL_RESOURCE_DIR += frameworks/support/v7/gridlayout/res
else
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/appcompat/res
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/gridlayout/res
endif
LOCAL_SRC_FILES := $(call all-java-files-under, app/src/main/)
# unbundled
LOCAL_STATIC_JAVA_LIBRARIES := \
android-common \
android-support-v4 \
android-support-v7-appcompat \
android-support-v7-gridlayout \
rxrelay \
rxjava \
rxandroid
LOCAL_SDK_VERSION := current
LOCAL_PRIVILEGED_MODULE := true
LOCAL_AAPT_FLAGS := --auto-add-overlay \
--extra-packages android.support.v4 \
--extra-packages android.support.v7.appcompat \
--extra-packages android.support.v7.gridlayout \
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := rxrelay:libs/rxrelay-2.0.0.jar rxjava:libs/rxjava-2.1.10.jar rxandroid:libs/rxandroid-2.0.2.aar
include $(BUILD_MULTI_PREBUILT)
# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
......@@ -72,9 +70,4 @@ dependencies {
androidTestImplementation "com.android.support.test.espresso:espresso-core:${rootProject.ext.espressoVersion}"
androidTestImplementation "com.android.support.test:runner:${rootProject.ext.runnerRulesVersion}"
androidTestImplementation "com.android.support.test:rules:${rootProject.ext.runnerRulesVersion}"
// Crashlytics
compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true
}
}
......@@ -4,25 +4,7 @@
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.android.email.permission.ACCESS_PROVIDER" />
<uses-permission android:name="com.google.android.gm.permission.READ_CONTENT_PROVIDER" />
<uses-permission android:name="com.sec.android.provider.badge.permission.READ" />
<uses-permission android:name="com.fsck.k9.permission.READ_MESSAGES" />
<uses-permission android:name="com.kaitenmail.permission.READ_MESSAGES" />
<uses-permission android:name="com.kaitenmail.adsupported.permission.READ_MESSAGES" />
<uses-permission android:name="android.intent.action.BADGE_COUNT_UPDATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.email.permission.READ_ATTACHMENT" />
<uses-permission android:name="android.email.permission.ACCESS_PROVIDER" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<application
android:name=".BlissLauncher"
......@@ -58,9 +40,5 @@
<meta-data
android:name="io.fabric.ApiKey"
android:value="8fcf342f1b8ac74d6980872082b7216ef4682a29" />
</application>
</manifest>
......@@ -2,14 +2,9 @@ package org.indin.blisslaunchero;
import android.app.Application;
import com.crashlytics.android.Crashlytics;
import io.fabric.sdk.android.Fabric;
public class BlissLauncher extends Application {
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
}
}
......@@ -32,28 +32,25 @@ public class Storage {
* @param dock
*/
public void save(final List<GridLayout> pages, final GridLayout dock) {
AsyncTask.execute(new Runnable() {
@Override
public void run() {
JSONObject data = new JSONObject();
JSONArray pagesData = new JSONArray();
JSONArray dockData = new JSONArray();
try {
for (int i = 0; i < pages.size(); i++) {
stuffData(pagesData, pages.get(i));
}
stuffData(dockData, dock);
data.put("pages", pagesData);
data.put("dock", dockData);
SharedPreferences.Editor editor = prefs.edit();
editor.putString("LAYOUT", data.toString(4));
editor.putBoolean("LAYOUT_PRESENT", true);
editor.commit();
} catch(Exception e) {
Log.e(TAG, "Couldn't save layout " + e);
AsyncTask.execute(() -> {
JSONObject data = new JSONObject();
JSONArray pagesData = new JSONArray();
JSONArray dockData = new JSONArray();
try {
for (int i = 0; i < pages.size(); i++) {
stuffData(pagesData, pages.get(i));
}
stuffData(dockData, dock);
data.put("pages", pagesData);
data.put("dock", dockData);
SharedPreferences.Editor editor = prefs.edit();
editor.putString("LAYOUT", data.toString(4));
editor.putBoolean("LAYOUT_PRESENT", true);
editor.commit();
} catch(Exception e) {
Log.e(TAG, "Couldn't save layout " + e);
}
});
}
......
package org.indin.blisslaunchero.data.model;
/**
* Created by falcon on 18/3/18.
*/
public class OtherInfo {
public int count;
public String packageName;
}
package org.indin.blisslaunchero.notification;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
......
package org.indin.blisslaunchero.notification;
import android.content.Intent;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
import android.util.Log;
......
......@@ -42,11 +42,10 @@ import android.widget.FrameLayout;
import android.widget.GridLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.crashlytics.android.Crashlytics;
import org.indin.blisslaunchero.R;
import org.indin.blisslaunchero.data.db.Storage;
import org.indin.blisslaunchero.data.model.AppItem;
......@@ -62,6 +61,7 @@ import org.indin.blisslaunchero.widgets.BlissFrameLayout;
import org.indin.blisslaunchero.widgets.BlissInput;
import org.indin.blisslaunchero.widgets.CustomAnalogClock;
import org.indin.blisslaunchero.widgets.HorizontalPager;
import org.indin.blisslaunchero.widgets.SquareFrameLayout;
import org.indin.blisslaunchero.widgets.SquareImageView;
import org.json.JSONArray;
import org.json.JSONObject;
......@@ -79,7 +79,7 @@ import java.util.UUID;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.observers.DisposableObserver;
public class LauncherActivity extends AppCompatActivity implements LauncherView {
public class LauncherActivity extends AppCompatActivity {
private HorizontalPager mHorizontalPager;
private GridLayout mDock;
......@@ -160,13 +160,13 @@ public class LauncherActivity extends AppCompatActivity implements LauncherView
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mHorizontalPager = findViewById(R.id.pages_container);
mDock = findViewById(R.id.dock);
mIndicator = findViewById(R.id.page_indicator);
mFolderWindowContainer = findViewById(R.id.folder_window_container);
mFolderApps = findViewById(R.id.folder_apps);
mBlissInput = findViewById(R.id.folder_title);
mProgressBar = findViewById(R.id.progressbar);
mHorizontalPager = (HorizontalPager) findViewById(R.id.pages_container);
mDock = (GridLayout) findViewById(R.id.dock);
mIndicator = (LinearLayout) findViewById(R.id.page_indicator);
mFolderWindowContainer = (ViewGroup) findViewById(R.id.folder_window_container);
mFolderApps = (GridLayout) findViewById(R.id.folder_apps);
mBlissInput = (BlissInput) findViewById(R.id.folder_title);
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
......@@ -483,7 +483,6 @@ public class LauncherActivity extends AppCompatActivity implements LauncherView
Toast.makeText(LauncherActivity.this, "Recreating Launcher",
Toast.LENGTH_SHORT).show();
e.printStackTrace();
Crashlytics.logException(e);
recreate();
}
......@@ -794,7 +793,7 @@ public class LauncherActivity extends AppCompatActivity implements LauncherView
mHorizontalPager.addView(layout, 0);
currentPageNumber = 1;
mHorizontalPager.setCurrentPage(currentPageNumber);
mSearchInput = layout.findViewById(R.id.search_input);
mSearchInput = (EditText) layout.findViewById(R.id.search_input);
layout.setOnDragListener(null);
mSearchInput.setOnFocusChangeListener((v, hasFocus) -> {
......@@ -908,9 +907,9 @@ public class LauncherActivity extends AppCompatActivity implements LauncherView
Log.d(TAG, "prepareApp() called with: app = [" + app + "]");
final BlissFrameLayout v = (BlissFrameLayout) getLayoutInflater().inflate(R.layout.app_view,
null);
final TextView label = v.findViewById(R.id.app_label);
final TextView label = (TextView) v.findViewById(R.id.app_label);
final View icon = v.findViewById(R.id.app_icon);
final SquareImageView squareImageView = v.findViewById(R.id.icon_image_view);
final SquareImageView squareImageView = (SquareImageView) v.findViewById(R.id.icon_image_view);
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) icon.getLayoutParams();
layoutParams.leftMargin = appIconMargin;
......@@ -925,19 +924,19 @@ public class LauncherActivity extends AppCompatActivity implements LauncherView
}
if (app.isClock()) {
final CustomAnalogClock analogClock = v.findViewById(R.id.icon_clock);
final CustomAnalogClock analogClock = (CustomAnalogClock) v.findViewById(R.id.icon_clock);
analogClock.setAutoUpdate(true);
analogClock.setVisibility(View.VISIBLE);
squareImageView.setVisibility(GONE);
} else if (app.isCalendar()) {
TextView monthTextView = v.findViewById(R.id.calendar_month_textview);
TextView monthTextView = (TextView) v.findViewById(R.id.calendar_month_textview);
monthTextView.getLayoutParams().height = appIconWidth * 40 / 192;
monthTextView.getLayoutParams().width = appIconWidth;
int monthPx = appIconWidth * 48 / 192;
monthTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, monthPx / 2);
TextView dateTextView = v.findViewById(R.id.calendar_date_textview);
TextView dateTextView = (TextView) v.findViewById(R.id.calendar_date_textview);
int datePx = appIconWidth * 154 / 192;
dateTextView.getLayoutParams().height = appIconWidth * 152 / 192;
dateTextView.getLayoutParams().width = appIconWidth;
......@@ -1118,7 +1117,7 @@ public class LauncherActivity extends AppCompatActivity implements LauncherView
}
} else {
// Remove uninstall icon
ImageView imageView = viewGroup.findViewById(R.id.uninstall_app);
ImageView imageView = (ImageView) viewGroup.findViewById(R.id.uninstall_app);
if (imageView != null) {
((ViewGroup) imageView.getParent()).removeView(imageView);
}
......@@ -1133,7 +1132,7 @@ public class LauncherActivity extends AppCompatActivity implements LauncherView
private void addUninstallIcon(ViewGroup viewGroup) {
final AppItem appItem = getAppDetails(viewGroup);
if (!appItem.isSystemApp()) {
FrameLayout appIcon = viewGroup.findViewById(R.id.app_icon);
SquareFrameLayout appIcon = (SquareFrameLayout) viewGroup.findViewById(R.id.app_icon);
int size = (appIcon.getRight() - appIcon.getLeft()) / 5;
if (size > appIcon.getTop() || size > appIcon.getLeft()) {
......@@ -1852,24 +1851,4 @@ public class LauncherActivity extends AppCompatActivity implements LauncherView
}
}
}
@Override
public void showApps(List<AppItem> allAppItems, List<AppItem> pinnedAppItems) {
}
@Override
public void showNotificationBadges(Map<String, Integer> map) {
}
@Override
public void showLoading() {
mProgressBar.setVisibility(View.VISIBLE);
}
@Override
public void hideLoading() {
mProgressBar.setVisibility(View.GONE);
}
}
......@@ -6,8 +6,6 @@ import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Property;
......@@ -48,16 +46,16 @@ public class BlissFrameLayout extends FrameLayout {
private Paint mPaint;
private boolean mWithText;
public BlissFrameLayout(@NonNull Context context) {
public BlissFrameLayout(Context context) {
this(context, null, 0);
}
public BlissFrameLayout(@NonNull Context context,
@Nullable AttributeSet attrs) {
public BlissFrameLayout(Context context,
AttributeSet attrs) {
this(context, attrs, 0);
}
public BlissFrameLayout(@NonNull Context context, @Nullable AttributeSet attrs,
public BlissFrameLayout(Context context, AttributeSet attrs,
int defStyleAttr) {
super(context, attrs, defStyleAttr);
mContext = context;
......
......@@ -5,7 +5,6 @@ import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.support.annotation.DrawableRes;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.View;
......@@ -83,8 +82,8 @@ public class CustomAnalogClock extends View {
setFace(r.getDrawable(drawableRes));
}
public void init(Context context, @DrawableRes int watchFace, @DrawableRes int hourHand,
@DrawableRes int minuteHand, @DrawableRes int secHand, int alpha, boolean is24,
public void init(Context context, int watchFace, int hourHand,
int minuteHand, int secHand, int alpha, boolean is24,
boolean hourOnTop) {
CustomAnalogClock.is24 = is24;
......
package org.indin.blisslaunchero.widgets;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.ImageView;
......@@ -16,12 +15,11 @@ public class SquareImageView extends android.support.v7.widget.AppCompatImageVie
super(context);
}
public SquareImageView(Context context,
@Nullable AttributeSet attrs) {
public SquareImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SquareImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
......
package org.indin.blisslaunchero.widgets;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
/**
......@@ -12,16 +9,16 @@ import android.widget.LinearLayout;
*/
public class SquareLinearLayout extends LinearLayout {
public SquareLinearLayout(@NonNull Context context) {
public SquareLinearLayout(Context context) {
super(context);
}
public SquareLinearLayout(@NonNull Context context,
@Nullable AttributeSet attrs) {
public SquareLinearLayout(Context context,
AttributeSet attrs) {
super(context, attrs);
}
public SquareLinearLayout(@NonNull Context context, @Nullable AttributeSet attrs,
public SquareLinearLayout(Context context, AttributeSet attrs,
int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
......
......@@ -60,7 +60,7 @@
android:background="@null"
android:imeOptions="actionDone"
android:inputType="textNoSuggestions"
android:text="Untitled"
android:text="@string/untitled"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="18sp" />
......
{
"baselineGridVisible": true,
"baselineGridCellSize": 8,
"keylines": [
{
"offset": 16,
"from": "LEFT"
},
{
"offset": 72,
"from": "LEFT"
},
{
"offset": 16,
"from": "RIGHT"
}
],
"spacings": [
{
"offset": 0,
"size": 16,
"from": "LEFT"
},
{
"offset": 56,
"size": 16,
"from": "LEFT"
},
{
"offset": 0,
"size": 16,
"from": "RIGHT"
}
]
}
\ No newline at end of file
<resources>
<string name="app_name">Bliss Launcher</string>
<string name="search">Search</string>
<string name="untitled">Untitled</string>
</resources>
......@@ -3,21 +3,17 @@
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'io.fabric.tools:gradle:1.+'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
maven { url 'https://maven.fabric.io/public' }
google()
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment