90 lines
3.1 KiB
Java
90 lines
3.1 KiB
Java
package com.ubt.jimu.widgets;
|
|
|
|
import android.app.Activity;
|
|
import android.view.View;
|
|
import android.widget.PopupWindow;
|
|
import android.widget.TextView;
|
|
import androidx.cardview.widget.CardView;
|
|
import com.ubt.jimu.JimuApplication;
|
|
import com.ubt.jimu.R;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class ShopPopupWindow implements View.OnClickListener {
|
|
private final PopupWindow a;
|
|
private final View b;
|
|
private PopupWindowOnClickLinsenter c;
|
|
private final TextView d;
|
|
private final View e;
|
|
|
|
public interface PopupWindowOnClickLinsenter {
|
|
void C0();
|
|
|
|
void q0();
|
|
}
|
|
|
|
public ShopPopupWindow(Activity activity, View view) {
|
|
this.e = View.inflate(activity, R.layout.layout_shop_popw, null);
|
|
this.a = new PopupWindow(this.e, -1, -1);
|
|
this.a.setOutsideTouchable(false);
|
|
this.a.setTouchable(true);
|
|
this.a.setAnimationStyle(R.style.popupWindow_anim_shop);
|
|
this.e.findViewById(R.id.tv_popu_cancel).setOnClickListener(this);
|
|
TextView textView = (TextView) this.e.findViewById(R.id.tv_popu_cancel);
|
|
TextView textView2 = (TextView) this.e.findViewById(R.id.tv_popu_ok);
|
|
this.e.findViewById(R.id.view_click).setOnClickListener(this);
|
|
((CardView) this.e.findViewById(R.id.cardView)).setCardBackgroundColor(activity.getResources().getColor(R.color.bg_white));
|
|
boolean i = JimuApplication.l().i();
|
|
int i2 = R.drawable.btn_publish;
|
|
textView.setBackgroundResource(i ? R.drawable.btn_publish : R.drawable.btn_publish_phone);
|
|
textView2.setBackgroundResource(JimuApplication.l().i() ? i2 : R.drawable.btn_publish_phone);
|
|
this.e.findViewById(R.id.tv_popu_ok).setOnClickListener(this);
|
|
this.d = (TextView) this.e.findViewById(R.id.tv_shop_popup_des);
|
|
this.b = view;
|
|
}
|
|
|
|
public void a(String str) {
|
|
this.d.setText(str);
|
|
}
|
|
|
|
public void b() {
|
|
if (this.a.isShowing()) {
|
|
return;
|
|
}
|
|
this.a.showAtLocation(this.b, 17, 0, 0);
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public void onClick(View view) {
|
|
switch (view.getId()) {
|
|
case R.id.tv_popu_cancel /* 2131297750 */:
|
|
PopupWindowOnClickLinsenter popupWindowOnClickLinsenter = this.c;
|
|
if (popupWindowOnClickLinsenter != null) {
|
|
popupWindowOnClickLinsenter.C0();
|
|
}
|
|
a();
|
|
break;
|
|
case R.id.tv_popu_ok /* 2131297751 */:
|
|
PopupWindowOnClickLinsenter popupWindowOnClickLinsenter2 = this.c;
|
|
if (popupWindowOnClickLinsenter2 != null) {
|
|
popupWindowOnClickLinsenter2.q0();
|
|
}
|
|
a();
|
|
break;
|
|
case R.id.view_click /* 2131297934 */:
|
|
a();
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void a() {
|
|
PopupWindow popupWindow = this.a;
|
|
if (popupWindow != null) {
|
|
popupWindow.dismiss();
|
|
}
|
|
}
|
|
|
|
public void a(PopupWindowOnClickLinsenter popupWindowOnClickLinsenter) {
|
|
this.c = popupWindowOnClickLinsenter;
|
|
}
|
|
}
|