63 lines
1.6 KiB
Java
63 lines
1.6 KiB
Java
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();
|
|
}
|
|
}
|