diff options
author | d34d <clark@cyngn.com> | 2015-04-15 14:42:03 -0700 |
---|---|---|
committer | Andy Mast <andy@cyngn.com> | 2015-04-17 19:43:33 +0000 |
commit | 04e482b0fb116c5fd0be87add3192b93ec35be0a (patch) | |
tree | afa50bbb53cf593a15e7673a422743493364417f /src | |
parent | df0a56c9c3f4c260f988f0394bc454b7d78e4f7a (diff) | |
download | packages_apps_ThemeChooser-04e482b0fb116c5fd0be87add3192b93ec35be0a.zip packages_apps_ThemeChooser-04e482b0fb116c5fd0be87add3192b93ec35be0a.tar.gz packages_apps_ThemeChooser-04e482b0fb116c5fd0be87add3192b93ec35be0a.tar.bz2 |
Remove deprecated theme showcase for shop themes
Now that theme showcase is deprecated and the store is shipping on
our devices, we no longer need the string for themes showcase and
the code that relied on that. This patch adds a check for the
theme store, even though it SHOULD be installed, and hides the
shop themes button in this case.
Change-Id: I89746914698305eb736c354440218d37dcdce02c
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyngn/theme/chooser/ChooserActivity.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/com/cyngn/theme/chooser/ChooserActivity.java b/src/com/cyngn/theme/chooser/ChooserActivity.java index 36e6149..5fce6fa 100644 --- a/src/com/cyngn/theme/chooser/ChooserActivity.java +++ b/src/com/cyngn/theme/chooser/ChooserActivity.java @@ -215,7 +215,7 @@ public class ChooserActivity extends FragmentActivity } }); - if (Utils.isRecentTaskThemeStore(this)) { + if (shouldHideShopThemes()) { mBottomActionsLayout.findViewById(R.id.shop_themes).setVisibility(View.GONE); } if (PreferenceUtils.getShowPerAppThemeNewTag(this)) { @@ -276,6 +276,18 @@ public class ChooserActivity extends FragmentActivity .setDuration(ANIMATE_SHOP_THEMES_SHOW_DURATION); } + private boolean shouldHideShopThemes() { + boolean hasThemeStore = false; + try { + if (getPackageManager().getPackageInfo(THEME_STORE_PACKAGE, 0) != null) { + hasThemeStore = true; + } + } catch (PackageManager.NameNotFoundException e) { + + } + return !hasThemeStore || Utils.isRecentTaskThemeStore(this); + } + @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); @@ -784,10 +796,7 @@ public class ChooserActivity extends FragmentActivity try { startActivity(intent); } catch (ActivityNotFoundException e) { - // Unable to launch the theme store so link the user to it - intent = new Intent(Intent.ACTION_VIEW, - Uri.parse(getString(R.string.themes_showcase_link))); - startActivity(intent); + Log.e(TAG, "Unable to launch Theme Store", e); } } }; |