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

Commit c5cd5e90 authored by Cary Clark's avatar Cary Clark
Browse files

cancel text selection on rotate

Rotating the screen may cause it to layout differently. The
selected text may be hard to match or may not be visible at
all. Cancel the text selection mode when a rotate is detected.

bug:3205291
Change-Id: If7e8f98a1cc396bf21f8261f2a7b4a342907ef2f
parent 693c99ff
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.DataSetObserver;
import android.graphics.Bitmap;
@@ -3733,6 +3734,16 @@ public class WebView extends AbsoluteLayout
        return false;
    }

    private int mOrientation = Configuration.ORIENTATION_UNDEFINED;

    @Override
    protected void onConfigurationChanged(Configuration newConfig) {
        if (mSelectingText && mOrientation != newConfig.orientation) {
            selectionDone();
        }
        mOrientation = newConfig.orientation;
    }

    /**
     * Keep track of the Callback so we can end its ActionMode or remove its
     * titlebar.