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

Commit 3784a7f6 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Insertion handles fades out after being positionned

Change-Id: I08b497222fd585a39cbd04b7be1992acf1a70145
parent c3d84701
Loading
Loading
Loading
Loading
+18 −16
Original line number Original line Diff line number Diff line
@@ -117,12 +117,12 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.View;
import android.view.ViewRootImpl;
import android.view.ViewConfiguration;
import android.view.ViewConfiguration;
import android.view.ViewDebug;
import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewParent;
import android.view.ViewParent;
import android.view.ViewRootImpl;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityEvent;
@@ -3424,7 +3424,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        return mHint;
        return mHint;
    }
    }


    private boolean isMultilineInputType(int type) {
    private static boolean isMultilineInputType(int type) {
        return (type & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE)) ==
        return (type & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE)) ==
            (EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE);
            (EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE);
    }
    }
@@ -3500,7 +3500,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        return mTransformation instanceof PasswordTransformationMethod;
        return mTransformation instanceof PasswordTransformationMethod;
    }
    }


    private boolean isPasswordInputType(int inputType) {
    private static boolean isPasswordInputType(int inputType) {
        final int variation =
        final int variation =
                inputType & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_MASK_VARIATION);
                inputType & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_MASK_VARIATION);
        return variation
        return variation
@@ -3511,7 +3511,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                == (EditorInfo.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_VARIATION_PASSWORD);
                == (EditorInfo.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_VARIATION_PASSWORD);
    }
    }


    private boolean isVisiblePasswordInputType(int inputType) {
    private static boolean isVisiblePasswordInputType(int inputType) {
        final int variation =
        final int variation =
                inputType & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_MASK_VARIATION);
                inputType & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_MASK_VARIATION);
        return variation
        return variation
@@ -5082,6 +5082,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
     * @hide
     * @hide
     * @param offsetRequired
     * @param offsetRequired
     */
     */
    @Override
    protected int getFadeHeight(boolean offsetRequired) {
    protected int getFadeHeight(boolean offsetRequired) {
        return mLayout != null ? mLayout.getHeight() : 0;
        return mLayout != null ? mLayout.getHeight() : 0;
    }
    }
@@ -9198,16 +9199,17 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
     * Paste actions, depending on what this View supports.
     * Paste actions, depending on what this View supports.
     *
     *
     * A custom implementation can add new entries in the default menu in its
     * A custom implementation can add new entries in the default menu in its
     * {@link ActionMode.Callback#onPrepareActionMode(ActionMode, Menu)} method. The default actions
     * {@link android.view.ActionMode.Callback#onPrepareActionMode(ActionMode, Menu)} method. The
     * can also be removed from the menu using {@link Menu#removeItem(int)} and passing
     * default actions can also be removed from the menu using {@link Menu#removeItem(int)} and
     * {@link android.R.id#selectAll}, {@link android.R.id#cut}, {@link android.R.id#copy} or
     * passing {@link android.R.id#selectAll}, {@link android.R.id#cut}, {@link android.R.id#copy}
     * {@link android.R.id#paste} ids as parameters.
     * or {@link android.R.id#paste} ids as parameters.
     *
     *
     * Returning false from {@link ActionMode.Callback#onCreateActionMode(ActionMode, Menu)} will
     * Returning false from 
     * prevent the action mode from being started.
     * {@link android.view.ActionMode.Callback#onCreateActionMode(ActionMode, Menu)} will prevent
     * the action mode from being started.
     *
     *
     * Action click events should be handled by the custom implementation of
     * Action click events should be handled by the custom implementation of
     * {@link ActionMode.Callback#onActionItemClicked(ActionMode, MenuItem)}.
     * {@link android.view.ActionMode.Callback#onActionItemClicked(ActionMode, MenuItem)}.
     *
     *
     * Note that text selection mode is not started when a TextView receives focus and the
     * Note that text selection mode is not started when a TextView receives focus and the
     * {@link android.R.attr#selectAllOnFocus} flag has been set. The content is highlighted in
     * {@link android.R.attr#selectAllOnFocus} flag has been set. The content is highlighted in
@@ -9763,9 +9765,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                        mLastParentX = mTempCoords[0];
                        mLastParentX = mTempCoords[0];
                        mLastParentY = mTempCoords[1];
                        mLastParentY = mTempCoords[1];
                    }
                    }
                }


                    onHandleMoved();
                    onHandleMoved();
                }


                if (isPositionVisible()) {
                if (isPositionVisible()) {
                    mContainer.update(mContainerPositionX, mContainerPositionY,
                    mContainer.update(mContainerPositionX, mContainerPositionY,
@@ -10208,7 +10210,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener


                    mPreviousTapPositionX = x;
                    mPreviousTapPositionX = x;
                    mPreviousTapPositionY = y;
                    mPreviousTapPositionY = y;

                    break;
                    break;


                case MotionEvent.ACTION_POINTER_DOWN:
                case MotionEvent.ACTION_POINTER_DOWN:
@@ -10524,6 +10525,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                mTextDir = TextDirectionHeuristics.RTL;
                mTextDir = TextDirectionHeuristics.RTL;
                break;
                break;
        }
        }

    }
    }


    /**
    /**