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

Commit d968d670 authored by Alan Viverette's avatar Alan Viverette
Browse files

Use drag-to-open overflow menu in Alarm and Clock fragments

BUG: 10903795
Change-Id: I6288b5d4d579cc7a0aa8c0142d3249c3da232b3e
parent 86588ad6
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -72,7 +72,6 @@
            android:contentDescription="@string/button_menu"
            style="?android:attr/actionOverflowButtonStyle"
            android:background="@drawable/item_background"
            android:onClick="clockButtonsOnClick"
            android:layout_gravity="end|center_vertical"
            android:layout_width="@dimen/footer_button_size"
            android:layout_height="@dimen/footer_button_size" />
+0 −1
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@
            android:contentDescription="@string/button_menu"
            style="?android:attr/actionOverflowButtonStyle"
            android:background="@drawable/item_background"
            android:onClick="clockButtonsOnClick"
            android:layout_gravity="end|center_vertical"
            android:layout_width="@dimen/footer_button_size"
            android:layout_height="@dimen/footer_button_size" />
+0 −1
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@
            android:contentDescription="@string/button_menu"
            style="?android:attr/actionOverflowButtonStyle"
            android:background="@drawable/item_background"
            android:onClick="clockButtonsOnClick"
            android:layout_gravity="end|center_vertical"
            android:layout_width="@dimen/footer_button_size"
            android:layout_height="@dimen/footer_button_size" />
+13 −4
Original line number Diff line number Diff line
@@ -186,18 +186,27 @@ public class AlarmClockFragment extends DeskClockFragment implements
            }
        });
        // For landscape, put the add button on the right and the menu in the actionbar.
        View menuButton = v.findViewById(R.id.menu_button);
        FrameLayout.LayoutParams layoutParams =
                (FrameLayout.LayoutParams) mAddAlarmButton.getLayoutParams();
        if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
        boolean isLandscape = getResources().getConfiguration().orientation
                == Configuration.ORIENTATION_LANDSCAPE;
        if (isLandscape) {
            layoutParams.gravity = Gravity.END;
            menuButton.setVisibility(View.GONE);
        } else {
            layoutParams.gravity = Gravity.CENTER;
            menuButton.setVisibility(View.VISIBLE);
        }
        mAddAlarmButton.setLayoutParams(layoutParams);

        View menuButton = v.findViewById(R.id.menu_button);
        if (menuButton != null) {
            if (isLandscape) {
                menuButton.setVisibility(View.GONE);
            } else {
                menuButton.setVisibility(View.VISIBLE);
                setupFakeOverflowMenuButton(menuButton);
            }
        }

        mEmptyView = v.findViewById(R.id.alarms_empty_view);
        mEmptyView.setOnClickListener(new OnClickListener() {
            @Override
+7 −0
Original line number Diff line number Diff line
@@ -173,6 +173,13 @@ public class ClockFragment extends DeskClockFragment implements OnSharedPreferen
        }
        mList.setOnTouchListener(longPressNightMode);

        // If the current layout has a fake overflow menu button, let the parent
        // activity set up its click and touch listeners.
        View menuButton = v.findViewById(R.id.menu_button);
        if (menuButton != null) {
            setupFakeOverflowMenuButton(menuButton);
        }

        mDigitalClock = mClockFrame.findViewById(R.id.digital_clock);
        mAnalogClock = mClockFrame.findViewById(R.id.analog_clock);
        View footerView = inflater.inflate(R.layout.blank_footer_view, mList, false);
Loading