Initial commit
This commit is contained in:
@@ -0,0 +1,251 @@
|
||||
package com.ubt.jimu.community.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import butterknife.ButterKnife;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.ubt.jimu.BaseActivity;
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.ViewImpl;
|
||||
import com.ubt.jimu.base.entities.Push;
|
||||
import com.ubt.jimu.user.view.AddressActivity;
|
||||
import com.ubt.jimu.utils.BitmapUtils;
|
||||
import com.ubt.jimu.widgets.BottomShadowLayout;
|
||||
import com.ubtech.utils.DensityUtils;
|
||||
import com.ubtech.utils.DisplayUtil;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActivityAlertActivity extends BaseActivity {
|
||||
static Bitmap d;
|
||||
private ArrayList<Push> a;
|
||||
private String b;
|
||||
private Handler c = new Handler();
|
||||
FrameLayout centerCardView;
|
||||
FrameLayout rootView;
|
||||
|
||||
private void E0() {
|
||||
Bundle bundleExtra = getIntent().getBundleExtra("extra");
|
||||
this.a = (ArrayList) bundleExtra.getSerializable("push_list");
|
||||
this.b = bundleExtra.getString("blur_bitmap_name");
|
||||
ArrayList<Push> arrayList = this.a;
|
||||
if (arrayList == null || arrayList.size() == 0) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < this.a.size(); i++) {
|
||||
this.centerCardView.addView(a(this.a.get(i), i, this.a.size()));
|
||||
this.a.size();
|
||||
}
|
||||
}
|
||||
|
||||
private void F0() {
|
||||
}
|
||||
|
||||
public void D0() {
|
||||
Bitmap bitmap = d;
|
||||
if (bitmap == null || bitmap.isRecycled()) {
|
||||
return;
|
||||
}
|
||||
new Thread(new Runnable() { // from class: com.ubt.jimu.community.activity.ActivityAlertActivity.6
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
ActivityAlertActivity activityAlertActivity = ActivityAlertActivity.this;
|
||||
final Bitmap a = BitmapUtils.a(activityAlertActivity, ActivityAlertActivity.d, activityAlertActivity.b);
|
||||
if (a == null || a.isRecycled()) {
|
||||
return;
|
||||
}
|
||||
ActivityAlertActivity.this.c.post(new Runnable() { // from class: com.ubt.jimu.community.activity.ActivityAlertActivity.6.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
ActivityAlertActivity.this.rootView.setBackground(new BitmapDrawable(a));
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
public void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(R.layout.activity_activity_alert);
|
||||
ButterKnife.a(this);
|
||||
E0();
|
||||
D0();
|
||||
F0();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onDestroy() {
|
||||
Handler handler = this.c;
|
||||
if (handler != null) {
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
super.onDestroy();
|
||||
FrameLayout frameLayout = this.rootView;
|
||||
if (frameLayout != null) {
|
||||
frameLayout.setBackground(null);
|
||||
}
|
||||
}
|
||||
|
||||
public void onDismiss(View view) {
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.BaseActivity
|
||||
public void relayout() {
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static void a(Activity activity, Bundle bundle) {
|
||||
View rootView = ((ViewImpl) activity).getRootView();
|
||||
if (rootView != null) {
|
||||
rootView.setDrawingCacheEnabled(true);
|
||||
rootView.buildDrawingCache();
|
||||
d = rootView.getDrawingCache();
|
||||
}
|
||||
Intent intent = new Intent(activity, (Class<?>) ActivityAlertActivity.class);
|
||||
intent.putExtra("extra", bundle);
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
|
||||
private View a(final Push push, final int i, int i2) {
|
||||
View inflate = LayoutInflater.from(this).inflate(R.layout.dialog_activity, (ViewGroup) null);
|
||||
ImageView imageView = (ImageView) inflate.findViewById(R.id.contentImageView);
|
||||
TextView textView = (TextView) inflate.findViewById(R.id.ok_button);
|
||||
TextView textView2 = (TextView) inflate.findViewById(R.id.subTitleTextView);
|
||||
TextView textView3 = (TextView) inflate.findViewById(R.id.titleTextView);
|
||||
TextView textView4 = (TextView) inflate.findViewById(R.id.expTextView);
|
||||
TextView textView5 = (TextView) inflate.findViewById(R.id.expTipTextView);
|
||||
TextView textView6 = (TextView) inflate.findViewById(R.id.scoreTextView);
|
||||
TextView textView7 = (TextView) inflate.findViewById(R.id.scoreTipTextView);
|
||||
BottomShadowLayout bottomShadowLayout = (BottomShadowLayout) inflate.findViewById(R.id.bsl_action);
|
||||
bottomShadowLayout.setListener(new View.OnClickListener() { // from class: com.ubt.jimu.community.activity.ActivityAlertActivity.2
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
int i3 = i;
|
||||
if (i3 == 0) {
|
||||
ActivityAlertActivity.this.finish();
|
||||
} else {
|
||||
ActivityAlertActivity.this.centerCardView.removeViewAt(i3);
|
||||
}
|
||||
if (push.getType() == 3 && push.getAwardEntity() == 1) {
|
||||
AddressActivity.start(ActivityAlertActivity.this);
|
||||
} else {
|
||||
JimuActActivity.start(ActivityAlertActivity.this, push.getActivityId());
|
||||
}
|
||||
}
|
||||
});
|
||||
Boolean valueOf = Boolean.valueOf(JimuApplication.l().i());
|
||||
bottomShadowLayout.a((int) DensityUtils.a(this, valueOf.booleanValue() ? 318 : 160), (int) DensityUtils.a(this, valueOf.booleanValue() ? 64 : 32));
|
||||
int type = push.getType();
|
||||
if (type == 1) {
|
||||
imageView.setScaleType(ImageView.ScaleType.FIT_START);
|
||||
RequestBuilder<Drawable> a = Glide.a((FragmentActivity) this).a(push.getImage());
|
||||
a.a(new RequestOptions().b());
|
||||
a.a(imageView);
|
||||
textView2.setVisibility(8);
|
||||
textView3.setVisibility(8);
|
||||
bottomShadowLayout.setVisibility(8);
|
||||
textView.setText(push.getButtonText());
|
||||
textView.setBackgroundColor(push.getType() == 2 ? Color.rgb(255, 73, 121) : Color.rgb(255, 168, 19));
|
||||
} else if (type == 2) {
|
||||
textView2.setVisibility(0);
|
||||
textView3.setVisibility(0);
|
||||
imageView.setImageResource(R.drawable.ic_win_praise);
|
||||
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
bottomShadowLayout.setVisibility(0);
|
||||
bottomShadowLayout.setText(getString(R.string.go_to_see));
|
||||
textView.setVisibility(8);
|
||||
} else if (type == 3) {
|
||||
textView2.setVisibility(0);
|
||||
textView3.setVisibility(0);
|
||||
imageView.setImageResource(R.drawable.ic_award_pad);
|
||||
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
textView.setVisibility(8);
|
||||
textView6.setVisibility(0);
|
||||
textView7.setVisibility(0);
|
||||
textView5.setVisibility(0);
|
||||
textView4.setVisibility(0);
|
||||
textView6.setText("+" + push.getScore());
|
||||
textView4.setText("+" + push.getExp());
|
||||
bottomShadowLayout.setVisibility(0);
|
||||
bottomShadowLayout.setText(TextUtils.isEmpty(push.getButtonText()) ? getString(R.string.add_address) : push.getButtonText());
|
||||
}
|
||||
textView.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.community.activity.ActivityAlertActivity.3
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
int i3 = i;
|
||||
if (i3 == 0) {
|
||||
ActivityAlertActivity.this.finish();
|
||||
} else {
|
||||
ActivityAlertActivity.this.centerCardView.removeViewAt(i3);
|
||||
}
|
||||
JimuActActivity.start(ActivityAlertActivity.this, push.getActivityId());
|
||||
}
|
||||
});
|
||||
inflate.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.community.activity.ActivityAlertActivity.4
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (push.getAwardEntity() == 1) {
|
||||
AddressActivity.start(ActivityAlertActivity.this);
|
||||
return;
|
||||
}
|
||||
int i3 = i;
|
||||
if (i3 == 0) {
|
||||
ActivityAlertActivity.this.finish();
|
||||
} else {
|
||||
ActivityAlertActivity.this.centerCardView.removeViewAt(i3);
|
||||
}
|
||||
JimuActActivity.start(ActivityAlertActivity.this, push.getActivityId());
|
||||
}
|
||||
});
|
||||
inflate.findViewById(R.id.cancel_button).setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.community.activity.ActivityAlertActivity.5
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
int i3 = i;
|
||||
if (i3 == 0) {
|
||||
ActivityAlertActivity.this.finish();
|
||||
} else {
|
||||
ActivityAlertActivity.this.centerCardView.removeViewAt(i3);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!TextUtils.isEmpty(push.getLink())) {
|
||||
textView2.setText(push.getLink());
|
||||
}
|
||||
if (!TextUtils.isEmpty(push.getContent())) {
|
||||
textView3.setText(push.getContent());
|
||||
}
|
||||
if (push.getType() == 1) {
|
||||
inflate.setLayoutParams(new FrameLayout.LayoutParams(DisplayUtil.a(this, valueOf.booleanValue() ? 552.0f : 360.0f), DisplayUtil.a(this, valueOf.booleanValue() ? 336.0f : 220.0f)));
|
||||
} else {
|
||||
int b = DisplayUtil.b(this);
|
||||
int a2 = DisplayUtil.a(this);
|
||||
inflate.setLayoutParams(new FrameLayout.LayoutParams((Math.max(b, a2) * 54) / 100, (Math.min(b, a2) * 64) / 100));
|
||||
}
|
||||
return inflate;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user