Skip to content

Commit 5a27c40

Browse files
committed
* 调整进度条样式
1 parent 7a598d8 commit 5a27c40

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

app/src/main/java/com/surcumference/fingerprint/activity/WebActivity.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import android.support.annotation.Nullable;
1010
import android.support.v7.app.AppCompatActivity;
1111
import android.text.TextUtils;
12+
import android.view.ContextThemeWrapper;
1213
import android.view.View;
1314
import android.view.ViewGroup;
1415
import android.view.animation.DecelerateInterpolator;
@@ -54,7 +55,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
5455
try {
5556
FrameLayout rootFLayout = new FrameLayout(this);
5657

57-
mProgressBar = initProgressBar();
58+
mProgressBar = initProgressBar(new ContextThemeWrapper(this, android.R.style.Theme_Material_NoActionBar_Fullscreen));
5859
WebView webView = initWebView();
5960
if (!TextUtils.isEmpty(url)) {
6061
webView.loadUrl(url);
@@ -74,10 +75,10 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
7475
}
7576
}
7677

77-
private ProgressBar initProgressBar() {
78-
ProgressBar progressBar = new ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal);
78+
private ProgressBar initProgressBar(Context context) {
79+
ProgressBar progressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal);
7980
progressBar.getIndeterminateDrawable().setColorFilter(Color.BLUE, android.graphics.PorterDuff.Mode.MULTIPLY);
80-
progressBar.setBackgroundColor(Color.TRANSPARENT);
81+
progressBar.setBackgroundColor(0x20009688);
8182
return progressBar;
8283
}
8384

app/src/main/java/com/surcumference/fingerprint/view/DownloadView.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ private void init(Context context) {
6060
LinearLayout rootLinearLayout = new LinearLayout(context);
6161
rootLinearLayout.setOrientation(LinearLayout.VERTICAL);
6262
mProgressBar = initProgressBar(new ContextThemeWrapper(context, android.R.style.Theme_Material_NoActionBar_Fullscreen));
63-
mProgressBar.setBackgroundColor(0x20009688);
6463
int paddingH = DpUtils.dip2px(context, 20);
6564
rootLinearLayout.addView(mProgressBar, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, DpUtils.dip2px(context, 4)));
6665

@@ -154,7 +153,7 @@ private void dismiss() {
154153
private ProgressBar initProgressBar(Context context) {
155154
ProgressBar progressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal);
156155
progressBar.getIndeterminateDrawable().setColorFilter(Color.BLUE, android.graphics.PorterDuff.Mode.MULTIPLY);
157-
progressBar.setBackgroundColor(Color.TRANSPARENT);
156+
progressBar.setBackgroundColor(0x20009688);
158157
return progressBar;
159158
}
160159

app/src/main/java/com/surcumference/fingerprint/view/LicenseView.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import android.support.annotation.Nullable;
99
import android.text.TextUtils;
1010
import android.util.AttributeSet;
11+
import android.view.ContextThemeWrapper;
1112
import android.view.View;
1213
import android.view.ViewGroup;
1314
import android.view.animation.DecelerateInterpolator;
@@ -50,7 +51,7 @@ public LicenseView(@NonNull Context context, @Nullable AttributeSet attrs, int d
5051

5152
private void init(Context context) {
5253
try {
53-
mProgressBar = initProgressBar(context);
54+
mProgressBar = initProgressBar(new ContextThemeWrapper(context, android.R.style.Theme_Material_NoActionBar_Fullscreen));
5455
WebView webView = initWebView(context);
5556
webView.loadUrl(Constant.HELP_URL_LICENSE);
5657
this.setMinimumHeight(DpUtils.dip2px(context, 200));
@@ -66,7 +67,7 @@ private void init(Context context) {
6667
private ProgressBar initProgressBar(Context context) {
6768
ProgressBar progressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal);
6869
progressBar.getIndeterminateDrawable().setColorFilter(Color.BLUE, android.graphics.PorterDuff.Mode.MULTIPLY);
69-
progressBar.setBackgroundColor(Color.TRANSPARENT);
70+
progressBar.setBackgroundColor(0x20009688);
7071
return progressBar;
7172
}
7273

0 commit comments

Comments
 (0)