|
|
@@ -1,11 +1,7 @@
|
|
|
package com.sheep.gamegroup.view.activity;
|
|
|
|
|
|
-import android.app.Activity;
|
|
|
-import android.app.AlertDialog;
|
|
|
import android.content.Intent;
|
|
|
import android.view.View;
|
|
|
-import android.view.ViewGroup;
|
|
|
-import android.view.Window;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
@@ -13,15 +9,16 @@ import android.widget.TextView;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.bumptech.glide.Glide;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
+import com.sheep.gamegroup.absBase.AbsChooseImageActivity;
|
|
|
import com.sheep.gamegroup.event.ImageHeadChange;
|
|
|
import com.sheep.gamegroup.event.UserNameChange;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.util.AppUtil;
|
|
|
import com.sheep.gamegroup.util.GlideImageLoader;
|
|
|
+import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
-import com.sheep.gamegroup.absBase.AbsChooseImageActivity;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
|
|
|
@@ -123,69 +120,6 @@ public class PersionInfoAct extends AbsChooseImageActivity {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static void showQR(Activity activity, String link) {
|
|
|
- AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
|
|
- View view = View.inflate(activity, R.layout.x_ask_qr_dialog, null);
|
|
|
- builder.setView(view);
|
|
|
- final AlertDialog dialog = builder.create();
|
|
|
- ImageView iv = view.findViewById(R.id.iv_close);
|
|
|
- ImageView iv_qr = view.findViewById(R.id.iv_qr);
|
|
|
- ImageView iv_qr_small = view.findViewById(R.id.iv_qr_small);
|
|
|
- Glide.with(activity)
|
|
|
- .load(AppUtil.getQRLink(link, 800))
|
|
|
- .apply(new RequestOptions().override(800, 800))
|
|
|
- .into(iv_qr);
|
|
|
- Glide.with(activity)
|
|
|
- .load("http://cdngame.kuaifazs.com/icon.png")
|
|
|
- .apply(new RequestOptions().override(G.WIDTH/5))
|
|
|
- .into(iv_qr_small);
|
|
|
- dialog.show();
|
|
|
- Window window = dialog.getWindow();
|
|
|
- if(window != null) {
|
|
|
- android.view.WindowManager.LayoutParams p = window.getAttributes();
|
|
|
- p.height = G.WIDTH;
|
|
|
- p.width = G.WIDTH;
|
|
|
- dialog.getWindow().setAttributes(p); //设置生效
|
|
|
- }
|
|
|
- iv.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- dialog.dismiss();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- private void showHead() {
|
|
|
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
|
|
- View view = View.inflate(this, R.layout.x_ask_qr_dialog, null);
|
|
|
- builder.setView(view);
|
|
|
- final AlertDialog dialog = builder.create();
|
|
|
- ImageView iv = view.findViewById(R.id.iv_close);
|
|
|
- ImageView iv_qr = view.findViewById(R.id.iv_qr);
|
|
|
- ViewGroup.LayoutParams params = iv_qr.getLayoutParams();
|
|
|
- params.height = G.WIDTH - 60;
|
|
|
- params.width = G.HEIGHT / 2 - 20;
|
|
|
- iv_qr.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
|
|
|
- iv_qr.setLayoutParams(params);
|
|
|
- Glide.with(PersionInfoAct.this)
|
|
|
- .load(mEntity.getAvatar())
|
|
|
- .apply(new RequestOptions().placeholder(R.mipmap.x_ic_def_head))
|
|
|
- .into(iv_qr);
|
|
|
- dialog.show();
|
|
|
- iv.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- dialog.dismiss();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
@OnClick({R.id.layout_more1, R.id.rl_qr, R.id.rl_head})
|
|
|
public void onClick(View view) {
|
|
|
switch (view.getId()) {
|
|
|
@@ -195,7 +129,7 @@ public class PersionInfoAct extends AbsChooseImageActivity {
|
|
|
startActivity(i);
|
|
|
break;
|
|
|
case R.id.rl_qr:
|
|
|
- showQR(PersionInfoAct.this, mEntity.getShare_link());
|
|
|
+ ViewUtil.showQR(PersionInfoAct.this, mEntity.getShare_link());
|
|
|
break;
|
|
|
case R.id.rl_head:
|
|
|
showChooseDialog();
|