Android6.0 Launcher3文件夹四宫格样式

+++ b/LINUX/android/packages/apps/Launcher3/res/layout/folder_icon.xml
@@ -26,7 +26,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:antialias="true"
-        android:src="@drawable/portal_ring_inner"/>
+        android:src="@drawable/folder_bg"/>
     <com.android.launcher3.BubbleTextView
         style="@style/Icon"
         android:id="@+id/folder_icon_name"
b/LINUX/android/packages/apps/Launcher3/src/com/android/launcher3/FolderIcon.java
@@ -60,7 +60,7 @@ public class FolderIcon extends FrameLayout implements FolderListener {
     private StylusEventHelper mStylusEventHelper;
 
     // The number of icons to display in the
-    public static final int NUM_ITEMS_IN_PREVIEW = 3;
+    public static final int NUM_ITEMS_IN_PREVIEW = 4;
     private static final int CONSUMPTION_ANIMATION_DURATION = 100;
     private static final int DROP_IN_ANIMATION_DURATION = 400;
     private static final int INITIAL_ITEM_ANIMATION_DURATION = 350;
@@ -73,7 +73,7 @@ public class FolderIcon extends FrameLayout implements FolderListener {
     private static final float OUTER_RING_GROWTH_FACTOR = 0.3f;
 
     // The amount of vertical spread between items in the stack [0...1]
-    private static final float PERSPECTIVE_SHIFT_FACTOR = 0.18f;
+    private static final float PERSPECTIVE_SHIFT_FACTOR = 1.0f;
 
     // Flag as to whether or not to draw an outer ring. Currently none is designed.
     public static final boolean HAS_OUTER_RING = true;
@@ -548,6 +548,11 @@ public class FolderIcon extends FrameLayout implements FolderListener {
 
     private PreviewItemDrawingParams computePreviewItemDrawingParams(int index,
             PreviewItemDrawingParams params) {
+
+        int index_order = index;
+        final int previewPadding = FolderRingAnimator.sPreviewPadding;
+
+
         index = NUM_ITEMS_IN_PREVIEW - index - 1;
         float r = (index * 1.0f) / (NUM_ITEMS_IN_PREVIEW - 1);
         float scale = (1 - PERSPECTIVE_SCALE_FACTOR * (1 - r));
@@ -558,10 +563,22 @@ public class FolderIcon extends FrameLayout implements FolderListener {
 
         // We want to imagine our coordinates from the bottom left, growing up and to the
         // right. This is natural for the x-axis, but for the y-axis, we have to invert things.
-        float transY = mAvailableSpaceInPreview - (offset + scaledSize + scaleOffsetCorrection) + getPaddingTop();
-        float transX = (mAvailableSpaceInPreview - scaledSize) / 2;
+        float transY = mAvailableSpaceInPreview - (offset + scaledSize + scaleOffsetCorrection);
+        float transX = offset + scaleOffsetCorrection;
+
+
+        if (0 <= index_order && index_order < 2) {
+            transX = index_order * mBaselineIconSize + 2 * previewPadding;
+            transY = mAvailableSpaceInPreview - (1 * mBaselineIconSize + scaledSize + scaleOffsetCorrection) + (getPaddingTop() / 2) + (getPaddingTop() / 3) + 0.1f * mBaselineIconSize;
+        } else if (2 <= index_order && index_order < 4) {
+            transX = (index_order - 2) * mBaselineIconSize + 2 * previewPadding;
+            //transY=1*mBaselineIconSize+9*previewPadding;
+            transY = mAvailableSpaceInPreview - (0 * mBaselineIconSize + scaledSize + scaleOffsetCorrection) + (getPaddingTop() / 2) + (getPaddingTop() / 3) + 0.1f * mBaselineIconSize;
+        }
+
         float totalScale = mBaselineIconScale * scale;
         final int overlayAlpha = (int) (80 * (1 - r));
+        totalScale = mBaselineIconScale * 1 - 0.1f;
 
         if (params == null) {
             params = new PreviewItemDrawingParams(transX, transY, totalScale, overlayAlpha);

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值