Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3542fd6 authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Make shadow alpha properties public, add lighting values for TV" into lmp-dev

parents 03740d74 ed6f14a2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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
+4 −6
Original line number Diff line number Diff line
@@ -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();
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->
<resources>

     <!-- Lighting and shadow properties -->
     <dimen name="light_y">-300dp</dimen>
     <item type="dimen" format="float" name="ambient_shadow_alpha">0.4</item>
     <item type="dimen" format="float" name="spot_shadow_alpha">0.4</item>

</resources>
+22 −10
Original line number Diff line number Diff line
@@ -1012,13 +1012,25 @@
        <!-- The color applied to framework switch thumbs in their normal state. -->
        <attr name="colorSwitchThumbNormal" format="color" />

        <!-- ================== -->
        <!-- Hardware rendering -->
        <!-- ================== -->
        <!-- =================== -->
        <!-- Lighting properties -->
        <!-- =================== -->
        <eat-comment />

        <!-- Reference to the Lighting style. -->
        <attr name="lightingStyle" format="reference" />
        <!-- @hide The default Y position of the light used to project view shadows. -->
        <attr name="lightY" format="dimension" />

        <!-- @hide The default Z position of the light used to project view shadows. -->
        <attr name="lightZ" format="dimension" />

        <!-- @hide The default radius of the light used to project view shadows. -->
        <attr name="lightRadius" format="dimension" />

        <!-- Alpha value of the ambient shadow projected by elevated views, between 0 and 1. -->
        <attr name="ambientShadowAlpha" format="float" />

        <!-- Alpha value of the spot shadow projected by elevated views, between 0 and 1. -->
        <attr name="spotShadowAlpha" format="float" />
    </declare-styleable>

    <!-- **************************************************************** -->
@@ -7384,11 +7396,11 @@

    <!-- @hide -->
    <declare-styleable name="Lighting">
        <attr name="lightY" format="dimension" />
        <attr name="lightZ" format="dimension" />
        <attr name="lightRadius" format="dimension" />
        <attr name="ambientShadowAlpha" format="float" />
        <attr name="spotShadowAlpha" format="float" />
        <attr name="lightY" />
        <attr name="lightZ" />
        <attr name="lightRadius" />
        <attr name="ambientShadowAlpha" />
        <attr name="spotShadowAlpha" />
    </declare-styleable>

    <declare-styleable name="RestrictionEntry">
+7 −0
Original line number Diff line number Diff line
@@ -405,4 +405,11 @@

     <dimen name="text_handle_min_size">40dp</dimen>

     <!-- Lighting and shadow properties -->
     <dimen name="light_y">-200dp</dimen>
     <dimen name="light_z">800dp</dimen>
     <dimen name="light_radius">800dp</dimen>
     <item type="dimen" format="float" name="ambient_shadow_alpha">0.06</item>
     <item type="dimen" format="float" name="spot_shadow_alpha">0.16</item>

</resources>
Loading