summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornebkat <nebkat@teamhacksung.org>2012-03-20 19:27:17 +0300
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-03-20 19:27:17 +0300
commite4aada67979eb45f38aa8e1f755aea4202b70981 (patch)
tree009383b2315d3a80561769ff6ba113e6c6f18e3b
parente903f8b68fd1c0be54e73b12d340e585ddb586ca (diff)
parent64c615fecf84b7e7ecc094a2cc91b306268c1a2d (diff)
downloadandroid_packages_apps_Trebuchet-e4aada67979eb45f38aa8e1f755aea4202b70981.tar.gz
android_packages_apps_Trebuchet-e4aada67979eb45f38aa8e1f755aea4202b70981.tar.bz2
android_packages_apps_Trebuchet-e4aada67979eb45f38aa8e1f755aea4202b70981.zip
Merge "Workspace: Cleanup hide icon labels" into ics
-rw-r--r--src/com/cyanogenmod/trebuchet/FolderIcon.java4
-rw-r--r--src/com/cyanogenmod/trebuchet/Launcher.java10
-rw-r--r--src/com/cyanogenmod/trebuchet/Workspace.java43
3 files changed, 36 insertions, 21 deletions
diff --git a/src/com/cyanogenmod/trebuchet/FolderIcon.java b/src/com/cyanogenmod/trebuchet/FolderIcon.java
index cff6c9f9a..44f1c7ac5 100644
--- a/src/com/cyanogenmod/trebuchet/FolderIcon.java
+++ b/src/com/cyanogenmod/trebuchet/FolderIcon.java
@@ -114,9 +114,7 @@ public class FolderIcon extends LinearLayout implements FolderListener {
FolderIcon icon = (FolderIcon) LayoutInflater.from(launcher).inflate(resId, group, false);
icon.mFolderName = (BubbleTextView) icon.findViewById(R.id.folder_icon_name);
- if (!PreferencesProvider.Interface.Homescreen.getHideIconLabels(launcher)) {
- icon.mFolderName.setText(folderInfo.title);
- }
+ icon.mFolderName.setText(folderInfo.title);
icon.mPreviewBackground = (ImageView) icon.findViewById(R.id.preview_background);
icon.setTag(folderInfo);
diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java
index 63e6c9085..c565207b8 100644
--- a/src/com/cyanogenmod/trebuchet/Launcher.java
+++ b/src/com/cyanogenmod/trebuchet/Launcher.java
@@ -862,8 +862,8 @@ 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.setText(null);
+ if (mHideIconLabels) {
+ favorite.setTextVisible(false);
}
favorite.setOnClickListener(this);
return favorite;
@@ -1625,6 +1625,9 @@ public final class Launcher extends Activity
// Create the view
FolderIcon newFolder =
FolderIcon.fromXml(R.layout.folder_icon, this, layout, folderInfo, mIconCache);
+ if (mHideIconLabels) {
+ newFolder.setTextVisible(false);
+ }
mWorkspace.addInScreen(newFolder, container, screen, cellX, cellY, 1, 1,
isWorkspaceLocked());
return newFolder;
@@ -3131,6 +3134,9 @@ public final class Launcher extends Activity
FolderIcon newFolder = FolderIcon.fromXml(R.layout.folder_icon, this,
(ViewGroup) workspace.getChildAt(workspace.getCurrentPage()),
(FolderInfo) item, mIconCache);
+ if (!mHideIconLabels) {
+ newFolder.setTextVisible(false);
+ }
workspace.addInScreen(newFolder, item.container, item.screen, item.cellX,
item.cellY, 1, 1, false);
break;
diff --git a/src/com/cyanogenmod/trebuchet/Workspace.java b/src/com/cyanogenmod/trebuchet/Workspace.java
index 5f8ea6dc7..bca48f6c7 100644
--- a/src/com/cyanogenmod/trebuchet/Workspace.java
+++ b/src/com/cyanogenmod/trebuchet/Workspace.java
@@ -262,6 +262,7 @@ public class Workspace extends PagedView
private int mScreenPaddingHorizontal;
private boolean mShowSearchBar;
private boolean mResizeAnyWidget;
+ private boolean mHideIconLabels;
private boolean mScrollWallpaper;
private boolean mShowScrollingIndicator;
private boolean mFadeScrollingIndicator;
@@ -350,6 +351,7 @@ public class Workspace extends PagedView
mScreenPaddingHorizontal = PreferencesProvider.Interface.Homescreen.getScreenPaddingHorizontal(context);
mShowSearchBar = PreferencesProvider.Interface.Homescreen.getShowSearchBar(context);
mResizeAnyWidget = PreferencesProvider.Interface.Homescreen.getResizeAnyWidget(context);
+ mHideIconLabels = PreferencesProvider.Interface.Homescreen.getHideIconLabels(context);
mScrollWallpaper = PreferencesProvider.Interface.Homescreen.Scrolling.getScrollWallpaper(context);
mTransitionEffect = PreferencesProvider.Interface.Homescreen.Scrolling.getTransitionEffect(context,
res.getString(R.string.config_workspaceDefaultTransitionEffect));
@@ -579,11 +581,13 @@ public class Workspace extends PagedView
layout = mLauncher.getHotseat().getLayout();
child.setOnKeyListener(null);
- // Hide folder title in the hotseat
- if (child instanceof FolderIcon) {
- ((FolderIcon) child).setTextVisible(false);
- } else if (child instanceof BubbleTextView) {
- ((BubbleTextView) child).setTextVisible(false);
+ if (!mHideIconLabels) {
+ // Hide titles in the hotseat
+ if (child instanceof FolderIcon) {
+ ((FolderIcon) child).setTextVisible(false);
+ } else if (child instanceof BubbleTextView) {
+ ((BubbleTextView) child).setTextVisible(false);
+ }
}
if (screen < 0) {
@@ -595,11 +599,13 @@ public class Workspace extends PagedView
y = mLauncher.getHotseat().getCellYFromOrder(screen);
}
} else {
- // Show folder title if not in the hotseat
- if (child instanceof FolderIcon) {
- ((FolderIcon) child).setTextVisible(true);
- } else if (child instanceof BubbleTextView) {
- ((BubbleTextView) child).setTextVisible(true);
+ 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);
+ }
}
layout = (CellLayout) getPageAt(screen);
@@ -2111,11 +2117,13 @@ public class Workspace extends PagedView
d.draw(destCanvas);
} else {
if (v instanceof FolderIcon) {
- // For FolderIcons the text can bleed into the icon area, and so we need to
- // hide the text completely (which can't be achieved by clipping).
- if (((FolderIcon) v).getTextVisible()) {
- ((FolderIcon) v).setTextVisible(false);
- textVisible = true;
+ if (!mHideIconLabels) {
+ // For FolderIcons the text can bleed into the icon area, and so we need to
+ // hide the text completely (which can't be achieved by clipping).
+ if (((FolderIcon) v).getTextVisible()) {
+ ((FolderIcon) v).setTextVisible(false);
+ textVisible = true;
+ }
}
} else if (v instanceof BubbleTextView) {
final BubbleTextView tv = (BubbleTextView) v;
@@ -2131,7 +2139,7 @@ public class Workspace extends PagedView
v.draw(destCanvas);
// Restore text visibility of FolderIcon if necessary
- if (textVisible) {
+ if (!mHideIconLabels && textVisible) {
((FolderIcon) v).setTextVisible(true);
}
}
@@ -3324,6 +3332,9 @@ public class Workspace extends PagedView
case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
view = FolderIcon.fromXml(R.layout.folder_icon, mLauncher, cellLayout,
(FolderInfo) info, mIconCache);
+ if (mHideIconLabels) {
+ ((FolderIcon) view).setTextVisible(false);
+ }
break;
default:
throw new IllegalStateException("Unknown item type: " + info.itemType);