[Provider Model] Refine progress bar (QS Internet Dialog)
- Dynamically set the Indeterminate parameter to avoid animation initialization issues. - If the status has not changed, avoid restarting the progress bar. Bug: 206061969 Bug: 208702776 Test: manual test atest -c InternetDialogTest Change-Id: I265a68126fd523f1996c09072f5a9220f9cb5adf
This commit is contained in:
@@ -67,7 +67,6 @@
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/wifi_searching_progress"
|
||||
android:indeterminate="true"
|
||||
android:layout_width="340dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
|
||||
@@ -78,7 +78,7 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
private static final String TAG = "InternetDialog";
|
||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
|
||||
static final long PROGRESS_DELAY_MS = 2000L;
|
||||
static final long PROGRESS_DELAY_MS = 1500L;
|
||||
|
||||
private final Handler mHandler;
|
||||
private final Executor mBackgroundExecutor;
|
||||
@@ -549,9 +549,13 @@ public class InternetDialog extends SystemUIDialog implements
|
||||
}
|
||||
|
||||
private void setProgressBarVisible(boolean visible) {
|
||||
if (mIsProgressBarVisible == visible) {
|
||||
return;
|
||||
}
|
||||
mIsProgressBarVisible = visible;
|
||||
mProgressBar.setVisibility(mIsProgressBarVisible ? View.VISIBLE : View.GONE);
|
||||
mDivider.setVisibility(mIsProgressBarVisible ? View.GONE : View.VISIBLE);
|
||||
mProgressBar.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
mProgressBar.setIndeterminate(visible);
|
||||
mDivider.setVisibility(visible ? View.GONE : View.VISIBLE);
|
||||
mInternetDialogSubTitle.setText(getSubtitleText());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user