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

Commit 237be37f authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge "Copy/Paste on RemoteInputView" into nyc-dev

parents 365de159 0bd8a4b2
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -9646,7 +9646,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    }

    boolean canShare() {
        return canCopy() && isDeviceProvisioned();
        if (!getContext().canStartActivityForResult() || !isDeviceProvisioned()) {
            return false;
        }
        return canCopy();
    }

    boolean isDeviceProvisioned() {
@@ -9669,16 +9672,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    }

    boolean canProcessText() {
        if (!getContext().canStartActivityForResult() || getId() == View.NO_ID
                || hasPasswordTransformationMethod()) {
        if (getId() == View.NO_ID) {
            return false;
        }

        if (mText.length() > 0 && hasSelection() && mEditor != null) {
            return true;
        }

        return false;
        return canShare();
    }

    boolean canSelectAllText() {
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
            android:singleLine="true"
            android:ellipsize="start"
            android:inputType="textShortMessage|textAutoCorrect|textCapSentences"
            android:textIsSelectable="true"
            android:imeOptions="actionSend|flagNoExtractUi" />

    <FrameLayout
+1 −0
Original line number Diff line number Diff line
@@ -1107,6 +1107,7 @@ public abstract class BaseStatusBar extends SystemUI implements
                        });
                        a.start();
                        guts.setExposed(true);
                        row.closeRemoteInput();
                        mStackScroller.onHeightChanged(null, true /* needsAnimation */);
                        mNotificationGutsExposed = guts;
                    }
+5 −0
Original line number Diff line number Diff line
@@ -579,6 +579,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        }
    }

    public void closeRemoteInput() {
        mPrivateLayout.closeRemoteInput();
        mPublicLayout.closeRemoteInput();
    }

    public interface ExpansionLogger {
        public void logNotificationExpansion(String key, boolean userAction, boolean expanded);
    }
+23 −3
Original line number Diff line number Diff line
@@ -69,6 +69,9 @@ public class NotificationContentView extends FrameLayout {
    private View mHeadsUpChild;
    private HybridNotificationView mSingleLineView;

    private RemoteInputView mExpandedRemoteInput;
    private RemoteInputView mHeadsUpRemoteInput;

    private NotificationViewWrapper mContractedWrapper;
    private NotificationViewWrapper mExpandedWrapper;
    private NotificationViewWrapper mHeadsUpWrapper;
@@ -743,15 +746,19 @@ public class NotificationContentView extends FrameLayout {

        View bigContentView = mExpandedChild;
        if (bigContentView != null) {
            applyRemoteInput(bigContentView, entry, hasRemoteInput);
            mExpandedRemoteInput = applyRemoteInput(bigContentView, entry, hasRemoteInput);
        } else {
            mExpandedRemoteInput = null;
        }
        View headsUpContentView = mHeadsUpChild;
        if (headsUpContentView != null) {
            applyRemoteInput(headsUpContentView, entry, hasRemoteInput);
            mHeadsUpRemoteInput = applyRemoteInput(headsUpContentView, entry, hasRemoteInput);
        } else {
            mHeadsUpRemoteInput = null;
        }
    }

    private void applyRemoteInput(View view, NotificationData.Entry entry, boolean hasRemoteInput) {
    private RemoteInputView applyRemoteInput(View view, NotificationData.Entry entry, boolean hasRemoteInput) {
        View actionContainerCandidate = view.findViewById(
                com.android.internal.R.id.actions_container);
        if (actionContainerCandidate instanceof FrameLayout) {
@@ -777,7 +784,20 @@ public class NotificationContentView extends FrameLayout {
                    color = mContext.getColor(R.color.default_remote_input_background);
                }
                riv.setBackgroundColor(color);

                return riv;
            }
            return existing;
        }
        return null;
    }

    public void closeRemoteInput() {
        if (mHeadsUpRemoteInput != null) {
            mHeadsUpRemoteInput.close();
        }
        if (mExpandedRemoteInput != null) {
            mExpandedRemoteInput.close();
        }
    }

Loading