summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/values/strings.xml3
-rw-r--r--src/com/cyngn/theme/chooser/ChooserActivity.java19
2 files changed, 14 insertions, 8 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ad06862..7326940 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -44,9 +44,6 @@
<!-- Shop themes -->
<string name="shop_themes">Shop themes</string>
- <string name="themes_showcase_link" translatable="false">
- https://play.google.com/store/apps/details?id=com.cyngn.theme.store
- </string>
<!-- Overlay titles -->
<string name="apply_theme_overlay_title">Apply</string>
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);
}
}
};