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

Commit 1d5eb254 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Visual changes to tap-again toast." into sc-dev

parents c074433e 9c72d6ee
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -137,11 +137,12 @@
            systemui:layout_constraintRight_toRightOf="parent"
            systemui:layout_constraintBottom_toBottomOf="parent"
            android:layout_marginBottom="20dp"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"
            android:paddingTop="10dp"
            android:paddingBottom="10dp"
            android:elevation="10dp"
            android:paddingHorizontal="16dp"
            android:minHeight="44dp"
            android:elevation="4dp"
            android:background="@drawable/rounded_bg_full"
            android:gravity="center"
            android:text="@string/tap_again"
            android:visibility="gone"
        />
    </com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer>
+3 −0
Original line number Diff line number Diff line
@@ -1062,6 +1062,9 @@
    <!-- Shows to explain the double tap interaction with notifications: After tapping a notification on Keyguard, this will explain users to tap again to launch a notification. [CHAR LIMIT=60] -->
    <string name="notification_tap_again">Tap again to open</string>

    <!-- Asks for a second tap as confirmation on an item that normally requires one tap. [CHAR LIMIT=60] -->
    <string name="tap_again">Tap again</string>

    <!-- Message shown when lock screen is tapped or face authentication fails. [CHAR LIMIT=60] -->
    <string name="keyguard_unlock">Swipe up to open</string>

+8 −9
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.animation.ObjectAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
@@ -35,24 +34,24 @@ import com.android.wm.shell.animation.Interpolators;
/**
 * View to show a toast-like popup on the notification shade and quick settings.
 */
public class TapAgainView extends FrameLayout {
public class TapAgainView extends TextView {
    private TextView mTextView;

    public TapAgainView(
            @NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        updateBgColor();
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();

        TextView text = new TextView(mContext);
        text.setText(R.string.notification_tap_again);
        addView(text);
        updateColor();
    }

    void updateBgColor() {
        setBackgroundResource(R.drawable.rounded_bg_full);
    void updateColor() {
        int textColor = getResources().getColor(R.color.notif_pill_text, mContext.getTheme());
        setTextColor(textColor);
        setBackground(getResources().getDrawable(R.drawable.rounded_bg_full, mContext.getTheme()));
    }

    /** Make the view visible. */
+3 −3
Original line number Diff line number Diff line
@@ -44,17 +44,17 @@ public class TapAgainViewController extends ViewController<TapAgainView> {
    final ConfigurationListener mConfigurationListener = new ConfigurationListener() {
        @Override
        public void onOverlayChanged() {
            mView.updateBgColor();
            mView.updateColor();
        }

        @Override
        public void onUiModeChanged() {
            mView.updateBgColor();
            mView.updateColor();
        }

        @Override
        public void onThemeChanged() {
            mView.updateBgColor();
            mView.updateColor();
        }
    };