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

Commit 2063aefa authored by Mihai Preda's avatar Mihai Preda Committed by Bruno Martins
Browse files

WallpaperPicker: add a "No Wallpaper" option

This is a squash of the following commits.

Author: Mihai Preda <preda@android.com>
Date:   Sat Jun 11 13:31:55 2011 +0200

    Add a "No wallpaper" wallpaper option.

    The simplest implementation is with a black 1x1px image,
    but it could be implemented in a more efficient way in the future.
    (i.e. the black image is an implementation detail of the
    "no wallpaper" goal).

    On Nexus One (OLED) this "no wallpaper" produces
    45mA current saving compared to the "CM Earth" image wallpaper
    when display is set to max brightness, and 20mA saving on low brightness.

Author: Keith Mok <kmok@cyngn.com>
Date:   Fri May 27 09:49:38 2016 -0700

    Add a set wallpaper button for nowallpaper

    We set the wallpaper to black without a confirm
    button currently and without exit the wallpaper picker.
    This causes odd behaviour.
    Add back a confirm button like live wallpaper picker

    FEIJ-822

Author: Steve Kondik <steve@cyngn.com>
Date:   Thu Oct 13 13:32:03 2016 -0700

    NoWallpaper: Clear lockscreen wallpaper too

Author: Joey Rizzoli <joey@lineageos.org>
Date:   Sat Jan 13 22:34:17 2018 +0200

    NoWallpaper: Add an adaptive icon

Change-Id: Id712314d4e0808145f2180001bfc4dbeea766a46

Author: Luca Stefani <luca.stefani.ge1@gmail.com>
Date:   Wed, 24 Jan 2018 19:03:37 +0100

    WallpaperPicker: Properly animate noWallpaper

Change-Id: I760c67544cdb298ed8f26f94ce77fb22d48afc25
parent 62947b9e
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -35,5 +35,17 @@
                <data android:mimeType="image/*" />
                <data android:mimeType="image/*" />
            </intent-filter>
            </intent-filter>
        </activity>
        </activity>

        <activity
            android:name="com.android.wallpaperpicker.NoWallpaper"
            android:theme="@style/NoWallpaperStyle"
            android:label="@string/no_wallpaper"
            android:icon="@mipmap/ic_nowallpaper">
            <intent-filter>
                <action android:name="android.intent.action.SET_WALLPAPER" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

    </application>
    </application>
</manifest>
</manifest>

res/drawable/black.png

0 → 100644
+67 B
Loading image diff...
+12 −0
Original line number Original line Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="108dp"
        android:height="108dp"
        android:viewportWidth="48"
        android:viewportHeight="48">
    <group android:translateX="12"
            android:translateY="12">
        <path
            android:fillColor="#FFFFFF"
            android:pathData="M4,4h7L11,2L4,2c-1.1,0 -2,0.9 -2,2v7h2L4,4zM10,13l-4,5h12l-3,-4 -2.03,2.71L10,13zM17,8.5c0,-0.83 -0.67,-1.5 -1.5,-1.5S14,7.67 14,8.5s0.67,1.5 1.5,1.5S17,9.33 17,8.5zM20,2h-7v2h7v7h2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,20h-7v2h7c1.1,0 2,-0.9 2,-2v-7h-2v7zM4,13L2,13v7c0,1.1 0.9,2 2,2h7v-2L4,20v-7z"/>
    </group>
</vector>
+34 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"

    android:layout_gravity="center_horizontal|bottom"
    style="?android:attr/buttonBarStyle">

    <Button
        android:layout_width="0dip"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"

        android:text="@string/wallpaper_instructions"

        android:onClick="setWallpaper"
        style="?android:attr/buttonBarButtonStyle" />
</LinearLayout>
+5 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/icon_background_nowallpaper"/>
    <foreground android:drawable="@drawable/ic_nowallpaper_foreground"/>
</adaptive-icon>
Loading