Merge "Don't accordion the progress bar out." into oc-dr1-dev
This commit is contained in:
@@ -81,7 +81,6 @@
|
|||||||
android:layout_marginStart="72dp"
|
android:layout_marginStart="72dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:visibility="gone"
|
|
||||||
android:max="100"
|
android:max="100"
|
||||||
style="?android:attr/progressBarStyleHorizontal" />
|
style="?android:attr/progressBarStyleHorizontal" />
|
||||||
|
|
||||||
|
@@ -30,9 +30,11 @@ import com.android.settings.utils.FileSizeFormatter;
|
|||||||
public class StorageItemPreference extends Preference {
|
public class StorageItemPreference extends Preference {
|
||||||
public int userHandle;
|
public int userHandle;
|
||||||
|
|
||||||
|
private static final int UNINITIALIZED = -1;
|
||||||
|
|
||||||
private ProgressBar mProgressBar;
|
private ProgressBar mProgressBar;
|
||||||
private static final int PROGRESS_MAX = 100;
|
private static final int PROGRESS_MAX = 100;
|
||||||
private int mProgressPercent = -1;
|
private int mProgressPercent = UNINITIALIZED;
|
||||||
|
|
||||||
public StorageItemPreference(Context context) {
|
public StorageItemPreference(Context context) {
|
||||||
this(context, null);
|
this(context, null);
|
||||||
@@ -60,15 +62,9 @@ public class StorageItemPreference extends Preference {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void updateProgressBar() {
|
protected void updateProgressBar() {
|
||||||
if (mProgressBar == null)
|
if (mProgressBar == null || mProgressPercent == UNINITIALIZED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mProgressPercent == -1) {
|
|
||||||
mProgressBar.setVisibility(View.GONE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mProgressBar.setVisibility(View.VISIBLE);
|
|
||||||
mProgressBar.setMax(PROGRESS_MAX);
|
mProgressBar.setMax(PROGRESS_MAX);
|
||||||
mProgressBar.setProgress(mProgressPercent);
|
mProgressBar.setProgress(mProgressPercent);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user