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

Commit ea7dbe71 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add background blur activity to silkfx" am: 81f5901e am: 9da79d37

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1966459

Change-Id: I42cc386c66ae508d8a05a8332248ac3165b8698f
parents 00174571 9da79d37
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -20,17 +20,20 @@
    <uses-sdk android:minSdkVersion="30"/>

    <uses-permission android:name="android.permission.CONTROL_DISPLAY_BRIGHTNESS" />
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />

    <application android:label="SilkFX"
         android:theme="@android:style/Theme.Material">

        <activity android:name=".Main"
             android:label="SilkFX Demos"
             android:banner="@drawable/background1"
             android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.LAUNCHER"/>
                <category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
            </intent-filter>
        </activity>

@@ -41,13 +44,16 @@

        <activity android:name=".materials.GlassActivity"
            android:label="Glass Examples"
            android:banner="@drawable/background1"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name=".materials.BackgroundBlurActivity"
            android:theme="@style/Theme.BackgroundBlurTheme"
            android:exported="true">
        </activity>

    </application>
</manifest>
+20 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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.
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
           android:shape="rectangle">
    <solid android:color="#20FFFFFF"/>
    <corners android:radius="10dp"/>
</shape>
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 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.
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:radius="10dp"/>
</shape>
+173 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 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.
  -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/background"
    android:layout_width="390dp"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:padding="15dp"
    android:orientation="vertical"
    tools:context=".materials.BackgroundBlurActivity">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:padding="10dp"
        android:textColor="#ffffffff"
        android:text="Hello blurry world!"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="#ffffffff"
            android:text="Background blur"/>

        <SeekBar
            android:id="@+id/set_background_blur"
            android:min="0"
            android:max="300"
            android:layout_width="160dp"
            android:layout_height="wrap_content"/>
        <TextView
            android:id="@+id/background_blur_radius"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#ffffffff"
            android:ems="3"
            android:gravity="center"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:text="TODO"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="#ffffffff"
            android:text="Background alpha"/>

        <SeekBar
            android:id="@+id/set_background_alpha"
            android:min="0"
            android:max="100"
            android:layout_width="160dp"
            android:layout_height="wrap_content" />
        <TextView
            android:id="@+id/background_alpha"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#ffffffff"
            android:ems="3"
            android:gravity="center"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:text="TODO"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="#ffffffff"
            android:text="Blur behind"/>

        <SeekBar
            android:id="@+id/set_blur_behind"
            android:min="0"
            android:max="300"
            android:layout_width="160dp"
            android:layout_height="wrap_content" />
        <TextView
            android:id="@+id/blur_behind_radius"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:textColor="#ffffffff"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:ems="3"
            android:text="TODO"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="#ffffffff"
            android:text="Dim amount"/>

        <SeekBar
            android:id="@+id/set_dim_amount"
            android:min="0"
            android:max="100"
            android:layout_width="160dp"
            android:layout_height="wrap_content" />
        <TextView
            android:id="@+id/dim_amount"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:textColor="#ffffffff"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:ems="3"
            android:text="TODO"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="5dp"
        android:orientation="vertical"
        android:gravity="center">

        <Button
            android:id="@+id/toggle_blur_enabled"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Disable blur"
            android:onClick="toggleForceBlurDisabled"/>

        <Button
            android:id="@+id/toggle_battery_saving_mode"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="TODO"
            android:onClick="toggleBatterySavingMode"/>
    </LinearLayout>
    <requestFocus/>

</LinearLayout>
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 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.
  -->
<!-- Styles for immersive actions UI. -->
<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="Theme.BackgroundBlurTheme" parent= "Theme.AppCompat.Dialog">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBlurBehindEnabled">true</item>
        <item name="android:backgroundDimEnabled">false</item>
        <item name="android:windowElevation">0dp</item>
        <item name="buttonStyle">@style/AppTheme.Button</item>
        <item name="colorAccent">#bbffffff</item>
    </style>
    <style name="AppTheme.Button" parent="Widget.AppCompat.Button">
        <item name="android:textColor">#ffffffff</item>
    </style>

</resources>
Loading