Initial commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.ubt.jimu.community.view.popwindow;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class BaseDialog extends Dialog {
|
||||
protected Context mContext;
|
||||
|
||||
public BaseDialog(Context context) {
|
||||
this(context, R.style.Dialog);
|
||||
}
|
||||
|
||||
public abstract void initData();
|
||||
|
||||
public abstract int layoutId();
|
||||
|
||||
@Override // android.app.Dialog
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(layoutId());
|
||||
initData();
|
||||
}
|
||||
|
||||
public void setCancel(boolean z) {
|
||||
setCanceledOnTouchOutside(z);
|
||||
setCancelable(z);
|
||||
}
|
||||
|
||||
public BaseDialog(Context context, int i) {
|
||||
super(context, i);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
protected BaseDialog(Context context, boolean z, DialogInterface.OnCancelListener onCancelListener) {
|
||||
super(context, z, null);
|
||||
}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
package com.ubt.jimu.community.view.popwindow;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.PopupWindow;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class BasePopwindow extends PopupWindow {
|
||||
protected Activity a;
|
||||
protected View b;
|
||||
|
||||
public BasePopwindow(Activity activity) {
|
||||
this(activity, "");
|
||||
}
|
||||
|
||||
private void c() {
|
||||
this.b = this.a.getLayoutInflater().inflate(a(), (ViewGroup) null);
|
||||
}
|
||||
|
||||
@SuppressLint({"InlinedApi"})
|
||||
private void d() {
|
||||
setContentView(this.b);
|
||||
setWidth(-1);
|
||||
setHeight(-1);
|
||||
setFocusable(true);
|
||||
setAnimationStyle(R.style.AnimationPreview);
|
||||
setBackgroundDrawable(new ColorDrawable(Color.argb(70, 0, 0, 0)));
|
||||
this.b.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.community.view.popwindow.a
|
||||
@Override // android.view.View.OnClickListener
|
||||
public final void onClick(View view) {
|
||||
BasePopwindow.this.a(view);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public abstract int a();
|
||||
|
||||
public /* synthetic */ void a(View view) {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
public abstract void b();
|
||||
|
||||
public void b(View view) {
|
||||
try {
|
||||
showAtLocation(view, 80, 0, 0);
|
||||
} catch (Exception unused) {
|
||||
}
|
||||
}
|
||||
|
||||
public BasePopwindow(Activity activity, String str) {
|
||||
this.a = activity;
|
||||
c();
|
||||
b();
|
||||
d();
|
||||
}
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
package com.ubt.jimu.community.view.popwindow;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.community.view.adapter.ReportAdapter;
|
||||
import com.ubt.jimu.utils.WrapContentLinearLayoutManager;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ReportPopwindow extends BasePopwindow {
|
||||
private TextView c;
|
||||
private RecyclerView d;
|
||||
private RelativeLayout e;
|
||||
|
||||
public ReportPopwindow(Activity activity) {
|
||||
super(activity);
|
||||
}
|
||||
|
||||
private void c() {
|
||||
this.e.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.community.view.popwindow.c
|
||||
@Override // android.view.View.OnClickListener
|
||||
public final void onClick(View view) {
|
||||
ReportPopwindow.this.c(view);
|
||||
}
|
||||
});
|
||||
this.c.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.community.view.popwindow.b
|
||||
@Override // android.view.View.OnClickListener
|
||||
public final void onClick(View view) {
|
||||
ReportPopwindow.this.d(view);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.view.popwindow.BasePopwindow
|
||||
public int a() {
|
||||
return R.layout.popw_report;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.community.view.popwindow.BasePopwindow
|
||||
public void b() {
|
||||
this.c = (TextView) this.b.findViewById(R.id.tv_popup_cancel);
|
||||
this.d = (RecyclerView) this.b.findViewById(R.id.ry_report);
|
||||
this.e = (RelativeLayout) this.b.findViewById(R.id.rl_top);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
arrayList.add(this.a.getString(R.string.issue_comment_report_content_1));
|
||||
arrayList.add(this.a.getString(R.string.issue_comment_report_content_2));
|
||||
arrayList.add(this.a.getString(R.string.issue_comment_report_content_3));
|
||||
ReportAdapter reportAdapter = new ReportAdapter(this.a, arrayList);
|
||||
this.d.setLayoutManager(new WrapContentLinearLayoutManager(this.a, 1, false));
|
||||
this.d.setAdapter(reportAdapter);
|
||||
c();
|
||||
}
|
||||
|
||||
public /* synthetic */ void d(View view) {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
public /* synthetic */ void c(View view) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user