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

Commit 37503a06 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Replace bubble settings icon with "manage" text" into qt-dev

parents 2f1382ea 754e77b7
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -33,13 +33,15 @@
        android:layout_height="wrap_content"
        android:animateLayoutChanges="true">

        <ImageView
        <com.android.systemui.statusbar.AlphaOptimizedButton
            style="@android:style/Widget.Material.Button.Borderless"
            android:id="@+id/settings_button"
            android:layout_width="@dimen/bubble_header_icon_size"
            android:layout_height="@dimen/bubble_header_icon_size"
            android:src="@drawable/ic_settings"
            android:scaleType="center"
            android:layout_gravity="end"/>
            android:layout_gravity="end"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusable="true"
            android:text="@string/manage_bubbles_text"
            android:textColor="?attr/wallpaperTextColor"/>

        <include layout="@layout/bubble_permission_view"
                 android:id="@+id/permission_layout"
+2 −0
Original line number Diff line number Diff line
@@ -2414,6 +2414,8 @@
    <!-- Text for asking the user whether bubbles (floating app content) should be enabled for an
         app. [CHAR LIMIT=NONE] -->
    <string name="bubbles_prompt">Allow bubbles from <xliff:g id="app_name" example="YouTube">%1$s</xliff:g>?</string>
    <!-- The text for the manage bubbles link. [CHAR LIMIT=NONE] -->
    <string name="manage_bubbles_text">Manage</string>
    <!-- Text used for button allowing user to opt out of bubbles [CHAR LIMIT=20] -->
    <string name="no_bubbles">Deny</string>
    <!-- Text used for button allowing user to approve / enable bubbles [CHAR LIMIT=20] -->
+4 −20
Original line number Diff line number Diff line
@@ -40,11 +40,8 @@ import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Insets;
import android.graphics.Point;
import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.InsetDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -66,6 +63,7 @@ import com.android.systemui.Dependency;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.recents.TriangleShape;
import com.android.systemui.statusbar.AlphaOptimizedButton;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
@@ -80,7 +78,7 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
    private View mPointerView;
    private int mPointerMargin;

    private ImageView mSettingsIcon;
    private AlphaOptimizedButton mSettingsIcon;

    // Permission view
    private View mPermissionView;
@@ -100,8 +98,6 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
    private int mSettingsIconHeight;
    private int mBubbleHeight;
    private int mPermissionHeight;
    private int mIconInset;
    private Drawable mSettingsIconDrawable;
    private int mPointerWidth;
    private int mPointerHeight;

@@ -218,10 +214,7 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
        mSettingsIconHeight = getContext().getResources().getDimensionPixelSize(
                R.dimen.bubble_expanded_header_height);
        mSettingsIcon = findViewById(R.id.settings_button);
        mIconInset = getResources().getDimensionPixelSize(R.dimen.bubble_icon_inset);
        mSettingsIcon.setOnClickListener(this);
        // Save initial drawable to create adaptive icons that will take its place.
        mSettingsIconDrawable = mSettingsIcon.getDrawable();

        mPermissionHeight = getContext().getResources().getDimensionPixelSize(
                R.dimen.bubble_permission_height);
@@ -377,16 +370,6 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
        int foregroundColor = ta.getColor(1, Color.BLACK /* default */);
        ta.recycle();

        // Must clear tint first - otherwise tint updates inconsistently.
        mSettingsIconDrawable.setTintList(null);
        mSettingsIconDrawable.setTint(foregroundColor);

        InsetDrawable foreground = new InsetDrawable(mSettingsIconDrawable, mIconInset);
        ColorDrawable background = new ColorDrawable(backgroundColor);
        AdaptiveIconDrawable adaptiveIcon = new AdaptiveIconDrawable(background,
                foreground);
        mSettingsIcon.setImageDrawable(adaptiveIcon);

        // Update permission prompt color.
        mPermissionView.setBackground(createPermissionBackground(backgroundColor));
        mPermissionPrompt.setTextColor(foregroundColor);
@@ -649,11 +632,12 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
    }

    private Intent getSettingsIntent(String packageName, final int appUid) {
        final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
        final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS);
        intent.putExtra(Settings.EXTRA_APP_PACKAGE, packageName);
        intent.putExtra(Settings.EXTRA_APP_UID, appUid);
        intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
        return intent;
    }