package X; import android.content.Context; import android.text.Editable; import android.text.SpannableString; import android.text.TextUtils; import android.text.style.ForegroundColorSpan; import android.widget.TextView; import com.bytedance.covode.number.Covode; import com.ss.android.ugc.aweme.profile.ui.ProfileEditUsernameFragment; import com.zhiliaoapp.musically.R; import kotlin.g.b.m; /* renamed from: X.H2j reason: case insensitive filesystem */ public final class C43396H2j extends C42957Gtu { public final /* synthetic */ ProfileEditUsernameFragment LIZ; static { Covode.recordClassIndex(87934); } /* JADX WARN: Incorrect args count in method signature: ()V */ public C43396H2j(ProfileEditUsernameFragment profileEditUsernameFragment) { this.LIZ = profileEditUsernameFragment; } @Override // X.C42957Gtu public final void afterTextChanged(Editable editable) { String obj = this.LIZ.LIZJ().getText().toString(); boolean isEmpty = TextUtils.isEmpty(obj); if (isEmpty || this.LIZ.LJIIJJI) { this.LIZ.LJIIIIZZ.LIZIZ(); this.LIZ.LJIIJ.LIZ(""); } if (this.LIZ.LJIIJJI) { this.LIZ.LIZJ().setSelection(obj.length()); this.LIZ.LIZ(true, 3, (String) null); this.LIZ.LJIIJJI = false; return; } C72292t0 r0 = this.LIZ.LJII; if (r0 == null) { m.LIZIZ(); } r0.LIZ(null); this.LIZ.LIZ(false, 1, (String) null); if (!isEmpty) { this.LIZ.LJIIJ.LIZ(obj); } } @Override // X.C42957Gtu public final void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) { super.onTextChanged(charSequence, i2, i3, i4); this.LIZ.LIZ().setText("www.tiktok.com/"); TextView LIZ2 = this.LIZ.LIZ(); ProfileEditUsernameFragment profileEditUsernameFragment = this.LIZ; String obj = profileEditUsernameFragment.LIZJ().getText().toString(); C21090sc.LIZ(obj); if (m.LIZ((Object) obj, (Object) "")) { obj = "username"; } SpannableString spannableString = new SpannableString("@".concat(String.valueOf(obj))); Context context = profileEditUsernameFragment.getContext(); if (context == null) { m.LIZIZ(); } spannableString.setSpan(new ForegroundColorSpan(C017906e.LIZJ(context, R.color.c1)), 0, obj.length() + 1, 33); LIZ2.append(spannableString); boolean z = this.LIZ.LJIIJJI; } }