diff options
author | Alan Viverette <alanv@google.com> | 2014-08-29 23:08:00 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-29 23:08:01 +0000 |
commit | cf2a75a66ecf9fed2601c85c0753195744d1c6bd (patch) | |
tree | 8465e87d5a1fb128513e458ba5d6e8865f528a91 | |
parent | efb1f36f09cdada7c3b2677e6628492d8f256729 (diff) | |
parent | 7ff48839b0149eba1ab46cfd1476854c2e664a81 (diff) | |
download | frameworks_base-cf2a75a66ecf9fed2601c85c0753195744d1c6bd.zip frameworks_base-cf2a75a66ecf9fed2601c85c0753195744d1c6bd.tar.gz frameworks_base-cf2a75a66ecf9fed2601c85c0753195744d1c6bd.tar.bz2 |
Merge "Variety of small UI tweaks" into lmp-dev
14 files changed, 83 insertions, 47 deletions
diff --git a/core/res/res/color/btn_default_material_dark.xml b/core/res/res/color/btn_default_material_dark.xml index 7c904cd..9be1417 100644 --- a/core/res/res/color/btn_default_material_dark.xml +++ b/core/res/res/color/btn_default_material_dark.xml @@ -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> diff --git a/core/res/res/color/btn_default_material_light.xml b/core/res/res/color/btn_default_material_light.xml index 738f9ad..af5afe6 100644 --- a/core/res/res/color/btn_default_material_light.xml +++ b/core/res/res/color/btn_default_material_light.xml @@ -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> diff --git a/core/res/res/color/primary_text_disable_only_material_dark.xml b/core/res/res/color/primary_text_disable_only_material_dark.xml index cdae790..a6296c9 100644 --- a/core/res/res/color/primary_text_disable_only_material_dark.xml +++ b/core/res/res/color/primary_text_disable_only_material_dark.xml @@ -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> diff --git a/core/res/res/color/primary_text_disable_only_material_light.xml b/core/res/res/color/primary_text_disable_only_material_light.xml index 0bf14d0..b781844 100644 --- a/core/res/res/color/primary_text_disable_only_material_light.xml +++ b/core/res/res/color/primary_text_disable_only_material_light.xml @@ -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> diff --git a/core/res/res/color/primary_text_material_dark.xml b/core/res/res/color/primary_text_material_dark.xml index 6ad837b..690f0ec 100644 --- a/core/res/res/color/primary_text_material_dark.xml +++ b/core/res/res/color/primary_text_material_dark.xml @@ -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> diff --git a/core/res/res/color/primary_text_material_light.xml b/core/res/res/color/primary_text_material_light.xml index 4c19e12..634ad94 100644 --- a/core/res/res/color/primary_text_material_light.xml +++ b/core/res/res/color/primary_text_material_light.xml @@ -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 index 0000000..5bddf96 --- /dev/null +++ b/core/res/res/color/secondary_text_material_dark.xml @@ -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 index 0000000..3c354cb --- /dev/null +++ b/core/res/res/color/secondary_text_material_light.xml @@ -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> diff --git a/core/res/res/drawable/progress_horizontal_material.xml b/core/res/res/drawable/progress_horizontal_material.xml index 7a1079c..6b64337 100644 --- a/core/res/res/drawable/progress_horizontal_material.xml +++ b/core/res/res/drawable/progress_horizontal_material.xml @@ -18,13 +18,13 @@ <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"> diff --git a/core/res/res/layout/action_menu_item_layout.xml b/core/res/res/layout/action_menu_item_layout.xml index 04d1f7b..6961f8d 100644 --- a/core/res/res/layout/action_menu_item_layout.xml +++ b/core/res/res/layout/action_menu_item_layout.xml @@ -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" /> diff --git a/core/res/res/values/colors_material.xml b/core/res/res/values/colors_material.xml index c9292eb..d8e14a0 100644 --- a/core/res/res/values/colors_material.xml +++ b/core/res/res/values/colors_material.xml @@ -58,19 +58,14 @@ <!-- 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 /> diff --git a/core/res/res/values/dimens_material.xml b/core/res/res/values/dimens_material.xml index f5c9299..5f7f0ed 100644 --- a/core/res/res/values/dimens_material.xml +++ b/core/res/res/values/dimens_material.xml @@ -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> diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml index 89fac13..2296a12 100644 --- a/core/res/res/values/themes_material.xml +++ b/core/res/res/values/themes_material.xml @@ -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> diff --git a/graphics/java/android/graphics/drawable/RippleBackground.java b/graphics/java/android/graphics/drawable/RippleBackground.java index 49862bc..34e6a20 100644 --- a/graphics/java/android/graphics/drawable/RippleBackground.java +++ b/graphics/java/android/graphics/drawable/RippleBackground.java @@ -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 |