-
Notifications
You must be signed in to change notification settings - Fork 1
/
ZJuHuaProgress.java
61 lines (52 loc) · 1.81 KB
/
ZJuHuaProgress.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.milkz.ui.progress;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
import com.milkz.ui.R;
/**
* Create by zuoqi@bhz.com.cn on 2019/10/9 17:12
*/
public class ZJuHuaProgress extends DialogFragment {
private String text = null;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
this.setCancelable(false);
View v = inflater.inflate(R.layout.zprogress_juhua, container);
TextView tvText = v.findViewById(R.id.tv_content_z_progress);
if (this.text != null && !this.text.equals("")){
tvText.setText(text);
}
return v;
}
@Override
public void onStart() {
super.onStart();
//设置背景色透明,在style中已设置backgroundDimEnabled为false,这里不需要.
Window window = getDialog().getWindow();
WindowManager.LayoutParams windowParams = window.getAttributes();
windowParams.dimAmount = 0.0f;
window.setAttributes(windowParams);
window.setBackgroundDrawableResource(android.R.color.transparent);
}
@Override
public void show(FragmentManager manager, String tag) {
super.show(manager, tag);
this.text = tag;
}
@Override
public void dismiss() {
super.dismiss();
Log.d("ZZZ","dismiss");
}
}