summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-09-30 11:06:59 -0700
committerWinson Chung <winsonc@google.com>2013-09-30 11:06:59 -0700
commitd64a66617b6b6aaa3d1d9f9220c33411acdca729 (patch)
tree38623df3197617a1eb8247495abcf6c422089c7b /src
parentab37bce36a7bc54cfcd634df95ca08e7e6143230 (diff)
downloadandroid_packages_apps_Trebuchet-d64a66617b6b6aaa3d1d9f9220c33411acdca729.tar.gz
android_packages_apps_Trebuchet-d64a66617b6b6aaa3d1d9f9220c33411acdca729.tar.bz2
android_packages_apps_Trebuchet-d64a66617b6b6aaa3d1d9f9220c33411acdca729.zip
Disable update logic for market button.
Change-Id: Ie05995b18252cc78c38b3cb0886407b0c5a13be0
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/Launcher.java81
1 files changed, 47 insertions, 34 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 9f7b02183..11772fde7 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -281,8 +281,6 @@ public class Launcher extends Activity
private static HashMap<Long, FolderInfo> sFolders = new HashMap<Long, FolderInfo>();
- private Intent mAppMarketIntent = null;
-
// Related to the auto-advancing of widgets
private final int ADVANCE_MSG = 1;
private final int mAdvanceInterval = 20000;
@@ -301,6 +299,9 @@ public class Launcher extends Activity
private static Drawable.ConstantState[] sVoiceSearchIcon = new Drawable.ConstantState[2];
private static Drawable.ConstantState[] sAppMarketIcon = new Drawable.ConstantState[2];
+ private Intent mAppMarketIntent = null;
+ private static final boolean DISABLE_MARKET_BUTTON = true;
+
private Drawable mWorkspaceBackgroundDrawable;
private final ArrayList<Integer> mSynchronouslyBoundPages = new ArrayList<Integer>();
@@ -513,7 +514,9 @@ public class Launcher extends Activity
int coi = getCurrentOrientationIndexForGlobalIcons();
if (sGlobalSearchIcon[coi] == null || sVoiceSearchIcon[coi] == null ||
sAppMarketIcon[coi] == null) {
- updateAppMarketIcon();
+ if (!DISABLE_MARKET_BUTTON) {
+ updateAppMarketIcon();
+ }
searchVisible = updateGlobalSearchIcon();
voiceVisible = updateVoiceSearchIcon(searchVisible);
}
@@ -525,7 +528,7 @@ public class Launcher extends Activity
updateVoiceSearchIcon(sVoiceSearchIcon[coi]);
voiceVisible = true;
}
- if (sAppMarketIcon[coi] != null) {
+ if (!DISABLE_MARKET_BUTTON && sAppMarketIcon[coi] != null) {
updateAppMarketIcon(sAppMarketIcon[coi]);
}
if (mSearchDropTargetBar != null) {
@@ -1527,7 +1530,9 @@ public class Launcher extends Activity
}
// When Launcher comes back to foreground, a different Activity might be responsible for
// the app market intent, so refresh the icon
- updateAppMarketIcon();
+ if (!DISABLE_MARKET_BUTTON) {
+ updateAppMarketIcon();
+ }
clearTypedText();
}
}
@@ -2268,10 +2273,12 @@ public class Launcher extends Activity
}
public void onClickAppMarketButton(View v) {
- if (mAppMarketIntent != null) {
- startActivitySafely(v, mAppMarketIntent, "app market");
- } else {
- Log.e(TAG, "Invalid app market intent.");
+ if (!DISABLE_MARKET_BUTTON) {
+ if (mAppMarketIntent != null) {
+ startActivitySafely(v, mAppMarketIntent, "app market");
+ } else {
+ Log.e(TAG, "Invalid app market intent.");
+ }
}
}
@@ -3374,35 +3381,39 @@ public class Launcher extends Activity
* Sets the app market icon
*/
private void updateAppMarketIcon() {
- final View marketButton = findViewById(R.id.market_button);
- Intent intent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_APP_MARKET);
- // Find the app market activity by resolving an intent.
- // (If multiple app markets are installed, it will return the ResolverActivity.)
- ComponentName activityName = intent.resolveActivity(getPackageManager());
- if (activityName != null) {
- int coi = getCurrentOrientationIndexForGlobalIcons();
- mAppMarketIntent = intent;
- sAppMarketIcon[coi] = updateTextButtonWithIconFromExternalActivity(
- R.id.market_button, activityName, R.drawable.ic_launcher_market_holo,
- TOOLBAR_ICON_METADATA_NAME);
- marketButton.setVisibility(View.VISIBLE);
- } else {
- // We should hide and disable the view so that we don't try and restore the visibility
- // of it when we swap between drag & normal states from IconDropTarget subclasses.
- marketButton.setVisibility(View.GONE);
- marketButton.setEnabled(false);
+ if (!DISABLE_MARKET_BUTTON) {
+ final View marketButton = findViewById(R.id.market_button);
+ Intent intent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_APP_MARKET);
+ // Find the app market activity by resolving an intent.
+ // (If multiple app markets are installed, it will return the ResolverActivity.)
+ ComponentName activityName = intent.resolveActivity(getPackageManager());
+ if (activityName != null) {
+ int coi = getCurrentOrientationIndexForGlobalIcons();
+ mAppMarketIntent = intent;
+ sAppMarketIcon[coi] = updateTextButtonWithIconFromExternalActivity(
+ R.id.market_button, activityName, R.drawable.ic_launcher_market_holo,
+ TOOLBAR_ICON_METADATA_NAME);
+ marketButton.setVisibility(View.VISIBLE);
+ } else {
+ // We should hide and disable the view so that we don't try and restore the visibility
+ // of it when we swap between drag & normal states from IconDropTarget subclasses.
+ marketButton.setVisibility(View.GONE);
+ marketButton.setEnabled(false);
+ }
}
}
private void updateAppMarketIcon(Drawable.ConstantState d) {
- // Ensure that the new drawable we are creating has the approprate toolbar icon bounds
- Resources r = getResources();
- Drawable marketIconDrawable = d.newDrawable(r);
- int w = r.getDimensionPixelSize(R.dimen.toolbar_external_icon_width);
- int h = r.getDimensionPixelSize(R.dimen.toolbar_external_icon_height);
- marketIconDrawable.setBounds(0, 0, w, h);
+ if (!DISABLE_MARKET_BUTTON) {
+ // Ensure that the new drawable we are creating has the approprate toolbar icon bounds
+ Resources r = getResources();
+ Drawable marketIconDrawable = d.newDrawable(r);
+ int w = r.getDimensionPixelSize(R.dimen.toolbar_external_icon_width);
+ int h = r.getDimensionPixelSize(R.dimen.toolbar_external_icon_height);
+ marketIconDrawable.setBounds(0, 0, w, h);
- updateTextButtonWithDrawable(R.id.market_button, marketIconDrawable);
+ updateTextButtonWithDrawable(R.id.market_button, marketIconDrawable);
+ }
}
@Override
@@ -3824,7 +3835,9 @@ public class Launcher extends Activity
// Update the market app icon as necessary (the other icons will be managed in response to
// package changes in bindSearchablesChanged()
- updateAppMarketIcon();
+ if (!DISABLE_MARKET_BUTTON) {
+ updateAppMarketIcon();
+ }
mWorkspaceLoading = false;
if (upgradePath) {