diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2013-04-28 05:11:42 +0200 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2013-05-07 03:26:39 +0200 |
commit | decbaf63416b21d1aece708b8c0b6523b47f74ac (patch) | |
tree | c2f7d9ea09bb0eb6c00bcb9d04bc943a7de196f0 /src/com/cyanogenmod/trebuchet/Workspace.java | |
parent | 59b16ee37be235d175a04114af9de402f5d5dfec (diff) | |
download | android_packages_apps_Trebuchet-decbaf63416b21d1aece708b8c0b6523b47f74ac.tar.gz android_packages_apps_Trebuchet-decbaf63416b21d1aece708b8c0b6523b47f74ac.tar.bz2 android_packages_apps_Trebuchet-decbaf63416b21d1aece708b8c0b6523b47f74ac.zip |
Trebuchet: Labels on dock items
Patchset 4: Discard item scale and use paddings to adjust the workspace
Patchset 5: mHideDockIconLabels = false on vertical hotseat
Patchset 6: Fixed FolderIcon typo
Fixed inline style
Remove Workspace injection on Launcher class
Use isLargeScreen to show text in vertical hotseat
Change-Id: I00c57a28b4c7110b66ec6f856df8865006a76699
JIRA: CYAN-523
Issue: https://jira.cyanogenmod.org/browse/CYAN-523
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/Workspace.java')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Workspace.java | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Workspace.java b/src/com/cyanogenmod/trebuchet/Workspace.java index 8a5d03a60..10ef99dcf 100644 --- a/src/com/cyanogenmod/trebuchet/Workspace.java +++ b/src/com/cyanogenmod/trebuchet/Workspace.java @@ -30,6 +30,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Bitmap; @@ -306,6 +307,7 @@ public class Workspace extends PagedView private boolean mShowHotseat; private boolean mResizeAnyWidget; private boolean mHideIconLabels; + private boolean mHideDockIconLabels; private boolean mScrollWallpaper; private int mWallpaperSize; private boolean mShowScrollingIndicator; @@ -393,6 +395,12 @@ public class Workspace extends PagedView mShowSearchBar = PreferencesProvider.Interface.Homescreen.getShowSearchBar(); mShowHotseat = PreferencesProvider.Interface.Dock.getShowDock(); mHideIconLabels = PreferencesProvider.Interface.Homescreen.getHideIconLabels(); + boolean showHotseat = PreferencesProvider.Interface.Dock.getShowDock(); + boolean verticalHotseat = + res.getBoolean(R.bool.hotseat_transpose_layout_with_orientation) && + res.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; + mHideDockIconLabels = PreferencesProvider.Interface.Dock.getHideIconLabels() || + (!showHotseat || (verticalHotseat && !LauncherApplication.isScreenLarge())); mTransitionEffect = PreferencesProvider.Interface.Homescreen.Scrolling.getTransitionEffect( res.getString(R.string.config_workspaceDefaultTransitionEffect)); mScrollWallpaper = PreferencesProvider.Interface.Homescreen.Scrolling.getScrollWallpaper(); @@ -678,24 +686,15 @@ public class Workspace extends PagedView // Hide titles in the hotseat if (child instanceof FolderIcon) { - ((FolderIcon) child).setTextVisible(false); + ((FolderIcon) child).setTextVisible(!mHideDockIconLabels); } else if (child instanceof BubbleTextView) { - ((BubbleTextView) child).setTextVisible(false); + ((BubbleTextView) child).setTextVisible(!mHideDockIconLabels); } } else { - if (!mHideIconLabels) { - // Show titles if not in the hotseat - if (child instanceof FolderIcon) { - ((FolderIcon) child).setTextVisible(true); - } else if (child instanceof BubbleTextView) { - ((BubbleTextView) child).setTextVisible(true); - } - } else { - if (child instanceof FolderIcon) { - ((FolderIcon) child).setTextVisible(false); - } else if (child instanceof BubbleTextView) { - ((BubbleTextView) child).setTextVisible(false); - } + if (child instanceof FolderIcon) { + ((FolderIcon) child).setTextVisible(!mHideIconLabels); + } else if (child instanceof BubbleTextView) { + ((BubbleTextView) child).setTextVisible(!mHideIconLabels); } layout = (CellLayout) getChildAt(screen); @@ -3787,9 +3786,7 @@ public class Workspace extends PagedView case LauncherSettings.Favorites.ITEM_TYPE_FOLDER: view = FolderIcon.fromXml(R.layout.folder_icon, mLauncher, cellLayout, (FolderInfo) info); - if (mHideIconLabels) { - ((FolderIcon) view).setTextVisible(false); - } + ((FolderIcon) view).setTextVisible(!mHideIconLabels); break; default: throw new IllegalStateException("Unknown item type: " + info.itemType); |