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

Commit 975a8d0f authored by Andrei Stingaceanu's avatar Andrei Stingaceanu
Browse files

Landscape extracted mode - floating toolbar interference

In landscape do not allow starting selection modes if the
extracted mode has not yet started. Also remove the single
tap selection delayed runnable.

This allows for a smooth transition (as in no floating
toolbar artifacts) into extracted mode. Also fixes
(more as in hides) the double selections.

Bug: 20930071
Change-Id: Idb9c375dc25777761b11ca17ccfd9f5eedc642b4
parent e94561ec
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -1645,6 +1645,15 @@ public class Editor {
     * @return true if the selection mode was actually started.
     */
    private boolean startSelectionActionModeWithoutSelection() {
        if (extractedTextModeWillBeStarted()) {
            // Cancel the single tap delayed runnable.
            if (mSelectionModeWithoutSelectionRunnable != null) {
                mTextView.removeCallbacks(mSelectionModeWithoutSelectionRunnable);
            }

            return false;
        }

        if (mSelectionActionMode != null) {
            // Selection action mode is already started
            // TODO: revisit invocations to minimize this case.
@@ -1686,6 +1695,15 @@ public class Editor {
    }

    private boolean startSelectionActionModeWithSelectionInternal() {
        if (extractedTextModeWillBeStarted()) {
            // Cancel the single tap delayed runnable.
            if (mSelectionModeWithoutSelectionRunnable != null) {
                mTextView.removeCallbacks(mSelectionModeWithoutSelectionRunnable);
            }

            return false;
        }

        if (mSelectionActionMode != null) {
            // Selection action mode is already started
            mSelectionActionMode.invalidate();