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

Commit 1ef1b670 authored by Justin Ghan's avatar Justin Ghan Committed by Automerger Merge Worker
Browse files

Merge "Set insert mode color to be 20% of the text color" into udc-qpr-dev am:...

Merge "Set insert mode color to be 20% of the text color" into udc-qpr-dev am: 5ec5b7d5 am: 0c354760

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23542775



Change-Id: I60d19240200b23e7af671f28b234cf0e8dab02c5
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 896b006f 0c354760
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -8112,16 +8112,10 @@ public class Editor {
            mHighlightPaint = new Paint();
            mHighlightPath = new Path();

            // The highlight color is supposed to be 12% of the color primary40. We can't
            // directly access Material 3 theme. But because Material 3 sets the colorPrimary to
            // be primary40, here we hardcoded it to be 12% of colorPrimary.
            final TypedValue typedValue = new TypedValue();
            mTextView.getContext().getTheme()
                    .resolveAttribute(R.attr.colorPrimary, typedValue, true);
            final int colorPrimary = typedValue.data;
            final int highlightColor = ColorUtils.setAlphaComponent(colorPrimary,
                    (int) (0.12f * Color.alpha(colorPrimary)));
            mHighlightPaint.setColor(highlightColor);
            // Insert mode highlight color is 20% opacity of the default text color.
            int color = mTextView.getTextColors().getDefaultColor();
            color = ColorUtils.setAlphaComponent(color, (int) (0.2f * Color.alpha(color)));
            mHighlightPaint.setColor(color);
        }

        /**