|
@@ -1,19 +1,21 @@
|
|
|
package com.sheep.gamegroup.util;
|
|
package com.sheep.gamegroup.util;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
|
-import android.app.AlertDialog;
|
|
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.Bitmap;
|
|
|
import android.net.Uri;
|
|
import android.net.Uri;
|
|
|
import android.provider.MediaStore;
|
|
import android.provider.MediaStore;
|
|
|
|
|
+import android.support.v7.app.AlertDialog;
|
|
|
import android.text.Html;
|
|
import android.text.Html;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
import android.text.method.ScrollingMovementMethod;
|
|
import android.text.method.ScrollingMovementMethod;
|
|
|
|
|
+import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
import android.view.Window;
|
|
import android.view.Window;
|
|
|
import android.view.WindowManager;
|
|
import android.view.WindowManager;
|
|
|
import android.webkit.WebView;
|
|
import android.webkit.WebView;
|
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
|
|
|
+import android.widget.LinearLayout;
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
import com.bumptech.glide.Glide;
|
|
import com.bumptech.glide.Glide;
|
|
@@ -88,12 +90,16 @@ public class ViewUtil {
|
|
|
* @param link
|
|
* @param link
|
|
|
*/
|
|
*/
|
|
|
public static void shareLink(final Activity activity, final String link) {
|
|
public static void shareLink(final Activity activity, final String link) {
|
|
|
- AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
|
|
|
|
- View view = View.inflate(activity, R.layout.x_recommend_dialog, null);
|
|
|
|
|
- builder.setView(view);
|
|
|
|
|
|
|
+ View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
|
|
|
|
|
+ final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
|
|
|
|
|
+ .setView(dialog_parent)
|
|
|
|
|
+ .create();
|
|
|
|
|
+ TextView dialog_title = dialog_parent.findViewById(R.id.dialog_title);
|
|
|
|
|
+ View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
|
|
|
|
|
+ LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
|
|
|
|
|
+ View view = LayoutInflater.from(activity).inflate(R.layout.x_recommend_dialog, dialog_center_ll, true);
|
|
|
|
|
+ dialog_title.setText("推荐给好友");
|
|
|
|
|
|
|
|
- final AlertDialog dialog = builder.create();
|
|
|
|
|
- ImageView iv = view.findViewById(R.id.iv_close);
|
|
|
|
|
TextView withdrawal = view.findViewById(R.id.withdrawal);
|
|
TextView withdrawal = view.findViewById(R.id.withdrawal);
|
|
|
TextView tv_link = view.findViewById(R.id.tv_link);
|
|
TextView tv_link = view.findViewById(R.id.tv_link);
|
|
|
TextView save_pic = view.findViewById(R.id.save_pic);
|
|
TextView save_pic = view.findViewById(R.id.save_pic);
|
|
@@ -105,15 +111,7 @@ public class ViewUtil {
|
|
|
.load(AppUtil.getQRLink(link, 800))
|
|
.load(AppUtil.getQRLink(link, 800))
|
|
|
.apply(new RequestOptions().override(800, 800))
|
|
.apply(new RequestOptions().override(800, 800))
|
|
|
.into(iv_qr);
|
|
.into(iv_qr);
|
|
|
- dialog.show();
|
|
|
|
|
- Window window = dialog.getWindow();
|
|
|
|
|
- if(window != null) {
|
|
|
|
|
- android.view.WindowManager.LayoutParams p = window.getAttributes();
|
|
|
|
|
- p.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
|
|
|
|
- p.width = WindowManager.LayoutParams.MATCH_PARENT;
|
|
|
|
|
- dialog.getWindow().setAttributes(p); //设置生效
|
|
|
|
|
- }
|
|
|
|
|
- iv.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
|
|
+ dialog_close.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
dialog.dismiss();
|
|
dialog.dismiss();
|
|
@@ -144,6 +142,7 @@ public class ViewUtil {
|
|
|
G.showToast("已保存");
|
|
G.showToast("已保存");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ dialog.show();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -207,107 +206,45 @@ public class ViewUtil {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public static void showSignPay(final Activity activity) {
|
|
|
|
|
- AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
|
|
|
|
- View view = View.inflate(activity, R.layout.x_sign_type_dialog, null);
|
|
|
|
|
- builder.setView(view);
|
|
|
|
|
- final AlertDialog dialog = builder.create();
|
|
|
|
|
- ImageView iv = view.findViewById(R.id.iv_close);
|
|
|
|
|
- TextView dialog_sure = view.findViewById(R.id.dialog_sure);
|
|
|
|
|
- dialog_sure.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View v) {
|
|
|
|
|
- //跳转到系统闹钟
|
|
|
|
|
- SysAppUtil.startAlermApp(activity, "小绵羊打卡任务", 7,0);
|
|
|
|
|
- dialog.dismiss();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- dialog.show();
|
|
|
|
|
- Window window = dialog.getWindow();
|
|
|
|
|
- if(window != null) {
|
|
|
|
|
- android.view.WindowManager.LayoutParams p = window.getAttributes();
|
|
|
|
|
- p.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
|
|
|
|
- p.width = WindowManager.LayoutParams.MATCH_PARENT;
|
|
|
|
|
- dialog.getWindow().setAttributes(p); //设置生效
|
|
|
|
|
- }
|
|
|
|
|
- iv.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View v) {
|
|
|
|
|
- dialog.dismiss();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //打卡 -》未报名提示对话框
|
|
|
|
|
- public static void showSignAlert(final Activity activity) {
|
|
|
|
|
- AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
|
|
|
|
- View view = View.inflate(activity, R.layout.x_sign_alert_dialog, null);
|
|
|
|
|
- builder.setView(view);
|
|
|
|
|
- final AlertDialog dialog = builder.create();
|
|
|
|
|
- ImageView iv = view.findViewById(R.id.iv_close);
|
|
|
|
|
- TextView dialog_sure = view.findViewById(R.id.dialog_sure);
|
|
|
|
|
- dialog_sure.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View v) {
|
|
|
|
|
- dialog.dismiss();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- dialog.show();
|
|
|
|
|
- Window window = dialog.getWindow();
|
|
|
|
|
- if(window != null) {
|
|
|
|
|
- android.view.WindowManager.LayoutParams p = window.getAttributes();
|
|
|
|
|
- p.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
|
|
|
|
- p.width = WindowManager.LayoutParams.MATCH_PARENT;
|
|
|
|
|
- dialog.getWindow().setAttributes(p); //设置生效
|
|
|
|
|
- }
|
|
|
|
|
- iv.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View v) {
|
|
|
|
|
- dialog.dismiss();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ public static void showMsgDialog(final Activity activity, String msg) {
|
|
|
|
|
+ showMsgDialog(activity, msg, null, null, null);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- //打卡->超出时间提示对话框
|
|
|
|
|
- public static void showSignTimeAlert(final Activity activity, String title) {
|
|
|
|
|
- showSignTimeAlert(activity, title, null, null);
|
|
|
|
|
|
|
+ public static void showMsgDialog(final Activity activity, String msg, String title, String sureText) {
|
|
|
|
|
+ showMsgDialog(activity, msg, title, sureText, null);
|
|
|
}
|
|
}
|
|
|
- //打卡->超出时间提示对话框
|
|
|
|
|
- public static void showSignTimeAlert(final Activity activity, String title, String sureText, final View.OnClickListener onClickListener) {
|
|
|
|
|
- AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
|
|
|
|
- View view = View.inflate(activity, R.layout.x_sign_alerttime_dialog, null);
|
|
|
|
|
- builder.setView(view);
|
|
|
|
|
- final AlertDialog dialog = builder.create();
|
|
|
|
|
- ImageView iv = view.findViewById(R.id.iv_close);
|
|
|
|
|
- TextView sign_tv_alert_title = view.findViewById(R.id.sign_tv_alert_title);
|
|
|
|
|
|
|
+ public static void showMsgDialog(final Activity activity, String msg, String title, String sureText, final View.OnClickListener onClickListener) {
|
|
|
|
|
+ View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
|
|
|
|
|
+ final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
|
|
|
|
|
+ .setView(dialog_parent)
|
|
|
|
|
+ .create();
|
|
|
|
|
+ TextView dialog_title = dialog_parent.findViewById(R.id.dialog_title);
|
|
|
|
|
+ View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
|
|
|
|
|
+ LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
|
|
|
|
|
+ View view = LayoutInflater.from(activity).inflate(R.layout.x_msg_dialog, dialog_center_ll, true);
|
|
|
|
|
+ if(!TextUtils.isEmpty(title))
|
|
|
|
|
+ dialog_title.setText(title);
|
|
|
|
|
+
|
|
|
|
|
+ TextView dialog_msg = view.findViewById(R.id.dialog_msg);
|
|
|
TextView dialog_sure = view.findViewById(R.id.dialog_sure);
|
|
TextView dialog_sure = view.findViewById(R.id.dialog_sure);
|
|
|
- sign_tv_alert_title.setText(title);
|
|
|
|
|
|
|
+ dialog_msg.setText(msg);
|
|
|
if(!TextUtils.isEmpty(sureText))
|
|
if(!TextUtils.isEmpty(sureText))
|
|
|
dialog_sure.setText(sureText);
|
|
dialog_sure.setText(sureText);
|
|
|
dialog_sure.setOnClickListener(new View.OnClickListener() {
|
|
dialog_sure.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
- if(onClickListener != null)
|
|
|
|
|
|
|
+ if(onClickListener != null){
|
|
|
onClickListener.onClick(v);
|
|
onClickListener.onClick(v);
|
|
|
|
|
+ }
|
|
|
dialog.dismiss();
|
|
dialog.dismiss();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- dialog.show();
|
|
|
|
|
- Window window = dialog.getWindow();
|
|
|
|
|
- if(window != null) {
|
|
|
|
|
- android.view.WindowManager.LayoutParams p = window.getAttributes();
|
|
|
|
|
- p.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
|
|
|
|
- p.width = WindowManager.LayoutParams.MATCH_PARENT;
|
|
|
|
|
- dialog.getWindow().setAttributes(p); //设置生效
|
|
|
|
|
- }
|
|
|
|
|
- iv.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
|
|
+ dialog_close.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
dialog.dismiss();
|
|
dialog.dismiss();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ dialog.show();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static final int REQUEST_CODE_TASK_LIST = 110;
|
|
public static final int REQUEST_CODE_TASK_LIST = 110;
|