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

Commit 8b5b62c0 authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Automerger Merge Worker
Browse files

Merge "Make the build text in QS marquee" into rvc-qpr-dev am: 47e6ba01

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

Change-Id: Ia7f5a91152643a63c0bbb5f659cde83384327a8b
parents 8f0839f1 47e6ba01
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@
                android:gravity="center_vertical"
                android:focusable="true"
                android:singleLine="true"
                android:ellipsize="end"
                android:ellipsize="marquee"
                android:textAppearance="@style/TextAppearance.QS.Status"
                android:layout_marginEnd="4dp"
                android:visibility="gone"/>
+13 −5
Original line number Diff line number Diff line
@@ -78,6 +78,8 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
    private SettingsButton mSettingsButton;
    protected View mSettingsContainer;
    private PageIndicator mPageIndicator;
    private TextView mBuildText;
    private boolean mShouldShowBuildText;

    private boolean mQsDisabled;
    private QSPanel mQsPanel;
@@ -147,6 +149,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,

        mActionsContainer = findViewById(R.id.qs_footer_actions_container);
        mEditContainer = findViewById(R.id.qs_footer_actions_edit_container);
        mBuildText = findViewById(R.id.build);

        // RenderThread is doing more harm than good when touching the header (to expand quick
        // settings), so disable it for this view
@@ -162,16 +165,19 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
    }

    private void setBuildText() {
        TextView v = findViewById(R.id.build);
        if (v == null) return;
        if (mBuildText == null) return;
        if (DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)) {
            v.setText(mContext.getString(
            mBuildText.setText(mContext.getString(
                    com.android.internal.R.string.bugreport_status,
                    Build.VERSION.RELEASE_OR_CODENAME,
                    Build.ID));
            v.setVisibility(View.VISIBLE);
            // Set as selected for marquee before its made visible, then it won't be announced when
            // it's made visible.
            mBuildText.setSelected(true);
            mShouldShowBuildText = true;
        } else {
            v.setVisibility(View.GONE);
            mShouldShowBuildText = false;
            mBuildText.setSelected(false);
        }
    }

@@ -321,6 +327,8 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
        mMultiUserSwitch.setVisibility(showUserSwitcher() ? View.VISIBLE : View.INVISIBLE);
        mEditContainer.setVisibility(isDemo || !mExpanded ? View.INVISIBLE : View.VISIBLE);
        mSettingsButton.setVisibility(isDemo || !mExpanded ? View.INVISIBLE : View.VISIBLE);

        mBuildText.setVisibility(mExpanded && mShouldShowBuildText ? View.VISIBLE : View.GONE);
    }

    private boolean showUserSwitcher() {