From b172c13dcced9226c935991ef9fe85cc920ce811 Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Sun, 10 Aug 2014 18:30:55 -0700 Subject: [PATCH] Updating the widget tray -> adding dark panel / associated visual updates -> cleaning up the sizing / padding / to match all apps -> fixing a couple things from previous CL Change-Id: I4f663af7022337d687124ef25a22bac03d9d6af9 --- res/drawable-hdpi/quantum_panel.9.png | Bin 557 -> 636 bytes res/drawable-hdpi/quantum_panel_dark.9.png | Bin 0 -> 713 bytes res/drawable-mdpi/quantum_panel.9.png | Bin 406 -> 438 bytes res/drawable-mdpi/quantum_panel_dark.9.png | Bin 0 -> 494 bytes res/drawable-xhdpi/quantum_panel.9.png | Bin 764 -> 908 bytes res/drawable-xhdpi/quantum_panel_dark.9.png | Bin 0 -> 951 bytes res/drawable-xxhdpi/quantum_panel.9.png | Bin 1073 -> 1380 bytes res/drawable-xxhdpi/quantum_panel_dark.9.png | Bin 0 -> 1425 bytes res/layout/apps_customize_widget.xml | 51 +++++++---- res/values/attrs.xml | 5 -- res/values/colors.xml | 3 +- res/values/dimens.xml | 7 +- .../launcher3/AppsCustomizePagedView.java | 42 +++++---- src/com/android/launcher3/Launcher.java | 83 +++++++++++------- src/com/android/launcher3/PagedView.java | 13 --- .../launcher3/PagedViewGridLayout.java | 12 --- src/com/android/launcher3/Workspace.java | 10 +-- 17 files changed, 118 insertions(+), 108 deletions(-) create mode 100644 res/drawable-hdpi/quantum_panel_dark.9.png create mode 100644 res/drawable-mdpi/quantum_panel_dark.9.png create mode 100644 res/drawable-xhdpi/quantum_panel_dark.9.png create mode 100644 res/drawable-xxhdpi/quantum_panel_dark.9.png diff --git a/res/drawable-hdpi/quantum_panel.9.png b/res/drawable-hdpi/quantum_panel.9.png index d86d7bc1db887988cc239d9f8bc53221b074affe..a005e0baa546701d40f30b0d2b304619a43bc1b4 100644 GIT binary patch delta 610 zcmV-o0-gP>1pEXciBL{Q4GJ0x0000DNk~Le0000t0000t2nGNE0I1v2Mv);We*zv!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1F0*O UqQD-ha{vGU07*qoM6N<$f>C?*!2kdN diff --git a/res/drawable-hdpi/quantum_panel_dark.9.png b/res/drawable-hdpi/quantum_panel_dark.9.png new file mode 100644 index 0000000000000000000000000000000000000000..057efd157bd970dec094a71438c04800570e7b5a GIT binary patch literal 713 zcmV;)0yh1LP);cpT2=E?SCevZwI_gDhs>jt-Pb3nF)Wfo~QWLYb2qL2WEWk|ZR~O-6&` z`}^S*^nysvzU0)k zsiIw+Yeei1&H=hf9*p2VTjU&&sz_Sj;y)BcRjadf5LUTFy-!t|l~YkvBq5L7O5^~X zh&X9rBB>%Gh)8wu5Q19e5ENW7v-41G?pb1BIJ>p6b(>(P7QTf5#U$R-cM#3 zo**o8N vtyFX1%_b-!kw_#GiJTvGuP*+pf2aQjJa+1`U#MUX00000NkvXXu0mjfC>2LI literal 0 HcmV?d00001 diff --git a/res/drawable-mdpi/quantum_panel.9.png b/res/drawable-mdpi/quantum_panel.9.png index 061c80adb57979159606776dd80443c51543a48c..785f573ee07aa17b758bd6374524080e77a8a365 100644 GIT binary patch delta 374 zcmV-+0g3*W1GWQ@Nq<;LL_t(oh3%J1YQr!PK%cB6?xHI%y6n~3v*cvXRk|^hl7^;> z+Lk-GVx5El!ecYn#6w~K88@@l!3I5 z4Nfps$^h2KYzko4G|iJS=4`E%l<52Z)HKaAunYW233W^ZcYkf$zF2Fk)cr*%h1U95 zmgOVx#s6KC(5F$rPDGNWz-^o&QsFu_+LVx3;l+}rF8ErZPdRBa>jlJgC~wj#TR<#G z%JN^7Rg10ijFrJjF_uluz(AOFWoH!w|0Wfu4?~O4Z ziB8gW-SKcZ>~C@R{?P|XXxA@*d*A`6a1W9>C&kZ)$UE=~e2&R&0tE-$-TdT#Z)b{K zYW2X`*G%ddxUOx15_j`V5wk$&1(U@td8r4!{EAE_b5kf0L8;&_aP8$iI-rQ~4IRhD Uc8XGH=>Px#07*qoM6N<$g2i38rvLx| delta 342 zcmV-c0jd7B1C|4jNq;y=L_t(oh3%NjPJ}QNKuu={*T}2+TU>t8;y%W zHWDS$UKfzKFqAehil!%FcXNAs`?^7i2udjek-+$%0YpO6MpYTz8W1Wtj? zSdfpH7Lni^c!CSygqdRM0Af4f2*+0P5jzAL_x_gO5}PE7g`x>>VSa>FS8VC4U=dbb zu~ibqLWyFb{CTm(UI*!W^T~W$pIl{G-lb`}Yuh$4#*8+1J`_dq0Ca$H#rfR&8z2L& z_-cvgycX|31y4KyFZ6x?H+(8)hh%%81&(Kk34OI*htG}$`VOG!C$YuRr+Z=tIp=bQ o&U~o{f0eCPBoc9<*7|e!6NlPeE}Wjrxc~qF07*qoM6N<$g6RgJYybcN diff --git a/res/drawable-mdpi/quantum_panel_dark.9.png b/res/drawable-mdpi/quantum_panel_dark.9.png new file mode 100644 index 0000000000000000000000000000000000000000..7837e48081ccf930c02c9794535bbd5d5621f2aa GIT binary patch literal 494 zcmVpI|2d+Iq8St>+}813(y~u z%p~S7*VY$y4h}C-sxC6=D)B3rQd*2TzrDUX1;SWvBwkWKfVZ`~f9!c)U2Bao#;J*j z9|XY(P_e{Lz6p3DvWUuYeN?InRI!YfRm|vq#dQb=hzN0C6<0B(wN}QAoeC49wN4XP z0$WGMNN!?78M9(DpBaS~%V%ciOrbMY$Re)L87m~E*rfbxv6-xM*3I-!EJk3>Sije8 zt<8 literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/quantum_panel.9.png b/res/drawable-xhdpi/quantum_panel.9.png index 8605cfd26b44e62f82ad3961082185829272f59b..5726fd215eeab661ce1cddc7a6eecd6d61e20c53 100644 GIT binary patch delta 884 zcmeyv+QY8c8Q|y6%O%Cdz`(%k>ERLtq&-2HgAGU)7IWX3sHk4gtmo{MT7srX&R_B3!TbHi6*bw?3uOK%Cq(G4SQDW% z#n8&%zvf+D+JkvKo_)Qd*I9lyMw_iYULQKi)||^-;pD!}rt`Fa`l&H9To&}0btw7Y zGb6Q|GqjCM_B{GBw~)C(!qNNFt_k~eU+!;E6-@ACi4bC(<^p7L6g(0SOm2w=aTmP* zesOUFn2D+gNj;d^Xr|KpaOvFeo;&rEIDU9YIdiXiEV8+KNmbpJAg{MEe05w?f}&;A zrkYK9dTY`fp76albEfruEjgFAxza)R-m=mkW#+67M+S1Q`-hEP zEx&X;w9GHs81d)S=RdcfK7D#L$E;er<-^MB;;KvUtiAraefRF&{@b^2w`W+wU^GQ? zhj0BSRmKOK&)YNltb4+9V2_qs`mY;Nll4~in@gn%WpX7%PnG?)Nb2F_`Ab$aKhrRd zu1}tybv?Xjy6w9eGkmV)Hp*R_HluFdAXRDRALk zCkKzZ^!9!4dJ`quAn50D!KiGGhkt#nzO;Kh7rqkpm|yERLtq`g3xgAGW^TsTxXQBl2~X`ZKxV@SoEw{!gS zE<1>{@82kV>Cwa`w_O_DKl1g9MOf(jVsDGS)JSithF(mFy zq56dHo?$uRQfF&wCzm|Bf2EV-oF$tZTVDMI#txplwTBIOz^H`hw^TsqNa$5K7*|YgK-+aTk;=`s{$@)zlQF_z!)hC}^+p%Qh z(=CPPHpZ>DpErO0e)dz>E_wtTb6uQ&G2_d-3n~ZKhyGXnAakP8_p`E6hu5i1GPVc9 zO=CS9jTH``UtlV`EFnISuOKv3)%LdJtZ;{>`9){H6x%G+_^^m?+nlVpNA;??4Z3l+ z;%fN8 zu5W!_$TAfFP`S-%r(VgnXWjXF|Hkwq)$$?>4sicutYM#aVAZ~Ri^N4$-e~=pbnnsP zlaGJZ9n>?HWIot^8 z>(|e0*7nah&pUhH(>G;$B479Jb!nAy5mxcN85+30AXDMi{Ib2@4z_uKM}*Dm29a(@jrp!8d;I|9u@Fg!7iadH!sI>MLNnW$<+Mb6Mw< G&;$SnGFd4A diff --git a/res/drawable-xhdpi/quantum_panel_dark.9.png b/res/drawable-xhdpi/quantum_panel_dark.9.png new file mode 100644 index 0000000000000000000000000000000000000000..8944a8f98d95d53bfb82f241c08e5627ad5223c1 GIT binary patch literal 951 zcmV;o14#UdP)V)~kC#+OCnP8cfW*ptkZ-XmE_ z8;$4sjO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Qug>U`;xGSP# zb5G`0pKUNSI4e_lcIEzE9oeh>qqqN%nU%CCRaFfo4?%O&lX$~(mJ-Ihs!NZR6`x%p db;7cJzrY?RA1fmXA7Gwm@O1TaS?83{1OOw@;hO*e diff --git a/res/drawable-xxhdpi/quantum_panel_dark.9.png b/res/drawable-xxhdpi/quantum_panel_dark.9.png new file mode 100644 index 0000000000000000000000000000000000000000..b74f1a65c7f360bcdfa5283a972e4afdbe894199 GIT binary patch literal 1425 zcmaKsdpOez7{@mm+mLkRGIAMdWu>Ahna#1xHP?A!AcH}fP+9FIctKY z^Ja#97gTD~?|%J!YBMCs7S^uN&545&(>FWpJi&tu0?A~27udLyQw;(^46QA3uF-`b z>E_|;c$Ku@YA-L-`(gK+ymig^n0LL$k)k^3=h9VuFVnl^%e;)spwtc`f9Q0 zi^^Kb+bp2kKdfDaQ|MwU2SnNaVR-swN*3ULI41tK>mPB2>7u^XuUFV+5 z4@@fzfK3lA@04li?0@1H&l*=0hFN=i7x@302D4+KCetA3?fLjuZRC9eyZ0zDc*o20 zl?F8oy21lUN-1Cwx5`hgcsAG3--Z-luP>8#d5k3(VJyvC^**%+&B6c-OtLk>Ex%a2 z49IIT^!2E>Tvc+H4a}%Yyc%_i=}OnECXq2v0Rz-zkqZ;mEj2A=REu zL{In#Y*(PVL9UgGMrWpoz1n@im)v(E;WDQsTzp|iy@`PVDU72L-zC=5P&fuU7k_AV zTkla5X|N-8(gwPPQnk7znT&bbxtK9XYgj)=&MP_kp$|m#C~6sNiEzrd8KSErxd-zm zR{`cTNJ$N;(|XrFjhS`9!KkfgH`MMrw^>-;afuZYGaKi)p>19iU7b#94`X*I5@>Vq z#?vx|(*D@-a)o}92IEEg+jSvhbXqcf5NoOV8vl6`z6wR6T^$G5Mbwi;##j_QKm_cK*1!NJM+z+ zytr$)?{%Zxw<;vJ<-YF8=jCn{SWowtfxb%^E3aXj-lX=6>qer5;B1WyBsFlGjUlv5 zHJK}GL6Rypy5dN~Z3IO4LwP?|RF4)lF!#&!-h&b$G~AE&-~azThmk6l(jHVz2HG1E zf=R(418Tdcm-?9`MV=;6Ta`2QTF@0EE4Q>zp2t%rlt^f~ImH#ABW)4|7AheB=l6yuz_1HCRkGyay! z^4!oy*ft44FF`!V`)y)kQO=PfQ!%%!e*Ww8_L!~U%BqEhD_2C-=Jz+&+&q+`z;jz} zfuH0w=Ew{R%_9>$xjb4O*e}!b{f9Zjz9Mt-@^sYTtLqJ;?_6Mj4+goSe{EKJgfZ2`{Nh)TtY@Lr+K}Ai+4y&XOAf{4!)~ zY^d}8Ai>D_v{ot$mdkiMA6e^{dOEhU{;A$1M5^Cz=rQQCdOaYJHsr17oUZU zh}D!+`7}ngQ*#r>I|Gj3vLs?6Ud)Wi^MM`)d-WvWC_f0#X0cQZtp{>Xl~&^*!%X>7 zbn!i@W|^|&!}p**28}N;M>s(mJBKBxK`E8{y6+K=SExjSo8^J^;1v>$OF0Kjv8j%- zMh|qy_qQ5nJUrmSrPP>|JnxhZc<6qYg#G0N3Y`V3(v$6PaZkhZPp8m$H(4FYd(jg~ z?8Gl?zk3BZsfWBp2s{LkT13`{Q%6$#KWzG!QbfG!On|u5?6KyXOKZw5%3Ot3sYK2u PQ$f~v2g@1@zofqb9h0EH literal 0 HcmV?d00001 diff --git a/res/layout/apps_customize_widget.xml b/res/layout/apps_customize_widget.xml index 7c98b4a9b7..e299b32b0e 100644 --- a/res/layout/apps_customize_widget.xml +++ b/res/layout/apps_customize_widget.xml @@ -25,24 +25,45 @@ android:background="@drawable/focusable_view_bg" android:focusable="true"> - - + android:layout_weight="1"> + + + + + + + - - - - - diff --git a/res/values/colors.xml b/res/values/colors.xml index 27a5b61ee1..41f38921f1 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -36,6 +36,7 @@ #FFC4C4C4 #FFCCCCCC #FFFFFFFF - + #FF374248 + #64b1ea diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 8e561cfc0f..893d7c0db7 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -62,7 +62,7 @@ 52dp 0dp 48dp - 4dp + 0dp 12dp @@ -89,9 +89,8 @@ 16dp 16dp 32dp - 4dp - 2dp - 2dp + 8dp + 8dp 0dp diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java index 24f90c341f..98a06f1e1a 100644 --- a/src/com/android/launcher3/AppsCustomizePagedView.java +++ b/src/com/android/launcher3/AppsCustomizePagedView.java @@ -183,7 +183,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen // Dimens private int mContentWidth, mContentHeight; private int mWidgetCountX, mWidgetCountY; - private int mWidgetWidthGap, mWidgetHeightGap; private PagedViewCellLayout mWidgetSpacingLayout; private int mNumAppsPages; private int mNumWidgetPages; @@ -195,7 +194,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen private static float TRANSITION_SCALE_FACTOR = 0.74f; private static float TRANSITION_PIVOT = 0.65f; private static float TRANSITION_MAX_ROTATION = 22; - private static final boolean PERFORM_OVERSCROLL_ROTATION = true; + private static final boolean PERFORM_OVERSCROLL_ROTATION = false; private AccelerateInterpolator mAlphaInterpolator = new AccelerateInterpolator(0.9f); private DecelerateInterpolator mLeftScreenAlphaInterpolator = new DecelerateInterpolator(4); @@ -245,7 +244,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AppsCustomizePagedView, 0, 0); LauncherAppState app = LauncherAppState.getInstance(); DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); - mWidgetWidthGap = mWidgetHeightGap = grid.edgeMarginPx; mWidgetCountX = a.getInt(R.styleable.AppsCustomizePagedView_widgetCountX, 2); mWidgetCountY = a.getInt(R.styleable.AppsCustomizePagedView_widgetCountY, 2); mClingFocusedX = a.getInt(R.styleable.AppsCustomizePagedView_clingFocusedX, 0); @@ -285,8 +283,9 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen void setAllAppsPadding(Rect r) { mAllAppsPadding.set(r); } + void setWidgetsPageIndicatorPadding(int pageIndicatorHeight) { - mPageLayoutPaddingBottom = pageIndicatorHeight; + setPadding(getPaddingLeft(), getPaddingTop(), getPaddingRight(), pageIndicatorHeight); } WidgetPreviewLoader getWidgetPreviewLoader() { @@ -365,8 +364,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen // use for each page LauncherAppState app = LauncherAppState.getInstance(); DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); - mWidgetSpacingLayout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop, - mPageLayoutPaddingRight, mPageLayoutPaddingBottom); mCellCountX = (int) grid.allAppsNumCols; mCellCountY = (int) grid.allAppsNumRows; updatePageCounts(); @@ -1002,11 +999,9 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen setVisibilityOnChildren(layout, View.GONE); int widthSpec = MeasureSpec.makeMeasureSpec(mContentWidth, MeasureSpec.AT_MOST); int heightSpec = MeasureSpec.makeMeasureSpec(mContentHeight, MeasureSpec.AT_MOST); - layout.setMinimumWidth(getPageContentWidth()); layout.measure(widthSpec, heightSpec); - Resources res = getContext().getResources(); - Drawable bg = res.getDrawable(R.drawable.quantum_panel); + Drawable bg = getContext().getDrawable(R.drawable.quantum_panel); if (bg != null) { layout.setBackground(bg); bg.setVisible(mPageBackgroundsVisible, false); @@ -1168,21 +1163,23 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen // immediately after syncing, we don't have a proper width. int widthSpec = MeasureSpec.makeMeasureSpec(mContentWidth, MeasureSpec.AT_MOST); int heightSpec = MeasureSpec.makeMeasureSpec(mContentHeight, MeasureSpec.AT_MOST); - layout.setMinimumWidth(getPageContentWidth()); + layout.setBackground(getContext().getDrawable(R.drawable.quantum_panel_dark)); layout.measure(widthSpec, heightSpec); } public void syncWidgetPageItems(final int page, final boolean immediate) { int numItemsPerPage = mWidgetCountX * mWidgetCountY; + final PagedViewGridLayout layout = (PagedViewGridLayout) getPageAt(page); + // Calculate the dimensions of each cell we are giving to each widget final ArrayList items = new ArrayList(); - int contentWidth = mContentWidth; - final int cellWidth = ((contentWidth - mPageLayoutPaddingLeft - mPageLayoutPaddingRight - - ((mWidgetCountX - 1) * mWidgetWidthGap)) / mWidgetCountX); - int contentHeight = mContentHeight; - final int cellHeight = ((contentHeight - mPageLayoutPaddingTop - mPageLayoutPaddingBottom - - ((mWidgetCountY - 1) * mWidgetHeightGap)) / mWidgetCountY); + int contentWidth = mContentWidth - getPaddingLeft() - getPaddingRight() + - layout.getPaddingLeft() - layout.getPaddingRight(); + final int cellWidth = contentWidth / mWidgetCountX; + int contentHeight = mContentHeight - getPaddingTop() - getPaddingBottom() + - layout.getPaddingTop() - layout.getPaddingBottom(); + final int cellHeight = contentHeight / mWidgetCountY; // Prepare the set of widgets to load previews for in the background int offset = page * numItemsPerPage; @@ -1191,7 +1188,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen } // Prepopulate the pages with the other widget info, and fill in the previews later - final PagedViewGridLayout layout = (PagedViewGridLayout) getPageAt(page); layout.setColumnCount(layout.getCellCountX()); for (int i = 0; i < items.size(); ++i) { Object rawInfo = items.get(i); @@ -1232,14 +1228,22 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen // Layout each widget int ix = i % mWidgetCountX; int iy = i / mWidgetCountX; + + if (ix > 0) { + View border = widget.findViewById(R.id.left_border); + border.setVisibility(View.VISIBLE); + } + if (ix < mWidgetCountX - 1) { + View border = widget.findViewById(R.id.right_border); + border.setVisibility(View.VISIBLE); + } + GridLayout.LayoutParams lp = new GridLayout.LayoutParams( GridLayout.spec(iy, GridLayout.START), GridLayout.spec(ix, GridLayout.TOP)); lp.width = cellWidth; lp.height = cellHeight; lp.setGravity(Gravity.TOP | Gravity.START); - if (ix > 0) lp.leftMargin = mWidgetWidthGap; - if (iy > 0) lp.topMargin = mWidgetHeightGap; layout.addView(widget, lp); } diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 75ba8fd99e..ebf3cc2ff9 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -3205,6 +3205,12 @@ public class Launcher extends Activity final View page = content.getPageAt(content.getCurrentPage()); final View revealView = toView.findViewById(R.id.fake_page); + if (contentType == AppsCustomizePagedView.ContentType.Widgets) { + revealView.setBackground(res.getDrawable(R.drawable.quantum_panel_dark)); + } else { + revealView.setBackground(res.getDrawable(R.drawable.quantum_panel)); + } + // Hide the real page background, and swap in the fake one revealView.setVisibility(View.VISIBLE); content.setPageBackgroundsVisible(false); @@ -3227,24 +3233,27 @@ public class Launcher extends Activity mStateAnimation.play(panelAlphaAndDrift); - page.setVisibility(View.VISIBLE); - page.setLayerType(View.LAYER_TYPE_HARDWARE, null); + if (page != null) { + page.setVisibility(View.VISIBLE); + page.setLayerType(View.LAYER_TYPE_HARDWARE, null); - ObjectAnimator pageDrift = ObjectAnimator.ofFloat(page, "translationY", yDrift, 0); - pageDrift.setDuration(revealDuration); - pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0)); - mStateAnimation.play(pageDrift); + ObjectAnimator pageDrift = ObjectAnimator.ofFloat(page, "translationY", yDrift, 0); + pageDrift.setDuration(revealDuration); + pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0)); + mStateAnimation.play(pageDrift); - // TODO (adamcohen): remove this 0.01f hack once fw is fixed - // it's there to work around a framework bug (16918357) - page.setAlpha(0.01f); - ObjectAnimator itemsAlpha = ObjectAnimator.ofFloat(page, "alpha", 0.01f, 1f); - itemsAlpha.setDuration(revealDuration); - itemsAlpha.setInterpolator(new AccelerateInterpolator(1.5f)); - itemsAlpha.setStartDelay(itemsAlphaStagger); - mStateAnimation.play(itemsAlpha); + // TODO (adamcohen): remove this 0.01f hack once fw is fixed + // it's there to work around a framework bug (16918357) + page.setAlpha(0.01f); + ObjectAnimator itemsAlpha = ObjectAnimator.ofFloat(page, "alpha", 0.01f, 1f); + itemsAlpha.setDuration(revealDuration); + itemsAlpha.setInterpolator(new AccelerateInterpolator(1.5f)); + itemsAlpha.setStartDelay(itemsAlphaStagger); + mStateAnimation.play(itemsAlpha); + } - View pageIndicators = fromView.findViewById(R.id.apps_customize_page_indicator); + View pageIndicators = toView.findViewById(R.id.apps_customize_page_indicator); + pageIndicators.setAlpha(0.01f); ObjectAnimator indicatorsAlpha = ObjectAnimator.ofFloat(pageIndicators, "alpha", 1f); indicatorsAlpha.setDuration(revealDuration); @@ -3267,7 +3276,9 @@ public class Launcher extends Activity revealView.setVisibility(View.INVISIBLE); revealView.setLayerType(View.LAYER_TYPE_NONE, null); - page.setLayerType(View.LAYER_TYPE_NONE, null); + if (page != null) { + page.setLayerType(View.LAYER_TYPE_NONE, null); + } content.setPageBackgroundsVisible(true); // Hide the search bar @@ -3396,6 +3407,13 @@ public class Launcher extends Activity final View page = content.getPageAt(content.getNextPage()); final View revealView = fromView.findViewById(R.id.fake_page); + AppsCustomizePagedView.ContentType contentType = content.getContentType(); + if (contentType == AppsCustomizePagedView.ContentType.Widgets) { + revealView.setBackground(res.getDrawable(R.drawable.quantum_panel_dark)); + } else { + revealView.setBackground(res.getDrawable(R.drawable.quantum_panel)); + } + int width = revealView.getMeasuredWidth(); int height = revealView.getMeasuredHeight(); float revealRadius = (float) Math.sqrt((width * width) / 4 + (height * height) / 4); @@ -3410,7 +3428,7 @@ public class Launcher extends Activity PropertyValuesHolder panelAlpha = PropertyValuesHolder.ofFloat(View.ALPHA, 1f, 0f); PropertyValuesHolder panelDrift = - PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, 0, yDrift); + PropertyValuesHolder.ofFloat("translationY", 0, yDrift); ObjectAnimator panelAlphaAndDrift = ObjectAnimator.ofPropertyValuesHolder(revealView, panelAlpha, panelDrift); panelAlphaAndDrift.setDuration(revealDuration); @@ -3420,23 +3438,26 @@ public class Launcher extends Activity mStateAnimation.play(panelAlphaAndDrift); - page.setLayerType(View.LAYER_TYPE_HARDWARE, null); + if (page != null) { + page.setLayerType(View.LAYER_TYPE_HARDWARE, null); - ObjectAnimator pageDrift = ObjectAnimator.ofFloat(page, View.TRANSLATION_Y, 0, yDrift); - pageDrift.setDuration(revealDuration); - pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0)); - pageDrift.setStartDelay(itemsAlphaStagger); - mStateAnimation.play(pageDrift); + ObjectAnimator pageDrift = ObjectAnimator.ofFloat(page, "translationY", 0, yDrift); + pageDrift.setDuration(revealDuration); + pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0)); + pageDrift.setStartDelay(itemsAlphaStagger); + mStateAnimation.play(pageDrift); - page.setAlpha(1f); - ObjectAnimator itemsAlpha = ObjectAnimator.ofFloat(page, View.ALPHA, 1f, 0f); - itemsAlpha.setDuration(revealDuration); - itemsAlpha.setInterpolator(new LogDecelerateInterpolator(100, 0)); - mStateAnimation.play(itemsAlpha); + page.setAlpha(1f); + ObjectAnimator itemsAlpha = ObjectAnimator.ofFloat(page, View.ALPHA, 1f, 0f); + itemsAlpha.setDuration(revealDuration); + itemsAlpha.setInterpolator(new LogDecelerateInterpolator(100, 0)); + mStateAnimation.play(itemsAlpha); + } View pageIndicators = fromView.findViewById(R.id.apps_customize_page_indicator); + pageIndicators.setAlpha(1f); ObjectAnimator indicatorsAlpha = - ObjectAnimator.ofFloat(pageIndicators, View.ALPHA, 0f); + ObjectAnimator.ofFloat(pageIndicators, "alpha", 0f); indicatorsAlpha.setDuration(revealDuration); indicatorsAlpha.setInterpolator(new DecelerateInterpolator(1.5f)); mStateAnimation.play(indicatorsAlpha); @@ -3479,7 +3500,9 @@ public class Launcher extends Activity } revealView.setLayerType(View.LAYER_TYPE_NONE, null); - page.setLayerType(View.LAYER_TYPE_NONE, null); + if (page != null) { + page.setLayerType(View.LAYER_TYPE_NONE, null); + } content.setPageBackgroundsVisible(true); mAppsCustomizeContent.updateCurrentPageScroll(); } diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 4e34628da7..90a6b15988 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -152,16 +152,11 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc protected int mTouchState = TOUCH_STATE_REST; protected boolean mForceScreenScrolled = false; - protected OnLongClickListener mLongClickListener; protected int mTouchSlop; private int mPagingTouchSlop; private int mMaximumVelocity; - protected int mPageLayoutPaddingTop; - protected int mPageLayoutPaddingBottom; - protected int mPageLayoutPaddingLeft; - protected int mPageLayoutPaddingRight; protected int mPageLayoutWidthGap; protected int mPageLayoutHeightGap; protected int mCellCountX = 0; @@ -283,14 +278,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PagedView, defStyle, 0); - mPageLayoutPaddingTop = a.getDimensionPixelSize( - R.styleable.PagedView_pageLayoutPaddingTop, 0); - mPageLayoutPaddingBottom = a.getDimensionPixelSize( - R.styleable.PagedView_pageLayoutPaddingBottom, 0); - mPageLayoutPaddingLeft = a.getDimensionPixelSize( - R.styleable.PagedView_pageLayoutPaddingLeft, 0); - mPageLayoutPaddingRight = a.getDimensionPixelSize( - R.styleable.PagedView_pageLayoutPaddingRight, 0); mPageLayoutWidthGap = a.getDimensionPixelSize( R.styleable.PagedView_pageLayoutWidthGap, 0); mPageLayoutHeightGap = a.getDimensionPixelSize( diff --git a/src/com/android/launcher3/PagedViewGridLayout.java b/src/com/android/launcher3/PagedViewGridLayout.java index b28686113b..f69fa562d4 100644 --- a/src/com/android/launcher3/PagedViewGridLayout.java +++ b/src/com/android/launcher3/PagedViewGridLayout.java @@ -56,18 +56,6 @@ public class PagedViewGridLayout extends GridLayout implements Page { } } - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - // PagedView currently has issues with different-sized pages since it calculates the - // offset of each page to scroll to before it updates the actual size of each page - // (which can change depending on the content if the contents aren't a fixed size). - // We work around this by having a minimum size on each widget page). - int widthSpecSize = Math.min(getSuggestedMinimumWidth(), - MeasureSpec.getSize(widthMeasureSpec)); - int widthSpecMode = MeasureSpec.EXACTLY; - super.onMeasure(MeasureSpec.makeMeasureSpec(widthSpecSize, widthSpecMode), - heightMeasureSpec); - } - @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 7c8708b507..20682ca931 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -212,7 +212,6 @@ public class Workspace extends SmoothPagedView private final int[] mTempXY = new int[2]; private int[] mTempVisiblePagesRange = new int[2]; private boolean mOverscrollTransformsSet; - private float mLastOverscrollPivotX; public static final int DRAG_BITMAP_PADDING = 2; private boolean mWorkspaceFadeInAdjacentScreens; @@ -1694,20 +1693,13 @@ public class Workspace extends SmoothPagedView final boolean isLeftPage = mOverScrollX < 0; index = (!isRtl && isLeftPage) || (isRtl && !isLeftPage) ? lowerIndex : upperIndex; - pivotX = isLeftPage ? rightBiasedPivot : leftBiasedPivot; CellLayout cl = (CellLayout) getChildAt(index); float scrollProgress = getScrollProgress(screenCenter, cl, index); cl.setOverScrollAmount(Math.abs(scrollProgress), isLeftPage); - float rotation = -WORKSPACE_OVERSCROLL_ROTATION * scrollProgress; - cl.setRotationY(rotation); - if (!mOverscrollTransformsSet || Float.compare(mLastOverscrollPivotX, pivotX) != 0) { + if (!mOverscrollTransformsSet) { mOverscrollTransformsSet = true; - mLastOverscrollPivotX = pivotX; - cl.setCameraDistance(mDensity * mCameraDistance); - cl.setPivotX(cl.getMeasuredWidth() * pivotX); - cl.setPivotY(cl.getMeasuredHeight() * 0.5f); cl.setOverscrollTransformsDirty(true); } } else {