|
@@ -1,9 +1,11 @@
|
|
|
package com.sheep.gamegroup.view.dialog;
|
|
package com.sheep.gamegroup.view.dialog;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
|
|
|
+import android.content.Context;
|
|
|
import android.support.v7.app.AlertDialog;
|
|
import android.support.v7.app.AlertDialog;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
|
|
+import android.widget.ImageView;
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
import com.kfzs.duanduan.event.BigEvent;
|
|
import com.kfzs.duanduan.event.BigEvent;
|
|
@@ -13,6 +15,7 @@ import com.kfzs.duanduan.utils.dlg.ViewFindUtils;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
import com.uuzuche.lib_zxing.view.ViewfinderView;
|
|
import com.uuzuche.lib_zxing.view.ViewfinderView;
|
|
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
import org.greenrobot.eventbus.EventBus;
|
|
@@ -54,7 +57,8 @@ public class DialogAccountAbnormal {
|
|
|
}
|
|
}
|
|
|
return mAlertDialog;
|
|
return mAlertDialog;
|
|
|
}
|
|
}
|
|
|
- public static AlertDialog showDialog(final Activity activity,String title, String content, String cancel, String sure) {
|
|
|
|
|
|
|
+ public static boolean showDialog(final Activity activity,String title, String content, String cancel, String sure) {
|
|
|
|
|
+ final boolean[] flag = {false};
|
|
|
View view = View.inflate(activity, R.layout.diag_account_abnormal, null);
|
|
View view = View.inflate(activity, R.layout.diag_account_abnormal, null);
|
|
|
final AlertDialog mAlertDialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
|
|
final AlertDialog mAlertDialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
|
|
|
.setView(view)
|
|
.setView(view)
|
|
@@ -70,6 +74,60 @@ public class DialogAccountAbnormal {
|
|
|
((TextView)ViewFindUtils.find(view, R.id.content_tv)).setText(content);
|
|
((TextView)ViewFindUtils.find(view, R.id.content_tv)).setText(content);
|
|
|
}
|
|
}
|
|
|
TextView dialog_sure = ViewFindUtils.find(view, R.id.dialog_sure);
|
|
TextView dialog_sure = ViewFindUtils.find(view, R.id.dialog_sure);
|
|
|
|
|
+ dialog_sure.setText(sure+"");
|
|
|
|
|
+ dialog_sure.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+ mAlertDialog.dismiss();
|
|
|
|
|
+ flag[0] = true;
|
|
|
|
|
+ SpUtils.saveClick(activity, true);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ ImageView dialog_close = ViewFindUtils.find(view, R.id.dialog_close);
|
|
|
|
|
+ dialog_close.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+ mAlertDialog.dismiss();
|
|
|
|
|
+ flag[0] = false;
|
|
|
|
|
+ SpUtils.saveClick(activity, false);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ TextView dialog_action = ViewFindUtils.find(view, R.id.dialog_action);
|
|
|
|
|
+ dialog_action.setText(cancel+"");
|
|
|
|
|
+ dialog_action.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+ mAlertDialog.dismiss();
|
|
|
|
|
+ flag[0] = false;
|
|
|
|
|
+ SpUtils.saveClick(activity, false);
|
|
|
|
|
+
|
|
|
|
|
+// EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DIALOG_ACTIVITY_DOWNLOAD_FILE));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ try {
|
|
|
|
|
+ mAlertDialog.show();
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ return flag[0];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static AlertDialog showDialogs(final Activity activity,String title, String content, String cancel, String sure) {
|
|
|
|
|
+ View view = View.inflate(activity, R.layout.diag_account_abnormal, null);
|
|
|
|
|
+ final AlertDialog mAlertDialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
|
|
|
|
|
+ .setView(view)
|
|
|
|
|
+ .create();
|
|
|
|
|
+ if(TextUtils.isEmpty(title)){
|
|
|
|
|
+ ViewFindUtils.find(view, R.id.title_tv).setVisibility(View.GONE);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ ((TextView)ViewFindUtils.find(view, R.id.title_tv)).setText(title);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(TextUtils.isEmpty(content)){
|
|
|
|
|
+ ViewFindUtils.find(view, R.id.content_tv).setVisibility(View.GONE);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ ((TextView)ViewFindUtils.find(view, R.id.content_tv)).setText(content);
|
|
|
|
|
+ }
|
|
|
|
|
+ TextView dialog_sure = ViewFindUtils.find(view, R.id.dialog_sure);
|
|
|
dialog_sure.setText(cancel+"");
|
|
dialog_sure.setText(cancel+"");
|
|
|
dialog_sure.setOnClickListener(new View.OnClickListener() {
|
|
dialog_sure.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
@@ -77,8 +135,7 @@ public class DialogAccountAbnormal {
|
|
|
mAlertDialog.dismiss();
|
|
mAlertDialog.dismiss();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- TextView dialog_close = ViewFindUtils.find(view, R.id.dialog_close);
|
|
|
|
|
- dialog_close.setText(sure+"");
|
|
|
|
|
|
|
+ ImageView dialog_close = ViewFindUtils.find(view, R.id.dialog_close);
|
|
|
dialog_close.setOnClickListener(new View.OnClickListener() {
|
|
dialog_close.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|