diff options
| -rw-r--r-- | core/java/android/widget/EdgeEffect.java | 10 | ||||
| -rw-r--r-- | core/res/res/drawable-hdpi/toast_frame.9.png | bin | 1573 -> 0 bytes | |||
| -rw-r--r-- | core/res/res/drawable-ldpi/toast_frame.9.png | bin | 3268 -> 0 bytes | |||
| -rw-r--r-- | core/res/res/drawable-mdpi/toast_frame.9.png | bin | 965 -> 0 bytes | |||
| -rw-r--r-- | core/res/res/drawable-xhdpi/toast_frame.9.png | bin | 2090 -> 0 bytes | |||
| -rw-r--r-- | core/res/res/drawable-xxhdpi/toast_frame.9.png | bin | 2323 -> 0 bytes | |||
| -rw-r--r-- | core/res/res/drawable/toast_frame.xml | 24 | ||||
| -rw-r--r-- | core/res/res/layout/transient_notification.xml | 4 | ||||
| -rw-r--r-- | core/res/res/values/dimens.xml | 2 | ||||
| -rw-r--r-- | core/res/res/values/styles.xml | 3 |
10 files changed, 36 insertions, 7 deletions
diff --git a/core/java/android/widget/EdgeEffect.java b/core/java/android/widget/EdgeEffect.java index 98d8a13d68b5..f9f5901a6651 100644 --- a/core/java/android/widget/EdgeEffect.java +++ b/core/java/android/widget/EdgeEffect.java @@ -59,7 +59,8 @@ 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.5f; + private static final float MAX_ALPHA = 0.15f; + private static final float GLOW_ALPHA_START = .09f; private static final float MAX_GLOW_SCALE = 2.f; @@ -75,6 +76,7 @@ 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; @@ -134,10 +136,10 @@ public class EdgeEffect { * @param height Effect height in pixels */ public void setSize(int width, int height) { - final float r = width * 0.75f / SIN; + final float r = width * RADIUS_FACTOR / SIN; final float y = COS * r; final float h = r - y; - final float or = height * 0.75f / SIN; + final float or = height * RADIUS_FACTOR / SIN; final float oy = COS * or; final float oh = or - oy; @@ -272,7 +274,7 @@ public class EdgeEffect { // The glow depends more on the velocity, and therefore starts out // nearly invisible. - mGlowAlphaStart = 0.3f; + mGlowAlphaStart = GLOW_ALPHA_START; 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 Binary files differdeleted file mode 100644 index a804a8a94564..000000000000 --- a/core/res/res/drawable-hdpi/toast_frame.9.png +++ /dev/null diff --git a/core/res/res/drawable-ldpi/toast_frame.9.png b/core/res/res/drawable-ldpi/toast_frame.9.png Binary files differdeleted file mode 100644 index e64dc7575051..000000000000 --- a/core/res/res/drawable-ldpi/toast_frame.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/toast_frame.9.png b/core/res/res/drawable-mdpi/toast_frame.9.png Binary files differdeleted file mode 100644 index 778e4e67653d..000000000000 --- a/core/res/res/drawable-mdpi/toast_frame.9.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/toast_frame.9.png b/core/res/res/drawable-xhdpi/toast_frame.9.png Binary files differdeleted file mode 100644 index 77e69c72ab9a..000000000000 --- a/core/res/res/drawable-xhdpi/toast_frame.9.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/toast_frame.9.png b/core/res/res/drawable-xxhdpi/toast_frame.9.png Binary files differdeleted file mode 100644 index edecb6320de5..000000000000 --- a/core/res/res/drawable-xxhdpi/toast_frame.9.png +++ /dev/null diff --git a/core/res/res/drawable/toast_frame.xml b/core/res/res/drawable/toast_frame.xml new file mode 100644 index 000000000000..053b4f4fed5f --- /dev/null +++ b/core/res/res/drawable/toast_frame.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* Copyright 2017, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <!-- background is material_grey_300 with .9 alpha --> + <solid android:color="#E6E0E0E0" /> + <corners android:radius="22dp" /> +</shape> + diff --git a/core/res/res/layout/transient_notification.xml b/core/res/res/layout/transient_notification.xml index daa9faf70bb2..2c08bf70491e 100644 --- a/core/res/res/layout/transient_notification.xml +++ b/core/res/res/layout/transient_notification.xml @@ -29,9 +29,11 @@ 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/bright_foreground_dark" + android:textColor="@color/primary_text_default_material_light" android:shadowColor="#BB000000" android:shadowRadius="2.75" /> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 80d8ab5889bd..b4636a69709c 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. --> <dimen name="app_icon_size">48dip</dimen> - <dimen name="toast_y_offset">64dip</dimen> + <dimen name="toast_y_offset">24dp</dimen> <!-- Height of the status bar --> <dimen name="status_bar_height">24dp</dimen> <!-- Height of the bottom navigation / system bar. --> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 5c6e3df3ac33..4b0fe3f3a04c 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -956,7 +956,8 @@ please see styles_device_defaults.xml. </style> <style name="TextAppearance.Toast"> - <item name="fontFamily">sans-serif-condensed</item> + <item name="fontFamily">sans-serif</item> + <item name="textSize">14sp</item> </style> <style name="TextAppearance.Tooltip"> |