新增auth弹出框的类型
This commit is contained in:
parent
0101057644
commit
696d083c68
|
|
@ -33,6 +33,14 @@ public class BaseConstants {
|
||||||
* 自定义字符串 权限请求
|
* 自定义字符串 权限请求
|
||||||
*/
|
*/
|
||||||
public final static String REQUEST_PER = "request_per";
|
public final static String REQUEST_PER = "request_per";
|
||||||
|
/**
|
||||||
|
* 自定义字符串 退出APP
|
||||||
|
*/
|
||||||
|
public final static String EXIT_APP = "exit_app";
|
||||||
|
/**
|
||||||
|
* 自定义字符串 自定义类型
|
||||||
|
*/
|
||||||
|
public final static String CUSTOM_TYPE = "custom_type";
|
||||||
/**
|
/**
|
||||||
* 自定义字符串 跳转动画
|
* 自定义字符串 跳转动画
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,12 @@
|
||||||
package com.tfq.library.view;
|
package com.tfq.library.view;
|
||||||
|
|
||||||
|
import static com.tfq.library.app.BaseConstants.AUTHORIZATIO;
|
||||||
|
import static com.tfq.library.app.BaseConstants.CUSTOM_TYPE;
|
||||||
|
import static com.tfq.library.app.BaseConstants.EXIT_APP;
|
||||||
|
import static com.tfq.library.app.BaseConstants.PLAYURL;
|
||||||
|
import static com.tfq.library.app.BaseConstants.PRIVACY;
|
||||||
|
import static com.tfq.library.app.BaseConstants.REQUEST_PER;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
@ -16,11 +23,6 @@ import android.widget.TextView;
|
||||||
import com.tfq.library.R;
|
import com.tfq.library.R;
|
||||||
import com.tfq.library.app.BaseConstants;
|
import com.tfq.library.app.BaseConstants;
|
||||||
|
|
||||||
import static com.tfq.library.app.BaseConstants.AUTHORIZATIO;
|
|
||||||
import static com.tfq.library.app.BaseConstants.PLAYURL;
|
|
||||||
import static com.tfq.library.app.BaseConstants.PRIVACY;
|
|
||||||
import static com.tfq.library.app.BaseConstants.REQUEST_PER;
|
|
||||||
|
|
||||||
|
|
||||||
public class AuthDialog extends Dialog {
|
public class AuthDialog extends Dialog {
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
|
|
@ -28,6 +30,8 @@ public class AuthDialog extends Dialog {
|
||||||
private Listener listener;
|
private Listener listener;
|
||||||
private View contentView;
|
private View contentView;
|
||||||
private String type;
|
private String type;
|
||||||
|
private String title;
|
||||||
|
private String content;
|
||||||
|
|
||||||
public AuthDialog(Context context, Listener listener) {
|
public AuthDialog(Context context, Listener listener) {
|
||||||
super(context, R.style.Dialog);
|
super(context, R.style.Dialog);
|
||||||
|
|
@ -51,6 +55,16 @@ public class AuthDialog extends Dialog {
|
||||||
inflater = LayoutInflater.from(context);
|
inflater = LayoutInflater.from(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AuthDialog(Context context, String type, String title, String content, Listener listener) {
|
||||||
|
super(context, R.style.Dialog);
|
||||||
|
this.listener = listener;
|
||||||
|
this.mContext = context;
|
||||||
|
this.type = type;
|
||||||
|
this.title = title;
|
||||||
|
this.content = content;
|
||||||
|
inflater = LayoutInflater.from(context);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
@ -160,6 +174,48 @@ public class AuthDialog extends Dialog {
|
||||||
});
|
});
|
||||||
this.setCanceledOnTouchOutside(false);
|
this.setCanceledOnTouchOutside(false);
|
||||||
this.setCancelable(false);
|
this.setCancelable(false);
|
||||||
|
} else if (EXIT_APP.equals(type)) {
|
||||||
|
tv_title.setText("退出应用");
|
||||||
|
tv_content.setText("退出应用请点击确定按钮");
|
||||||
|
tv_content.setGravity(Gravity.CENTER);
|
||||||
|
tv_right.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
dismiss();
|
||||||
|
if (listener != null) {
|
||||||
|
listener.callBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tv_left.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.setCanceledOnTouchOutside(false);
|
||||||
|
this.setCancelable(false);
|
||||||
|
} else if (CUSTOM_TYPE.equals(type)) {
|
||||||
|
tv_title.setText(title);
|
||||||
|
tv_content.setText(content);
|
||||||
|
tv_content.setGravity(Gravity.CENTER);
|
||||||
|
tv_right.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
dismiss();
|
||||||
|
if (listener != null) {
|
||||||
|
listener.callBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tv_left.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.setCanceledOnTouchOutside(false);
|
||||||
|
this.setCancelable(false);
|
||||||
} else {
|
} else {
|
||||||
tv_right.setOnClickListener(new View.OnClickListener() {
|
tv_right.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="Title"
|
android:text=""
|
||||||
android:textColor="#FF333333"
|
android:textColor="#FF333333"
|
||||||
android:textSize="17dp"
|
android:textSize="17dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_marginRight="5dp"
|
android:layout_marginRight="5dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="content"
|
android:text=""
|
||||||
android:textColor="#FF333333"
|
android:textColor="#FF333333"
|
||||||
android:textSize="13dp"
|
android:textSize="13dp"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:layout_marginRight="15dp"
|
android:layout_marginRight="15dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="Title"
|
android:text=""
|
||||||
android:textColor="#FF333333"
|
android:textColor="#FF333333"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingLeft="22dp"
|
android:paddingLeft="22dp"
|
||||||
android:paddingRight="22dp"
|
android:paddingRight="22dp"
|
||||||
android:text="content"
|
android:text=""
|
||||||
android:textColor="#FF333333"
|
android:textColor="#FF333333"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
android:id="@+id/tv_title"
|
android:id="@+id/tv_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Title"
|
android:text=""
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="17dp"
|
android:textSize="17dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/tv_title"
|
android:layout_below="@+id/tv_title"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:text="content"
|
android:text=""
|
||||||
android:textColor="#212121"
|
android:textColor="#212121"
|
||||||
android:textSize="15dp"
|
android:textSize="15dp"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
8c477eba97731fbe79d9663af2518298
|
82978083b7a9dc63ac2ea5b363657fd3
|
||||||
|
|
@ -1 +1 @@
|
||||||
2d3d867ae453082e62eb6333d4885107f4978073
|
49647a06684fb194d73066e0bd527c16a12c14cc
|
||||||
|
|
@ -1 +1 @@
|
||||||
6f479ffac05a3ee0506ed0ea8c873a18f0799cb6dcf1801c99a1b17386c374ba
|
ea391aa2070a476446c208b0084ff125015cd35e05d8b56ba9dc6398a380bd94
|
||||||
|
|
@ -1 +1 @@
|
||||||
5674456dce464dca57189ce4ef8246cda2118c92b45c153757ba9af1551d42f9a940846ab3e196c87241f975b142c6144f6a318f6296191a175b68a010bea180
|
922a98afbe4c7a07b6946e9e2280fdba34bacf9ae618e0f015075ba2ae44a4bc33bfd9ebeb14ceb2dc4e709c8b6b38494300d968f882a152522e7c9790f6647e
|
||||||
|
|
@ -8,6 +8,6 @@
|
||||||
<versions>
|
<versions>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</versions>
|
</versions>
|
||||||
<lastUpdated>20250907141830</lastUpdated>
|
<lastUpdated>20251016122404</lastUpdated>
|
||||||
</versioning>
|
</versioning>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
34eea020b0626cb20b3414517b9159c9
|
cec8739567a7395a79db341dfc6361dd
|
||||||
|
|
@ -1 +1 @@
|
||||||
ae52d0f623ab1ce238b22fe5491d87a0a4d92452
|
884642a62b0472ff417731ebc84c1f82a6245f55
|
||||||
|
|
@ -1 +1 @@
|
||||||
d1c1df19b84dc27a5e39fe79b3d43ab1b6e0facc67788e6dd6d3321c8109d67f
|
8b43d5687a367bb5de4e20bd911ed6c2ce6ed2fc62b88a3daaa8a919550d18ff
|
||||||
|
|
@ -1 +1 @@
|
||||||
61936a4c82eb8c4ce51f8975c5d3c28f7460fa278c2f947e46aea63f6f66894866d8200a1bef03217d29a0832427a99e160655d0c4e58e79b572164bd7cf4eb2
|
999a7d65001f86c0cd16a2b01ec2720de7db2af25c7b79fe31f4a8b3946f281118e7d67be579a89556da6ecfc2a60ca48b9a47804a969da6933c246485d1d271
|
||||||
Loading…
Reference in New Issue