am 0ba40ce9: am ecba5c53: am 30da9cd4: Merge "Variety of small UI tweaks" into lmp-dev
* commit '0ba40ce90e3424f395a66680cf4251d8b514eb92': Variety of small UI tweaks
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
22
core/res/res/color/secondary_text_material_dark.xml
Normal file
22
core/res/res/color/secondary_text_material_dark.xml
Normal 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>
|
||||
22
core/res/res/color/secondary_text_material_light.xml
Normal file
22
core/res/res/color/secondary_text_material_light.xml
Normal 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>
|
||||
@@ -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">
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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 />
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user