OSDN Git Service

Variety of small UI tweaks
authorAlan Viverette <alanv@google.com>
Fri, 29 Aug 2014 22:20:13 +0000 (15:20 -0700)
committerAlan Viverette <alanv@google.com>
Fri, 29 Aug 2014 22:20:13 +0000 (15:20 -0700)
Updates dialog padding, text opacities on dark theme, progress bar
opacity, ripple background exit speed, remove unnecessary text color
attribute from action menu item layout, fix secondary and tertiary
disabled state text colors.

BUG: 17321765
BUG: 17333263
BUG: 17322159
BUG: 17330086
Change-Id: I14473a985b2c6b853afe7db535a2443e934238e9

14 files changed:
core/res/res/color/btn_default_material_dark.xml
core/res/res/color/btn_default_material_light.xml
core/res/res/color/primary_text_disable_only_material_dark.xml
core/res/res/color/primary_text_disable_only_material_light.xml
core/res/res/color/primary_text_material_dark.xml
core/res/res/color/primary_text_material_light.xml
core/res/res/color/secondary_text_material_dark.xml [new file with mode: 0644]
core/res/res/color/secondary_text_material_light.xml [new file with mode: 0644]
core/res/res/drawable/progress_horizontal_material.xml
core/res/res/layout/action_menu_item_layout.xml
core/res/res/values/colors_material.xml
core/res/res/values/dimens_material.xml
core/res/res/values/themes_material.xml
graphics/java/android/graphics/drawable/RippleBackground.java

index 7c904cd..9be1417 100644 (file)
@@ -16,7 +16,7 @@
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:state_enabled="false"
-        android:alpha="@dimen/disabled_alpha_material"
-        android:color="@color/button_material_dark"/>
+          android:alpha="@dimen/disabled_alpha_material_dark"
+          android:color="@color/button_material_dark"/>
     <item android:color="@color/button_material_dark"/>
 </selector>
index 738f9ad..af5afe6 100644 (file)
@@ -16,7 +16,7 @@
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:state_enabled="false"
-        android:alpha="@dimen/disabled_alpha_material"
-        android:color="@color/button_material_light"/>
+          android:alpha="@dimen/disabled_alpha_material_light"
+          android:color="@color/button_material_light"/>
     <item android:color="@color/button_material_light"/>
 </selector>
index cdae790..a6296c9 100644 (file)
@@ -16,7 +16,7 @@
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:state_enabled="false"
-        android:alpha="@dimen/disabled_alpha_material"
-        android:color="@color/bright_foreground_material_dark"/>
+          android:alpha="@dimen/disabled_alpha_material_dark"
+          android:color="@color/bright_foreground_material_dark"/>
     <item android:color="@color/bright_foreground_material_dark"/>
 </selector>
index 0bf14d0..b781844 100644 (file)
@@ -16,7 +16,7 @@
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:state_enabled="false"
-        android:alpha="@dimen/disabled_alpha_material"
-        android:color="@color/bright_foreground_material_light"/>
+          android:alpha="@dimen/disabled_alpha_material_light"
+          android:color="@color/bright_foreground_material_light"/>
     <item android:color="@color/bright_foreground_material_light"/>
 </selector>
index 6ad837b..690f0ec 100644 (file)
@@ -16,7 +16,7 @@
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:state_enabled="false"
-        android:alpha="@dimen/disabled_alpha_material"
-        android:color="@color/primary_text_default_material_dark"/>
+          android:alpha="@dimen/disabled_alpha_material_dark"
+          android:color="@color/primary_text_default_material_dark"/>
     <item android:color="@color/primary_text_default_material_dark"/>
 </selector>
index 4c19e12..634ad94 100644 (file)
@@ -16,7 +16,7 @@
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:state_enabled="false"
-        android:alpha="@dimen/disabled_alpha_material"
-        android:color="@color/primary_text_default_material_light"/>
+          android:alpha="@dimen/disabled_alpha_material_light"
+          android:color="@color/primary_text_default_material_light"/>
     <item android:color="@color/primary_text_default_material_light"/>
 </selector>
diff --git a/core/res/res/color/secondary_text_material_dark.xml b/core/res/res/color/secondary_text_material_dark.xml
new file mode 100644 (file)
index 0000000..5bddf96
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_enabled="false"
+          android:alpha="@dimen/disabled_alpha_material_dark"
+          android:color="@color/secondary_text_default_material_dark"/>
+    <item android:color="@color/secondary_text_default_material_dark"/>
+</selector>
diff --git a/core/res/res/color/secondary_text_material_light.xml b/core/res/res/color/secondary_text_material_light.xml
new file mode 100644 (file)
index 0000000..3c354cb
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_enabled="false"
+          android:alpha="@dimen/disabled_alpha_material_light"
+          android:color="@color/secondary_text_default_material_light"/>
+    <item android:color="@color/secondary_text_default_material_light"/>
+</selector>
index 7a1079c..6b64337 100644 (file)
     <item android:id="@id/background">
         <nine-patch android:src="@drawable/progress_mtrl_alpha"
             android:tint="?attr/colorControlNormal"
-            android:alpha="0.5" />
+            android:alpha="?attr/disabledAlpha" />
     </item>
     <item android:id="@id/secondaryProgress">
         <scale android:scaleWidth="100%">
             <nine-patch android:src="@drawable/progress_mtrl_alpha"
                 android:tint="?attr/colorControlActivated"
-                android:alpha="0.5" />
+                android:alpha="?attr/disabledAlpha" />
         </scale>
     </item>
     <item android:id="@id/progress">
index 04d1f7b..6961f8d 100644 (file)
@@ -25,5 +25,4 @@
     android:paddingStart="8dip"
     android:paddingEnd="8dip"
     android:textAppearance="?attr/actionMenuTextAppearance"
-    android:textColor="?attr/actionMenuTextColor"
-    style="?android:attr/actionButtonStyle" />
+    style="?attr/actionButtonStyle" />
index c9292eb..d8e14a0 100644 (file)
     <!-- Text & foreground colors -->
     <eat-comment />
 
-    <!-- Black 87% -->
     <color name="primary_text_default_material_light">#de000000</color>
-    <!-- Black 54% -->
-    <color name="secondary_text_material_light">#8a000000</color>
-    <!-- Black 54% (TODO: same as secondary?) -->
-    <color name="tertiary_text_material_light">#8a000000</color>
-
-    <!-- White 87% -->
-    <color name="primary_text_default_material_dark">#deffffff</color>
-    <!-- White 38% -->
-    <color name="secondary_text_material_dark">#61ffffff</color>
-    <!-- White 38% (TODO: same as secondary?) -->
-    <color name="tertiary_text_material_dark">#61ffffff</color>
+    <color name="secondary_text_default_material_light">#8a000000</color>
+
+    <color name="primary_text_default_material_dark">#ffffffff</color>
+    <color name="secondary_text_default_material_dark">#b3ffffff</color>
+
+    <item name="disabled_alpha_material_light" format="float" type="dimen">0.26</item>
+    <item name="disabled_alpha_material_dark" format="float" type="dimen">0.30</item>
 
     <!-- Primary & accent colors -->
     <eat-comment />
index f5c9299..5f7f0ed 100644 (file)
@@ -77,8 +77,5 @@
     <!-- Default rounded corner for controls -->
     <dimen name="control_corner_material">2dp</dimen>
 
-    <!-- Default alpha value for disabled elements. -->
-    <item name="disabled_alpha_material" format="float" type="dimen">0.26</item>
-
-    <dimen name="alert_dialog_padding_material">12dp</dimen>
+    <dimen name="alert_dialog_padding_material">18dp</dimen>
 </resources>
index 89fac13..2296a12 100644 (file)
@@ -46,7 +46,7 @@ please see themes_device_defaults.xml.
         <item name="colorForegroundInverse">@color/bright_foreground_material_light</item>
         <item name="colorBackground">@color/background_material_dark</item>
         <item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_material_dark</item>
-        <item name="disabledAlpha">@dimen/disabled_alpha_material</item>
+        <item name="disabledAlpha">@dimen/disabled_alpha_material_dark</item>
         <item name="backgroundDimAmount">0.6</item>
 
         <!-- Text styles -->
@@ -58,8 +58,8 @@ please see themes_device_defaults.xml.
         <item name="textColorPrimaryDisableOnly">@color/primary_text_disable_only_material_dark</item>
         <item name="textColorSecondary">@color/secondary_text_material_dark</item>
         <item name="textColorSecondaryInverse">@color/secondary_text_material_light</item>
-        <item name="textColorTertiary">@color/tertiary_text_material_dark</item>
-        <item name="textColorTertiaryInverse">@color/tertiary_text_material_light</item>
+        <item name="textColorTertiary">@color/secondary_text_material_dark</item>
+        <item name="textColorTertiaryInverse">@color/secondary_text_material_light</item>
         <item name="textColorHint">@color/hint_foreground_material_dark</item>
         <item name="textColorHintInverse">@color/hint_foreground_material_light</item>
         <item name="textColorHighlight">@color/highlighted_text_material_dark</item>
@@ -387,7 +387,7 @@ please see themes_device_defaults.xml.
         <item name="colorForegroundInverse">@color/bright_foreground_material_dark</item>
         <item name="colorBackground">@color/background_material_light</item>
         <item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_material_light</item>
-        <item name="disabledAlpha">@dimen/disabled_alpha_material</item>
+        <item name="disabledAlpha">@dimen/disabled_alpha_material_light</item>
         <item name="backgroundDimAmount">0.6</item>
 
         <!-- Text styles -->
@@ -398,8 +398,8 @@ please see themes_device_defaults.xml.
         <item name="textColorPrimaryInverse">@color/primary_text_material_dark</item>
         <item name="textColorSecondary">@color/secondary_text_material_light</item>
         <item name="textColorSecondaryInverse">@color/secondary_text_material_dark</item>
-        <item name="textColorTertiary">@color/tertiary_text_material_light</item>
-        <item name="textColorTertiaryInverse">@color/tertiary_text_material_dark</item>
+        <item name="textColorTertiary">@color/secondary_text_material_light</item>
+        <item name="textColorTertiaryInverse">@color/secondary_text_material_dark</item>
         <item name="textColorPrimaryDisableOnly">@color/primary_text_disable_only_material_light</item>
         <item name="textColorPrimaryInverseDisableOnly">@color/primary_text_disable_only_material_dark</item>
         <item name="textColorHint">@color/hint_foreground_material_light</item>
@@ -750,8 +750,8 @@ please see themes_device_defaults.xml.
         <item name="textColorPrimaryInverse">@color/primary_text_material_dark</item>
         <item name="textColorSecondary">@color/secondary_text_material_light</item>
         <item name="textColorSecondaryInverse">@color/secondary_text_material_dark</item>
-        <item name="textColorTertiary">@color/tertiary_text_material_light</item>
-        <item name="textColorTertiaryInverse">@color/tertiary_text_material_dark</item>
+        <item name="textColorTertiary">@color/secondary_text_material_light</item>
+        <item name="textColorTertiaryInverse">@color/secondary_text_material_dark</item>
         <item name="textColorPrimaryDisableOnly">@color/primary_text_disable_only_material_light</item>
         <item name="textColorPrimaryInverseDisableOnly">@color/primary_text_disable_only_material_dark</item>
         <item name="textColorHint">@color/hint_foreground_material_light</item>
@@ -790,8 +790,8 @@ please see themes_device_defaults.xml.
         <item name="textColorPrimaryDisableOnly">@color/primary_text_disable_only_material_dark</item>
         <item name="textColorSecondary">@color/secondary_text_material_dark</item>
         <item name="textColorSecondaryInverse">@color/secondary_text_material_light</item>
-        <item name="textColorTertiary">@color/tertiary_text_material_dark</item>
-        <item name="textColorTertiaryInverse">@color/tertiary_text_material_light</item>
+        <item name="textColorTertiary">@color/secondary_text_material_dark</item>
+        <item name="textColorTertiaryInverse">@color/secondary_text_material_light</item>
         <item name="textColorHint">@color/hint_foreground_material_dark</item>
         <item name="textColorHintInverse">@color/hint_foreground_material_light</item>
         <item name="textColorHighlight">@color/highlighted_text_material_dark</item>
index 49862bc..34e6a20 100644 (file)
@@ -42,8 +42,9 @@ class RippleBackground {
     private static final float GLOBAL_SPEED = 1.0f;
     private static final float WAVE_TOUCH_DOWN_ACCELERATION = 1024.0f * GLOBAL_SPEED;
     private static final float WAVE_OPACITY_DECAY_VELOCITY = 3.0f / GLOBAL_SPEED;
-    private static final float WAVE_OUTER_OPACITY_VELOCITY_MAX = 4.5f * GLOBAL_SPEED;
-    private static final float WAVE_OUTER_OPACITY_VELOCITY_MIN = 1.5f * GLOBAL_SPEED;
+    private static final float WAVE_OUTER_OPACITY_EXIT_VELOCITY_MAX = 4.5f * GLOBAL_SPEED;
+    private static final float WAVE_OUTER_OPACITY_EXIT_VELOCITY_MIN = 1.5f * GLOBAL_SPEED;
+    private static final float WAVE_OUTER_OPACITY_ENTER_VELOCITY = 10.0f * GLOBAL_SPEED;
     private static final float WAVE_OUTER_SIZE_INFLUENCE_MAX = 200f;
     private static final float WAVE_OUTER_SIZE_INFLUENCE_MIN = 40f;
 
@@ -285,7 +286,7 @@ class RippleBackground {
     public void enter() {
         final int radiusDuration = (int)
                 (1000 * Math.sqrt(mOuterRadius / WAVE_TOUCH_DOWN_ACCELERATION * mDensity) + 0.5);
-        final int outerDuration = (int) (1000 * 1.0f / WAVE_OUTER_OPACITY_VELOCITY_MIN);
+        final int outerDuration = (int) (1000 * 1.0f / WAVE_OUTER_OPACITY_ENTER_VELOCITY);
 
         final ObjectAnimator cX = ObjectAnimator.ofFloat(this, "xGravity", 1);
         cX.setAutoCancel(true);
@@ -328,8 +329,8 @@ class RippleBackground {
         final float outerSizeInfluence = MathUtils.constrain(
                 (mOuterRadius - WAVE_OUTER_SIZE_INFLUENCE_MIN * mDensity)
                 / (WAVE_OUTER_SIZE_INFLUENCE_MAX * mDensity), 0, 1);
-        final float outerOpacityVelocity = MathUtils.lerp(WAVE_OUTER_OPACITY_VELOCITY_MIN,
-                WAVE_OUTER_OPACITY_VELOCITY_MAX, outerSizeInfluence);
+        final float outerOpacityVelocity = MathUtils.lerp(WAVE_OUTER_OPACITY_EXIT_VELOCITY_MIN,
+                WAVE_OUTER_OPACITY_EXIT_VELOCITY_MAX, outerSizeInfluence);
 
         // Determine at what time the inner and outer opacity intersect.
         // inner(t) = mOpacity - t * WAVE_OPACITY_DECAY_VELOCITY / 1000