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

Commit 7c9f3348 authored by Mark Ashdown's avatar Mark Ashdown
Browse files

Merge remote-tracking branch 'goog/ub-now-lunchbox' into lunchbox-release

parents 56ca86b7 0c255a94
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
    <permission
        android:name="com.android.launcher3.permission.PRELOAD_WORKSPACE"
        android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
        android:protectionLevel="system|signature" />
        android:protectionLevel="signatureOrSystem" />
    <permission
        android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
        android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
@@ -47,7 +47,7 @@
    <permission
        android:name="com.android.launcher3.permission.WRITE_SETTINGS"
        android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
        android:protectionLevel="normal"
        android:protectionLevel="signatureOrSystem"
        android:label="@string/permlab_write_settings"
        android:description="@string/permdesc_write_settings"/>

@@ -106,7 +106,7 @@

        <activity
            android:name="com.android.launcher3.LauncherWallpaperPickerActivity"
            android:theme="@style/Theme.WallpaperCropper"
            android:theme="@style/Theme.WallpaperPicker"
            android:label="@string/pick_wallpaper"
            android:icon="@mipmap/ic_launcher_wallpaper"
            android:finishOnCloseSystemDialogs="true"
+10 −13
Original line number Diff line number Diff line
@@ -18,18 +18,15 @@
*/
-->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    style="?android:actionButtonStyle"
<com.android.launcher3.AlphaDisableableButton
    xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/ActionBarSetWallpaperStyle"
    android:id="@+id/set_wallpaper_button"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    <TextView style="?android:actionBarTabTextStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="start|center_vertical"
    android:layout_height="match_parent"
    android:paddingRight="20dp"
    android:drawableLeft="@drawable/ic_actionbar_accept"
    android:drawablePadding="8dp"
        android:gravity="center_vertical"
        android:text="@string/wallpaper_instructions" />
</FrameLayout>
    android:gravity="start|center_vertical"
    android:text="@string/wallpaper_instructions">
</com.android.launcher3.AlphaDisableableButton>
+10 −0
Original line number Diff line number Diff line
@@ -24,6 +24,12 @@
        <item name="android:windowActionBarOverlay">true</item>
    </style>

    <style name="Theme.WallpaperPicker" parent="Theme.WallpaperCropper">
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:colorBackgroundCacheHint">@null</item>
        <item name="android:windowShowWallpaper">true</item>
    </style>

    <style name="WallpaperCropperActionBar" parent="android:style/Widget.Holo.ActionBar">
        <item name="android:displayOptions">showCustom</item>
        <item name="android:background">#88000000</item>
@@ -31,4 +37,8 @@

    <style name="Theme" parent="@android:style/Theme.Holo.Wallpaper.NoTitleBar">
    </style>

    <style name="ActionBarSetWallpaperStyle" parent="@android:style/Widget.Holo.ActionButton">
        <item name="android:textColor">#ffffffff</item>
    </style>
</resources>
+50 −0
Original line number Diff line number Diff line
/*
 * 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
 */

package com.android.launcher3;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;

/**
 * A Button which becomes translucent when it is disabled
 */
public class AlphaDisableableButton extends Button {
    public static float DISABLED_ALPHA_VALUE = 0.4f;
    public AlphaDisableableButton(Context context) {
        this(context, null);
    }

    public AlphaDisableableButton(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public AlphaDisableableButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setLayerType(LAYER_TYPE_HARDWARE, null);
    }

    @Override
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        if(enabled) {
            setAlpha(1.0f);
        } else {
            setAlpha(DISABLED_ALPHA_VALUE);
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ public class LiveWallpaperListAdapter extends BaseAdapter implements ListAdapter
            Intent preview = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
            preview.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
                    mInfo.getComponent());
            a.onLiveWallpaperPickerLaunch();
            a.onLiveWallpaperPickerLaunch(mInfo);
            a.startActivityForResultSafely(preview, WallpaperPickerActivity.PICK_LIVE_WALLPAPER);
        }
    }
Loading