summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHayden Schoen <hayden@cyngn.com>2015-04-02 14:04:28 -0700
committerLinus Lee <llee@cyngn.com>2015-04-02 21:51:37 +0000
commit4c38ea9a1796dd55bd017a1742b3e95c4e583e84 (patch)
tree5fac03f2744b73f32f8433a9d689b21b64620a2f
parente002b691b3233629598c77ef50f1ef91eb1877f0 (diff)
downloadandroid_packages_apps_Trebuchet-4c38ea9a1796dd55bd017a1742b3e95c4e583e84.tar.gz
android_packages_apps_Trebuchet-4c38ea9a1796dd55bd017a1742b3e95c4e583e84.tar.bz2
android_packages_apps_Trebuchet-4c38ea9a1796dd55bd017a1742b3e95c4e583e84.zip
AppDrawer: tweak animations and layout
Change-Id: If9d788b25fbabf21bd4d9d35b0dd82ddcca180f8
-rw-r--r--res/layout/app_drawer_container.xml2
-rw-r--r--res/layout/app_drawer_item.xml7
-rw-r--r--src/com/android/launcher3/AppDrawerListAdapter.java2
-rw-r--r--src/com/android/launcher3/AppDrawerScrubber.java13
4 files changed, 16 insertions, 8 deletions
diff --git a/res/layout/app_drawer_container.xml b/res/layout/app_drawer_container.xml
index 6024ddd19..30a4ceeb0 100644
--- a/res/layout/app_drawer_container.xml
+++ b/res/layout/app_drawer_container.xml
@@ -78,7 +78,7 @@
android:gravity="center_horizontal|top"
android:textColor="@android:color/black"
android:clickable="false"
- android:layout_marginBottom="-48dp"
+ android:layout_marginBottom="-40dp"
android:visibility="invisible"
android:layout_height="100dp" />
</RelativeLayout>
diff --git a/res/layout/app_drawer_item.xml b/res/layout/app_drawer_item.xml
index 43e2562ae..cc2ed8f9b 100644
--- a/res/layout/app_drawer_item.xml
+++ b/res/layout/app_drawer_item.xml
@@ -43,7 +43,7 @@
android:layout_width="27dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
- android:layout_marginLeft="10dp"
+ android:layout_marginLeft="6dp"
android:layout_centerVertical="true"
android:includeFontPadding="false"
android:gravity="center"
@@ -52,6 +52,9 @@
android:textSize="24sp"
android:layout_gravity="center"
android:fontFamily="sans-serif-light"
- android:textColor="@android:color/white" />
+ android:textColor="@android:color/white"
+ android:shadowRadius="4.0"
+ android:shadowDy="2"
+ android:shadowColor="#b0000000"/>
</RelativeLayout>
diff --git a/src/com/android/launcher3/AppDrawerListAdapter.java b/src/com/android/launcher3/AppDrawerListAdapter.java
index ea3243534..5a5e6cb9f 100644
--- a/src/com/android/launcher3/AppDrawerListAdapter.java
+++ b/src/com/android/launcher3/AppDrawerListAdapter.java
@@ -138,7 +138,7 @@ public class AppDrawerListAdapter extends RecyclerView.Adapter<AppDrawerListAdap
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
// set the pivot of the text view
- v.setPivotX(0);
+ v.setPivotX(v.getMeasuredWidth() / 4);
v.setPivotY(v.getMeasuredHeight() / 2);
}
};
diff --git a/src/com/android/launcher3/AppDrawerScrubber.java b/src/com/android/launcher3/AppDrawerScrubber.java
index 1670934d6..706ddfe96 100644
--- a/src/com/android/launcher3/AppDrawerScrubber.java
+++ b/src/com/android/launcher3/AppDrawerScrubber.java
@@ -163,7 +163,10 @@ public class AppDrawerScrubber extends LinearLayout {
* Handles the animations of the scrubber indicator
*/
private class ScrubberAnimationState implements SeekBar.OnSeekBarChangeListener {
- private static final long SCRUBBER_DISPLAY_DURATION = 150;
+ private static final long SCRUBBER_DISPLAY_DURATION_IN = 60;
+ private static final long SCRUBBER_DISPLAY_DURATION_OUT = 150;
+ private static final long SCRUBBER_DISPLAY_DELAY_IN = 0;
+ private static final long SCRUBBER_DISPLAY_DELAY_OUT = 200;
private static final float SCRUBBER_SCALE_START = 0f;
private static final float SCRUBBER_SCALE_END = 1f;
private static final float SCRUBBER_ALPHA_START = 0f;
@@ -191,7 +194,7 @@ public class AppDrawerScrubber extends LinearLayout {
// start from a scratch position when animating in
mScrubberIndicator.animate().cancel();
mScrubberIndicator.setPivotX(mScrubberIndicator.getMeasuredWidth() / 2);
- mScrubberIndicator.setPivotY(mScrubberIndicator.getMeasuredHeight() * 0.8f);
+ mScrubberIndicator.setPivotY(mScrubberIndicator.getMeasuredHeight() * 0.9f);
mScrubberIndicator.setAlpha(SCRUBBER_ALPHA_START);
mScrubberIndicator.setScaleX(SCRUBBER_SCALE_START);
mScrubberIndicator.setScaleY(SCRUBBER_SCALE_START);
@@ -202,7 +205,8 @@ public class AppDrawerScrubber extends LinearLayout {
.alpha(SCRUBBER_ALPHA_END)
.scaleX(SCRUBBER_SCALE_END)
.scaleY(SCRUBBER_SCALE_END)
- .setDuration(SCRUBBER_DISPLAY_DURATION)
+ .setStartDelay(SCRUBBER_DISPLAY_DELAY_IN)
+ .setDuration(SCRUBBER_DISPLAY_DURATION_IN)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@@ -221,7 +225,8 @@ public class AppDrawerScrubber extends LinearLayout {
.alpha(SCRUBBER_ALPHA_START)
.scaleX(SCRUBBER_SCALE_START)
.scaleY(SCRUBBER_SCALE_START)
- .setDuration(SCRUBBER_DISPLAY_DURATION)
+ .setStartDelay(SCRUBBER_DISPLAY_DELAY_OUT)
+ .setDuration(SCRUBBER_DISPLAY_DURATION_OUT)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {