am 30da9cd4: Merge "Variety of small UI tweaks" into lmp-dev

* commit '30da9cd4009b42cdcaff5787c7ef4f8fa6f34dee':
  Variety of small UI tweaks
This commit is contained in:
Alan Viverette
2014-08-29 23:36:01 +00:00
committed by Android Git Automerger
14 changed files with 82 additions and 46 deletions

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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">

View 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" />

View File

@@ -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>
<color name="secondary_text_default_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="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 />

View 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>

View 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>

View 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