From 45c493f2c2908d782e2fb5dbc5aa56fc92d703c9 Mon Sep 17 00:00:00 2001 From: Aurimas Liutikas Date: Wed, 26 Jul 2017 22:07:41 +0000 Subject: Revert "Update overscroll and toast UI" This change broke android.uirendering.cts.testclasses.EdgeEffectTests. This reverts commit 6085f8a16b5f6ed6a7a7acf854ec29ff2bef45fa. Bug: 64085792 Change-Id: I70ccebebb54dabf1ec0ee5002adca93e44104a1e --- core/java/android/widget/EdgeEffect.java | 10 ++++------ core/res/res/drawable-hdpi/toast_frame.9.png | Bin 0 -> 1573 bytes core/res/res/drawable-ldpi/toast_frame.9.png | Bin 0 -> 3268 bytes core/res/res/drawable-mdpi/toast_frame.9.png | Bin 0 -> 965 bytes core/res/res/drawable-xhdpi/toast_frame.9.png | Bin 0 -> 2090 bytes core/res/res/drawable-xxhdpi/toast_frame.9.png | Bin 0 -> 2323 bytes core/res/res/drawable/toast_frame.xml | 24 ------------------------ core/res/res/layout/transient_notification.xml | 4 +--- core/res/res/values/dimens.xml | 2 +- core/res/res/values/styles.xml | 3 +-- 10 files changed, 7 insertions(+), 36 deletions(-) create mode 100644 core/res/res/drawable-hdpi/toast_frame.9.png create mode 100644 core/res/res/drawable-ldpi/toast_frame.9.png create mode 100644 core/res/res/drawable-mdpi/toast_frame.9.png create mode 100644 core/res/res/drawable-xhdpi/toast_frame.9.png create mode 100644 core/res/res/drawable-xxhdpi/toast_frame.9.png delete mode 100644 core/res/res/drawable/toast_frame.xml diff --git a/core/java/android/widget/EdgeEffect.java b/core/java/android/widget/EdgeEffect.java index f9f5901a6651..98d8a13d68b5 100644 --- a/core/java/android/widget/EdgeEffect.java +++ b/core/java/android/widget/EdgeEffect.java @@ -59,8 +59,7 @@ public class EdgeEffect { // Time it will take in ms for a pulled glow to decay to partial strength before release private static final int PULL_DECAY_TIME = 2000; - private static final float MAX_ALPHA = 0.15f; - private static final float GLOW_ALPHA_START = .09f; + private static final float MAX_ALPHA = 0.5f; private static final float MAX_GLOW_SCALE = 2.f; @@ -76,7 +75,6 @@ public class EdgeEffect { private static final double ANGLE = Math.PI / 6; private static final float SIN = (float) Math.sin(ANGLE); private static final float COS = (float) Math.cos(ANGLE); - private static final float RADIUS_FACTOR = 0.6f; private float mGlowAlpha; private float mGlowScaleY; @@ -136,10 +134,10 @@ public class EdgeEffect { * @param height Effect height in pixels */ public void setSize(int width, int height) { - final float r = width * RADIUS_FACTOR / SIN; + final float r = width * 0.75f / SIN; final float y = COS * r; final float h = r - y; - final float or = height * RADIUS_FACTOR / SIN; + final float or = height * 0.75f / SIN; final float oy = COS * or; final float oh = or - oy; @@ -274,7 +272,7 @@ public class EdgeEffect { // The glow depends more on the velocity, and therefore starts out // nearly invisible. - mGlowAlphaStart = GLOW_ALPHA_START; + mGlowAlphaStart = 0.3f; mGlowScaleYStart = Math.max(mGlowScaleY, 0.f); diff --git a/core/res/res/drawable-hdpi/toast_frame.9.png b/core/res/res/drawable-hdpi/toast_frame.9.png new file mode 100644 index 000000000000..a804a8a94564 Binary files /dev/null and b/core/res/res/drawable-hdpi/toast_frame.9.png differ diff --git a/core/res/res/drawable-ldpi/toast_frame.9.png b/core/res/res/drawable-ldpi/toast_frame.9.png new file mode 100644 index 000000000000..e64dc7575051 Binary files /dev/null and b/core/res/res/drawable-ldpi/toast_frame.9.png differ diff --git a/core/res/res/drawable-mdpi/toast_frame.9.png b/core/res/res/drawable-mdpi/toast_frame.9.png new file mode 100644 index 000000000000..778e4e67653d Binary files /dev/null and b/core/res/res/drawable-mdpi/toast_frame.9.png differ diff --git a/core/res/res/drawable-xhdpi/toast_frame.9.png b/core/res/res/drawable-xhdpi/toast_frame.9.png new file mode 100644 index 000000000000..77e69c72ab9a Binary files /dev/null and b/core/res/res/drawable-xhdpi/toast_frame.9.png differ diff --git a/core/res/res/drawable-xxhdpi/toast_frame.9.png b/core/res/res/drawable-xxhdpi/toast_frame.9.png new file mode 100644 index 000000000000..edecb6320de5 Binary files /dev/null and b/core/res/res/drawable-xxhdpi/toast_frame.9.png differ diff --git a/core/res/res/drawable/toast_frame.xml b/core/res/res/drawable/toast_frame.xml deleted file mode 100644 index 053b4f4fed5f..000000000000 --- a/core/res/res/drawable/toast_frame.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/core/res/res/layout/transient_notification.xml b/core/res/res/layout/transient_notification.xml index 2c08bf70491e..daa9faf70bb2 100644 --- a/core/res/res/layout/transient_notification.xml +++ b/core/res/res/layout/transient_notification.xml @@ -29,11 +29,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" - android:layout_marginHorizontal="24dp" - android:layout_marginVertical="15dp" android:layout_gravity="center_horizontal" android:textAppearance="@style/TextAppearance.Toast" - android:textColor="@color/primary_text_default_material_light" + android:textColor="@color/bright_foreground_dark" android:shadowColor="#BB000000" android:shadowRadius="2.75" /> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 715522607195..9f9c883fe6aa 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -30,7 +30,7 @@ will be displayed in the app launcher and elsewhere. --> 48dip - 24dp + 64dip 24dp diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 4b0fe3f3a04c..5c6e3df3ac33 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -956,8 +956,7 @@ please see styles_device_defaults.xml.