diff options
author | Winson Chung <winsonc@google.com> | 2013-10-25 15:24:24 -0700 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2014-06-05 23:25:37 -0700 |
commit | c46482fe2103a62e24b07d09975af346540079d8 (patch) | |
tree | 33e464ce79decfe207b796a7c0dc3a6fc34c9d15 /src/com/android/launcher3/FolderIcon.java | |
parent | d9fa00579bf09fc9f637ad9a36223ec09849c939 (diff) | |
download | android_packages_apps_Trebuchet-c46482fe2103a62e24b07d09975af346540079d8.tar.gz android_packages_apps_Trebuchet-c46482fe2103a62e24b07d09975af346540079d8.tar.bz2 android_packages_apps_Trebuchet-c46482fe2103a62e24b07d09975af346540079d8.zip |
Initial changes to support smaller landscape layouts.
Change-Id: If0abe2b82eb08bae4f1ce65b805362d548acb876
Diffstat (limited to 'src/com/android/launcher3/FolderIcon.java')
-rw-r--r-- | src/com/android/launcher3/FolderIcon.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java index 9b7919b42..8876a38e1 100644 --- a/src/com/android/launcher3/FolderIcon.java +++ b/src/com/android/launcher3/FolderIcon.java @@ -37,7 +37,7 @@ import android.view.ViewGroup; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.widget.ImageView; -import android.widget.LinearLayout; +import android.widget.FrameLayout; import android.widget.TextView; import com.android.launcher3.R; @@ -49,7 +49,7 @@ import java.util.ArrayList; /** * An icon that can appear on in the workspace representing an {@link UserFolder}. */ -public class FolderIcon extends LinearLayout implements FolderListener { +public class FolderIcon extends FrameLayout implements FolderListener { private Launcher mLauncher; private Folder mFolder; private FolderInfo mInfo; @@ -134,18 +134,21 @@ public class FolderIcon extends LinearLayout implements FolderListener { "INITIAL_ITEM_ANIMATION_DURATION, as sequencing of adding first two items " + "is dependent on this"); } + LauncherAppState app = LauncherAppState.getInstance(); + DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); FolderIcon icon = (FolderIcon) LayoutInflater.from(launcher).inflate(resId, group, false); icon.setClipToPadding(false); icon.mFolderName = (BubbleTextView) icon.findViewById(R.id.folder_icon_name); icon.mFolderName.setText(folderInfo.title); Utilities.applyTypeface(icon.mFolderName); - icon.mPreviewBackground = (ImageView) icon.findViewById(R.id.preview_background); - LauncherAppState app = LauncherAppState.getInstance(); - DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); + icon.mFolderName.setCompoundDrawablePadding(0); + FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) icon.mFolderName.getLayoutParams(); + lp.topMargin = grid.iconSizePx + grid.iconDrawablePaddingPx; + // Offset the preview background to center this view accordingly - LinearLayout.LayoutParams lp = - (LinearLayout.LayoutParams) icon.mPreviewBackground.getLayoutParams(); + icon.mPreviewBackground = (ImageView) icon.findViewById(R.id.preview_background); + lp = (FrameLayout.LayoutParams) icon.mPreviewBackground.getLayoutParams(); lp.topMargin = grid.folderBackgroundOffset; lp.width = grid.folderIconSizePx; lp.height = grid.folderIconSizePx; @@ -548,12 +551,10 @@ public class FolderIcon extends LinearLayout implements FolderListener { if (d != null) { mOldBounds.set(d.getBounds()); d.setBounds(0, 0, mIntrinsicIconSize, mIntrinsicIconSize); - d.setFilterBitmap(true); d.setColorFilter(Color.argb(params.overlayAlpha, 255, 255, 255), PorterDuff.Mode.SRC_ATOP); d.draw(canvas); d.clearColorFilter(); - d.setFilterBitmap(false); d.setBounds(mOldBounds); } canvas.restore(); |