Skip to content

Commit

Permalink
Update to release 2.0.2
Browse files Browse the repository at this point in the history
- Fixed search toolbar color
- Added ABC Launcher to apply section
- Updated dependency
  • Loading branch information
danimahardhika authored Feb 17, 2017
1 parent 49aaa6d commit 8597676
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,7 @@ public void OnSearchExpanded(boolean expand) {
mIsMenuVisible = !expand;

if (expand) {
int color = ColorHelper.getAttributeColor(this, R.attr.search_toolbar);
ViewHelper.changeSearchViewActionModeColor(this,
collapsingToolbar, R.attr.colorPrimary, R.attr.search_toolbar);
ColorHelper.setStatusBarColor(this, color);

int icon = ColorHelper.getAttributeColor(this, R.attr.search_toolbar_icon);
toolbar.setNavigationIcon(DrawableHelper.getTintedDrawable(
this, R.drawable.ic_toolbar_back, icon));
toolbar.setNavigationIcon(R.drawable.ic_toolbar_back);
toolbar.setNavigationOnClickListener(view -> onBackPressed());
} else {
SoftKeyboardHelper.closeKeyboard(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
mSearchView.setIconifiedByDefault(false);
mSearchView.clearFocus();

int color = ColorHelper.getAttributeColor(getActivity(), R.attr.search_toolbar_icon);
ViewHelper.changeSearchViewTextColor(mSearchView, color,
ColorHelper.getAttributeColor(getActivity(), R.attr.search_toolbar_hint));
int color = ColorHelper.getAttributeColor(getActivity(), R.attr.toolbar_icon);
ViewHelper.changeSearchViewTextColor(mSearchView,
color, ColorHelper.setColorAlpha(color, 0.6f));
View view = mSearchView.findViewById(android.support.v7.appcompat.R.id.search_plate);
if (view != null) view.setBackgroundColor(Color.TRANSPARENT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public class LauncherHelper {
private static final int ITOP = 25;
private static final int ZERO = 26;
private static final int V = 27;
private static final int ABC = 28;

private static int getLauncherId(String packageName) {
if (packageName == null) return UNKNOWN;
Expand Down Expand Up @@ -125,6 +126,8 @@ private static int getLauncherId(String packageName) {
return ZERO;
case "com.vivid.launcher":
return V;
case "com.abclauncher.launcher":
return ABC;
default:
return UNKNOWN;
}
Expand Down Expand Up @@ -478,6 +481,26 @@ private static void applyLauncher(@NonNull Context context, String launcherPacka
openGooglePlay(context, launcherPackage, launcherName);
}
break;
case ABC:
try {
/*
* Just want to let anyone who is going to copy
* It's not easy searching for this
* I will be grateful if you take this with a proper credit
* Thank you
*/
final Intent abc = context.getPackageManager().getLaunchIntentForPackage(
"com.abclauncher.launcher");
final Intent abc1 = new Intent("com.abclauncher.launcher.themes.themeaction");
abc1.putExtra("theme_package_name", context.getPackageName());
abc.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.sendBroadcast(abc1);
context.startActivity(abc);
((AppCompatActivity) context).finish();
} catch (ActivityNotFoundException | NullPointerException e) {
openGooglePlay(context, launcherPackage, launcherName);
}
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public boolean isFirstRun() {
return getSharedPreferences().getBoolean(KEY_FIRST_RUN, true);
}

void setFirstRun(boolean bool) {
public void setFirstRun(boolean bool) {
getSharedPreferences().edit().putBoolean(KEY_FIRST_RUN, bool).apply();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ public static void showPremiumRequestExist(@NonNull Context context) {
}

public static void checkPiracyApp(@NonNull Context context) {
boolean premiumRequest = context.getResources().getBoolean(R.bool.enable_premium_request);
//Dashboard don't need to check piracy app if premium request is disabled
if (!premiumRequest) return;

//Lucky Patcher and Freedom package name
String[] strings = new String[] {
"com.chelpus.lackypatch",
Expand All @@ -228,14 +232,12 @@ public static void checkPiracyApp(@NonNull Context context) {
string, PackageManager.GET_ACTIVITIES);
if (packageInfo != null) {
isPiracyAppInstalled = true;
Preferences.getPreferences(context).setPremiumRequestEnabled(false);
return;
break;
}
} catch (Exception ignored) {}
}

Preferences.getPreferences(context).setPremiumRequestEnabled(
context.getResources().getBoolean(R.bool.enable_premium_request));
Preferences.getPreferences(context).setPremiumRequestEnabled(!isPiracyAppInstalled);

try {
RequestListener listener = (RequestListener) context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ protected Boolean doInBackground(Void... voids) {
byte data[] = new byte[1024];
long total = 0;
int count;

while ((count = stream.read(data)) != -1) {
total += count;
if (fileLength > 0)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core/src/main/res/drawable/ic_toolbar_close.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="?attr/search_toolbar_icon"
android:fillColor="?attr/toolbar_icon"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
10 changes: 7 additions & 3 deletions core/src/main/res/layout/fragment_icons_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
<android.support.design.widget.TabLayout
android:id="@+id/tab"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:visibility="invisible"
android:paddingLeft="8dp"
android:paddingStart="8dp"
android:paddingRight="8dp"
android:paddingEnd="8dp"
android:clipToPadding="false"
app:tabIndicatorColor="?attr/tab_indicator"
app:tabSelectedTextColor="?attr/tab_text_selected"
app:tabTextColor="?attr/tab_text"
app:tabIndicatorHeight="2dp"
app:tabPaddingStart="14dp"
app:tabPaddingEnd="14dp"
app:tabPadding="@dimen/tab_padding"
app:tabMode="scrollable" />

<android.support.v4.view.ViewPager
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/res/layout/fragment_licenses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />

</RelativeLayout>
1 change: 1 addition & 0 deletions core/src/main/res/values-sw600dp/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<!-- Toolbar -->
<dimen name="tab_text">16sp</dimen>
<dimen name="tab_padding">14dp</dimen>

<!-- Splash Screen -->
<dimen name="splash_screen_logo">114dp</dimen>
Expand Down
4 changes: 0 additions & 4 deletions core/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,4 @@

<attr name="home_title" format="color"/>

<attr name="search_toolbar" format="color"/>
<attr name="search_toolbar_icon" format="color"/>
<attr name="search_toolbar_hint" format="color"/>

</resources>
10 changes: 0 additions & 10 deletions core/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
<color name="toolbarIcon">#FFFFFFFF</color>
<color name="toolbarIconDark">#FFFFFFFF</color>

<!-- Toolbar Search -->
<color name="searchToolbar">#E2E2E2</color>
<color name="searchToolbarDark">#181818</color>
<color name="searchToolbarIcon">#555555</color>
<color name="searchToolbarIconDark">#DDFFFFFF</color>
<color name="searchToolbarHintText">#44000000</color>
<color name="searchToolbarHintTextDark">#44FFFFFF</color>

<!-- Home -->
<color name="homeTitle">#FFFFFF</color>
<color name="homeTitleDark">#FFFFFF</color>
Expand Down Expand Up @@ -76,8 +68,6 @@
<color name="primaryTextDark">#EEFFFFFF</color>
<color name="secondaryText">#777777</color>
<color name="secondaryTextDark">#99FFFFFF</color>
<color name="hintText">#44FFFFFF</color>
<color name="hintTextDark">#44FFFFFF</color>
<color name="dividerList">#EEEEEE</color>
<color name="dividerListDark">#22FFFFFF</color>

Expand Down
7 changes: 6 additions & 1 deletion core/src/main/res/values/dashboard_launchers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<item>Solo Launcher</item>
<item>Zero Launcher</item>
<item>V Launcher</item>
<item>ABC Launcher</item>
</string-array>

<array name="launcher_icons">
Expand Down Expand Up @@ -57,6 +58,7 @@
<item>@drawable/ic_launcher_solo</item>
<item>@drawable/ic_launcher_zero</item>
<item>@drawable/ic_launcher_v</item>
<item>@drawable/ic_launcher_abc</item>
</array>

<!-- Launcher Packages -->
Expand Down Expand Up @@ -87,6 +89,7 @@
<item>home.solo.launcher.free</item> <!-- 23 -->
<item>com.zeroteam.zerolauncher</item> <!-- 24 -->
<item>com.vivid.launcher</item> <!-- 25 -->
<item>com.abclauncher.launcher</item> <!-- 26 -->
</string-array>

<string-array name="launcher_packages_2">
Expand Down Expand Up @@ -115,7 +118,8 @@
<item>ginlemon.flowerpro</item> <!-- 22 -->
<item>none</item> <!-- 23 -->
<item>none</item> <!-- 24 -->
<item>note</item> <!-- 25 -->
<item>none</item> <!-- 25 -->
<item>none</item> <!-- 26 -->
</string-array>

<string-array name="launcher_packages_3">
Expand Down Expand Up @@ -145,6 +149,7 @@
<item>none</item> <!-- 23 -->
<item>none</item> <!-- 24 -->
<item>note</item> <!-- 25 -->
<item>none</item> <!-- 26 -->
</string-array>

</resources>
6 changes: 1 addition & 5 deletions core/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<!-- Toolbar -->
<dimen name="toolbar_shadow">8dp</dimen>
<dimen name="tab_text">14sp</dimen>
<dimen name="tab_padding">12dp</dimen>

<!-- Splash Screen -->
<dimen name="splash_screen_logo">96dp</dimen>
Expand All @@ -38,11 +39,6 @@
<dimen name="home_feature_padding">8dp</dimen>
<dimen name="home_image_height">220dp</dimen>

<!-- Apply -->
<dimen name="launcher_icon_size">68dp</dimen>
<dimen name="launcher_icon_column_width">100dp</dimen>
<dimen name="launcher_icon_padding">16dp</dimen>

<!-- Icons -->
<dimen name="icon_thumbnail_padding">16dp</dimen>
<dimen name="icon_preview">90dp</dimen>
Expand Down
8 changes: 0 additions & 8 deletions core/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,10 @@
<item name="toolbar_accent">@color/colorAccent</item>
<item name="divider_list">@color/dividerList</item>
<item name="home_feature_line">@color/homeFeatureLine</item>
<item name="hint_text">@color/hintText</item>
<item name="tab_indicator">@color/tabIndicator</item>
<item name="tab_text">@color/tabText</item>
<item name="tab_text_selected">@color/tabTextSelected</item>
<item name="home_title">@color/homeTitle</item>
<item name="search_toolbar">@color/searchToolbar</item>
<item name="search_toolbar_icon">@color/searchToolbarIcon</item>
<item name="search_toolbar_hint">@color/searchToolbarHintText</item>

<item name="md_positive_color">@color/colorAccent</item>
<item name="md_neutral_color">@color/primaryText</item>
Expand Down Expand Up @@ -72,14 +68,10 @@
<item name="toolbar_accent">@color/darkColorAccent</item>
<item name="divider_list">@color/dividerListDark</item>
<item name="home_feature_line">@color/homeFeatureLineDark</item>
<item name="hint_text">@color/hintTextDark</item>
<item name="tab_indicator">@color/tabIndicatorDark</item>
<item name="tab_text">@color/tabTextDark</item>
<item name="tab_text_selected">@color/tabTextSelectedDark</item>
<item name="home_title">@color/homeTitleDark</item>
<item name="search_toolbar">@color/searchToolbarDark</item>
<item name="search_toolbar_icon">@color/searchToolbarIconDark</item>
<item name="search_toolbar_hint">@color/searchToolbarHintTextDark</item>

<item name="md_background_color">@color/cardBackgroundDark</item>
<item name="md_positive_color">@color/darkColorAccent</item>
Expand Down

0 comments on commit 8597676

Please sign in to comment.