package r22; import android.content.Intent; import android.graphics.Bitmap; import android.text.SpannableString; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; import androidx.lifecycle.j0; import bw3.bv1; import bw3.cu4; import bw3.or1; import com.tencent.mm.R; import com.tencent.mm.plugin.finder.feed.ui.FinderEmojiSelectUI; import com.tencent.mm.plugin.finder.post.PostMainUIC; import com.tencent.mm.plugin.finder.view.FinderExtendReadingEditView; import com.tencent.mm.plugin.finder.view.p4; import com.tencent.mm.plugin.mmsight.segment.FFmpegMetadataRetriever; import com.tencent.mm.sdk.platformtools.MD5Util; import com.tencent.mm.sdk.platformtools.Util; import com.tencent.mm.ui.MMActivity; import com.tencent.mm.ui.tools.KeyboardHeightProvider; import com.tencent.mm.ui.tools.u0; import com.tencent.mm.ui.x4; import com.tencent.tinker.loader.hotplug.EnvConsts; import d32.ta; import d60.z; import dj1.a; import ez1.o2; import kh4.l; import kh4.p; import kv3.d0; import lh4.m; import lh4.o; import nx1.k0; import p64.w; import s02.j; import sk1.q; import t32.e2; import tt1.h0; import tt1.q0; import tt1.v0; import wg4.b0; import wg4.n; import y24.r; import zz1.j3; public final class d implements u0, sk1.i { /* renamed from: d reason: collision with root package name */ public final MMActivity f292831d; /* renamed from: e reason: collision with root package name */ public final l<Boolean, b0> f292832e; /* renamed from: f reason: collision with root package name */ public final p<String, Boolean, b0> f292833f; /* renamed from: g reason: collision with root package name */ public q f292834g; /* renamed from: h reason: collision with root package name */ public FinderExtendReadingEditView f292835h; /* renamed from: i reason: collision with root package name */ public final KeyboardHeightProvider f292836i; /* renamed from: j reason: collision with root package name */ public boolean f292837j = true; /* renamed from: n reason: collision with root package name */ public boolean f292838n; /* renamed from: o reason: collision with root package name */ public boolean f292839o; public static final class a extends o implements l<String, b0> { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ d f292840d; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public a(d dVar) { super(1); this.f292840d = dVar; } /* Return type fixed from 'java.lang.Object' to match base method */ /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */ @Override // kh4.l public b0 invoke(String str) { String str2 = str; m.g(str2, "link"); this.f292840d.f292833f.invoke(str2, Boolean.FALSE); return b0.f332794a; } } public static final class b extends o implements kh4.a<b0> { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ d f292841d; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public b(d dVar) { super(0); this.f292841d = dVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kh4.a public b0 invoke() { this.f292841d.a(); return b0.f332794a; } } public static final class c extends o implements kh4.a<b0> { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ d f292842d; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public c(d dVar) { super(0); this.f292842d = dVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kh4.a public b0 invoke() { d dVar = this.f292842d; String string = dVar.f292831d.getResources().getString(R.string.cmc); m.f(string, "activity.resources.getSt….string.finder_biz_essay)"); boolean z15 = false; String str = null; ij1.b a15 = a.C2191a.a(dj1.b.f200487e, r32.b.c(dVar.f292831d), false, 2, null); if (a15 != null) { str = a15.r2().R; } if (str == null || str.length() == 0) { z15 = true; } if (z15) { str = dVar.f292831d.getResources().getString(R.string.cme); } m.f(str, "if (articleTips.isNullOr… articleTips\n }"); String string2 = dVar.f292831d.getResources().getString(R.string.cmd); m.f(string2, "activity.resources.getSt…ng.finder_biz_essay_hint)"); dVar.c(string, str, string2); return b0.f332794a; } } /* renamed from: r22.d$d reason: collision with other inner class name */ public static final class C4859d extends o implements kh4.a<b0> { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ d f292843d; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public C4859d(d dVar) { super(0); this.f292843d = dVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kh4.a public b0 invoke() { boolean z15; d dVar = this.f292843d; dVar.getClass(); r rVar = r.f342954a; j0 a15 = rVar.c(dVar.f292831d).a(s02.g.class); m.f(a15, "UICProvider.of(activity)…PackCoverUIC::class.java)"); s02.g gVar = (s02.g) a15; if (!((Boolean) ((n) gVar.f298730d).getValue()).booleanValue() || gVar.f298731e == null) { z15 = false; } else { z15 = true; } if (z15) { e eVar = new e(dVar); f fVar = new f(dVar); cu4 cu4 = gVar.f298731e; if (cu4 != null) { w wVar = new w(gVar.getActivity()); View inflate = LayoutInflater.from(gVar.getActivity()).inflate(R.layout.f366297b61, (ViewGroup) null); ImageView imageView = (ImageView) inflate.findViewById(R.id.bzh); TextView textView = (TextView) inflate.findViewById(R.id.odf); ImageView imageView2 = (ImageView) inflate.findViewById(R.id.cl7); TextView textView2 = (TextView) inflate.findViewById(R.id.cjm); Button button = (Button) inflate.findViewById(R.id.f361845lf); TextView textView3 = (TextView) inflate.findViewById(R.id.ob5); if (imageView != null) { imageView.setOnClickListener(new s02.h(eVar, wVar)); } x4.n0(textView.getPaint()); k80.b<tt1.j0, Bitmap> b15 = ((v0) rVar.e(e2.class).c(v0.class)).C3().b(new q0(cu4.f18668d, j3.f357048e), ((v0) rVar.e(e2.class).c(v0.class)).W(h0.a.f315087z)); m.f(imageView2, "coverIv"); ((k80.a) b15).c(imageView2); String string = gVar.getActivity().getResources().getString(R.string.euw, Integer.valueOf(cu4.f18670f)); m.f(string, "activity.resources.getSt…over_count, cover.remain)"); if (textView2 != null) { textView2.setText(string); } if (button != null) { button.setOnClickListener(new s02.i(gVar, cu4, wVar)); } String string2 = gVar.getActivity().getResources().getString(R.string.eux); m.f(string2, "activity.resources.getSt…_add_red_pack_cover_tips)"); SpannableString spannableString = new SpannableString(string2); spannableString.setSpan(new p4(string2, gVar.getActivity().getResources().getColor(R.color.f357958a5), gVar.getActivity().getResources().getColor(R.color.a9e), false, false, new j(wVar, fVar)), string2.length() - 6, string2.length(), 17); if (textView3 != null) { textView3.setOnTouchListener(new d0(gVar.getActivity())); } if (textView3 != null) { textView3.setText(spannableString); } wVar.k(inflate); wVar.p(); } } else { dVar.b(); } return b0.f332794a; } } public static final class e extends o implements kh4.a<b0> { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ d f292844d; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public e(d dVar) { super(0); this.f292844d = dVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kh4.a public b0 invoke() { String str; d dVar = this.f292844d; MMActivity mMActivity = dVar.f292831d; q qVar = dVar.f292834g; m.g(mMActivity, EnvConsts.ACTIVITY_MANAGER_SRVNAME); Intent intent = new Intent(mMActivity, FinderEmojiSelectUI.class); if (qVar != null) { str = qVar.field_username; } else { str = null; } if (str == null) { str = r32.b.c(mMActivity); } intent.putExtra("finder_username", str); mMActivity.startActivityForResult(intent, 20004); bv1 l05 = ((ta) r.f342954a.c(mMActivity).a(ta.class)).l0(); l05.f17675i = 74; o2.f(o2.f210885a, l05, "button_post_choose_emoji", 1, null, false, 24, null); this.f292844d.a(); return b0.f332794a; } } public static final class f extends o implements kh4.a<b0> { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ d f292845d; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public f(d dVar) { super(0); this.f292845d = dVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kh4.a public b0 invoke() { this.f292845d.a(); return b0.f332794a; } } public static final class g extends o implements kh4.a<b0> { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ d f292846d; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public g(d dVar) { super(0); this.f292846d = dVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kh4.a public b0 invoke() { MMActivity mMActivity = this.f292846d.f292831d; m.g(mMActivity, EnvConsts.ACTIVITY_MANAGER_SRVNAME); String d15 = ((jt3.b) z.q(jt3.b.class)).gv0().d("FinderTencentVideoChooseLink"); if (Util.isNullOrNil(d15)) { d15 = "https://m.v.qq.com/video/selection/index.html"; } or1 or12 = ((PostMainUIC) r.f342954a.c(mMActivity).a(PostMainUIC.class)).u5().E; char c15 = '?'; boolean z15 = true; char c16 = '&'; if (or12 != null && or12.f32253d == 1) { StringBuilder sb5 = new StringBuilder(); sb5.append(d15); sb5.append('?' + ("businessType=" + or12 + "?.businessType")); d15 = sb5.toString(); c15 = '&'; } String str = or12 != null ? or12.f32254e : null; if (!(str == null || str.length() == 0)) { StringBuilder sb6 = new StringBuilder(); sb6.append(d15); sb6.append(c15 + ("cid=" + or12 + "?.cid")); d15 = sb6.toString(); c15 = '&'; } String str2 = or12 != null ? or12.f32255f : null; if (!(str2 == null || str2.length() == 0)) { z15 = false; } if (!z15) { StringBuilder sb7 = new StringBuilder(); sb7.append(d15); sb7.append(c15 + ("lid=" + or12 + "?.lid")); d15 = sb7.toString(); } else { c16 = c15; } String str3 = d15 + c16 + "callBackKey=" + MD5Util.getMD5String(d15); Intent intent = new Intent(); intent.putExtra("rawUrl", str3); sv3.b.j(mMActivity, "webview", ".ui.tools.WebViewUI", intent, null); this.f292846d.a(); return b0.f332794a; } } public static final class h extends o implements kh4.a<b0> { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ d f292847d; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public h(d dVar) { super(0); this.f292847d = dVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // kh4.a public b0 invoke() { this.f292847d.a(); return b0.f332794a; } } public static final class i implements Runnable { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ d f292848d; public i(d dVar) { this.f292848d = dVar; } public final void run() { FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1); View decorView = this.f292848d.f292831d.getWindow().getDecorView(); m.e(decorView, "null cannot be cast to non-null type android.widget.FrameLayout"); ((FrameLayout) decorView).addView(this.f292848d.f292835h, layoutParams); this.f292848d.f292835h.setVisibility(8); } } /* JADX DEBUG: Multi-variable search result rejected for r7v0, resolved type: kh4.l<? super java.lang.Boolean, wg4.b0> */ /* JADX DEBUG: Multi-variable search result rejected for r8v0, resolved type: kh4.p<? super java.lang.String, ? super java.lang.Boolean, wg4.b0> */ /* JADX WARN: Multi-variable type inference failed */ public d(MMActivity mMActivity, l<? super Boolean, b0> lVar, p<? super String, ? super Boolean, b0> pVar) { m.g(mMActivity, EnvConsts.ACTIVITY_MANAGER_SRVNAME); m.g(lVar, "changeEditViewCallback"); m.g(pVar, "doVerify"); this.f292831d = mMActivity; this.f292832e = lVar; this.f292833f = pVar; KeyboardHeightProvider keyboardHeightProvider = new KeyboardHeightProvider(mMActivity); this.f292836i = keyboardHeightProvider; this.f292834g = sk1.d.f302423a.b(r32.b.c(mMActivity)); keyboardHeightProvider.f186156b = this; FinderExtendReadingEditView finderExtendReadingEditView = new FinderExtendReadingEditView(mMActivity); this.f292835h = finderExtendReadingEditView; a aVar = new a(this); b bVar = new b(this); finderExtendReadingEditView.f120118d = aVar; finderExtendReadingEditView.f120119e = bVar; k0 k0Var = (k0) r.f342954a.c(mMActivity).a(k0.class); FinderExtendReadingEditView finderExtendReadingEditView2 = this.f292835h; k0Var.getClass(); m.g(finderExtendReadingEditView2, "view"); k0Var.f273291d = finderExtendReadingEditView2; k0Var.k5(); c cVar = new c(this); C4859d dVar = new C4859d(this); e eVar = new e(this); f fVar = new f(this); g gVar = new g(this); h hVar = new h(this); k0Var.f273296i = cVar; k0Var.f273297j = dVar; k0Var.f273298n = eVar; k0Var.f273299o = fVar; k0Var.f273300p = gVar; k0Var.f273301q = hVar; mMActivity.getWindow().getDecorView().post(new i(this)); } @Override // com.tencent.mm.ui.tools.u0 public void K1(int i15, boolean z15) { ViewGroup.LayoutParams layoutParams = this.f292835h.getLayoutParams(); m.e(layoutParams, "null cannot be cast to non-null type android.widget.FrameLayout.LayoutParams"); if (((FrameLayout.LayoutParams) layoutParams).bottomMargin != i15) { h hVar = new h(this, i15); if (i15 != 0) { hVar.setDuration(200); } else { hVar.setDuration(300); } this.f292835h.startAnimation(hVar); } this.f292835h.setVisibility(0); } public final void a() { this.f292832e.invoke(Boolean.FALSE); this.f292838n = false; this.f292836i.d(); this.f292831d.hideVKB(); if (this.f292839o) { FinderExtendReadingEditView finderExtendReadingEditView = this.f292835h; finderExtendReadingEditView.f120127p.setVisibility(0); finderExtendReadingEditView.f120126o.setVisibility(8); finderExtendReadingEditView.f120123i.setVisibility(8); finderExtendReadingEditView.f120124j.setVisibility(8); finderExtendReadingEditView.f120121g.setVisibility(8); finderExtendReadingEditView.f120122h.setText(finderExtendReadingEditView.getContext().getResources().getString(R.string.f368156li2)); } this.f292835h.setVisibility(8); ViewGroup.LayoutParams layoutParams = this.f292835h.getLayoutParams(); m.e(layoutParams, "null cannot be cast to non-null type android.widget.FrameLayout.LayoutParams"); FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) layoutParams; layoutParams2.bottomMargin = 0; this.f292835h.setLayoutParams(layoutParams2); } public final void b() { String string = this.f292831d.getResources().getString(R.string.f1n); m.f(string, "activity.resources.getSt…ing.finder_redpack_cover)"); String string2 = this.f292831d.getResources().getString(R.string.f1o); m.f(string2, "activity.resources.getSt…inder_redpack_cover_hint)"); c(string, "", string2); } public final void c(String str, String str2, String str3) { m.g(str, FFmpegMetadataRetriever.METADATA_KEY_TITLE); m.g(str2, "titleTips"); m.g(str3, "hint"); this.f292839o = true; FinderExtendReadingEditView finderExtendReadingEditView = this.f292835h; finderExtendReadingEditView.getClass(); finderExtendReadingEditView.f120127p.setVisibility(8); finderExtendReadingEditView.f120126o.setVisibility(0); finderExtendReadingEditView.f120123i.setVisibility(0); finderExtendReadingEditView.f120121g.setVisibility(0); finderExtendReadingEditView.f120122h.setText(str); finderExtendReadingEditView.f120126o.setText(str2); finderExtendReadingEditView.f120123i.setText(""); finderExtendReadingEditView.f120123i.setHint(str3); finderExtendReadingEditView.f120126o.setTextColor(finderExtendReadingEditView.getContext().getResources().getColor(R.color.FG_1)); if (this.f292837j) { this.f292835h.post(new g(this)); } this.f292836i.e(); this.f292835h.f120123i.requestFocus(); this.f292831d.showVKB(); } @Override // sk1.i public void h0(ij1.b bVar) { m.g(bVar, "account"); this.f292834g = sk1.d.f302423a.b(r32.b.c(this.f292831d)); } }