diff options
| author | Adam Powell <adamp@google.com> | 2011-09-09 17:47:23 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-09 17:47:23 -0700 |
| commit | 81cca039bdbc7f9fe8aefd68ce2cf22978678b01 (patch) | |
| tree | 259ff6a476236f6b9fd7ceff5a02456a40e92f2f /core/java | |
| parent | 3593fc4c3fac8d957db0171387472e7b812c9073 (diff) | |
| parent | ba3c377ba428bcf1c9b5a5cdf697fec0ed4fade7 (diff) | |
Merge "Fix metrics on Holo progress dialogs"
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/ProgressDialog.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/core/java/android/app/ProgressDialog.java b/core/java/android/app/ProgressDialog.java index f1a04f85f232..7f1f3850a397 100644 --- a/core/java/android/app/ProgressDialog.java +++ b/core/java/android/app/ProgressDialog.java @@ -16,7 +16,10 @@ package android.app; +import com.android.internal.R; + import android.content.Context; +import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Handler; @@ -29,8 +32,6 @@ import android.view.View; import android.widget.ProgressBar; import android.widget.TextView; -import com.android.internal.R; - import java.text.NumberFormat; /** @@ -119,6 +120,9 @@ public class ProgressDialog extends AlertDialog { @Override protected void onCreate(Bundle savedInstanceState) { LayoutInflater inflater = LayoutInflater.from(mContext); + TypedArray a = mContext.obtainStyledAttributes(null, + com.android.internal.R.styleable.AlertDialog, + com.android.internal.R.attr.alertDialogStyle, 0); if (mProgressStyle == STYLE_HORIZONTAL) { /* Use a separate handler to update the text views as they @@ -149,17 +153,22 @@ public class ProgressDialog extends AlertDialog { } } }; - View view = inflater.inflate(R.layout.alert_dialog_progress, null); + View view = inflater.inflate(a.getResourceId( + com.android.internal.R.styleable.AlertDialog_horizontalProgressLayout, + R.layout.alert_dialog_progress), null); mProgress = (ProgressBar) view.findViewById(R.id.progress); mProgressNumber = (TextView) view.findViewById(R.id.progress_number); mProgressPercent = (TextView) view.findViewById(R.id.progress_percent); setView(view); } else { - View view = inflater.inflate(R.layout.progress_dialog, null); + View view = inflater.inflate(a.getResourceId( + com.android.internal.R.styleable.AlertDialog_progressLayout, + R.layout.progress_dialog), null); mProgress = (ProgressBar) view.findViewById(R.id.progress); mMessageView = (TextView) view.findViewById(R.id.message); setView(view); } + a.recycle(); if (mMax > 0) { setMax(mMax); } |
