From ed6f14a20c69da3d221cc1acbaa31e74e837917c Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Tue, 26 Aug 2014 14:53:28 -0700 Subject: [PATCH] Make shadow alpha properties public, add lighting values for TV BUG: 17189722 BUG: 17221975 Change-Id: I4ed477b658fec96ce69fa278f67345dab6bacaa3 --- api/current.txt | 2 ++ core/java/android/view/ThreadedRenderer.java | 10 +++--- core/res/res/values-television/dimens.xml | 23 ++++++++++++++ core/res/res/values/attrs.xml | 32 ++++++++++++++------ core/res/res/values/dimens.xml | 7 +++++ core/res/res/values/public.xml | 2 ++ core/res/res/values/styles.xml | 8 ----- core/res/res/values/symbols.xml | 1 - core/res/res/values/themes.xml | 11 +++++-- packages/SystemUI/res/values/styles.xml | 5 +-- 10 files changed, 69 insertions(+), 32 deletions(-) create mode 100644 core/res/res/values-television/dimens.xml diff --git a/api/current.txt b/api/current.txt index 82a2d8b8fd0b6..76c3717aba88c 100644 --- a/api/current.txt +++ b/api/current.txt @@ -327,6 +327,7 @@ package android { field public static final int alwaysRetainTaskState = 16843267; // 0x1010203 field public static final int amPmBackgroundColor = 16843942; // 0x10104a6 field public static final int amPmTextColor = 16843941; // 0x10104a5 + field public static final int ambientShadowAlpha = 16843967; // 0x10104bf field public static final int angle = 16843168; // 0x10101a0 field public static final int animateFirstView = 16843477; // 0x10102d5 field public static final int animateLayoutChanges = 16843506; // 0x10102f2 @@ -1147,6 +1148,7 @@ package android { field public static final int spinnersShown = 16843595; // 0x101034b field public static final int splitMotionEvents = 16843503; // 0x10102ef field public static final int splitTrack = 16843852; // 0x101044c + field public static final int spotShadowAlpha = 16843968; // 0x10104c0 field public static final int src = 16843033; // 0x1010119 field public static final int ssp = 16843747; // 0x10103e3 field public static final int sspPattern = 16843749; // 0x10103e5 diff --git a/core/java/android/view/ThreadedRenderer.java b/core/java/android/view/ThreadedRenderer.java index 50341fc3299ea..3af214db0ad93 100644 --- a/core/java/android/view/ThreadedRenderer.java +++ b/core/java/android/view/ThreadedRenderer.java @@ -99,15 +99,13 @@ public class ThreadedRenderer extends HardwareRenderer { private boolean mRootNodeNeedsUpdate; ThreadedRenderer(Context context, boolean translucent) { - final TypedArray a = context.obtainStyledAttributes( - null, R.styleable.Lighting, R.attr.lightingStyle, 0); + final TypedArray a = context.obtainStyledAttributes(null, R.styleable.Lighting, 0, 0); mLightY = a.getDimension(R.styleable.Lighting_lightY, 0); mLightZ = a.getDimension(R.styleable.Lighting_lightZ, 0); mLightRadius = a.getDimension(R.styleable.Lighting_lightRadius, 0); - mAmbientShadowAlpha = Math.round( - 255 * a.getFloat(R.styleable.Lighting_ambientShadowAlpha, 0)); - mSpotShadowAlpha = Math.round( - 255 * a.getFloat(R.styleable.Lighting_spotShadowAlpha, 0)); + mAmbientShadowAlpha = + (int) (255 * a.getFloat(R.styleable.Lighting_ambientShadowAlpha, 0) + 0.5f); + mSpotShadowAlpha = (int) (255 * a.getFloat(R.styleable.Lighting_spotShadowAlpha, 0) + 0.5f); a.recycle(); long rootNodePtr = nCreateRootRenderNode(); diff --git a/core/res/res/values-television/dimens.xml b/core/res/res/values-television/dimens.xml new file mode 100644 index 0000000000000..8266642325e06 --- /dev/null +++ b/core/res/res/values-television/dimens.xml @@ -0,0 +1,23 @@ + + + + + + -300dp + 0.4 + 0.4 + + diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index cc8d7cf30fec6..f092f73832b30 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1012,13 +1012,25 @@ - - - + + + - - + + + + + + + + + + + + + + @@ -7383,11 +7395,11 @@ - - - - - + + + + + diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 6fd2bb1def954..b152c6a26c94f 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -405,4 +405,11 @@ 40dp + + -200dp + 800dp + 800dp + 0.06 + 0.16 + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index f2466f78c3267..36e26ddd539b7 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2278,6 +2278,8 @@ + + diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 8fc9bacdf1114..5f6f546441381 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -1355,12 +1355,4 @@ please see styles_device_defaults.xml. 16dp - - diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 3f373aabde838..ac177537eb0cc 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1976,7 +1976,6 @@ - diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index 5445816e9e618..48de5adf552cb 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -410,14 +410,19 @@ please see themes_device_defaults.xml. @drawable/menu_submenu_background floating @color/primary_text_dark + @style/Pointer - + @drawable/view_accessibility_focused - - @style/Lighting + + @dimen/light_y + @dimen/light_z + @dimen/light_radius + @dimen/ambient_shadow_alpha + @dimen/spot_shadow_alpha diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 8c1ac9fec1896..b39fe24834f1d 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -33,11 +33,8 @@ @android:color/transparent true @style/Animation.RecentsActivity - @style/RecentsLighting - -