推送管理
This commit is contained in:
@@ -69,7 +69,8 @@ public class DialogUitl {
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
public static void showToast(Context context,String content,long delayMillis){
|
||||
|
||||
public static void showToast(Context context, String content, long delayMillis) {
|
||||
Dialog dialog = new Dialog(context, R.style.dialog);
|
||||
dialog.setContentView(R.layout.dialog_toast);
|
||||
dialog.setCancelable(false);
|
||||
@@ -82,7 +83,7 @@ public class DialogUitl {
|
||||
}
|
||||
}
|
||||
dialog.show();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss,delayMillis);
|
||||
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss, delayMillis);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,6 +122,38 @@ public class DialogUitl {
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
|
||||
public static void showDelSysMsg(Context context, String content, SimpleCallback simpleCallback) {
|
||||
if (context instanceof Activity) {
|
||||
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final Dialog dialog = new Dialog(context, R.style.dialog2);
|
||||
dialog.setContentView(R.layout.dialog_del_sys_msg);
|
||||
dialog.setCancelable(true);
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
if (!TextUtils.isEmpty(content)) {
|
||||
TextView contentTextView = (TextView) dialog.findViewById(R.id.content);
|
||||
contentTextView.setText(content);
|
||||
}
|
||||
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
simpleCallback.onConfirmClick(dialog, "");
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
|
||||
public static void showSimpleDialog(Context context, String content, SimpleCallback callback) {
|
||||
showSimpleDialog(context, content, false, callback);
|
||||
}
|
||||
@@ -135,13 +168,7 @@ public class DialogUitl {
|
||||
return;
|
||||
}
|
||||
}
|
||||
new Builder(context)
|
||||
.setTitle(title)
|
||||
.setContent(content)
|
||||
.setCancelable(cancelable)
|
||||
.setClickCallback(callback)
|
||||
.build()
|
||||
.show();
|
||||
new Builder(context).setTitle(title).setContent(content).setCancelable(cancelable).setClickCallback(callback).build().show();
|
||||
}
|
||||
|
||||
public static void showSimpleDialog(Context context, String title, String content, boolean cancelable, SimpleCallback3 callback) {
|
||||
@@ -150,13 +177,7 @@ public class DialogUitl {
|
||||
return;
|
||||
}
|
||||
}
|
||||
new Builder(context)
|
||||
.setTitle(title)
|
||||
.setContent(content)
|
||||
.setCancelable(cancelable)
|
||||
.setClickCallback3(callback)
|
||||
.build()
|
||||
.show();
|
||||
new Builder(context).setTitle(title).setContent(content).setCancelable(cancelable).setClickCallback3(callback).build().show();
|
||||
}
|
||||
|
||||
public static void showSimpleInputDialog(Context context, String title, String hint, int inputType, int length, SimpleCallback callback) {
|
||||
@@ -165,15 +186,7 @@ public class DialogUitl {
|
||||
return;
|
||||
}
|
||||
}
|
||||
new Builder(context).setTitle(title)
|
||||
.setCancelable(true)
|
||||
.setInput(true)
|
||||
.setHint(hint)
|
||||
.setInputType(inputType)
|
||||
.setLength(length)
|
||||
.setClickCallback(callback)
|
||||
.build()
|
||||
.show();
|
||||
new Builder(context).setTitle(title).setCancelable(true).setInput(true).setHint(hint).setInputType(inputType).setLength(length).setClickCallback(callback).build().show();
|
||||
}
|
||||
|
||||
|
||||
@@ -483,8 +496,8 @@ public class DialogUitl {
|
||||
mClickCallback3.onConfirmClick(dialog);
|
||||
}
|
||||
if (mSimpleCallbackView != null) {
|
||||
mSimpleCallbackView.onConfirmClick(dialog,titleView, content, btnConfirm, btnCancel);
|
||||
}else{
|
||||
mSimpleCallbackView.onConfirmClick(dialog, titleView, content, btnConfirm, btnCancel);
|
||||
} else {
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@@ -501,8 +514,8 @@ public class DialogUitl {
|
||||
((SimpleCallback2) mClickCallback).onCancelClick();
|
||||
}
|
||||
if (mSimpleCallbackView != null) {
|
||||
mSimpleCallbackView.onCancel(dialog,titleView, content, btnConfirm, btnCancel);
|
||||
}else{
|
||||
mSimpleCallbackView.onCancel(dialog, titleView, content, btnConfirm, btnCancel);
|
||||
} else {
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
@@ -510,17 +523,17 @@ public class DialogUitl {
|
||||
}
|
||||
}
|
||||
};
|
||||
if(btnConfirm!=null) {
|
||||
if (btnConfirm != null) {
|
||||
btnConfirm.setOnClickListener(listener);
|
||||
}
|
||||
if(btnCancel!=null) {
|
||||
if (btnCancel != null) {
|
||||
btnCancel.setOnClickListener(listener);
|
||||
}
|
||||
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
if (mSimpleCallbackView != null) {
|
||||
mSimpleCallbackView.onShow(dialog,titleView, content, btnConfirm, btnCancel);
|
||||
mSimpleCallbackView.onShow(dialog, titleView, content, btnConfirm, btnCancel);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -563,8 +576,7 @@ public class DialogUitl {
|
||||
/**
|
||||
* 城市选择
|
||||
*/
|
||||
public static void showCityChooseDialog(Activity activity, ArrayList<Province> list,
|
||||
String province, String city, String district, AddressPicker.OnAddressPickListener listener) {
|
||||
public static void showCityChooseDialog(Activity activity, ArrayList<Province> list, String province, String city, String district, AddressPicker.OnAddressPickListener listener) {
|
||||
AddressPicker picker = new AddressPicker(activity, list);
|
||||
picker.setTextColor(0xff323232);
|
||||
picker.setDividerColor(0xffdcdcdc);
|
||||
|
||||
@@ -31,6 +31,8 @@ public class RouteUtil {
|
||||
public static final String PATH_MYWEBVIEWACTIVTITY = "/main/MyWebViewActivity";
|
||||
public static final String PATH_ZHUANGBANACTIVITY = "/main/ZhuangBanActivity";
|
||||
public static final String PATH_LiveZHUANGBANACTIVITY = "/live/ZhuangBanActivity";
|
||||
|
||||
public static final String PATH_COMPENSATE_ACTIVITY = "/live/CompensateActivity";
|
||||
public static final String PATH_FACEBOOKACTIVITY = "/baidu/FacebookLoginActivity";
|
||||
public static final String PATH_MAIN = "/main/MainActivity";
|
||||
public static final String PATH_ENTRY = "/main/EntryActivity";
|
||||
@@ -147,6 +149,16 @@ public class RouteUtil {
|
||||
.navigation();
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到
|
||||
*/
|
||||
public static void forwardLiveCompensateActivity(String url, boolean isFull) {
|
||||
ARouter.getInstance().build(PATH_COMPENSATE_ACTIVITY)
|
||||
.withString("url", url)
|
||||
.withBoolean("isFull", isFull)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到装扮
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user