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

Commit 7916ca9c authored by Veeti Paananen's avatar Veeti Paananen
Browse files

Remove redundant click action from date & time container layout

Unlike AOSP, CyanogenMod provides separate actions for both the clock
and date & time views in the expanded notification area. AOSP has a
single action for both views.

This commit removes the redundant AOSP click action completely. In
addition, the clock and date views are modified to occupy the entire
height of the layout to increase the clickable area.

Change-Id: I78f4353c9ae4646f14124a38ef94e44ab920a067
parent d1e3a1bc
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -32,26 +32,26 @@
        android:layout_height="match_parent"
        android:paddingStart="8dp"
        android:paddingEnd="8dp"
        android:background="@drawable/ic_notify_button_bg"
        android:enabled="false"
        >
        <com.android.systemui.statusbar.policy.Clock
            android:id="@+id/clock"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:layout_height="match_parent"
            android:paddingEnd="4dp"
            android:singleLine="true"
            android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock"
            android:layout_centerVertical="true"
            android:gravity="center_vertical"
            android:clickable="true"
            />

        <com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_height="match_parent"
            android:paddingStart="4dp"
            android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
            android:layout_toEndOf="@id/clock"
            android:layout_centerVertical="true"
            android:gravity="center_vertical"
            android:clickable="true"
            />
    </RelativeLayout>

+0 −12
Original line number Diff line number Diff line
@@ -542,10 +542,6 @@ public class PhoneStatusBar extends BaseStatusBar {
        mHasFlipSettings = res.getBoolean(R.bool.config_hasFlipSettingsPanel);

        mDateTimeView = mNotificationPanelHeader.findViewById(R.id.datetime);
        if (mDateTimeView != null) {
            mDateTimeView.setOnClickListener(mClockClickListener);
            mDateTimeView.setEnabled(true);
        }

        mSettingsButton = (ImageView) mStatusBarWindow.findViewById(R.id.settings_button);
        if (mSettingsButton != null) {
@@ -2659,14 +2655,6 @@ public class PhoneStatusBar extends BaseStatusBar {
        }
    };

    private final View.OnClickListener mClockClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            startActivityDismissingKeyguard(
                    new Intent(Intent.ACTION_QUICK_CLOCK), true); // have fun, everyone
        }
    };

    private final View.OnClickListener mNotificationButtonListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
+0 −18
Original line number Diff line number Diff line
@@ -45,8 +45,6 @@ import libcore.icu.ICU;
public class DateView extends TextView implements OnClickListener, OnLongClickListener {
    private static final String TAG = "DateView";

    private RelativeLayout mParent;

    private boolean mAttachedToWindow;
    private boolean mWindowVisible;
    private boolean mUpdating;
@@ -81,25 +79,9 @@ public class DateView extends TextView implements OnClickListener, OnLongClickLi
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        mAttachedToWindow = false;
        if (mParent != null) {
            mParent.setOnClickListener(null);
            mParent.setOnLongClickListener(null);
            mParent = null;
        }
        setUpdates();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        if (mParent == null) {
            mParent = (RelativeLayout) getParent();
            mParent.setOnClickListener(this);
            mParent.setOnLongClickListener(this);
        }

        super.onDraw(canvas);
    }

    @Override
    protected void onWindowVisibilityChanged(int visibility) {
        super.onWindowVisibilityChanged(visibility);