Make the build text in QS marquee
The text marquees only when visible. Test: manual Test: manual check that it's not announced prematurely Fixes: 158410766 Change-Id: Iede2b8d20de4f87f6bbc95f228376bb5bf488a9e
This commit is contained in:
@@ -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"/>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user