用户数据同步-我的关注(页面更新逻辑修改)
This commit is contained in:
@ -23,9 +23,9 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.halo.assistant.HaloApp;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.kuaichuan.WifiMgr;
|
||||
import com.halo.assistant.HaloApp;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DecimalFormat;
|
||||
@ -331,61 +331,6 @@ public class DialogUtils {
|
||||
final ConfirmListener cmListener, final CancelListener clListener) {
|
||||
|
||||
showAlertDialog(context, title, msg, confirm, cancel, cmListener, clListener);
|
||||
if (true) return; // TODO TEST
|
||||
|
||||
if (isShow) {
|
||||
return;
|
||||
}
|
||||
isShow = true;
|
||||
|
||||
final Dialog dialog = new Dialog(context);
|
||||
|
||||
View view = View.inflate(context, R.layout.common_alertdialog, null);
|
||||
|
||||
// 标题
|
||||
TextView alertdialog_title = (TextView) view.findViewById(R.id.alertdialog_title);
|
||||
alertdialog_title.setText(title);
|
||||
|
||||
// 内容
|
||||
TextView alertdialog_content = (TextView) view.findViewById(R.id.alertdialog_content);
|
||||
alertdialog_content.setText(msg);
|
||||
|
||||
// 取消按钮
|
||||
TextView alertdialog_cannel = (TextView) view.findViewById(R.id.alertdialog_cannel);
|
||||
alertdialog_cannel.setText(cancel);
|
||||
alertdialog_cannel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
if (clListener != null) {
|
||||
clListener.onCancel();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 确定按钮
|
||||
TextView alertdialog_confirm = (TextView) view.findViewById(R.id.alertdialog_confirm);
|
||||
alertdialog_confirm.setText(confirm);
|
||||
alertdialog_confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
if (cmListener != null) {
|
||||
cmListener.onConfirm();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dialog.setOnDismissListener(new Dialog.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
isShow = false;
|
||||
}
|
||||
});
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(view);
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
// 网络劫持时 打开QQ客户端,创建临时会话
|
||||
@ -408,11 +353,11 @@ public class DialogUtils {
|
||||
showWarningDialog(context, "下载提示", "您当前使用的网络为2G/3G/4G,开始下载将会消耗移动流量,确定下载?", listener);
|
||||
}
|
||||
|
||||
public static void showCancelDialog(Context context, final ConfirmListener listener) {
|
||||
public static void showCancelDialog(Context context, final ConfirmListener listener, CancelListener cancelListener) {
|
||||
Spanned content = Html.fromHtml("取消关注游戏后,您将无法及时收到游戏" +
|
||||
"<font color=\"#ff0000\">攻略</font>、" +
|
||||
"<font color=\"#ff0000\">资讯</font>等最新动态提醒。");
|
||||
showWarningDialog(context, "取消关注", content, "暂不取消", "确定取消", listener, null);
|
||||
showCancelListenerDialog(context, "取消关注", content, "确定取消", "暂不取消", listener, cancelListener);
|
||||
}
|
||||
|
||||
public static void showPluginDialog(Context context, final ConfirmListener listener) {
|
||||
@ -544,15 +489,60 @@ public class DialogUtils {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击外部退出和取消监听绑定
|
||||
*/
|
||||
public static void showCancelListenerDialog(Context context, String title, CharSequence message
|
||||
, String positive, String negative, final ConfirmListener cmListener, final CancelListener clListener) {
|
||||
|
||||
AlertDialog alertDialog = new AlertDialog.Builder(context, R.style.GhAlertDialog)
|
||||
.setTitle(title)
|
||||
.setMessage(message)
|
||||
.setPositiveButton(positive, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (cmListener != null) {
|
||||
cmListener.onConfirm();
|
||||
}
|
||||
}
|
||||
})
|
||||
.setNegativeButton(negative, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (clListener != null) {
|
||||
clListener.onCancel();
|
||||
}
|
||||
}
|
||||
})
|
||||
.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialogInterface) {
|
||||
clListener.onCancel();
|
||||
}
|
||||
})
|
||||
.create();
|
||||
|
||||
alertDialog.show();
|
||||
|
||||
TextView mesage = (TextView) alertDialog.findViewById(android.R.id.message);
|
||||
Button positiveBtn = alertDialog.getButton(android.app.AlertDialog.BUTTON_POSITIVE);
|
||||
Button negativeBtn = alertDialog.getButton(android.app.AlertDialog.BUTTON_NEGATIVE);
|
||||
|
||||
positiveBtn.setTextSize(13);
|
||||
positiveBtn.setTextColor(ContextCompat.getColor(context, R.color.theme));
|
||||
negativeBtn.setTextSize(13);
|
||||
negativeBtn.setTextColor(ContextCompat.getColor(context, R.color.hint));
|
||||
if (mesage != null) {
|
||||
mesage.setTextSize(13);
|
||||
mesage.setTextColor(ContextCompat.getColor(context, R.color.title));
|
||||
mesage.setLineSpacing(1.0f, 1.3f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 权限弹窗
|
||||
* @param context
|
||||
* @param title
|
||||
* @param message
|
||||
* @param positive
|
||||
* @param negative
|
||||
* @param cmListener
|
||||
* @param clListener
|
||||
*/
|
||||
public static void showPermissionDialog(Context context, String title, CharSequence message
|
||||
, String positive, String negative, final ConfirmListener cmListener, final CancelListener clListener) {
|
||||
|
||||
Reference in New Issue
Block a user