diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2013-03-03 05:37:13 +0100 |
---|---|---|
committer | Nebojsa Cvetkovic <nebkat@gmail.com> | 2013-03-03 08:51:34 +0000 |
commit | 1e39be6b64d2fb996120079d221463f0ecd47897 (patch) | |
tree | 039366e48f07bb3d1bda6bce42e2cddf4a9c7c19 /src | |
parent | 1e20d97c20b1529cabf054cff3e99a6cd954512c (diff) | |
download | android_packages_apps_Trebuchet-1e39be6b64d2fb996120079d221463f0ecd47897.tar.gz android_packages_apps_Trebuchet-1e39be6b64d2fb996120079d221463f0ecd47897.tar.bz2 android_packages_apps_Trebuchet-1e39be6b64d2fb996120079d221463f0ecd47897.zip |
Launcher: Fix overflow menu button
On rotate screen, at all apps drawer in Trebuchet, the overflow menu icon overlays the market
icon. This changes contains:
1.- Modify the app_customize_pane layout to avoid that overflow button and market button overlap
each other.
2.- Move updateOverflowMenuButton() from runNewAppsAnimation to bindAllApplications. The overflow
button need to be updated every time the all app drawer change.
3.- Fix preferencesVisible assignment. If we are in CM and launcher is Trebuchet and device
has not permanent button, the overflow menu should be displayed.
4.- Fix onCreateOptionsMenu. On AllAppsVisible the menu should be recreated always
5.- Buttons padding (market and overflow) are reduced to avoid a bad visual effect when
both buttons are one beside the other.
Before: https://www.dropbox.com/s/i9vgp6sh35nsnjt/before_phone_portrait.png
After: https://www.dropbox.com/s/es5j35ny1jf9ey8/after_phone_portrait.png
https://www.dropbox.com/s/6sztai1hq0w9ngr/after_phone_landscape.png
Patchset 2: Remove unnecessary invalidateOptionsMenu() call
Change-Id: I7ec08ff00ed4705846c0b46639965899b16a143d
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Launcher.java | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java index 320b86936..adcb61cb3 100644 --- a/src/com/cyanogenmod/trebuchet/Launcher.java +++ b/src/com/cyanogenmod/trebuchet/Launcher.java @@ -3314,17 +3314,7 @@ public final class Launcher extends Activity // 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()); - - // Check to see if overflow menu is shown - Intent launcherIntent = new Intent(Intent.ACTION_MAIN); - launcherIntent.addCategory(Intent.CATEGORY_HOME); - launcherIntent.addCategory(Intent.CATEGORY_DEFAULT); - ActivityInfo defaultLauncher = getPackageManager().resolveActivity(launcherIntent, PackageManager.MATCH_DEFAULT_ONLY).activityInfo; - // Hide preferences if not on CyanogenMod or not default launcher - // (in which case preferences don't get shown in system settings) - boolean preferencesVisible = !getPackageManager().hasSystemFeature("com.cyanogenmod.android") || - !defaultLauncher.packageName.equals(getClass().getPackage().getName()); - if (activityName != null && (ViewConfiguration.get(this).hasPermanentMenuKey() || !preferencesVisible)) { + if (activityName != null) { int coi = getCurrentOrientationIndexForGlobalIcons(); mAppMarketIntent = intent; sAppMarketIcon[coi] = updateTextButtonWithIconFromExternalActivity( @@ -3374,12 +3364,10 @@ public final class Launcher extends Activity // (in which case preferences don't get shown in system settings) boolean preferencesVisible = !getPackageManager().hasSystemFeature("com.cyanogenmod.android") || !defaultLauncher.packageName.equals(getClass().getPackage().getName()); - if (ViewConfiguration.get(this).hasPermanentMenuKey() || !preferencesVisible) { - overflowMenuButton.setVisibility(View.GONE); - overflowMenuButton.setEnabled(false); - } else { - overflowMenuButton.setVisibility(View.VISIBLE); - } + + boolean disabled = ViewConfiguration.get(this).hasPermanentMenuKey() || !preferencesVisible; + overflowMenuButton.setVisibility(disabled ? View.GONE : View.VISIBLE); + overflowMenuButton.setEnabled(!disabled); } /** |