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

Commit 761cde11 authored by Mady Mellor's avatar Mady Mellor
Browse files

Rename notification settings icon row / gear to notification menu row

Test: manual
Change-Id: I3a84c5ea180bd1e53495c5a44a93fa1982056174
parent 43c2cd1a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<com.android.systemui.statusbar.NotificationSettingsIconRow
<com.android.systemui.statusbar.NotificationMenuRow
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
+3 −3
Original line number Diff line number Diff line
@@ -24,9 +24,9 @@
    >

    <ViewStub
        android:layout="@layout/notification_settings_icon_row"
        android:id="@+id/settings_icon_row_stub"
        android:inflatedId="@+id/notification_settings_icon_row"
        android:layout="@layout/notification_menu_row"
        android:id="@+id/menu_row_stub"
        android:inflatedId="@+id/notification_menu_row"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />
+4 −4
Original line number Diff line number Diff line
@@ -106,11 +106,11 @@
    <!-- Minimum layouted height of a notification in the statusbar-->
    <dimen name="min_notification_layout_height">48dp</dimen>

    <!-- Width of the space containing the gear icon behind a notification -->
    <dimen name="notification_gear_width">64dp</dimen>
    <!-- Size of the space to place a notification menu item -->
    <dimen name="notification_menu_icon_size">64dp</dimen>

    <!-- The space around the gear icon displayed behind a notification  -->
    <dimen name="notification_gear_padding">20dp</dimen>
    <!-- The space around a notification menu item  -->
    <dimen name="notification_menu_icon_padding">20dp</dimen>

    <!-- size at which Notification icons will be drawn in the status bar -->
    <dimen name="status_bar_icon_drawing_size">17dp</dimen>
+2 −3
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import android.view.accessibility.AccessibilityEvent;
import com.android.systemui.classifier.FalsingManager;
import com.android.systemui.plugins.statusbar.NotificationMenuRowProvider.MenuItem;
import com.android.systemui.statusbar.FlingAnimationUtils;
import com.android.systemui.statusbar.NotificationSettingsIconRow;
import com.android.systemui.statusbar.NotificationMenuRow;

import java.util.HashMap;

@@ -286,8 +286,7 @@ public class SwipeHelper implements Gefingerpoken {
                                        final int x = (int) ev.getRawX() - mTmpPos[0];
                                        final int y = (int) ev.getRawY() - mTmpPos[1];
                                        mLongPressListener.onLongPress(mCurrView, x, y,
                                                NotificationSettingsIconRow
                                                        .getSettingsMenuItem(mContext));
                                                NotificationMenuRow.getSettingsMenuItem(mContext));
                                    }
                                }
                            };
+35 −37
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
    private int mNotificationColor;
    private ExpansionLogger mLogger;
    private String mLoggingKey;
    private NotificationSettingsIconRow mSettingsIconRow;
    private NotificationMenuRow mMenuRow;
    private NotificationGuts mGuts;
    private NotificationData.Entry mEntry;
    private StatusBarNotification mStatusBarNotification;
@@ -130,7 +130,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
    private boolean mChildrenExpanded;
    private boolean mIsSummaryWithChildren;
    private NotificationChildrenContainer mChildrenContainer;
    private ViewStub mSettingsIconRowStub;
    private ViewStub mMenuRowStub;
    private ViewStub mGutsStub;
    private boolean mIsSystemChildExpanded;
    private boolean mIsPinned;
@@ -372,8 +372,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {

    public void setAppName(String appName) {
        mAppName = appName;
        if (mSettingsIconRow != null) {
            mSettingsIconRow.setAppName(mAppName);
        if (mMenuRow != null) {
            mMenuRow.setAppName(mAppName);
        }
    }

@@ -442,7 +442,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {

    @Override
    protected boolean handleSlideBack() {
        if (mSettingsIconRow != null && mSettingsIconRow.isVisible()) {
        if (mMenuRow != null && mMenuRow.isVisible()) {
            animateTranslateNotification(0 /* targetLeft */);
            return true;
        }
@@ -682,16 +682,16 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            mGuts.setVisibility(oldGuts.getVisibility());
            addView(mGuts, index);
        }
        if (mSettingsIconRow != null) {
            View oldSettings = mSettingsIconRow;
            int settingsIndex = indexOfChild(oldSettings);
            removeView(oldSettings);
            mSettingsIconRow = (NotificationSettingsIconRow) LayoutInflater.from(mContext).inflate(
                    R.layout.notification_settings_icon_row, this, false);
            mSettingsIconRow.setNotificationRowParent(ExpandableNotificationRow.this);
            mSettingsIconRow.setAppName(mAppName);
            mSettingsIconRow.setVisibility(oldSettings.getVisibility());
            addView(mSettingsIconRow, settingsIndex);
        if (mMenuRow != null) {
            View oldMenu = mMenuRow;
            int menuIndex = indexOfChild(oldMenu);
            removeView(oldMenu);
            mMenuRow = (NotificationMenuRow) LayoutInflater.from(mContext).inflate(
                    R.layout.notification_menu_row, this, false);
            mMenuRow.setNotificationRowParent(ExpandableNotificationRow.this);
            mMenuRow.setAppName(mAppName);
            mMenuRow.setVisibility(oldMenu.getVisibility());
            addView(mMenuRow, menuIndex);

        }
        for (NotificationContentView l : mLayouts) {
@@ -1012,21 +1012,19 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        super.onFinishInflate();
        mPublicLayout = (NotificationContentView) findViewById(R.id.expandedPublic);
        mPrivateLayout = (NotificationContentView) findViewById(R.id.expanded);

        mLayouts = new NotificationContentView[] {mPrivateLayout, mPublicLayout};

        for (NotificationContentView l : mLayouts) {
            l.setExpandClickListener(mExpandClickListener);
            l.setContainingNotification(this);
        }

        mSettingsIconRowStub = (ViewStub) findViewById(R.id.settings_icon_row_stub);
        mSettingsIconRowStub.setOnInflateListener(new ViewStub.OnInflateListener() {
        mMenuRowStub = (ViewStub) findViewById(R.id.menu_row_stub);
        mMenuRowStub.setOnInflateListener(new ViewStub.OnInflateListener() {
            @Override
            public void onInflate(ViewStub stub, View inflated) {
                mSettingsIconRow = (NotificationSettingsIconRow) inflated;
                mSettingsIconRow.setNotificationRowParent(ExpandableNotificationRow.this);
                mSettingsIconRow.setAppName(mAppName);
                mMenuRow = (NotificationMenuRow) inflated;
                mMenuRow.setNotificationRowParent(ExpandableNotificationRow.this);
                mMenuRow.setAppName(mAppName);
            }
        });
        mGutsStub = (ViewStub) findViewById(R.id.notification_guts_stub);
@@ -1057,7 +1055,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            mTranslateableViews.add(getChildAt(i));
        }
        // Remove views that don't translate
        mTranslateableViews.remove(mSettingsIconRowStub);
        mTranslateableViews.remove(mMenuRowStub);
        mTranslateableViews.remove(mChildrenContainerStub);
        mTranslateableViews.remove(mGutsStub);
    }
@@ -1072,8 +1070,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            }
        }
        invalidateOutline();
        if (mSettingsIconRow != null) {
            mSettingsIconRow.resetState(true /* notify */);
        if (mMenuRow != null) {
            mMenuRow.resetState(true /* notify */);
        }
    }

@@ -1100,8 +1098,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            }
        }
        invalidateOutline();
        if (mSettingsIconRow != null) {
            mSettingsIconRow.updateSettingsIcons(translationX, getMeasuredWidth());
        if (mMenuRow != null) {
            mMenuRow.updateMenuAlpha(translationX, getMeasuredWidth());
        }
    }

@@ -1138,8 +1136,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {

            @Override
            public void onAnimationEnd(Animator anim) {
                if (!cancelled && mSettingsIconRow != null && leftTarget == 0) {
                    mSettingsIconRow.resetState(true /* notify */);
                if (!cancelled && mMenuRow != null && leftTarget == 0) {
                    mMenuRow.resetState(true /* notify */);
                    mTranslateAnim = null;
                }
            }
@@ -1149,17 +1147,17 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
    }

    public float getSpaceForGear() {
        if (mSettingsIconRow != null) {
            return mSettingsIconRow.getSpaceForGear();
        if (mMenuRow != null) {
            return mMenuRow.getSpaceForMenu();
        }
        return 0;
    }

    public NotificationSettingsIconRow getSettingsRow() {
        if (mSettingsIconRow == null) {
            mSettingsIconRowStub.inflate();
    public NotificationMenuRow getSettingsRow() {
        if (mMenuRow == null) {
            mMenuRowStub.inflate();
        }
        return mSettingsIconRow;
        return mMenuRow;
    }

    public void inflateGuts() {
@@ -1434,8 +1432,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
        updateMaxHeights();
        if (mSettingsIconRow != null) {
            mSettingsIconRow.updateVerticalLocation();
        if (mMenuRow != null) {
            mMenuRow.updateVerticalLocation();
        }
        updateContentShiftHeight();
    }
Loading