package at1; import android.os.Bundle; import android.os.Looper; import android.view.View; import android.view.ViewGroup; import android.view.ViewPropertyAnimator; import android.widget.Button; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import b10.d0; import com.tencent.mm.R; import com.tencent.mm.plugin.finder.feed.ui.FinderGameLiveAuthUI; import com.tencent.mm.sdk.platformtools.Log; import com.tencent.mm.sdk.platformtools.MTimerHandler; import com.tencent.mm.ui.MMActivity; import com.tencent.mm.ui.MMActivityController; import com.tencent.mm.ui.component.UIComponent; import com.tencent.mm.ui.j5; import com.tencent.mm.ui.l5; import com.tencent.mm.ui.widget.MMWebView; import com.tencent.tinker.loader.hotplug.EnvConsts; import com.tencent.xweb.WebChromeClient; import com.tencent.xweb.WebView; import ek4.y; import lh4.m; import wg4.b0; import yz3.j; public final class e1 extends UIComponent { /* renamed from: d reason: collision with root package name */ public final String f8237d = "Finder.FinderGameFinishUIC"; /* renamed from: e reason: collision with root package name */ public int f8238e = 6; /* renamed from: f reason: collision with root package name */ public String f8239f = ""; /* renamed from: g reason: collision with root package name */ public View f8240g; /* renamed from: h reason: collision with root package name */ public MMWebView f8241h; /* renamed from: i reason: collision with root package name */ public Button f8242i; /* renamed from: j reason: collision with root package name */ public TextView f8243j; /* renamed from: n reason: collision with root package name */ public View f8244n; /* renamed from: o reason: collision with root package name */ public kh4.a<b0> f8245o; /* renamed from: p reason: collision with root package name */ public final c f8246p; /* renamed from: q reason: collision with root package name */ public MTimerHandler f8247q; public static final class a implements Runnable { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ e1 f8248d; public a(e1 e1Var) { this.f8248d = e1Var; } public final void run() { View view = this.f8248d.f8240g; if (view != null) { k30.a aVar = new k30.a(); ThreadLocal<k30.a> threadLocal = k30.c.f244265a; aVar.c(8); j30.a.d(view, aVar.b(), "com/tencent/mm/plugin/finder/live/viewmodel/FinderGameProtocolUIC$hide$1", "run", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V"); view.setVisibility(((Integer) aVar.a(0)).intValue()); j30.a.e(view, "com/tencent/mm/plugin/finder/live/viewmodel/FinderGameProtocolUIC$hide$1", "run", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V"); } } } public static final class b implements MTimerHandler.CallBack { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ e1 f8249d; public b(e1 e1Var) { this.f8249d = e1Var; } @Override // com.tencent.mm.sdk.platformtools.MTimerHandler.CallBack public boolean onTimerExpired() { String str; e1 e1Var = this.f8249d; int i15 = e1Var.f8238e - 1; e1Var.f8238e = i15; Button button = e1Var.f8242i; if (button != null) { if (i15 <= 0) { str = e1Var.getResources().getString(R.string.e5q); } else { str = e1Var.getResources().getString(R.string.e5p, Integer.valueOf(e1Var.f8238e)); } button.setText(str); } e1 e1Var2 = this.f8249d; if (e1Var2.f8238e > 0) { return true; } Button button2 = e1Var2.f8242i; if (button2 != null) { button2.setEnabled(true); } return false; } } public static final class c extends WebChromeClient { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ e1 f8250a; /* renamed from: b reason: collision with root package name */ public final /* synthetic */ AppCompatActivity f8251b; public c(e1 e1Var, AppCompatActivity appCompatActivity) { this.f8250a = e1Var; this.f8251b = appCompatActivity; } @Override // com.tencent.xweb.WebChromeClient public void onReceivedTitle(WebView webView, String str) { boolean z15; TextView textView; super.onReceivedTitle(webView, str); Log.i(this.f8250a.f8237d, "onReceivedTitle title:" + str + ' ' + this.f8251b); if (str == null || str.length() == 0) { z15 = true; } else { z15 = false; } if (!z15 && !m.b(this.f8250a.f8239f, str) && !((d0) j.c(d0.class)).Hw(str) && !y.v(str, "about:blank", false) && (textView = this.f8250a.f8243j) != null) { textView.setText(str); } } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public e1(AppCompatActivity appCompatActivity) { super(appCompatActivity); m.g(appCompatActivity, EnvConsts.ACTIVITY_MANAGER_SRVNAME); this.f8246p = new c(this, appCompatActivity); this.f8247q = new MTimerHandler(Looper.getMainLooper(), (MTimerHandler.CallBack) new b(this), true); } public final void j5() { MMActivity mMActivity; ViewPropertyAnimator animate; ViewPropertyAnimator translationX; ViewPropertyAnimator withEndAction; MMActivityController controller; AppCompatActivity activity = getActivity(); if (activity instanceof MMActivity) { mMActivity = (MMActivity) activity; } else { mMActivity = null; } if (!(mMActivity == null || (controller = mMActivity.getController()) == null)) { controller.B0(getActivity().getResources().getColor(R.color.a9e)); } View view = this.f8240g; if (view != null && (animate = view.animate()) != null && (translationX = animate.translationX(-((float) l5.b(getActivity()).x))) != null && (withEndAction = translationX.withEndAction(new a(this))) != null) { withEndAction.start(); } } public final void k5() { MMActivityController controller; View findViewById; View findViewById2; View findViewById3; View view = this.f8240g; MMActivity mMActivity = null; this.f8243j = view != null ? (TextView) view.findViewById(R.id.eyn) : null; View view2 = this.f8240g; this.f8244n = view2 != null ? view2.findViewById(R.id.eyk) : null; getActivity(); MMWebView mMWebView = (MMWebView) this.f8240g.findViewById(R.id.ezd); mMWebView.getClass(); this.f8241h = mMWebView; mMWebView.setWebChromeClient(this.f8246p); View view3 = this.f8240g; Button button = view3 != null ? (Button) view3.findViewById(R.id.eym) : null; this.f8242i = button; ViewGroup.LayoutParams layoutParams = button != null ? button.getLayoutParams() : null; ViewGroup.MarginLayoutParams marginLayoutParams = layoutParams instanceof ViewGroup.MarginLayoutParams ? (ViewGroup.MarginLayoutParams) layoutParams : null; if (marginLayoutParams != null) { marginLayoutParams.bottomMargin = j5.a(getActivity(), 48) + l5.c(getActivity()); } View view4 = this.f8240g; ViewGroup.LayoutParams layoutParams2 = (view4 == null || (findViewById3 = view4.findViewById(R.id.eyl)) == null) ? null : findViewById3.getLayoutParams(); ViewGroup.MarginLayoutParams marginLayoutParams2 = layoutParams2 instanceof ViewGroup.MarginLayoutParams ? (ViewGroup.MarginLayoutParams) layoutParams2 : null; if (marginLayoutParams2 != null) { marginLayoutParams2.bottomMargin = l5.c(getActivity()); } Button button2 = this.f8242i; if (button2 != null) { button2.setOnClickListener(new f1(this)); } View view5 = this.f8244n; if (view5 != null) { view5.setOnClickListener(new g1(this)); } if (!(getContext() instanceof FinderGameLiveAuthUI)) { View view6 = this.f8240g; ViewGroup.LayoutParams layoutParams3 = (view6 == null || (findViewById2 = view6.findViewById(R.id.ezb)) == null) ? null : findViewById2.getLayoutParams(); ViewGroup.MarginLayoutParams marginLayoutParams3 = layoutParams3 instanceof ViewGroup.MarginLayoutParams ? (ViewGroup.MarginLayoutParams) layoutParams3 : null; if (marginLayoutParams3 != null) { marginLayoutParams3.topMargin = l5.f(getActivity()); } } else { View view7 = this.f8240g; ViewGroup.LayoutParams layoutParams4 = (view7 == null || (findViewById = view7.findViewById(R.id.ezb)) == null) ? null : findViewById.getLayoutParams(); ViewGroup.MarginLayoutParams marginLayoutParams4 = layoutParams4 instanceof ViewGroup.MarginLayoutParams ? (ViewGroup.MarginLayoutParams) layoutParams4 : null; if (marginLayoutParams4 != null) { marginLayoutParams4.topMargin = (int) getActivity().getResources().getDimension(R.dimen.f359119dv); } } AppCompatActivity activity = getActivity(); if (activity instanceof MMActivity) { mMActivity = (MMActivity) activity; } if (!(mMActivity == null || (controller = mMActivity.getController()) == null)) { controller.B0(getActivity().getResources().getColor(R.color.BW_100)); } View view8 = this.f8240g; if (view8 != null) { view8.setTranslationX(0.0f); } View view9 = this.f8240g; if (view9 != null) { k30.a aVar = new k30.a(); ThreadLocal<k30.a> threadLocal = k30.c.f244265a; aVar.c(0); j30.a.d(view9, aVar.b(), "com/tencent/mm/plugin/finder/live/viewmodel/FinderGameProtocolUIC", "show", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V"); view9.setVisibility(((Integer) aVar.a(0)).intValue()); j30.a.e(view9, "com/tencent/mm/plugin/finder/live/viewmodel/FinderGameProtocolUIC", "show", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V"); } try { this.f8239f = "https://weixin.qq.com/cgi-bin/readtemplate?t=finder_live_game_agreement"; MMWebView mMWebView2 = this.f8241h; if (mMWebView2 != null) { mMWebView2.loadUrl("https://weixin.qq.com/cgi-bin/readtemplate?t=finder_live_game_agreement"); } this.f8247q.stopTimer(); this.f8238e = 6; this.f8247q.startTimer(1000); Button button3 = this.f8242i; if (button3 != null) { button3.setEnabled(false); } } catch (Exception e15) { Log.e(this.f8237d, e15.getMessage()); } } @Override // com.tencent.mm.ui.component.UIComponent public void onCreate(Bundle bundle) { super.onCreate(bundle); this.f8240g = findViewById(R.id.lcj); } @Override // y24.g, com.tencent.mm.ui.component.UIComponent public void onDestroy() { super.onDestroy(); this.f8247q.stopTimer(); MMWebView mMWebView = this.f8241h; if (mMWebView != null) { mMWebView.destroy(); } } }