OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.excelliance.kxqp.ui.comment.subscribe;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.bumptech.glide.d.d.a.e;
import com.bumptech.glide.g.b.h;
import com.bumptech.glide.i;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.make_money.f;
import com.excelliance.kxqp.gs.ui.share.core.config.SocializeMedia;
import com.excelliance.kxqp.gs.ui.share.core.helper.ShareHelper;
import com.excelliance.kxqp.gs.ui.share.core.param.BigImageShareParam;
import com.excelliance.kxqp.gs.ui.share.core.param.ShareImage;
import com.excelliance.kxqp.gs.util.ad;
import com.excelliance.kxqp.gs.util.bv;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.k;
import com.excelliance.kxqp.gs.util.t;
import com.excelliance.kxqp.widget.SimpleRatingBar;
import java.io.File;
import java.io.IOException;
public class b extends Dialog implements View.OnClickListener {
private Context f14179a;
private View f14180b;
private TextView c;
private ViewGroup d;
private ImageView e;
private ImageView f;
private ImageView g;
private TextView h;
private ImageView i;
private TextView j;
private SimpleRatingBar k;
private TextView l;
private TextView m;
private ImageView n;
private ViewGroup o;
private ViewGroup p;
private ViewGroup q;
private ViewGroup r;
private String s;
private b(@NonNull Context context) {
this(context, R.style.theme_dialog_bg_transparent);
}
private b(@NonNull Context context, int i) {
super(context, i);
this.f14179a = context;
}
public static void a(Context context, String str, String str2, String str3, String str4, int i, String str5, boolean z) {
b bVar = new b(context);
bVar.show();
bVar.b(str5);
bVar.c(str);
bVar.d(str2);
bVar.e(str3);
bVar.a(str4);
bVar.a(i);
bVar.a(z);
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.f14180b = LayoutInflater.from(getContext()).inflate(R.layout.dialog_comment_success, (ViewGroup) null);
setContentView(this.f14180b);
a();
b();
c();
d();
}
public void a() {
Window window = getWindow();
if (window == null) {
return;
}
window.setLayout(-1, -1);
window.getDecorView().setSystemUiVisibility(4);
final View decorView = window.getDecorView();
a(decorView);
decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(int i) {
if ((i & 4) == 0) {
b.this.a(decorView);
}
}
});
}
public void a(View view) {
view.setSystemUiVisibility(5894);
}
private void b() {
this.c = (TextView) findViewById(R.id.tv_title);
this.d = (ViewGroup) findViewById(R.id.layout_content);
this.e = (ImageView) findViewById(R.id.iv_cover_round);
this.f = (ImageView) findViewById(R.id.iv_cover_raw);
this.g = (ImageView) findViewById(R.id.iv_game_icon);
this.h = (TextView) findViewById(R.id.tv_game_name);
this.i = (ImageView) findViewById(R.id.iv_portrait);
this.j = (TextView) findViewById(R.id.tv_nickname);
this.m = (TextView) findViewById(R.id.tv_comment);
this.k = (SimpleRatingBar) findViewById(R.id.srb);
this.l = (TextView) findViewById(R.id.tv_rating);
this.n = (ImageView) findViewById(R.id.iv_square_code);
this.o = (ViewGroup) findViewById(R.id.layout_share_wechat);
this.p = (ViewGroup) findViewById(R.id.layout_share_moment);
this.q = (ViewGroup) findViewById(R.id.layout_share_qq);
this.r = (ViewGroup) findViewById(R.id.layout_save_album);
tp.g(new Runnable() {
@Override
public void run() {
((Activity) b.this.f14179a).getWindow().getDecorView().buildDrawingCache();
final Bitmap a2 = k.a(b.this.f14179a, ((Activity) b.this.f14179a).getWindow().getDecorView().getDrawingCache(), 25, false);
tp.i(new Runnable() {
@Override
public void run() {
b.this.f14180b.setBackgroundDrawable(new BitmapDrawable(a2));
}
});
}
});
}
private void c() {
tp.f(new Runnable() {
@Override
public void run() {
SharedPreferences sharedPreferences = b.this.getContext().getSharedPreferences("USERINFO", 4);
final String a2 = bx.a().a(sharedPreferences, t.c);
final String a3 = bx.a().a(sharedPreferences, t.f);
tp.i(new Runnable() {
@Override
public void run() {
b.this.j.setText(a2);
i.b(b.this.getContext()).a(a3).a(new e(b.this.getContext()), new com.excelliance.kxqp.gs.discover.common.b(b.this.getContext())).d(com.excelliance.kxqp.gs.ui.medal.a.c.d()).c(com.excelliance.kxqp.gs.ui.medal.a.c.d()).a(b.this.i);
}
});
}
});
}
private void d() {
this.k.setIndicator(true);
this.k.a(14.0f, 1);
this.k.setDrawBorderEnabled(false);
this.k.b(10.0f, 1);
this.o.setOnClickListener(this);
this.p.setOnClickListener(this);
this.q.setOnClickListener(this);
this.r.setOnClickListener(this);
}
@Override
public void onClick(View view) {
if (view.getId() == this.o.getId()) {
a(SocializeMedia.WEIXIN);
return;
}
if (view.getId() == this.p.getId()) {
a(SocializeMedia.WEIXIN_MONMENT);
} else if (view.getId() == this.q.getId()) {
a(SocializeMedia.QQ);
} else if (view.getId() == this.r.getId()) {
f();
}
}
public void a(String str) {
if (cd.a(str)) {
return;
}
i.b(getContext().getApplicationContext()).a(str).c(R.drawable.ic_ranking_temp).a((com.bumptech.glide.c<String>) new h<com.bumptech.glide.d.d.b.b>(ad.a(getContext(), 300.0f), ad.a(getContext(), 162.0f)) {
@Override
public void a(Object obj, com.bumptech.glide.g.a.c cVar) {
a((com.bumptech.glide.d.d.b.b) obj, (com.bumptech.glide.g.a.c<? super com.bumptech.glide.d.d.b.b>) cVar);
}
public void a(com.bumptech.glide.d.d.b.b bVar, com.bumptech.glide.g.a.c<? super com.bumptech.glide.d.d.b.b> cVar) {
b.this.e.setImageDrawable(bVar);
b.this.f.setImageDrawable(bVar);
}
});
}
public void a(int i) {
this.k.setRating(i);
this.l.setText(String.valueOf(i * 2));
}
public void a(boolean z) {
this.c.setText(z ? this.f14179a.getString(R.string.comment_success) : this.f14179a.getString(R.string.comment_success_share));
}
public void b(String str) {
this.m.setText(str);
}
public void c(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
i.b(getContext().getApplicationContext()).a(str).a(new e(getContext()), new com.excelliance.kxqp.widget.c(getContext(), 12)).c(R.drawable.default_icon).d(R.drawable.default_icon).a(this.g);
}
public void d(String str) {
this.h.setText(str);
}
public void e(String str) {
this.s = "https://m.ourplay.net/rank/detail/" + str;
tp.f(new Runnable() {
@Override
public void run() {
final Bitmap a2 = bv.a(b.this.s, ad.a(b.this.getContext(), 45.0f), ad.a(b.this.getContext(), 45.0f));
tp.i(new Runnable() {
@Override
public void run() {
if (a2 != null) {
b.this.n.setImageBitmap(a2);
}
}
});
}
});
}
private Bitmap e() {
Bitmap b2 = b(this.d);
Bitmap b3 = b(this.f);
if (b2 == null || b3 == null) {
return null;
}
int a2 = ad.a(this.f14179a, 10.0f);
Bitmap createBitmap = Bitmap.createBitmap(b2, 0, a2, b2.getWidth(), b2.getHeight() - (a2 * 2), (Matrix) null, false);
int a3 = ad.a(getContext(), 16.0f);
Paint paint = new Paint();
Canvas canvas = new Canvas(createBitmap);
Rect rect = new Rect(0, 0, b3.getWidth(), a3);
canvas.drawBitmap(b3, rect, new Rect(rect), paint);
paint.setColor(Color.rgb(245, 245, 245));
Path path = new Path();
path.moveTo(0.0f, createBitmap.getHeight() - a3);
path.lineTo(0.0f, createBitmap.getHeight());
float f = a3;
path.lineTo(f, createBitmap.getHeight());
path.quadTo(f, createBitmap.getHeight() - a3, 0.0f, createBitmap.getHeight() - a3);
path.close();
canvas.drawPath(path, paint);
path.reset();
path.moveTo(createBitmap.getWidth(), createBitmap.getHeight() - a3);
path.lineTo(createBitmap.getWidth(), createBitmap.getHeight());
path.lineTo(createBitmap.getWidth() - a3, createBitmap.getHeight());
path.quadTo(createBitmap.getWidth() - a3, createBitmap.getHeight() - a3, createBitmap.getWidth(), createBitmap.getHeight() - a3);
path.close();
canvas.drawPath(path, paint);
return createBitmap;
}
private Bitmap b(View view) {
if (view == null) {
return null;
}
view.buildDrawingCache();
Bitmap drawingCache = view.getDrawingCache();
if (drawingCache != null) {
return drawingCache;
}
Bitmap createBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.RGB_565);
Canvas canvas = new Canvas(createBitmap);
canvas.translate(-view.getScrollX(), -view.getScrollY());
view.draw(canvas);
return createBitmap;
}
private void a(SocializeMedia socializeMedia) {
Bitmap e = e();
String charSequence = this.h.getText().toString();
String charSequence2 = this.m.getText().toString();
if (e == null) {
Toast.makeText(this.f14179a, "生成失败", 0).show();
return;
}
ShareHelper instance = ShareHelper.instance((Activity) this.f14179a);
instance.from(1);
BigImageShareParam bigImageShareParam = new BigImageShareParam("#" + charSequence + "#" + charSequence2, "OurPlay评论成功", this.s);
ShareImage shareImage = new ShareImage();
shareImage.setLocalFile(new File(f.b(e)));
bigImageShareParam.setThumb(shareImage);
instance.shareMediaTo(socializeMedia, bigImageShareParam);
}
private void f() {
Bitmap e = e();
if (e == null) {
Toast.makeText(this.f14179a, "生成失败", 0).show();
return;
}
File file = new File(f.b(e));
try {
MediaStore.Images.Media.insertImage(getContext().getContentResolver(), file.getAbsolutePath(), file.getName(), (String) null);
Toast.makeText(getContext(), R.string.comment_save_album_success, 0).show();
} catch (IOException e2) {
e2.printStackTrace();
Toast.makeText(getContext(), R.string.comment_save_album_failed, 0).show();
}
}
}