我有一个代码要在最后显示文件内容时使用“Style.xml”。我想要做的是“ ProgressDailog Indicator 来改变它的颜色,这将在 Style.xml 中定义......简单。
公共类 SimpleProgressDialog 扩展对话框 {
public static SimpleProgressDialog show(Context context, CharSequence title,
CharSequence message) {
return show(context, title, message, false);
}
public static SimpleProgressDialog show(Context context, CharSequence title,
CharSequence message, boolean indeterminate) {
return show(context, title, message, indeterminate, false, null);
}
public static SimpleProgressDialog show(Context context, CharSequence title,
CharSequence message, boolean indeterminate, boolean cancelable) {
return show(context, title, message, indeterminate, cancelable, null);
}
public static SimpleProgressDialog show(Context context, CharSequence title,
CharSequence message, boolean indeterminate,
boolean cancelable, OnCancelListener cancelListener) {
SimpleProgressDialog dialog = new SimpleProgressDialog(context);
dialog.setTitle(title);
dialog.setCancelable(cancelable);
dialog.setOnCancelListener(cancelListener);
/* The next line will add the ProgressBar to the dialog. */
dialog.addContentView(new ProgressBar ( context , null ,android.R.attr.progressBarStyleLargeInverse ), new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
dialog.show();
return dialog;
}
public SimpleProgressDialog(Context context) {
super(context, R.style.NewDialog);
}
}
这里是风格。我只想修改 style.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- The style for the unit on the statistics activity. -->
<style name="NewDialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowTitleStyle">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:background">@android:color/transparent</item>
</style>