summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-04-28 05:11:42 +0200
committerJorge Ruesga <jorge@ruesga.com>2013-05-08 01:53:42 +0200
commit7fc2a5039f11da376076213ff9613a84e678fc55 (patch)
treec2f7d9ea09bb0eb6c00bcb9d04bc943a7de196f0
parent59b16ee37be235d175a04114af9de402f5d5dfec (diff)
downloadandroid_packages_apps_Trebuchet-7fc2a5039f11da376076213ff9613a84e678fc55.tar.gz
android_packages_apps_Trebuchet-7fc2a5039f11da376076213ff9613a84e678fc55.tar.bz2
android_packages_apps_Trebuchet-7fc2a5039f11da376076213ff9613a84e678fc55.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: I055817d30e95ea7f5beaa7e7bdb242c6e887d2fd JIRA: CYAN-523 Issue: https://jira.cyanogenmod.org/browse/CYAN-523 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
-rw-r--r--res/values-sw340dp/dimens.xml2
-rw-r--r--res/values-sw600dp/dimens.xml2
-rw-r--r--res/values-sw720dp/dimens.xml3
-rw-r--r--res/values/cm_strings.xml2
-rw-r--r--res/values/dimens.xml4
-rw-r--r--res/xml/preferences_dock.xml5
-rw-r--r--src/com/cyanogenmod/trebuchet/CellLayout.java9
-rw-r--r--src/com/cyanogenmod/trebuchet/FolderIcon.java1
-rw-r--r--src/com/cyanogenmod/trebuchet/Hotseat.java21
-rw-r--r--src/com/cyanogenmod/trebuchet/Launcher.java50
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherModel.java10
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherProvider.java4
-rw-r--r--src/com/cyanogenmod/trebuchet/Workspace.java33
-rw-r--r--src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java3
14 files changed, 117 insertions, 32 deletions
diff --git a/res/values-sw340dp/dimens.xml b/res/values-sw340dp/dimens.xml
index 7fcbefd06..e7ab9f584 100644
--- a/res/values-sw340dp/dimens.xml
+++ b/res/values-sw340dp/dimens.xml
@@ -23,12 +23,14 @@
<dimen name="hotseat_height_gap">0dp</dimen>
<!-- height of the bottom row of controls -->
<dimen name="button_bar_height">62dip</dimen>
+ <dimen name="button_bar_height_with_text">90dip</dimen>
<!-- Because portal animations go beyond the bounds of an icon, we need
to make the dock layout slightly larger than the button_bar_height -->
<dimen name="button_bar_height_bottom_padding">0dp</dimen>
<dimen name="button_bar_width_left_padding">8dp</dimen>
<dimen name="button_bar_width_right_padding">8dp</dimen>
<dimen name="button_bar_height_plus_padding">62dp</dimen>
+ <dimen name="button_bar_height_plus_padding_with_text">90dp</dimen>
<!-- CellLayout padding land / port-->
<dimen name="cell_layout_left_padding_port">8dp</dimen>
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index bf19e5c88..55d9bf7fb 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -35,11 +35,13 @@
<dimen name="hotseat_width_gap">-1dp</dimen>
<dimen name="hotseat_height_gap">-1dp</dimen>
<dimen name="button_bar_height">94dip</dimen>
+ <dimen name="button_bar_height_with_text">@dimen/button_bar_height</dimen>
<dimen name="button_bar_height_bottom_padding">14dp</dimen>
<dimen name="button_bar_height_top_padding">20dp</dimen>
<dimen name="button_bar_width_left_padding">25dp</dimen>
<dimen name="button_bar_width_right_padding">25dp</dimen>
<dimen name="button_bar_height_plus_padding">104dp</dimen>
+ <dimen name="button_bar_height_plus_padding_with_text">@dimen/button_bar_height_plus_padding</dimen>
<!-- Folders -->
<!-- The size of the image which sits behind the preview of the folder contents -->
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml
index 80d4b3bb4..6e1727dbb 100644
--- a/res/values-sw720dp/dimens.xml
+++ b/res/values-sw720dp/dimens.xml
@@ -21,11 +21,13 @@
<!-- Hotseat -->
<dimen name="button_bar_height">82dp</dimen>
+ <dimen name="button_bar_height_with_text">@dimen/button_bar_height</dimen>
<dimen name="button_bar_height_top_padding">12dp</dimen>
<dimen name="button_bar_height_bottom_padding">12dp</dimen>
<dimen name="button_bar_width_left_padding">12dp</dimen>
<dimen name="button_bar_width_right_padding">12dp</dimen>
<dimen name="button_bar_height_plus_padding">82dp</dimen>
+ <dimen name="button_bar_height_plus_padding_with_text">@dimen/button_bar_height_plus_padding</dimen>
<dimen name="hotseat_width_gap">58dp</dimen>
<!-- QSB -->
@@ -89,6 +91,7 @@
<dimen name="workspace_top_padding_port">@dimen/qsb_bar_height_inset</dimen>
<dimen name="workspace_top_padding_land">@dimen/qsb_bar_height_inset</dimen>
<dimen name="workspace_bottom_padding_port">@dimen/button_bar_height_plus_padding</dimen>
+ <dimen name="workspace_bottom_padding_port_with_text">@dimen/button_bar_height_plus_padding</dimen>
<dimen name="workspace_bottom_padding_land">@dimen/button_bar_height_plus_padding</dimen>
<!-- Divider width set to match the qsb width -->
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index affa6591c..511e0d527 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -139,6 +139,8 @@
<string name="preferences_interface_dock_default_page_summary">Choose the default page</string>
<string name="preferences_interface_dock_icons_title">Icons</string>
<string name="preferences_interface_dock_icons_summary">Number of icons/columns in the dock</string>
+ <string name="preferences_interface_dock_hide_icon_labels_title">Hide icon labels</string>
+ <string name="preferences_interface_dock_hide_icon_labels_summary">Hide dock icon labels</string>
<string name="preferences_interface_dock_icon_scale_title">Icon scale</string>
<string name="preferences_interface_dock_icon_scale_summary">Scale of icons in the dock</string>
<string name="preferences_interface_dock_divider_title">Show dock divider</string>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index a5ffc0ba6..21eaf2570 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -79,6 +79,7 @@
<!-- height of the bottom row of controls -->
<dimen name="button_bar_height">62dip</dimen>
+ <dimen name="button_bar_height_with_text">90dip</dimen>
<!-- Because portal animations go beyond the bounds of an icon, we need
to make the dock layout slightly larger than the button_bar_height -->
<dimen name="button_bar_height_top_padding">0dp</dimen>
@@ -86,6 +87,7 @@
<dimen name="button_bar_width_left_padding">0dp</dimen>
<dimen name="button_bar_width_right_padding">0dp</dimen>
<dimen name="button_bar_height_plus_padding">62dp</dimen>
+ <dimen name="button_bar_height_plus_padding_with_text">90dp</dimen>
<!-- Drag padding to add to the bottom of drop targets -->
<dimen name="drop_target_drag_padding">14dp</dimen>
@@ -148,6 +150,7 @@
<dimen name="workspace_top_padding_port">@dimen/qsb_bar_height_inset</dimen>
<dimen name="workspace_top_padding_land">0dp</dimen>
<dimen name="workspace_bottom_padding_port">@dimen/button_bar_height</dimen>
+ <dimen name="workspace_bottom_padding_port_with_text">100dp</dimen>
<dimen name="workspace_bottom_padding_land">0dp</dimen>
<dimen name="workspace_left_padding_port_qsb_hidden">0dp</dimen>
@@ -171,4 +174,5 @@
<!-- Preferences -->
<dimen name="header_icon_width">28dp</dimen>
+
</resources>
diff --git a/res/xml/preferences_dock.xml b/res/xml/preferences_dock.xml
index c07a1cb39..f24c64f9f 100644
--- a/res/xml/preferences_dock.xml
+++ b/res/xml/preferences_dock.xml
@@ -44,6 +44,11 @@
launcher:max="@integer/hotseat_cell_count"
launcher:min="3" />
<!-- android:dependency="ui_dock_enabled" /-->
+ <CheckBoxPreference android:key="ui_dock_hide_icon_labels"
+ android:title="@string/preferences_interface_dock_hide_icon_labels_title"
+ android:summary="@string/preferences_interface_dock_hide_icon_labels_summary"
+ android:defaultValue="true" />
+ <!-- android:dependency="ui_dock_enabled" /-->
<com.cyanogenmod.trebuchet.preference.SeekBarDialogPreference android:key="ui_dock_icon_scale"
android:title="@string/preferences_interface_dock_icon_scale_title"
android:summary="@string/preferences_interface_dock_icon_scale_summary"
diff --git a/src/com/cyanogenmod/trebuchet/CellLayout.java b/src/com/cyanogenmod/trebuchet/CellLayout.java
index a59a96e0d..6062c31f2 100644
--- a/src/com/cyanogenmod/trebuchet/CellLayout.java
+++ b/src/com/cyanogenmod/trebuchet/CellLayout.java
@@ -348,6 +348,15 @@ public class CellLayout extends ViewGroup {
requestLayout();
}
+ void setCellDimensions(int cellWidth, int cellHeight, int widthGap, int heightGap) {
+ mCellWidth = cellWidth;
+ mCellHeight = cellHeight;
+ mWidthGap = widthGap;
+ mHeightGap = heightGap;
+ mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
+ requestLayout();
+ }
+
private void invalidateBubbleTextView(BubbleTextView icon) {
final int padding = icon.getPressedOrFocusedBackgroundPadding();
invalidate(icon.getLeft() + getPaddingLeft() - padding,
diff --git a/src/com/cyanogenmod/trebuchet/FolderIcon.java b/src/com/cyanogenmod/trebuchet/FolderIcon.java
index b67e0bd33..882757694 100644
--- a/src/com/cyanogenmod/trebuchet/FolderIcon.java
+++ b/src/com/cyanogenmod/trebuchet/FolderIcon.java
@@ -596,6 +596,7 @@ public class FolderIcon extends LinearLayout implements FolderListener {
}
public void setTextVisible(boolean visible) {
+ if (getTextVisible() == visible) return;
if (visible) {
mFolderName.setVisibility(VISIBLE);
} else {
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java
index 9f6441a39..2773c0f73 100644
--- a/src/com/cyanogenmod/trebuchet/Hotseat.java
+++ b/src/com/cyanogenmod/trebuchet/Hotseat.java
@@ -18,17 +18,15 @@ package com.cyanogenmod.trebuchet;
import android.content.Context;
import android.content.res.Configuration;
+import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Matrix;
import android.util.AttributeSet;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
-import java.util.Arrays;
-
public class Hotseat extends PagedView {
private int mCellCount;
@@ -53,6 +51,8 @@ public class Hotseat extends PagedView {
public Hotseat(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
+ final Resources res = getResources();
+
mFadeInAdjacentScreens = false;
mHandleScrollIndicator = true;
@@ -67,8 +67,8 @@ public class Hotseat extends PagedView {
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.Hotseat, defStyle, 0);
mTransposeLayoutWithOrientation =
- context.getResources().getBoolean(R.bool.hotseat_transpose_layout_with_orientation);
- mIsLandscape = context.getResources().getConfiguration().orientation ==
+ res.getBoolean(R.bool.hotseat_transpose_layout_with_orientation);
+ mIsLandscape = res.getConfiguration().orientation ==
Configuration.ORIENTATION_LANDSCAPE;
mCellCount = a.getInt(R.styleable.Hotseat_cellCount, DEFAULT_CELL_COUNT);
mCellCount = PreferencesProvider.Interface.Dock.getNumberIcons(mCellCount);
@@ -77,6 +77,12 @@ public class Hotseat extends PagedView {
mVertical = hasVerticalHotseat();
+ boolean hideDockIconLabels = PreferencesProvider.Interface.Dock.getHideIconLabels() ||
+ (mVertical && !LauncherApplication.isScreenLarge());
+ int cellHeight = (int)res.getDimension(R.dimen.hotseat_cell_height);
+ if (!hideDockIconLabels) {
+ cellHeight = (int)res.getDimension(R.dimen.workspace_cell_height);
+ }
float childrenScale = PreferencesProvider.Interface.Dock.getIconScale(
getResources().getInteger(R.integer.hotseat_item_scale_percentage)) / 100f;
@@ -87,6 +93,11 @@ public class Hotseat extends PagedView {
CellLayout cl = (CellLayout) inflater.inflate(R.layout.hotseat_page, null);
cl.setChildrenScale(childrenScale);
cl.setGridSize((!hasVerticalHotseat() ? mCellCount : 1), (hasVerticalHotseat() ? mCellCount : 1));
+
+ if (!hideDockIconLabels) {
+ cl.setCellDimensions(cl.getCellWidth(), cellHeight, cl.getWidthGap(), cl.getHeightGap());
+ }
+
addView(cl);
}
diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java
index ed8ae0879..148f3368f 100644
--- a/src/com/cyanogenmod/trebuchet/Launcher.java
+++ b/src/com/cyanogenmod/trebuchet/Launcher.java
@@ -87,6 +87,7 @@ import android.view.View.OnLongClickListener;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
+import android.view.ViewGroup.MarginLayoutParams;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
@@ -319,6 +320,7 @@ public final class Launcher extends Activity
private boolean mShowHotseat;
private boolean mShowDockDivider;
private boolean mHideIconLabels;
+ private boolean mHideDockIconLabels;
private boolean mAutoRotate;
private boolean mLockWorkspace;
private boolean mFullscreenMode;
@@ -387,6 +389,7 @@ public final class Launcher extends Activity
mIconCache = app.getIconCache();
mDragController = new DragController(this);
mInflater = getLayoutInflater();
+ final Resources res = getResources();
// Load all preferences
PreferencesProvider.load(this);
@@ -404,6 +407,12 @@ public final class Launcher extends Activity
mShowHotseat = PreferencesProvider.Interface.Dock.getShowDock();
mShowDockDivider = PreferencesProvider.Interface.Dock.getShowDivider() && mShowHotseat;
mHideIconLabels = PreferencesProvider.Interface.Homescreen.getHideIconLabels();
+ mHideDockIconLabels = PreferencesProvider.Interface.Dock.getHideIconLabels();
+ boolean verticalHotseat =
+ res.getBoolean(R.bool.hotseat_transpose_layout_with_orientation) &&
+ res.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
+ mHideDockIconLabels = PreferencesProvider.Interface.Dock.getHideIconLabels() ||
+ (!mShowHotseat || (verticalHotseat && !LauncherApplication.isScreenLarge()));
mAutoRotate = PreferencesProvider.Interface.General.getAutoRotate(getResources().getBoolean(R.bool.allow_rotation));
mLockWorkspace = PreferencesProvider.Interface.General.getLockWorkspace(getResources().getBoolean(R.bool.lock_workspace));
mFullscreenMode = PreferencesProvider.Interface.General.getFullscreenMode();
@@ -983,6 +992,30 @@ public final class Launcher extends Activity
mDockDivider.setVisibility(View.GONE);
}
+ // Redim the hotseat and statusbar to let some extra size for the item text
+ if (mShowHotseat && !mHideDockIconLabels && !mHotseat.hasVerticalHotseat()) {
+ Resources res = getResources();
+ int bottomMarginWithText = res.getDimensionPixelSize(R.dimen.button_bar_height_with_text);
+ // Divider
+ if (mDockDivider != null) {
+ ((MarginLayoutParams)mDockDivider.getLayoutParams()).bottomMargin = bottomMarginWithText;
+ }
+ // Divider indicator
+ View dockScrollingIndicator = findViewById(R.id.paged_view_indicator_dock);
+ if (dockScrollingIndicator != null) {
+ ((MarginLayoutParams)dockScrollingIndicator.getLayoutParams()).bottomMargin = bottomMarginWithText;
+ }
+ // Hotseat
+ mHotseat.getLayoutParams().height = res.getDimensionPixelSize(R.dimen.button_bar_height_plus_padding_with_text);
+
+ // Workspace
+ mWorkspace.setPadding(
+ mWorkspace.getPaddingLeft(),
+ mWorkspace.getPaddingTop(),
+ mWorkspace.getPaddingRight(),
+ res.getDimensionPixelSize(R.dimen.workspace_bottom_padding_port_with_text));
+ }
+
// Setup AppsCustomize
mAppsCustomizeTabHost = (AppsCustomizeTabHost) findViewById(R.id.apps_customize_pane);
mAppsCustomizeContent = (AppsCustomizePagedView)
@@ -1048,9 +1081,7 @@ public final class Launcher extends Activity
View createShortcut(int layoutResId, ViewGroup parent, ShortcutInfo info) {
BubbleTextView favorite = (BubbleTextView) mInflater.inflate(layoutResId, parent, false);
favorite.applyFromShortcutInfo(info, mIconCache);
- if (mHideIconLabels) {
- favorite.setTextVisible(false);
- }
+ favorite.setTextVisible(!mHideIconLabels);
favorite.setOnClickListener(this);
favorite.setOnTouchListener(this);
return favorite;
@@ -2001,10 +2032,13 @@ public final class Launcher extends Activity
// Create the view
FolderIcon newFolder =
FolderIcon.fromXml(R.layout.folder_icon, this, layout, folderInfo);
- if (mHideIconLabels) {
- newFolder.setTextVisible(false);
- }
int x = cellX, y = cellY;
+ if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
+ newFolder.setTextVisible(!mHideDockIconLabels);
+ } else {
+ newFolder.setTextVisible(!mHideIconLabels);
+ }
+
if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT &&
getHotseat().hasVerticalHotseat()) {
// Note: If the destination of the new folder is the hotseat and
@@ -3636,9 +3670,7 @@ public final class Launcher extends Activity
FolderIcon newFolder = FolderIcon.fromXml(R.layout.folder_icon, this,
(ViewGroup) workspace.getChildAt(workspace.getCurrentPage()),
(FolderInfo) item);
- if (!mHideIconLabels) {
- newFolder.setTextVisible(false);
- }
+ newFolder.setTextVisible(!mHideIconLabels);
workspace.addInScreen(newFolder, item.container, item.screen, item.cellX,
item.cellY, 1, 1, false);
break;
diff --git a/src/com/cyanogenmod/trebuchet/LauncherModel.java b/src/com/cyanogenmod/trebuchet/LauncherModel.java
index a3d198c7e..923842c5f 100644
--- a/src/com/cyanogenmod/trebuchet/LauncherModel.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherModel.java
@@ -1354,6 +1354,16 @@ public class LauncherModel extends BroadcastReceiver {
iconPackageIndex, iconResourceIndex, iconIndex,
titleIndex);
info.itemType = LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS;
+ if (info.title == null) {
+ info.title = mContext.getString(R.string.all_apps_button_label);
+ }
+ intentDescription = c.getString(intentIndex);
+ try {
+ intent = Intent.parseUri(intentDescription, 0);
+ } catch (Exception ex) {
+ intent = new Intent();
+ intent.setClassName(mContext.getPackageName(), Launcher.class.getName());
+ }
}
if (info != null) {
diff --git a/src/com/cyanogenmod/trebuchet/LauncherProvider.java b/src/com/cyanogenmod/trebuchet/LauncherProvider.java
index af3ad8ba3..9f450389a 100644
--- a/src/com/cyanogenmod/trebuchet/LauncherProvider.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherProvider.java
@@ -896,11 +896,15 @@ public class LauncherProvider extends ContentProvider {
private long addAllAppsButton(SQLiteDatabase db, ContentValues values) {
Resources r = mContext.getResources();
+ Intent intent = new Intent();
+ intent.setClassName(mContext.getPackageName(), Launcher.class.getName());
+
long id = generateNewId();
values.put(Favorites.TITLE, r.getString(R.string.all_apps_button_label));
values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_ALLAPPS);
values.put(Favorites.SPANX, 1);
values.put(Favorites.SPANY, 1);
+ values.put(Favorites.INTENT, intent.toUri(0));
values.put(Favorites.ICON_TYPE, Favorites.ICON_TYPE_RESOURCE);
values.put(Favorites.ICON_PACKAGE, mContext.getPackageName());
values.put(Favorites.ICON_RESOURCE, r.getResourceName(R.drawable.all_apps_button_icon));
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);
diff --git a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
index 178873282..912d310af 100644
--- a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
+++ b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
@@ -197,6 +197,9 @@ public final class PreferencesProvider {
public static int getNumberIcons(int def) {
return getInt("ui_dock_icons", def);
}
+ public static boolean getHideIconLabels() {
+ return getBoolean("ui_dock_hide_icon_labels", true);
+ }
public static int getIconScale(int def) {
return getInt("ui_dock_icon_scale", def);
}