CheetahGram v8.5.4版本的 MD5 值为:3d14e79cc242c314d3933620ff3ab030
以下内容为反编译后的 ff.java 源代码,内容仅作参考
package org.telegram.ui;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.StateListAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.BlendMode;
import android.graphics.Canvas;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.os.SystemClock;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.style.CharacterStyle;
import android.util.Property;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.ViewTreeObserver;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.u;
import androidx.viewpager.widget.b;
import co.cheetah.gram.R;
import com.batch.android.msgpack.core.h;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.ApplicationLoader;
import org.telegram.messenger.BuildVars;
import org.telegram.messenger.DownloadController;
import org.telegram.messenger.FileLoader;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.ImageLoader;
import org.telegram.messenger.ImageLocation;
import org.telegram.messenger.ImageReceiver;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.MediaController;
import org.telegram.messenger.MediaDataController;
import org.telegram.messenger.MessageObject;
import org.telegram.messenger.MessagesController;
import org.telegram.messenger.MessagesStorage;
import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.SharedConfig;
import org.telegram.messenger.SvgHelper;
import org.telegram.messenger.UserConfig;
import org.telegram.messenger.Utilities;
import org.telegram.messenger.p110.an6;
import org.telegram.messenger.p110.au5;
import org.telegram.messenger.p110.b36;
import org.telegram.messenger.p110.b87;
import org.telegram.messenger.p110.cu6;
import org.telegram.messenger.p110.d17;
import org.telegram.messenger.p110.dl6;
import org.telegram.messenger.p110.ea5;
import org.telegram.messenger.p110.ed0;
import org.telegram.messenger.p110.es1;
import org.telegram.messenger.p110.f27;
import org.telegram.messenger.p110.fd0;
import org.telegram.messenger.p110.fn6;
import org.telegram.messenger.p110.fp6;
import org.telegram.messenger.p110.fu;
import org.telegram.messenger.p110.g52;
import org.telegram.messenger.p110.ga5;
import org.telegram.messenger.p110.gu;
import org.telegram.messenger.p110.gz6;
import org.telegram.messenger.p110.i95;
import org.telegram.messenger.p110.jj0;
import org.telegram.messenger.p110.l46;
import org.telegram.messenger.p110.l97;
import org.telegram.messenger.p110.lg5;
import org.telegram.messenger.p110.m27;
import org.telegram.messenger.p110.me4;
import org.telegram.messenger.p110.o76;
import org.telegram.messenger.p110.oe5;
import org.telegram.messenger.p110.op4;
import org.telegram.messenger.p110.ov5;
import org.telegram.messenger.p110.pc5;
import org.telegram.messenger.p110.pe5;
import org.telegram.messenger.p110.qb5;
import org.telegram.messenger.p110.qc5;
import org.telegram.messenger.p110.r86;
import org.telegram.messenger.p110.rr1;
import org.telegram.messenger.p110.s76;
import org.telegram.messenger.p110.sg3;
import org.telegram.messenger.p110.sp5;
import org.telegram.messenger.p110.st2;
import org.telegram.messenger.p110.t72;
import org.telegram.messenger.p110.tv5;
import org.telegram.messenger.p110.u95;
import org.telegram.messenger.p110.uk6;
import org.telegram.messenger.p110.v66;
import org.telegram.messenger.p110.vt5;
import org.telegram.messenger.p110.ww0;
import org.telegram.messenger.p110.xs3;
import org.telegram.messenger.p110.xt5;
import org.telegram.messenger.p110.y76;
import org.telegram.messenger.p110.zo6;
import org.telegram.messenger.p110.zq0;
import org.telegram.tgnet.ConnectionsManager;
import org.telegram.tgnet.RequestDelegate;
import org.telegram.ui.ActionBar.a;
import org.telegram.ui.ActionBar.a0;
import org.telegram.ui.ActionBar.d;
import org.telegram.ui.ActionBar.i;
import org.telegram.ui.ActionBar.w;
import org.telegram.ui.Cif;
import org.telegram.ui.Components.ColorPicker;
import org.telegram.ui.Components.UndoView;
import org.telegram.ui.Components.h6;
import org.telegram.ui.Components.k9;
import org.telegram.ui.Components.o;
import org.telegram.ui.Components.p6;
import org.telegram.ui.ff;
import uk.co.chrisjenx.calligraphy.BuildConfig;
public class ff extends org.telegram.ui.ActionBar.k implements DownloadController.FileDownloadProgressListener, NotificationCenter.NotificationCenterDelegate {
private int A;
private FrameLayout A0;
private Bitmap A1;
private int B;
private org.telegram.ui.Components.h6 B0;
private float B1;
private i0 C0;
private TextView C1;
private org.telegram.messenger.p110.pf D0;
private Object D1;
private FrameLayout E0;
private Bitmap E1;
private FrameLayout F0;
private boolean F1;
private int G;
private es1 G0;
private boolean G1;
private int H;
private AnimatorSet H0;
private boolean H1;
private int I;
private me4 I0;
private boolean I1;
private boolean J;
private FrameLayout J0;
private boolean J1;
private FrameLayout K0;
private String K1;
private FrameLayout L0;
private int L1;
private ImageView M0;
private k0 M1;
private ImageView N0;
private AnimatorSet O0;
private AnimatorSet P0;
private long Q;
private org.telegram.ui.Components.j9[] Q0;
private long R;
private org.telegram.ui.Components.j9[] R0;
private long S;
private FrameLayout[] S0;
private long T;
private TextView[] T0;
private float U;
private TextView[] U0;
private String V;
private FrameLayout[] V0;
private int W;
private org.telegram.ui.Components.h6 W0;
private long X;
private j0 X0;
private ViewTreeObserver.OnGlobalLayoutListener Y;
private androidx.recyclerview.widget.o Y0;
w.p Z;
private rr1 Z0;
w.p a0;
private org.telegram.ui.Components.p6 a1;
w.p b0;
private ArrayList<Object> b1;
w.p c0;
private HashMap<Long, Object> c1;
private ColorPicker d0;
private d17 d1;
private int e0;
private d17 e1;
private int f0;
private d17 f1;
private Runnable g0;
private int g1;
private boolean h0;
private int h1;
private View i0;
private int i1;
private FrameLayout j0;
private int j1;
private TextView k0;
private int k1;
private TextView l0;
private int l1;
private w.v m0;
private int m1;
private boolean n0;
private int n1;
private boolean o0;
private int o1;
private boolean p0;
private int p1;
private final int q;
private List<org.telegram.ui.ActionBar.a0> q0;
private int q1;
public boolean r;
private androidx.viewpager.widget.b r0;
private int r1;
private org.telegram.ui.ActionBar.d s;
private FrameLayout s0;
private float s1;
private org.telegram.ui.ActionBar.d t;
private UndoView t0;
private float t1;
private TextView u;
private FrameLayout u0;
private AnimatorSet u1;
private int v;
private org.telegram.ui.Components.h6 v0;
private final PorterDuff.Mode v1;
private Drawable w;
private h0 w0;
private int w1;
private w.u x;
private ImageView x0;
private o.c x1;
private boolean y;
private boolean y0;
private org.telegram.ui.Components.k9 y1;
private int z;
private org.telegram.ui.ActionBar.a z0;
private Bitmap z1;
class a extends u.t {
a() {
}
@Override
public void a(androidx.recyclerview.widget.u uVar, int i) {
if (i == 0) {
ff.this.y0 = false;
}
}
@Override
public void b(androidx.recyclerview.widget.u uVar, int i, int i2) {
ff.this.B0.G2();
ff.this.y0 = true;
}
}
class a0 extends ViewOutlineProvider {
a0(ff ffVar) {
}
@Override
@SuppressLint({"NewApi"})
public void getOutline(View view, Outline outline) {
outline.setOval(0, 0, AndroidUtilities.dp(56.0f), AndroidUtilities.dp(56.0f));
}
}
class b extends FrameLayout {
b(ff ffVar, Context context) {
super(context);
}
@Override
public void onDraw(Canvas canvas) {
int intrinsicHeight = org.telegram.ui.ActionBar.w.H2.getIntrinsicHeight();
org.telegram.ui.ActionBar.w.H2.setBounds(0, 0, getMeasuredWidth(), intrinsicHeight);
org.telegram.ui.ActionBar.w.H2.draw(canvas);
canvas.drawRect(0.0f, intrinsicHeight, getMeasuredWidth(), getMeasuredHeight(), org.telegram.ui.ActionBar.w.X1);
}
}
class b0 extends FrameLayout {
private boolean a;
b0(Context context) {
super(context);
}
@Override
protected boolean drawChild(Canvas canvas, View view, long j) {
boolean drawChild = super.drawChild(canvas, view, j);
if (view == ff.this.z0 && ((org.telegram.ui.ActionBar.k) ff.this).f != null) {
((org.telegram.ui.ActionBar.k) ff.this).f.Z(canvas, ff.this.z0.getVisibility() == 0 ? (int) (ff.this.z0.getMeasuredHeight() + ff.this.z0.getTranslationY()) : 0);
}
return drawChild;
}
@Override
protected void onMeasure(int i, int i2) {
TextView textView;
float f;
int size = View.MeasureSpec.getSize(i);
int size2 = View.MeasureSpec.getSize(i2);
setMeasuredDimension(size, size2);
if (ff.this.s != null) {
this.a = true;
if (!AndroidUtilities.isTablet()) {
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) ff.this.s.getLayoutParams();
layoutParams.topMargin = Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0;
ff.this.s.setLayoutParams(layoutParams);
}
if (AndroidUtilities.isTablet() || ApplicationLoader.applicationContext.getResources().getConfiguration().orientation != 2) {
textView = ff.this.u;
f = 20.0f;
} else {
textView = ff.this.u;
f = 18.0f;
}
textView.setTextSize(1, f);
this.a = false;
}
measureChildWithMargins(ff.this.z0, i, 0, i2, 0);
int measuredHeight = ff.this.z0.getMeasuredHeight();
if (ff.this.z0.getVisibility() == 0) {
size2 -= measuredHeight;
}
FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) ff.this.B0.getLayoutParams();
layoutParams2.topMargin = measuredHeight;
ff.this.B0.measure(View.MeasureSpec.makeMeasureSpec(size, 1073741824), View.MeasureSpec.makeMeasureSpec(size2 - layoutParams2.bottomMargin, 1073741824));
((FrameLayout.LayoutParams) ff.this.D0.getLayoutParams()).topMargin = measuredHeight;
ff.this.D0.measure(View.MeasureSpec.makeMeasureSpec(size, 1073741824), View.MeasureSpec.makeMeasureSpec(size2, 1073741824));
if (ff.this.J0 != null) {
measureChildWithMargins(ff.this.J0, i, 0, i2, 0);
}
for (int i3 = 0; i3 < ff.this.S0.length; i3++) {
if (ff.this.S0[i3] != null) {
measureChildWithMargins(ff.this.S0[i3], i, 0, i2, 0);
}
}
}
@Override
public void requestLayout() {
if (this.a) {
return;
}
super.requestLayout();
}
}
class c extends FrameLayout {
private RectF a;
c(Context context) {
super(context);
this.a = new RectF();
}
@Override
protected void onDraw(Canvas canvas) {
this.a.set(0.0f, 0.0f, getMeasuredWidth(), getMeasuredHeight());
org.telegram.ui.ActionBar.w.a0(ff.this.K0, ff.this.D0);
canvas.drawRoundRect(this.a, getMeasuredHeight() / 2, getMeasuredHeight() / 2, org.telegram.ui.ActionBar.w.R1);
if (org.telegram.ui.ActionBar.w.m2()) {
canvas.drawRoundRect(this.a, getMeasuredHeight() / 2, getMeasuredHeight() / 2, org.telegram.ui.ActionBar.w.V1);
}
}
}
class c0 extends a.h {
class a extends org.telegram.ui.Components.r6 {
a(Context context, ArrayList arrayList, String str, boolean z, String str2, boolean z2) {
super(context, arrayList, str, z, str2, z2);
}
@Override
protected void o2(androidx.collection.d<ea5> dVar, int i) {
if (dVar.size() == 1) {
ff.this.t0.z(dVar.valueAt(0).p, 61, Integer.valueOf(i));
} else {
ff.this.t0.A(0L, 61, Integer.valueOf(i), Integer.valueOf(dVar.size()), null, null);
}
}
}
c0() {
}
@Override
public void b(int i) {
w.u A;
String b;
int i2 = 0;
if (i == -1) {
if (ff.this.V3()) {
ff.this.U3(false);
return;
}
return;
}
if (i >= 1 && i <= 3) {
ff.this.D4(i);
return;
}
if (i == 4) {
if (ff.this.y) {
org.telegram.ui.ActionBar.w.T2(false);
}
File b2 = ff.this.x.b();
if (b2 != null) {
b2.delete();
}
ff.this.x.o = ff.this.d1 != null ? ff.this.d1.h : BuildConfig.FLAVOR;
ff.this.x.p = ff.this.s1;
ff.this.x.q = ff.this.G1;
if (((int) ff.this.x.j) == 0) {
ff.this.x.j = 4294967296L;
}
if (((int) ff.this.x.k) == 0) {
ff.this.x.k = 4294967296L;
}
if (((int) ff.this.x.l) == 0) {
ff.this.x.l = 4294967296L;
}
if (((int) ff.this.x.m) == 0) {
ff.this.x.m = 4294967296L;
}
ff.this.B4();
NotificationCenter.getGlobalInstance().removeObserver(ff.this, NotificationCenter.wallpapersDidLoad);
org.telegram.ui.ActionBar.w.Y2(ff.this.m0, true, false, false, true);
org.telegram.ui.ActionBar.w.W();
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, ff.this.m0, Boolean.valueOf(ff.this.n0), null, -1);
ff.this.D();
return;
}
if (i != 5 || ff.this.c0() == null) {
return;
}
StringBuilder sb = new StringBuilder();
if (ff.this.H1) {
sb.append("blur");
}
if (ff.this.G1) {
if (sb.length() > 0) {
sb.append("+");
}
sb.append("motion");
}
if (ff.this.D1 instanceof d17) {
b = "https://" + MessagesController.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).linkPrefix + "/bg/" + ((d17) ff.this.D1).h;
if (sb.length() > 0) {
b = b + "?mode=" + sb.toString();
}
} else if (ff.this.D1 instanceof Cif.i) {
Cif.i iVar = new Cif.i(ff.this.d1 != null ? ff.this.d1.h : "c", ff.this.g1, ff.this.i1, ff.this.j1, ff.this.k1, ff.this.o1, ff.this.s1, ff.this.G1, null);
iVar.h = ff.this.d1;
b = iVar.b();
} else {
if (!BuildVars.DEBUG_PRIVATE_VERSION || (A = org.telegram.ui.ActionBar.w.i1().A(false)) == null) {
return;
}
Cif.i iVar2 = new Cif.i(A.o, (int) A.j, (int) A.k, (int) A.l, (int) A.m, A.n, A.p, A.q, null);
int size = ff.this.b1.size();
while (true) {
if (i2 >= size) {
break;
}
d17 d17Var = (d17) ff.this.b1.get(i2);
if (d17Var.e && A.o.equals(d17Var.h)) {
iVar2.h = d17Var;
break;
}
i2++;
}
b = iVar2.b();
}
String str = b;
ff.this.o1(new a(ff.this.c0(), null, str, false, str, false));
}
}
class d implements View.OnClickListener {
int a = 0;
d() {
}
@Override
public void onClick(View view) {
Drawable background = ff.this.D0.getBackground();
ff.this.M0.setRotation(this.a);
this.a -= 45;
ff.this.M0.animate().rotationBy(-45.0f).setDuration(300L).setInterpolator(zq0.g).start();
if (background instanceof sg3) {
((sg3) background).H();
} else {
ff.this.A4();
}
}
}
class d0 extends org.telegram.messenger.p110.pf {
private Drawable d;
d0(Context context) {
super(context);
}
@Override
public Drawable getBackground() {
return this.d;
}
@Override
public void onDraw(Canvas canvas) {
Drawable drawable = this.d;
if (!(drawable instanceof ColorDrawable) && !(drawable instanceof GradientDrawable) && !(drawable instanceof sg3)) {
if (drawable instanceof BitmapDrawable) {
if (((BitmapDrawable) drawable).getTileModeX() == Shader.TileMode.REPEAT) {
canvas.save();
float f = 2.0f / AndroidUtilities.density;
canvas.scale(f, f);
this.d.setBounds(0, 0, (int) Math.ceil(getMeasuredWidth() / f), (int) Math.ceil(getMeasuredHeight() / f));
this.d.draw(canvas);
canvas.restore();
} else {
int measuredHeight = getMeasuredHeight();
float max = Math.max(getMeasuredWidth() / this.d.getIntrinsicWidth(), measuredHeight / this.d.getIntrinsicHeight());
int ceil = (int) Math.ceil(this.d.getIntrinsicWidth() * max * ff.this.B1);
int ceil2 = (int) Math.ceil(this.d.getIntrinsicHeight() * max * ff.this.B1);
int measuredWidth = (getMeasuredWidth() - ceil) / 2;
int i = (measuredHeight - ceil2) / 2;
this.d.setBounds(measuredWidth, i, ceil + measuredWidth, ceil2 + i);
}
}
super.onDraw(canvas);
if (ff.this.J1 || ff.this.I0 == null) {
}
ff.this.I0.a(canvas);
return;
}
drawable.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
this.d.draw(canvas);
super.onDraw(canvas);
if (ff.this.J1) {
}
}
@Override
protected void onMeasure(int i, int i2) {
super.onMeasure(i, i2);
ff ffVar = ff.this;
ffVar.B1 = ffVar.y1.a(getMeasuredWidth(), getMeasuredHeight());
if (ff.this.G1) {
setScaleX(ff.this.B1);
setScaleY(ff.this.B1);
}
if (ff.this.I0 != null) {
int dp = AndroidUtilities.dp(44.0f);
int measuredWidth = (getMeasuredWidth() - dp) / 2;
int measuredHeight = (getMeasuredHeight() - dp) / 2;
ff.this.I0.E(measuredWidth, measuredHeight, measuredWidth + dp, dp + measuredHeight);
}
ff ffVar2 = ff.this;
ffVar2.J1 = ffVar2.q == 2 && getMeasuredWidth() <= getMeasuredHeight();
}
@Override
public void setAlpha(float f) {
if (ff.this.I0 != null) {
ff.this.I0.A(f);
}
}
@Override
public void setBackground(Drawable drawable) {
this.d = drawable;
}
}
class e extends FrameLayout {
private RectF a;
e(Context context) {
super(context);
this.a = new RectF();
}
@Override
protected void onDraw(Canvas canvas) {
this.a.set(0.0f, 0.0f, getMeasuredWidth(), getMeasuredHeight());
org.telegram.ui.ActionBar.w.a0(ff.this.L0, ff.this.D0);
canvas.drawRoundRect(this.a, getMeasuredHeight() / 2, getMeasuredHeight() / 2, org.telegram.ui.ActionBar.w.R1);
if (org.telegram.ui.ActionBar.w.m2()) {
canvas.drawRoundRect(this.a, getMeasuredHeight() / 2, getMeasuredHeight() / 2, org.telegram.ui.ActionBar.w.V1);
}
}
}
class e0 extends org.telegram.ui.ActionBar.d {
e0(Context context, org.telegram.ui.ActionBar.b bVar, int i, int i2) {
super(context, bVar, i, i2);
}
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
accessibilityNodeInfo.setText(ff.this.u.getText());
}
}
class f implements View.OnClickListener {
int a = 0;
f() {
}
@Override
public void onClick(View view) {
ff.this.N0.setRotation(this.a);
this.a -= 45;
ff.this.N0.animate().rotationBy(-45.0f).setDuration(300L).setInterpolator(zq0.g).start();
if (ff.this.x.i) {
if (ff.this.Z.k() != null) {
ff.this.Z.k().H();
return;
}
return;
}
if (ff.this.x.h != 0) {
int i = ff.this.x.e != 0 ? ff.this.x.e : ff.this.x.c;
ff.this.x.e = ff.this.x.f;
ff.this.x.f = ff.this.x.g;
ff.this.x.g = ff.this.x.h;
ff.this.x.h = i;
} else {
int i2 = ff.this.x.e != 0 ? ff.this.x.e : ff.this.x.c;
ff.this.x.e = ff.this.x.f;
ff.this.x.f = ff.this.x.g;
ff.this.x.g = i2;
}
ff.this.d0.J(ff.this.x.h, 3);
ff.this.d0.J(ff.this.x.g, 2);
ff.this.d0.J(ff.this.x.f, 1);
ff.this.d0.J(ff.this.x.e != 0 ? ff.this.x.e : ff.this.x.c, 0);
ff.this.R0[1].g(0, ff.this.x.e);
ff.this.R0[1].g(1, ff.this.x.f);
ff.this.R0[1].g(2, ff.this.x.g);
ff.this.R0[1].g(3, ff.this.x.h);
org.telegram.ui.ActionBar.w.Q2(true, true);
ff.this.B0.G2();
}
}
class f0 extends org.telegram.ui.Components.h6 {
f0(Context context) {
super(context);
}
private void V2(MotionEvent motionEvent) {
if (motionEvent.getAction() == 1) {
if (!ff.this.y0 && (ff.this.D1 instanceof Cif.i) && ff.this.S0[0].getVisibility() == 0) {
ff.this.M4(0, false, true);
}
ff.this.y0 = false;
}
}
@Override
public void K2(View view, float f, float f2, boolean z) {
if (z && (view instanceof ed0) && !((ed0) view).m3(f, f2)) {
return;
}
super.K2(view, f, f2, z);
}
@Override
public boolean drawChild(Canvas canvas, View view, long j) {
u.d0 l0;
boolean drawChild = super.drawChild(canvas, view, j);
if (view instanceof ed0) {
ed0 ed0Var = (ed0) view;
ed0Var.getMessageObject();
ImageReceiver avatarImage = ed0Var.getAvatarImage();
if (avatarImage != null) {
int top = view.getTop();
if (ed0Var.q3() && (l0 = ff.this.B0.l0(view)) != null) {
if (ff.this.B0.Z(l0.j() - 1) != null) {
avatarImage.setImageY(-AndroidUtilities.dp(1000.0f));
avatarImage.draw(canvas);
return drawChild;
}
}
float translationX = ed0Var.getTranslationX();
int top2 = view.getTop() + ed0Var.getLayoutHeight();
int measuredHeight = ff.this.B0.getMeasuredHeight() - ff.this.B0.getPaddingBottom();
if (top2 > measuredHeight) {
top2 = measuredHeight;
}
if (ed0Var.r3() && (r9 = ff.this.B0.l0(view)) != null) {
int i = 0;
while (i < 20) {
i++;
u.d0 l02 = ff.this.B0.Z(l02.j() + 1);
if (l02 == null) {
break;
}
top = l02.a.getTop();
if (top2 - AndroidUtilities.dp(48.0f) < l02.a.getBottom()) {
translationX = Math.min(l02.a.getTranslationX(), translationX);
}
View view2 = l02.a;
if (!(view2 instanceof ed0) || !((ed0) view2).r3()) {
break;
}
}
}
if (top2 - AndroidUtilities.dp(48.0f) < top) {
top2 = top + AndroidUtilities.dp(48.0f);
}
if (translationX != 0.0f) {
canvas.save();
canvas.translate(translationX, 0.0f);
}
avatarImage.setImageY(top2 - AndroidUtilities.dp(44.0f));
avatarImage.draw(canvas);
if (translationX != 0.0f) {
canvas.restore();
}
}
}
return drawChild;
}
@Override
public boolean o2(View view) {
u.d0 U = ff.this.B0.U(view);
if (U == null || U.l() != 2) {
return super.o2(view);
}
return false;
}
@Override
public boolean onTouchEvent(MotionEvent motionEvent) {
V2(motionEvent);
return super.onTouchEvent(motionEvent);
}
@Override
public void setTranslationY(float f) {
super.setTranslationY(f);
if (ff.this.Q0 != null) {
for (int i = 0; i < ff.this.Q0.length; i++) {
ff.this.Q0[i].invalidate();
}
}
if (ff.this.R0 != null) {
for (int i2 = 0; i2 < ff.this.R0.length; i2++) {
ff.this.R0[i2].invalidate();
}
}
if (ff.this.K0 != null) {
ff.this.K0.invalidate();
}
if (ff.this.L0 != null) {
ff.this.L0.invalidate();
}
}
}
class g extends FrameLayout {
final int a;
final Rect b;
g(Context context, int i, Rect rect) {
super(context);
this.a = i;
this.b = rect;
}
@Override
public void onDraw(Canvas canvas) {
Drawable drawable;
int i;
int measuredWidth;
if (this.a == 0) {
drawable = ff.this.w;
i = ff.this.d0.getLeft() - this.b.left;
measuredWidth = ff.this.d0.getRight();
} else {
drawable = ff.this.w;
i = -this.b.left;
measuredWidth = getMeasuredWidth();
}
drawable.setBounds(i, 0, measuredWidth + this.b.right, getMeasuredHeight());
ff.this.w.draw(canvas);
}
}
class g0 extends androidx.recyclerview.widget.h {
g0() {
}
@Override
protected void k0(u.d0 d0Var) {
ff.this.B0.G2();
}
}
class h extends FrameLayout {
h(ff ffVar, Context context) {
super(context);
}
@Override
public void onDraw(Canvas canvas) {
int intrinsicHeight = org.telegram.ui.ActionBar.w.H2.getIntrinsicHeight();
org.telegram.ui.ActionBar.w.H2.setBounds(0, 0, getMeasuredWidth(), intrinsicHeight);
org.telegram.ui.ActionBar.w.H2.draw(canvas);
canvas.drawRect(0.0f, intrinsicHeight, getMeasuredWidth(), getMeasuredHeight(), org.telegram.ui.ActionBar.w.X1);
}
}
public static class h0 extends h6.s {
private Context c;
private ArrayList<ww0.e> d = new ArrayList<>();
public h0(Context context) {
this.c = context;
int currentTimeMillis = (int) (System.currentTimeMillis() / 1000);
ww0.e eVar = new ww0.e();
eVar.a = LocaleController.getString("ThemePreviewDialog1", R.string.ThemePreviewDialog1);
eVar.b = LocaleController.getString("ThemePreviewDialogMessage1", R.string.ThemePreviewDialogMessage1);
eVar.c = 0;
eVar.d = 0;
eVar.e = true;
eVar.f = false;
eVar.g = 0;
eVar.h = currentTimeMillis;
eVar.i = false;
eVar.j = false;
eVar.k = true;
this.d.add(eVar);
ww0.e eVar2 = new ww0.e();
eVar2.a = LocaleController.getString("ThemePreviewDialog2", R.string.ThemePreviewDialog2);
eVar2.b = LocaleController.getString("ThemePreviewDialogMessage2", R.string.ThemePreviewDialogMessage2);
eVar2.c = 1;
eVar2.d = 2;
eVar2.e = false;
eVar2.f = false;
eVar2.g = 0;
eVar2.h = currentTimeMillis - 3600;
eVar2.i = false;
eVar2.j = false;
eVar2.k = false;
this.d.add(eVar2);
ww0.e eVar3 = new ww0.e();
eVar3.a = LocaleController.getString("ThemePreviewDialog3", R.string.ThemePreviewDialog3);
eVar3.b = LocaleController.getString("ThemePreviewDialogMessage3", R.string.ThemePreviewDialogMessage3);
eVar3.c = 2;
eVar3.d = 3;
eVar3.e = false;
eVar3.f = true;
eVar3.g = 0;
eVar3.h = currentTimeMillis - 7200;
eVar3.i = false;
eVar3.j = true;
eVar3.k = false;
this.d.add(eVar3);
ww0.e eVar4 = new ww0.e();
eVar4.a = LocaleController.getString("ThemePreviewDialog4", R.string.ThemePreviewDialog4);
eVar4.b = LocaleController.getString("ThemePreviewDialogMessage4", R.string.ThemePreviewDialogMessage4);
eVar4.c = 3;
eVar4.d = 0;
eVar4.e = false;
eVar4.f = false;
eVar4.g = 2;
eVar4.h = currentTimeMillis - 10800;
eVar4.i = false;
eVar4.j = false;
eVar4.k = false;
this.d.add(eVar4);
ww0.e eVar5 = new ww0.e();
eVar5.a = LocaleController.getString("ThemePreviewDialog5", R.string.ThemePreviewDialog5);
eVar5.b = LocaleController.getString("ThemePreviewDialogMessage5", R.string.ThemePreviewDialogMessage5);
eVar5.c = 4;
eVar5.d = 0;
eVar5.e = false;
eVar5.f = false;
eVar5.g = 1;
eVar5.h = currentTimeMillis - 14400;
eVar5.i = false;
eVar5.j = false;
eVar5.k = true;
this.d.add(eVar5);
ww0.e eVar6 = new ww0.e();
eVar6.a = LocaleController.getString("ThemePreviewDialog6", R.string.ThemePreviewDialog6);
eVar6.b = LocaleController.getString("ThemePreviewDialogMessage6", R.string.ThemePreviewDialogMessage6);
eVar6.c = 5;
eVar6.d = 0;
eVar6.e = false;
eVar6.f = false;
eVar6.g = 0;
eVar6.h = currentTimeMillis - 18000;
eVar6.i = false;
eVar6.j = false;
eVar6.k = false;
this.d.add(eVar6);
ww0.e eVar7 = new ww0.e();
eVar7.a = LocaleController.getString("ThemePreviewDialog7", R.string.ThemePreviewDialog7);
eVar7.b = LocaleController.getString("ThemePreviewDialogMessage7", R.string.ThemePreviewDialogMessage7);
eVar7.c = 6;
eVar7.d = 0;
eVar7.e = false;
eVar7.f = false;
eVar7.g = 0;
eVar7.h = currentTimeMillis - 21600;
eVar7.i = true;
eVar7.j = false;
eVar7.k = false;
this.d.add(eVar7);
ww0.e eVar8 = new ww0.e();
eVar8.a = LocaleController.getString("ThemePreviewDialog8", R.string.ThemePreviewDialog8);
eVar8.b = LocaleController.getString("ThemePreviewDialogMessage8", R.string.ThemePreviewDialogMessage8);
eVar8.c = 0;
eVar8.d = 0;
eVar8.e = false;
eVar8.f = false;
eVar8.g = 0;
eVar8.h = currentTimeMillis - 25200;
eVar8.i = true;
eVar8.j = false;
eVar8.k = false;
this.d.add(eVar8);
}
@Override
public boolean G(u.d0 d0Var) {
return d0Var.l() != 1;
}
@Override
public int e() {
return this.d.size();
}
@Override
public int g(int i) {
return i == this.d.size() ? 1 : 0;
}
@Override
public void u(u.d0 d0Var, int i) {
if (d0Var.l() == 0) {
ww0 ww0Var = (ww0) d0Var.a;
ww0Var.E0 = i != e() - 1;
ww0Var.setDialog(this.d.get(i));
}
}
@Override
public u.d0 w(ViewGroup viewGroup, int i) {
View ww0Var = i == 0 ? new ww0(null, this.c, false, false) : new t72(this.c);
ww0Var.setLayoutParams(new u.p(-1, -2));
return new h6.j(ww0Var);
}
}
class i extends org.telegram.ui.Components.h6 {
i(ff ffVar, Context context) {
super(context);
}
@Override
public boolean onTouchEvent(MotionEvent motionEvent) {
if (motionEvent.getAction() == 0) {
getParent().requestDisallowInterceptTouchEvent(true);
}
return super.onTouchEvent(motionEvent);
}
}
public class i0 extends h6.s {
private Context c;
private ArrayList<MessageObject> d;
private boolean e;
class a implements w.s {
a() {
}
@Override
public Paint b(String str) {
return l97.e(this, str);
}
@Override
public void c(String str, int i) {
l97.g(this, str, i);
}
@Override
public void e(int i, int i2, float f, float f2) {
l97.a(this, i, i2, f, f2);
}
@Override
public int f(String str) {
return l97.b(this, str);
}
@Override
public boolean g() {
return l97.f(this);
}
@Override
public Integer h(String str) {
return Integer.valueOf(org.telegram.ui.ActionBar.w.r1(str));
}
@Override
public Integer i(String str) {
return l97.c(this, str);
}
@Override
public Drawable j(String str) {
return str.equals("drawableMsgOut") ? ff.this.Z : str.equals("drawableMsgOutSelected") ? ff.this.a0 : str.equals("drawableMsgOutMedia") ? ff.this.b0 : str.equals("drawableMsgOutMediaSelected") ? ff.this.c0 : org.telegram.ui.ActionBar.w.Y1(str);
}
}
class b implements ed0.i {
b(i0 i0Var) {
}
@Override
public void A(ed0 ed0Var, String str) {
fd0.y(this, ed0Var, str);
}
@Override
public void B(ed0 ed0Var) {
fd0.g(this, ed0Var);
}
@Override
public boolean C() {
return fd0.H(this);
}
@Override
public void D(MessageObject messageObject) {
fd0.M(this, messageObject);
}
@Override
public void E(MessageObject messageObject, String str, String str2, String str3, String str4, int i, int i2) {
fd0.I(this, messageObject, str, str2, str3, str4, i, i2);
}
@Override
public void F(ed0 ed0Var, int i) {
fd0.o(this, ed0Var, i);
}
@Override
public void G(ed0 ed0Var) {
fd0.u(this, ed0Var);
}
@Override
public p9 H() {
return fd0.C(this);
}
@Override
public void I(ed0 ed0Var, CharacterStyle characterStyle, boolean z) {
fd0.w(this, ed0Var, characterStyle, z);
}
@Override
public void J(ed0 ed0Var, qb5 qb5Var) {
fd0.f(this, ed0Var, qb5Var);
}
@Override
public boolean K() {
return fd0.a(this);
}
@Override
public void L(ed0 ed0Var) {
fd0.v(this, ed0Var);
}
@Override
public void M() {
fd0.K(this);
}
@Override
public boolean N(ed0 ed0Var) {
return fd0.N(this, ed0Var);
}
@Override
public b87.i O() {
return fd0.D(this);
}
@Override
public boolean P(ed0 ed0Var, f27 f27Var, float f, float f2) {
return fd0.e(this, ed0Var, f27Var, f, f2);
}
@Override
public boolean a() {
return fd0.b(this);
}
@Override
public void b(ed0 ed0Var) {
fd0.j(this, ed0Var);
}
@Override
public void c() {
fd0.F(this);
}
@Override
public void d() {
fd0.L(this);
}
@Override
public void e(ed0 ed0Var, u95 u95Var, int i, float f, float f2) {
fd0.h(this, ed0Var, u95Var, i, f, f2);
}
@Override
public String f(long j) {
return fd0.B(this, j);
}
@Override
public void g(ed0 ed0Var) {
fd0.l(this, ed0Var);
}
@Override
public void h(ed0 ed0Var, int i) {
fd0.m(this, ed0Var, i);
}
@Override
public void i(ed0 ed0Var) {
fd0.p(this, ed0Var);
}
@Override
public void j(MessageObject messageObject) {
fd0.A(this, messageObject);
}
@Override
public boolean k() {
return fd0.E(this);
}
@Override
public void l(ed0 ed0Var) {
fd0.i(this, ed0Var);
}
@Override
public void m(ed0 ed0Var, int i) {
fd0.s(this, ed0Var, i);
}
@Override
public void n(ed0 ed0Var, float f, float f2) {
fd0.n(this, ed0Var, f, f2);
}
@Override
public void o(ed0 ed0Var) {
fd0.t(this, ed0Var);
}
@Override
public boolean p(MessageObject messageObject) {
return fd0.J(this, messageObject);
}
@Override
public boolean q(MessageObject messageObject) {
return fd0.O(this, messageObject);
}
@Override
public void r(ed0 ed0Var, ArrayList arrayList, int i, int i2, int i3) {
fd0.z(this, ed0Var, arrayList, i, i2, i3);
}
@Override
public void s() {
fd0.P(this);
}
@Override
public void t(ed0 ed0Var, zo6 zo6Var, boolean z) {
fd0.r(this, ed0Var, zo6Var, z);
}
@Override
public void u(ed0 ed0Var, float f, float f2) {
fd0.c(this, ed0Var, f, f2);
}
@Override
public void v(ed0 ed0Var, float f, float f2) {
fd0.q(this, ed0Var, f, f2);
}
@Override
public void w(ed0 ed0Var) {
fd0.k(this, ed0Var);
}
@Override
public boolean x(ed0 ed0Var, u95 u95Var, int i, float f, float f2) {
return fd0.d(this, ed0Var, u95Var, i, f, f2);
}
@Override
public boolean y() {
return fd0.G(this);
}
@Override
public void z(ed0 ed0Var, f27 f27Var, float f, float f2) {
fd0.x(this, ed0Var, f27Var, f, f2);
}
}
class c implements gu.a {
c(i0 i0Var) {
}
@Override
public void a(gu guVar, float f, float f2) {
fu.b(this, guVar, f, f2);
}
@Override
public void b(gu guVar, int i) {
fu.c(this, guVar, i);
}
@Override
public void c(sp5 sp5Var) {
fu.d(this, sp5Var);
}
@Override
public void d(gu guVar) {
fu.a(this, guVar);
}
@Override
public void e(long j) {
fu.e(this, j);
}
}
class d extends FrameLayout {
d(i0 i0Var, Context context) {
super(context);
}
@Override
protected void onMeasure(int i, int i2) {
super.onMeasure(View.MeasureSpec.makeMeasureSpec(View.MeasureSpec.getSize(i), 1073741824), View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(60.0f), 1073741824));
}
}
class e extends FrameLayout {
e(i0 i0Var, Context context) {
super(context);
}
@Override
protected void onMeasure(int i, int i2) {
super.onMeasure(View.MeasureSpec.makeMeasureSpec(View.MeasureSpec.getSize(i), 1073741824), View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(60.0f), 1073741824));
}
}
public i0(Context context) {
MessageObject messageObject;
int i;
String str;
int i2;
String str2;
this.e = ff.this.q == 0 && Utilities.random.nextInt(100) <= 1;
this.c = context;
this.d = new ArrayList<>();
int currentTimeMillis = ((int) (System.currentTimeMillis() / 1000)) - 3600;
if (ff.this.q == 2) {
l46 l46Var = new l46();
if (ff.this.D1 instanceof Cif.i) {
i = R.string.BackgroundColorSinglePreviewLine2;
str = "BackgroundColorSinglePreviewLine2";
} else {
i = R.string.BackgroundPreviewLine2;
str = "BackgroundPreviewLine2";
}
l46Var.f = LocaleController.getString(str, i);
int i3 = currentTimeMillis + 60;
l46Var.d = i3;
l46Var.O = 1L;
l46Var.h = 259;
dl6 dl6Var = new dl6();
l46Var.b = dl6Var;
dl6Var.a = UserConfig.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).getClientUserId();
l46Var.a = 1;
l46Var.g = new s76();
l46Var.k = true;
dl6 dl6Var2 = new dl6();
l46Var.c = dl6Var2;
dl6Var2.a = 0L;
MessageObject messageObject2 = new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var, true, false);
messageObject2.eventId = 1L;
messageObject2.resetLayout();
this.d.add(messageObject2);
l46 l46Var2 = new l46();
if (ff.this.D1 instanceof Cif.i) {
i2 = R.string.BackgroundColorSinglePreviewLine1;
str2 = "BackgroundColorSinglePreviewLine1";
} else {
i2 = R.string.BackgroundPreviewLine1;
str2 = "BackgroundPreviewLine1";
}
l46Var2.f = LocaleController.getString(str2, i2);
l46Var2.d = i3;
l46Var2.O = 1L;
l46Var2.h = 265;
l46Var2.b = new dl6();
l46Var2.a = 1;
l46Var2.g = new s76();
l46Var2.k = false;
dl6 dl6Var3 = new dl6();
l46Var2.c = dl6Var3;
dl6Var3.a = UserConfig.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).getClientUserId();
messageObject = new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var2, true, false);
messageObject.eventId = 1L;
messageObject.resetLayout();
} else {
if (ff.this.q == 1) {
l46 l46Var3 = new l46();
o76 o76Var = new o76();
l46Var3.g = o76Var;
o76Var.document = new vt5();
ga5 ga5Var = l46Var3.g.document;
ga5Var.mime_type = "audio/mp3";
ga5Var.file_reference = new byte[0];
ga5Var.id = -2147483648L;
ga5Var.size = MediaController.VIDEO_BITRATE_720;
ga5Var.dc_id = Integer.MIN_VALUE;
au5 au5Var = new au5();
au5Var.h = LocaleController.getString("NewThemePreviewReply2", R.string.NewThemePreviewReply2) + ".mp3";
l46Var3.g.document.attributes.add(au5Var);
int i4 = currentTimeMillis + 60;
l46Var3.d = i4;
l46Var3.O = 1L;
l46Var3.h = 259;
dl6 dl6Var4 = new dl6();
l46Var3.b = dl6Var4;
dl6Var4.a = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId();
l46Var3.a = 1;
l46Var3.k = true;
dl6 dl6Var5 = new dl6();
l46Var3.c = dl6Var5;
dl6Var5.a = 0L;
MessageObject messageObject3 = new MessageObject(UserConfig.selectedAccount, l46Var3, true, false);
if (BuildVars.DEBUG_PRIVATE_VERSION) {
l46 l46Var4 = new l46();
l46Var4.f = "this is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text\nthis is very very long text";
l46Var4.d = currentTimeMillis + 960;
l46Var4.O = 1L;
l46Var4.h = 259;
dl6 dl6Var6 = new dl6();
l46Var4.b = dl6Var6;
dl6Var6.a = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId();
l46Var4.a = 1;
l46Var4.g = new s76();
l46Var4.k = true;
dl6 dl6Var7 = new dl6();
l46Var4.c = dl6Var7;
dl6Var7.a = 0L;
MessageObject messageObject4 = new MessageObject(UserConfig.selectedAccount, l46Var4, true, false);
messageObject4.resetLayout();
messageObject4.eventId = 1L;
this.d.add(messageObject4);
}
l46 l46Var5 = new l46();
String string = LocaleController.getString("NewThemePreviewLine3", R.string.NewThemePreviewLine3);
StringBuilder sb = new StringBuilder(string);
int indexOf = string.indexOf(42);
int lastIndexOf = string.lastIndexOf(42);
if (indexOf != -1 && lastIndexOf != -1) {
sb.replace(lastIndexOf, lastIndexOf + 1, BuildConfig.FLAVOR);
sb.replace(indexOf, indexOf + 1, BuildConfig.FLAVOR);
v66 v66Var = new v66();
v66Var.a = indexOf;
v66Var.b = (lastIndexOf - indexOf) - 1;
v66Var.c = "https://telegram.org";
l46Var5.m.add(v66Var);
}
l46Var5.f = sb.toString();
l46Var5.d = currentTimeMillis + 960;
l46Var5.O = 1L;
l46Var5.h = 259;
dl6 dl6Var8 = new dl6();
l46Var5.b = dl6Var8;
dl6Var8.a = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId();
l46Var5.a = 1;
l46Var5.g = new s76();
l46Var5.k = true;
dl6 dl6Var9 = new dl6();
l46Var5.c = dl6Var9;
dl6Var9.a = 0L;
MessageObject messageObject5 = new MessageObject(UserConfig.selectedAccount, l46Var5, true, false);
messageObject5.resetLayout();
messageObject5.eventId = 1L;
this.d.add(messageObject5);
l46 l46Var6 = new l46();
l46Var6.f = LocaleController.getString("NewThemePreviewLine1", R.string.NewThemePreviewLine1);
l46Var6.d = i4;
l46Var6.O = 1L;
l46Var6.h = 265;
l46Var6.b = new dl6();
l46Var6.a = 1;
r86 r86Var = new r86();
l46Var6.B = r86Var;
r86Var.b = 5;
l46Var6.g = new s76();
l46Var6.k = false;
dl6 dl6Var10 = new dl6();
l46Var6.c = dl6Var10;
dl6Var10.a = UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId();
MessageObject messageObject6 = new MessageObject(UserConfig.selectedAccount, l46Var6, true, false);
messageObject6.customReplyName = LocaleController.getString("NewThemePreviewName", R.string.NewThemePreviewName);
messageObject5.customReplyName = "Test User";
messageObject6.eventId = 1L;
messageObject6.resetLayout();
messageObject6.replyMessageObject = messageObject3;
messageObject5.replyMessageObject = messageObject6;
this.d.add(messageObject6);
this.d.add(messageObject3);
l46 l46Var7 = new l46();
l46Var7.d = currentTimeMillis + 120;
l46Var7.O = 1L;
l46Var7.h = 259;
l46Var7.k = false;
l46Var7.b = new dl6();
l46Var7.a = 1;
o76 o76Var2 = new o76();
l46Var7.g = o76Var2;
o76Var2.flags |= 3;
o76Var2.document = new vt5();
ga5 ga5Var2 = l46Var7.g.document;
ga5Var2.mime_type = "audio/ogg";
ga5Var2.file_reference = new byte[0];
xt5 xt5Var = new xt5();
xt5Var.d = 1028;
xt5Var.c = 3;
xt5Var.n = true;
xt5Var.o = new byte[]{0, 4, 17, h.a.s, -93, 86, -103, h.a.x, -12, -26, 63, -25, -3, 109, -114, h.a.o, -4, -1, -1, -1, -1, -29, -1, -1, -25, -1, -1, -97, h.a.z, 57, h.a.l, -108, 1, -91, -4, h.a.v, 21, 99, 10, 97, 43, 45, 115, h.a.c, -77, 51, h.a.f, 66, 40, 34, -122, -116, 48, -124, 16, 66, -120, 16, 68, 16, 33, 4, 1};
l46Var7.g.document.attributes.add(xt5Var);
l46Var7.k = true;
dl6 dl6Var11 = new dl6();
l46Var7.c = dl6Var11;
dl6Var11.a = 0L;
messageObject = new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var7, true, false);
messageObject.audioProgressSec = 1;
messageObject.audioProgress = 0.3f;
} else {
if (this.e) {
gz6 gz6Var = new gz6();
gz6Var.a = 2147483647L;
gz6Var.b = "Me";
gz6 gz6Var2 = new gz6();
gz6Var2.a = 2147483646L;
gz6Var2.b = "Serj";
ArrayList<f27> arrayList = new ArrayList<>();
arrayList.add(gz6Var);
arrayList.add(gz6Var2);
MessagesController.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).putUsers(arrayList, true);
l46 l46Var8 = new l46();
l46Var8.f = "Guess why Half-Life 3 was never released.";
int i5 = currentTimeMillis + 960;
l46Var8.d = i5;
l46Var8.O = -1L;
l46Var8.h = 259;
l46Var8.a = 2147483646;
l46Var8.g = new s76();
l46Var8.k = false;
uk6 uk6Var = new uk6();
l46Var8.c = uk6Var;
uk6Var.b = 1L;
dl6 dl6Var12 = new dl6();
l46Var8.b = dl6Var12;
dl6Var12.a = gz6Var2.a;
this.d.add(new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var8, true, false));
l46 l46Var9 = new l46();
l46Var9.f = "No.\nAnd every unnecessary ping of the dev delays the release for 10 days.\nEvery request for ETA delays the release for 2 weeks.";
l46Var9.d = i5;
l46Var9.O = -1L;
l46Var9.h = 259;
l46Var9.a = 1;
l46Var9.g = new s76();
l46Var9.k = false;
uk6 uk6Var2 = new uk6();
l46Var9.c = uk6Var2;
uk6Var2.b = 1L;
dl6 dl6Var13 = new dl6();
l46Var9.b = dl6Var13;
dl6Var13.a = gz6Var2.a;
this.d.add(new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var9, true, false));
l46 l46Var10 = new l46();
l46Var10.f = "Is source code for Android coming anytime soon?";
l46Var10.d = currentTimeMillis + 600;
l46Var10.O = -1L;
l46Var10.h = 259;
l46Var10.a = 1;
l46Var10.g = new s76();
l46Var10.k = false;
uk6 uk6Var3 = new uk6();
l46Var10.c = uk6Var3;
uk6Var3.b = 1L;
dl6 dl6Var14 = new dl6();
l46Var10.b = dl6Var14;
dl6Var14.a = gz6Var.a;
this.d.add(new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var10, true, false));
return;
}
l46 l46Var11 = new l46();
l46Var11.f = LocaleController.getString("ThemePreviewLine1", R.string.ThemePreviewLine1);
int i6 = currentTimeMillis + 60;
l46Var11.d = i6;
l46Var11.O = 1L;
l46Var11.h = 259;
dl6 dl6Var15 = new dl6();
l46Var11.b = dl6Var15;
dl6Var15.a = UserConfig.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).getClientUserId();
l46Var11.a = 1;
l46Var11.g = new s76();
l46Var11.k = true;
dl6 dl6Var16 = new dl6();
l46Var11.c = dl6Var16;
dl6Var16.a = 0L;
MessageObject messageObject7 = new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var11, true, false);
l46 l46Var12 = new l46();
l46Var12.f = LocaleController.getString("ThemePreviewLine2", R.string.ThemePreviewLine2);
l46Var12.d = currentTimeMillis + 960;
l46Var12.O = 1L;
l46Var12.h = 259;
dl6 dl6Var17 = new dl6();
l46Var12.b = dl6Var17;
dl6Var17.a = UserConfig.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).getClientUserId();
l46Var12.a = 1;
l46Var12.g = new s76();
l46Var12.k = true;
dl6 dl6Var18 = new dl6();
l46Var12.c = dl6Var18;
dl6Var18.a = 0L;
this.d.add(new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var12, true, false));
l46 l46Var13 = new l46();
l46Var13.d = currentTimeMillis + 130;
l46Var13.O = 1L;
l46Var13.h = 259;
l46Var13.b = new dl6();
l46Var13.a = 5;
o76 o76Var3 = new o76();
l46Var13.g = o76Var3;
o76Var3.flags |= 3;
o76Var3.document = new vt5();
ga5 ga5Var3 = l46Var13.g.document;
ga5Var3.mime_type = "audio/mp4";
ga5Var3.file_reference = new byte[0];
xt5 xt5Var2 = new xt5();
xt5Var2.c = 243;
xt5Var2.m = LocaleController.getString("ThemePreviewSongPerformer", R.string.ThemePreviewSongPerformer);
xt5Var2.l = LocaleController.getString("ThemePreviewSongTitle", R.string.ThemePreviewSongTitle);
l46Var13.g.document.attributes.add(xt5Var2);
l46Var13.k = false;
dl6 dl6Var19 = new dl6();
l46Var13.c = dl6Var19;
dl6Var19.a = UserConfig.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).getClientUserId();
this.d.add(new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var13, true, false));
l46 l46Var14 = new l46();
l46Var14.f = LocaleController.getString("ThemePreviewLine3", R.string.ThemePreviewLine3);
l46Var14.d = i6;
l46Var14.O = 1L;
l46Var14.h = 265;
l46Var14.b = new dl6();
l46Var14.a = 1;
r86 r86Var2 = new r86();
l46Var14.B = r86Var2;
r86Var2.b = 5;
l46Var14.g = new s76();
l46Var14.k = false;
dl6 dl6Var20 = new dl6();
l46Var14.c = dl6Var20;
dl6Var20.a = UserConfig.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).getClientUserId();
MessageObject messageObject8 = new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var14, true, false);
messageObject8.customReplyName = LocaleController.getString("ThemePreviewLine3Reply", R.string.ThemePreviewLine3Reply);
messageObject8.replyMessageObject = messageObject7;
this.d.add(messageObject8);
l46 l46Var15 = new l46();
l46Var15.d = currentTimeMillis + 120;
l46Var15.O = 1L;
l46Var15.h = 259;
dl6 dl6Var21 = new dl6();
l46Var15.b = dl6Var21;
dl6Var21.a = UserConfig.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).getClientUserId();
l46Var15.a = 1;
o76 o76Var4 = new o76();
l46Var15.g = o76Var4;
o76Var4.flags |= 3;
o76Var4.document = new vt5();
ga5 ga5Var4 = l46Var15.g.document;
ga5Var4.mime_type = "audio/ogg";
ga5Var4.file_reference = new byte[0];
xt5 xt5Var3 = new xt5();
xt5Var3.d = 1028;
xt5Var3.c = 3;
xt5Var3.n = true;
xt5Var3.o = new byte[]{0, 4, 17, h.a.s, -93, 86, -103, h.a.x, -12, -26, 63, -25, -3, 109, -114, h.a.o, -4, -1, -1, -1, -1, -29, -1, -1, -25, -1, -1, -97, h.a.z, 57, h.a.l, -108, 1, -91, -4, h.a.v, 21, 99, 10, 97, 43, 45, 115, h.a.c, -77, 51, h.a.f, 66, 40, 34, -122, -116, 48, -124, 16, 66, -120, 16, 68, 16, 33, 4, 1};
l46Var15.g.document.attributes.add(xt5Var3);
l46Var15.k = true;
dl6 dl6Var22 = new dl6();
l46Var15.c = dl6Var22;
dl6Var22.a = 0L;
MessageObject messageObject9 = new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var15, true, false);
messageObject9.audioProgressSec = 1;
messageObject9.audioProgress = 0.3f;
messageObject9.useCustomPhoto = true;
this.d.add(messageObject9);
this.d.add(messageObject7);
l46 l46Var16 = new l46();
l46Var16.d = currentTimeMillis + 10;
l46Var16.O = 1L;
l46Var16.h = 257;
l46Var16.b = new dl6();
l46Var16.a = 1;
y76 y76Var = new y76();
l46Var16.g = y76Var;
y76Var.flags |= 3;
y76Var.photo = new an6();
pc5 pc5Var = l46Var16.g.photo;
pc5Var.e = new byte[0];
pc5Var.b = false;
pc5Var.c = 1L;
pc5Var.d = 0L;
pc5Var.f = currentTimeMillis;
fn6 fn6Var = new fn6();
fn6Var.e = 0;
fn6Var.c = 500;
fn6Var.d = 302;
fn6Var.a = "s";
fn6Var.b = new tv5();
l46Var16.g.photo.g.add(fn6Var);
l46Var16.f = LocaleController.getString("ThemePreviewLine4", R.string.ThemePreviewLine4);
l46Var16.k = false;
dl6 dl6Var23 = new dl6();
l46Var16.c = dl6Var23;
dl6Var23.a = UserConfig.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).getClientUserId();
messageObject = new MessageObject(((org.telegram.ui.ActionBar.k) ff.this).d, l46Var16, true, false);
}
messageObject.useCustomPhoto = true;
}
this.d.add(messageObject);
}
private boolean I() {
if (ff.this.F0 != null && ff.this.q == 1 && ff.this.v == 3 && ff.this.x.g != 0) {
return true;
}
if (ff.this.E0 != null) {
if (ff.this.q == 2) {
return true;
}
if (ff.this.q == 1 && ff.this.v == 2) {
return true;
}
}
return false;
}
@Override
public boolean G(u.d0 d0Var) {
return false;
}
@Override
public int e() {
int size = this.d.size();
return I() ? size + 1 : size;
}
@Override
public int g(int i) {
if (I()) {
if (i == 0) {
return ff.this.v == 3 ? 3 : 2;
}
i--;
}
if (i < 0 || i >= this.d.size()) {
return 4;
}
return this.d.get(i).contentType;
}
@Override
public void u(u.d0 d0Var, int i) {
boolean z;
MessageObject messageObject;
int l = d0Var.l();
if (l == 2 || l == 3) {
return;
}
if (I()) {
i--;
}
MessageObject messageObject2 = this.d.get(i);
View view = d0Var.a;
if (!(view instanceof ed0)) {
if (view instanceof gu) {
gu guVar = (gu) view;
guVar.setMessageObject(messageObject2);
guVar.setAlpha(1.0f);
return;
}
return;
}
ed0 ed0Var = (ed0) view;
boolean z2 = false;
ed0Var.g4 = false;
int i2 = i - 1;
int g = g(i2);
int i3 = i + 1;
int g2 = g(i3);
if (!(messageObject2.messageOwner.o instanceof fp6) && g == d0Var.l()) {
MessageObject messageObject3 = this.d.get(i2);
if (messageObject3.isOutOwner() == messageObject2.isOutOwner() && Math.abs(messageObject3.messageOwner.d - messageObject2.messageOwner.d) <= 300) {
z = true;
if (g2 == d0Var.l() && i3 < this.d.size()) {
messageObject = this.d.get(i3);
if (!(messageObject.messageOwner.o instanceof fp6) && messageObject.isOutOwner() == messageObject2.isOutOwner() && Math.abs(messageObject.messageOwner.d - messageObject2.messageOwner.d) <= 300) {
z2 = true;
}
}
ed0Var.g4 = this.e;
ed0Var.setFullyDraw(true);
ed0Var.S3(messageObject2, null, z, z2);
}
}
z = false;
if (g2 == d0Var.l()) {
messageObject = this.d.get(i3);
if (!(messageObject.messageOwner.o instanceof fp6)) {
z2 = true;
}
}
ed0Var.g4 = this.e;
ed0Var.setFullyDraw(true);
ed0Var.S3(messageObject2, null, z, z2);
}
@Override
public u.d0 w(ViewGroup viewGroup, int i) {
View view;
FrameLayout frameLayout;
FrameLayout frameLayout2;
if (i == 0) {
ed0 ed0Var = new ed0(this.c, false, new a());
ed0Var.setDelegate(new b(this));
frameLayout2 = ed0Var;
} else if (i == 1) {
gu guVar = new gu(this.c);
guVar.setDelegate(new c(this));
frameLayout2 = guVar;
} else {
if (i == 2) {
if (ff.this.E0.getParent() != null) {
((ViewGroup) ff.this.E0.getParent()).removeView(ff.this.E0);
}
FrameLayout dVar = new d(this, this.c);
view = ff.this.E0;
frameLayout = dVar;
} else {
if (ff.this.F0.getParent() != null) {
((ViewGroup) ff.this.F0.getParent()).removeView(ff.this.F0);
}
FrameLayout eVar = new e(this, this.c);
view = ff.this.F0;
frameLayout = eVar;
}
frameLayout.addView(view, g52.c(-1, 76, 17));
frameLayout2 = frameLayout;
}
frameLayout2.setLayoutParams(new u.p(-1, -2));
return new h6.j(frameLayout2);
}
}
class j extends u.n {
j(ff ffVar) {
}
@Override
public void d(Rect rect, View view, androidx.recyclerview.widget.u uVar, u.a0 a0Var) {
int i0 = uVar.i0(view);
rect.left = AndroidUtilities.dp(12.0f);
rect.top = 0;
rect.bottom = 0;
if (i0 == a0Var.b() - 1) {
rect.right = AndroidUtilities.dp(12.0f);
}
}
}
public class j0 extends h6.s {
private Context c;
class a implements xs3.b {
a() {
}
@Override
public int a() {
if (ff.this.q == 2) {
return ff.this.j1;
}
int E1 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to2");
int i = (int) ff.this.x.l;
return i != 0 ? i : E1;
}
@Override
public int b() {
return ff.this.r1;
}
@Override
public int c() {
if (ff.this.q == 2) {
return ff.this.i1;
}
int E1 = org.telegram.ui.ActionBar.w.E1("chat_wallpaper_gradient_to");
int i = (int) ff.this.x.k;
return i != 0 ? i : E1;
}
@Override
public d17 d() {
return ff.this.d1;
}
@Override
public int e() {
if (ff.this.q == 2) {
return ff.this.k1;
}
int E1 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to3");
int i = (int) ff.this.x.m;
return i != 0 ? i : E1;
}
@Override
public int f() {
return ff.this.q1;
}
@Override
public int g() {
return ff.this.q == 2 ? ff.this.o1 : ff.this.x.n;
}
@Override
public float h() {
return ff.this.s1;
}
@Override
public int i() {
if (ff.this.q == 2) {
return ff.this.g1;
}
int E1 = org.telegram.ui.ActionBar.w.E1("chat_wallpaper");
int i = (int) ff.this.x.j;
return i != 0 ? i : E1;
}
}
public j0(Context context) {
this.c = context;
}
@Override
public boolean G(u.d0 d0Var) {
return false;
}
@Override
public int e() {
if (ff.this.b1 != null) {
return ff.this.b1.size();
}
return 0;
}
@Override
public int g(int i) {
return 0;
}
@Override
public void u(u.d0 d0Var, int i) {
ImageReceiver imageReceiver;
BlendMode blendMode;
xs3 xs3Var = (xs3) d0Var.a;
xs3Var.setPattern((d17) ff.this.b1.get(i));
xs3Var.getImageReceiver().setColorFilter(new PorterDuffColorFilter(ff.this.q1, ff.this.v1));
if (Build.VERSION.SDK_INT >= 29) {
int i2 = 0;
if (ff.this.q == 1) {
int E1 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to2");
int i3 = (int) ff.this.x.l;
if (i3 != 0 || ff.this.x.l == 0) {
if (i3 != 0) {
E1 = i3;
}
i2 = E1;
}
} else if (ff.this.D1 instanceof Cif.i) {
i2 = ff.this.j1;
}
if (i2 == 0 || ff.this.s1 < 0.0f) {
imageReceiver = xs3Var.getImageReceiver();
blendMode = null;
} else {
imageReceiver = ff.this.D0.getImageReceiver();
blendMode = BlendMode.SOFT_LIGHT;
}
imageReceiver.setBlendMode(blendMode);
}
}
@Override
public u.d0 w(ViewGroup viewGroup, int i) {
return new h6.j(new xs3(this.c, ff.this.L1, new a()));
}
}
class k extends d.n {
k(ff ffVar) {
}
@Override
public boolean a() {
return true;
}
@Override
public void g() {
}
@Override
public void h() {
}
@Override
public void k(EditText editText) {
}
}
public interface k0 {
void a();
}
class l extends org.telegram.ui.Components.p6 {
l(ff ffVar, Context context) {
super(context);
}
@Override
public boolean onTouchEvent(MotionEvent motionEvent) {
if (motionEvent.getAction() == 0) {
getParent().requestDisallowInterceptTouchEvent(true);
}
return super.onTouchEvent(motionEvent);
}
}
class m implements p6.b {
m() {
}
@Override
public void a(boolean z, float f) {
ff.this.s1 = f;
ff.this.D0.getImageReceiver().setAlpha(Math.abs(ff.this.s1));
ff.this.D0.invalidate();
ff.this.W0.G2();
if (ff.this.s1 >= 0.0f) {
if (Build.VERSION.SDK_INT >= 29 && (ff.this.D0.getBackground() instanceof sg3)) {
ff.this.D0.getImageReceiver().setBlendMode(BlendMode.SOFT_LIGHT);
}
ff.this.D0.getImageReceiver().setGradientBitmap(null);
return;
}
if (Build.VERSION.SDK_INT >= 29) {
ff.this.D0.getImageReceiver().setBlendMode(null);
}
if (ff.this.D0.getBackground() instanceof sg3) {
ff.this.D0.getImageReceiver().setGradientBitmap(((sg3) ff.this.D0.getBackground()).f());
}
}
@Override
public int b() {
return op4.b(this);
}
@Override
public void c(boolean z) {
}
@Override
public CharSequence getContentDescription() {
return op4.a(this);
}
}
public class n implements ColorPicker.j {
n() {
}
public void f(DialogInterface dialogInterface, int i) {
org.telegram.ui.ActionBar.w.d1(ff.this.m0, ff.this.x, true);
org.telegram.ui.ActionBar.w.W();
org.telegram.ui.ActionBar.w.P2();
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, ff.this.m0, Boolean.valueOf(ff.this.n0), null, -1);
ff.this.D();
}
@Override
public void a(boolean z) {
if (!z) {
org.telegram.ui.Components.b.Z1(ff.this, 1, null, null);
return;
}
if (ff.this.x.r == null) {
ff.this.D();
MessagesController.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).saveThemeToServer(ff.this.x.b, ff.this.x);
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needShareTheme, ff.this.x.b, ff.this.x);
return;
}
String str = "https://" + MessagesController.getInstance(((org.telegram.ui.ActionBar.k) ff.this).d).linkPrefix + "/addtheme/" + ff.this.x.r.g;
ff.this.o1(new org.telegram.ui.Components.r6(ff.this.c0(), null, str, false, str, false));
}
@Override
public void b() {
if (ff.this.c0() == null) {
return;
}
i.C0142i c0142i = new i.C0142i(ff.this.c0());
c0142i.u(LocaleController.getString("DeleteThemeTitle", R.string.DeleteThemeTitle));
c0142i.l(LocaleController.getString("DeleteThemeAlert", R.string.DeleteThemeAlert));
c0142i.s(LocaleController.getString("Delete", R.string.Delete), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
ff.n.this.f(dialogInterface, i);
}
});
c0142i.n(LocaleController.getString("Cancel", R.string.Cancel), null);
org.telegram.ui.ActionBar.i a = c0142i.a();
ff.this.o1(a);
TextView textView = (TextView) a.r0(-1);
if (textView != null) {
textView.setTextColor(org.telegram.ui.ActionBar.w.r1("dialogTextRed2"));
}
}
@Override
public void c(int i, int i2, boolean z) {
if (ff.this.q == 2) {
ff.this.G4(i, i2, z, true);
} else {
ff.this.C4(i, i2, z);
}
}
@Override
public int d(int i) {
w.u uVar;
if (ff.this.v == 3 && ff.this.m0.G && i == 0 && (uVar = ff.this.m0.U.get(org.telegram.ui.ActionBar.w.l)) != null) {
return uVar.e;
}
return 0;
}
}
class o extends FrameLayout {
private int[] a;
o(Context context) {
super(context);
this.a = new int[2];
}
@Override
public void invalidate() {
super.invalidate();
if (ff.this.A0 != null) {
ff.this.A0.invalidate();
}
}
@Override
protected void onDraw(Canvas canvas) {
if (AndroidUtilities.usingHardwareInput) {
return;
}
getLocationInWindow(this.a);
if (Build.VERSION.SDK_INT < 21 && !AndroidUtilities.isTablet()) {
int[] iArr = this.a;
iArr[1] = iArr[1] - AndroidUtilities.statusBarHeight;
}
if (ff.this.z0.getTranslationY() != this.a[1]) {
ff.this.z0.setTranslationY(-this.a[1]);
ff.this.A0.invalidate();
}
if (SystemClock.elapsedRealtime() < ff.this.X) {
invalidate();
}
}
}
class p implements b.j {
p() {
}
@Override
public void a(int i) {
ff.this.i0.invalidate();
}
@Override
public void b(int i, float f, int i2) {
}
@Override
public void c(int i) {
}
}
class q extends androidx.viewpager.widget.a {
q() {
}
@Override
public void e(ViewGroup viewGroup, int i, Object obj) {
viewGroup.removeView((View) obj);
}
@Override
public int h() {
return ff.this.q != 0 ? 1 : 2;
}
@Override
public int i(Object obj) {
return -1;
}
@Override
public Object m(ViewGroup viewGroup, int i) {
FrameLayout frameLayout = i == 0 ? ff.this.A0 : ff.this.u0;
viewGroup.addView(frameLayout);
return frameLayout;
}
@Override
public boolean n(View view, Object obj) {
return obj == view;
}
}
class r extends View {
private Paint a;
r(Context context) {
super(context);
this.a = new Paint(1);
}
@Override
protected void onDraw(Canvas canvas) {
int currentItem = ff.this.r0.getCurrentItem();
this.a.setColor(ff.this.W3("chat_fieldOverlayText"));
int i = 0;
while (i < 2) {
this.a.setAlpha(i == currentItem ? 255 : 127);
canvas.drawCircle(AndroidUtilities.dp((i * 15) + 3), AndroidUtilities.dp(4.0f), AndroidUtilities.dp(3.0f), this.a);
i++;
}
}
}
public class s extends AnimatorListenerAdapter {
s() {
}
@Override
public void onAnimationEnd(Animator animator) {
ff.this.Q0[ff.this.d1 != null ? (char) 0 : (char) 2].setVisibility(4);
}
}
public class t extends AnimatorListenerAdapter {
t() {
}
@Override
public void onAnimationEnd(Animator animator) {
if (ff.this.d1 == null) {
ff.this.Q0[0].setVisibility(4);
}
}
}
public class u extends AnimatorListenerAdapter {
final boolean a;
final int b;
final int c;
final boolean d;
u(boolean z, int i, int i2, boolean z2) {
this.a = z;
this.b = i;
this.c = i2;
this.d = z2;
}
@Override
public void onAnimationEnd(Animator animator) {
FrameLayout frameLayout;
ff.this.u1 = null;
if (!this.a || ff.this.S0[this.b].getVisibility() != 0) {
if (!this.a) {
frameLayout = ff.this.S0[this.c];
}
if (ff.this.q != 1 || ff.this.q == 2) {
ff.this.Q0[this.d ? (char) 0 : (char) 2].setVisibility(4);
} else {
if (this.c == 1) {
ff.this.S0[this.b].setAlpha(0.0f);
return;
}
return;
}
}
ff.this.S0[this.b].setAlpha(1.0f);
frameLayout = ff.this.S0[this.b];
frameLayout.setVisibility(4);
if (ff.this.q != 1) {
}
ff.this.Q0[this.d ? (char) 0 : (char) 2].setVisibility(4);
}
}
class v extends FrameLayout {
v(Context context) {
super(context);
}
@Override
protected boolean drawChild(Canvas canvas, View view, long j) {
boolean drawChild = super.drawChild(canvas, view, j);
if (view == ((org.telegram.ui.ActionBar.k) ff.this).g && ((org.telegram.ui.ActionBar.k) ff.this).f != null) {
((org.telegram.ui.ActionBar.k) ff.this).f.Z(canvas, ((org.telegram.ui.ActionBar.k) ff.this).g.getVisibility() == 0 ? ((org.telegram.ui.ActionBar.k) ff.this).g.getMeasuredHeight() : 0);
}
return drawChild;
}
@Override
protected void onMeasure(int i, int i2) {
int size = View.MeasureSpec.getSize(i);
int size2 = View.MeasureSpec.getSize(i2);
setMeasuredDimension(size, size2);
measureChildWithMargins(((org.telegram.ui.ActionBar.k) ff.this).g, i, 0, i2, 0);
int measuredHeight = ((org.telegram.ui.ActionBar.k) ff.this).g.getMeasuredHeight();
if (((org.telegram.ui.ActionBar.k) ff.this).g.getVisibility() == 0) {
size2 -= measuredHeight;
}
((FrameLayout.LayoutParams) ff.this.v0.getLayoutParams()).topMargin = measuredHeight;
ff.this.v0.measure(View.MeasureSpec.makeMeasureSpec(size, 1073741824), View.MeasureSpec.makeMeasureSpec(size2, 1073741824));
measureChildWithMargins(ff.this.x0, i, 0, i2, 0);
}
}
public class w extends AnimatorListenerAdapter {
w() {
}
@Override
public void onAnimationEnd(Animator animator) {
ff.this.H0 = null;
}
}
public class x extends AnimatorListenerAdapter {
x() {
}
@Override
public void onAnimationEnd(Animator animator) {
if (ff.this.K0.getTag() == null) {
ff.this.K0.setVisibility(4);
}
ff.this.O0 = null;
}
}
public class y extends AnimatorListenerAdapter {
y() {
}
@Override
public void onAnimationEnd(Animator animator) {
if (ff.this.L0.getTag() == null) {
ff.this.L0.setVisibility(4);
}
ff.this.P0 = null;
}
}
public class z extends o.e {
z() {
}
@Override
public void b(int i, int i2) {
Point point = AndroidUtilities.displaySize;
if ((point.x <= point.y) == (i <= i2)) {
ff.this.D0.invalidate();
}
}
}
public ff(Object obj, Bitmap bitmap) {
this(obj, bitmap, false, false);
}
public ff(Object obj, Bitmap bitmap, boolean z2, boolean z3) {
this.r = true;
this.v = 1;
this.Z = new w.p(0, true, false);
this.a0 = new w.p(0, true, true);
this.b0 = new w.p(1, true, false);
this.c0 = new w.p(1, true, true);
this.f0 = -1;
this.g0 = new Runnable() {
@Override
public final void run() {
org.telegram.ui.ff.this.u4();
}
};
this.S0 = new FrameLayout[2];
this.T0 = new TextView[2];
this.U0 = new TextView[2];
this.V0 = new FrameLayout[2];
this.c1 = new HashMap<>();
this.s1 = 0.5f;
this.v1 = PorterDuff.Mode.SRC_IN;
this.B1 = 1.0f;
this.K1 = "640_360";
this.L1 = 1920;
this.q = 2;
this.I1 = z3;
this.D1 = obj;
this.E1 = bitmap;
this.F1 = z2;
if (obj instanceof Cif.i) {
Cif.i iVar = (Cif.i) obj;
this.G1 = iVar.k;
d17 d17Var = iVar.h;
this.d1 = d17Var;
if (d17Var != null) {
float f2 = iVar.i;
this.s1 = f2;
if (f2 < 0.0f && !org.telegram.ui.ActionBar.w.i1().J()) {
this.s1 *= -1.0f;
}
}
}
this.Z.u = true;
this.b0.u = true;
this.a0.u = true;
this.c0.u = true;
}
public ff(w.v vVar) {
this(vVar, false, 0, false, false);
}
public ff(w.v vVar, boolean z2, int i2, boolean z3, boolean z4) {
this.r = true;
this.v = 1;
this.Z = new w.p(0, true, false);
this.a0 = new w.p(0, true, true);
this.b0 = new w.p(1, true, false);
this.c0 = new w.p(1, true, true);
this.f0 = -1;
this.g0 = new Runnable() {
@Override
public final void run() {
org.telegram.ui.ff.this.u4();
}
};
this.S0 = new FrameLayout[2];
this.T0 = new TextView[2];
this.U0 = new TextView[2];
this.V0 = new FrameLayout[2];
this.c1 = new HashMap<>();
this.s1 = 0.5f;
this.v1 = PorterDuff.Mode.SRC_IN;
this.B1 = 1.0f;
this.K1 = "640_360";
this.L1 = 1920;
this.q = i2;
this.n0 = z4;
this.m0 = vVar;
this.p0 = z2;
this.o0 = z3;
if (i2 == 1) {
w.u A = vVar.A(!z3);
this.x = A;
if (A != null) {
this.r = false;
this.z = A.c;
this.A = A.d;
this.B = A.e;
this.G = A.f;
this.H = A.g;
this.I = A.h;
this.J = A.i;
this.Q = A.j;
this.R = A.k;
this.S = A.l;
this.T = A.m;
this.U = A.p;
this.V = A.o;
this.W = A.n;
}
} else {
if (i2 == 0) {
this.r = false;
}
w.u A2 = vVar.A(false);
this.x = A2;
if (A2 != null) {
this.d1 = A2.s;
}
}
w.u uVar = this.x;
if (uVar != null) {
this.G1 = uVar.q;
if (!TextUtils.isEmpty(uVar.o)) {
this.s1 = this.x.p;
}
org.telegram.ui.ActionBar.w.g0(this.m0, true);
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.goingToPreviewTheme, new Object[0]);
this.Z.u = true;
this.b0.u = true;
this.a0.u = true;
this.c0.u = true;
}
public void A4() {
if (this.q == 2) {
int i2 = this.o1 + 45;
while (true) {
this.o1 = i2;
int i3 = this.o1;
if (i3 < 360) {
G4(this.g1, 0, true, true);
return;
}
i2 = i3 - 360;
}
} else {
w.u uVar = this.x;
int i4 = uVar.n + 45;
while (true) {
uVar.n = i4;
uVar = this.x;
int i5 = uVar.n;
if (i5 < 360) {
org.telegram.ui.ActionBar.w.P2();
return;
}
i4 = i5 - 360;
}
}
}
public void B4() {
FileOutputStream fileOutputStream;
w.u uVar = this.x;
if (uVar == null || TextUtils.isEmpty(uVar.o)) {
return;
}
try {
File b2 = this.x.b();
Drawable background = this.D0.getBackground();
Bitmap bitmap = this.D0.getImageReceiver().getBitmap();
if (background instanceof sg3) {
fileOutputStream = new FileOutputStream(b2);
bitmap.compress(Bitmap.CompressFormat.PNG, 87, fileOutputStream);
} else {
Bitmap createBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(createBitmap);
background.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight());
background.draw(canvas);
Paint paint = new Paint(2);
paint.setColorFilter(new PorterDuffColorFilter(this.q1, this.v1));
paint.setAlpha((int) (this.s1 * 255.0f));
canvas.drawBitmap(bitmap, 0.0f, 0.0f, paint);
fileOutputStream = new FileOutputStream(b2);
createBitmap.compress(Bitmap.CompressFormat.JPEG, 87, fileOutputStream);
}
fileOutputStream.close();
} catch (Throwable th) {
FileLog.e(th);
}
}
public void C4(int i2, int i3, boolean z2) {
if (i3 != -1) {
int i4 = this.f0;
if (i4 != -1 && i4 != i3) {
this.g0.run();
}
this.e0 = i2;
this.f0 = i3;
if (z2) {
this.g0.run();
return;
} else {
if (this.h0) {
return;
}
this.h0 = true;
this.e.postDelayed(this.g0, 16L);
return;
}
}
int i5 = this.v;
if (i5 == 1 || i5 == 2) {
long j2 = this.Q;
if (j2 != 0) {
this.x.j = j2;
} else {
this.x.j = 0L;
}
long j3 = this.R;
if (j3 != 0) {
this.x.k = j3;
} else {
this.x.k = 0L;
}
long j4 = this.S;
if (j4 != 0) {
this.x.l = j4;
} else {
this.x.l = 0L;
}
long j5 = this.T;
if (j5 != 0) {
this.x.m = j5;
} else {
this.x.m = 0L;
}
this.x.n = this.W;
if (i5 == 2) {
int E1 = org.telegram.ui.ActionBar.w.E1("chat_wallpaper");
int E12 = org.telegram.ui.ActionBar.w.E1("chat_wallpaper_gradient_to");
int E13 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to2");
int E14 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to3");
w.u uVar = this.x;
int i6 = (int) uVar.k;
int i7 = (int) uVar.l;
int i8 = (int) uVar.m;
int i9 = (int) uVar.j;
ColorPicker colorPicker = this.d0;
if (i8 != 0) {
E14 = i8;
}
colorPicker.J(E14, 3);
ColorPicker colorPicker2 = this.d0;
if (i7 != 0) {
E13 = i7;
}
colorPicker2.J(E13, 2);
ColorPicker colorPicker3 = this.d0;
if (i6 != 0) {
E12 = i6;
}
colorPicker3.J(E12, 1);
ColorPicker colorPicker4 = this.d0;
if (i9 != 0) {
E1 = i9;
}
colorPicker4.J(E1, 0);
}
}
int i10 = this.v;
if (i10 == 1 || i10 == 3) {
int i11 = this.B;
if (i11 != 0) {
this.x.e = i11;
} else {
this.x.e = 0;
}
int i12 = this.G;
if (i12 != 0) {
this.x.f = i12;
} else {
this.x.f = 0;
}
int i13 = this.H;
if (i13 != 0) {
this.x.g = i13;
} else {
this.x.g = 0;
}
int i14 = this.I;
if (i14 != 0) {
this.x.h = i14;
} else {
this.x.h = 0;
}
if (i10 == 3) {
this.d0.J(this.x.h, 3);
this.d0.J(this.x.g, 2);
this.d0.J(this.x.f, 1);
ColorPicker colorPicker5 = this.d0;
w.u uVar2 = this.x;
int i15 = uVar2.e;
if (i15 == 0) {
i15 = uVar2.c;
}
colorPicker5.J(i15, 0);
}
}
org.telegram.ui.ActionBar.w.P2();
this.B0.G2();
}
public void D4(int i2) {
E4(i2, true);
}
private void E4(int i2, boolean z2) {
String string;
DialogInterface.OnClickListener onClickListener;
if (c0() == null || this.v == i2 || this.u1 != null) {
return;
}
if (z2 && i2 == 2 && (org.telegram.ui.ActionBar.w.l2() || this.x.j == 4294967296L)) {
i.C0142i c0142i = new i.C0142i(c0());
c0142i.u(LocaleController.getString("ChangeChatBackground", R.string.ChangeChatBackground));
if (!org.telegram.ui.ActionBar.w.l2() || org.telegram.ui.ActionBar.w.u2()) {
c0142i.l(LocaleController.getString("ChangeColorToColor", R.string.ChangeColorToColor));
c0142i.s(LocaleController.getString("Reset", R.string.Reset), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i3) {
org.telegram.ui.ff.this.w4(dialogInterface, i3);
}
});
string = LocaleController.getString("Continue", R.string.Continue);
onClickListener = new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i3) {
org.telegram.ui.ff.this.x4(dialogInterface, i3);
}
};
} else {
c0142i.l(LocaleController.getString("ChangeWallpaperToColor", R.string.ChangeWallpaperToColor));
c0142i.s(LocaleController.getString("Change", R.string.Change), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i3) {
org.telegram.ui.ff.this.y4(dialogInterface, i3);
}
});
string = LocaleController.getString("Cancel", R.string.Cancel);
onClickListener = null;
}
c0142i.n(string, onClickListener);
o1(c0142i.a());
return;
}
int i3 = this.v;
this.v = i2;
if (i2 == 1) {
this.u.setText(LocaleController.getString("ColorPickerMainColor", R.string.ColorPickerMainColor));
this.d0.K(1, Y3(1), 2, this.x.d != 0 ? 2 : 1, false, 0, false);
this.d0.J(this.x.c, 0);
int i4 = this.x.d;
if (i4 != 0) {
this.d0.J(i4, 1);
}
if (i3 == 2 || (i3 == 3 && this.x.g != 0)) {
this.C0.s(0);
}
} else if (i2 == 2) {
this.u.setText(LocaleController.getString("ColorPickerBackground", R.string.ColorPickerBackground));
int r1 = org.telegram.ui.ActionBar.w.r1("chat_wallpaper");
int r12 = org.telegram.ui.ActionBar.w.n2("chat_wallpaper_gradient_to") ? org.telegram.ui.ActionBar.w.r1("chat_wallpaper_gradient_to") : 0;
int r13 = org.telegram.ui.ActionBar.w.n2("key_chat_wallpaper_gradient_to2") ? org.telegram.ui.ActionBar.w.r1("key_chat_wallpaper_gradient_to2") : 0;
int r14 = org.telegram.ui.ActionBar.w.n2("key_chat_wallpaper_gradient_to3") ? org.telegram.ui.ActionBar.w.r1("key_chat_wallpaper_gradient_to3") : 0;
w.u uVar = this.x;
long j2 = uVar.k;
int i5 = (int) j2;
if (i5 == 0 && j2 != 0) {
r12 = 0;
}
long j3 = uVar.l;
int i6 = (int) j3;
if (i6 == 0 && j3 != 0) {
r13 = 0;
}
long j4 = uVar.m;
int i7 = (int) j4;
if (i7 == 0 && j4 != 0) {
r14 = 0;
}
int i8 = (int) uVar.j;
this.d0.K(2, Y3(2), 4, (i5 == 0 && r12 == 0) ? 1 : (i7 == 0 && r14 == 0) ? (i6 == 0 && r13 == 0) ? 2 : 3 : 4, false, this.x.n, false);
ColorPicker colorPicker = this.d0;
if (i7 == 0) {
i7 = r14;
}
colorPicker.J(i7, 3);
ColorPicker colorPicker2 = this.d0;
if (i6 == 0) {
i6 = r13;
}
colorPicker2.J(i6, 2);
ColorPicker colorPicker3 = this.d0;
if (i5 == 0) {
i5 = r12;
}
colorPicker3.J(i5, 1);
ColorPicker colorPicker4 = this.d0;
if (i8 != 0) {
r1 = i8;
}
colorPicker4.J(r1, 0);
if (i3 == 1 || this.x.g == 0) {
this.C0.m(0);
} else {
this.C0.k(0);
}
this.B0.s1(0, AndroidUtilities.dp(60.0f));
} else if (i2 == 3) {
this.u.setText(LocaleController.getString("ColorPickerMyMessages", R.string.ColorPickerMyMessages));
w.u uVar2 = this.x;
this.d0.K(2, Y3(3), 4, uVar2.f != 0 ? uVar2.h != 0 ? 4 : uVar2.g != 0 ? 3 : 2 : 1, true, 0, false);
this.d0.J(this.x.h, 3);
this.d0.J(this.x.g, 2);
this.d0.J(this.x.f, 1);
ColorPicker colorPicker5 = this.d0;
w.u uVar3 = this.x;
int i9 = uVar3.e;
if (i9 == 0) {
i9 = uVar3.c;
}
colorPicker5.J(i9, 0);
this.R0[1].g(0, this.x.e);
this.R0[1].g(1, this.x.f);
this.R0[1].g(2, this.x.g);
this.R0[1].g(3, this.x.h);
if (this.x.g != 0) {
i0 i0Var = this.C0;
if (i3 == 1) {
i0Var.m(0);
} else {
i0Var.k(0);
}
} else if (i3 == 2) {
this.C0.s(0);
}
this.B0.s1(0, AndroidUtilities.dp(60.0f));
L4();
}
if (i2 == 1 || i2 == 3) {
if (i3 == 2 && this.S0[1].getVisibility() == 0) {
M4(0, true, true);
}
if (i2 == 1) {
if (this.m0.J()) {
this.d0.setMinBrightness(0.2f);
return;
} else {
this.d0.setMinBrightness(0.05f);
this.d0.setMaxBrightness(0.8f);
return;
}
}
}
this.d0.setMinBrightness(0.0f);
this.d0.setMaxBrightness(1.0f);
}
private void F4(int i2) {
d17 d17Var = (i2 < 0 || i2 >= this.b1.size()) ? this.f1 : (d17) this.b1.get(i2);
if (d17Var == null) {
return;
}
this.D0.k(ImageLocation.getForDocument(d17Var.i), this.K1, null, null, "jpg", d17Var.i.size, 1, d17Var);
this.d1 = d17Var;
this.G1 = this.Q0[2].e();
O4(false, true);
}
public void G4(int i2, int i3, boolean z2, boolean z3) {
int i4;
sg3 sg3Var;
if (i3 == 0) {
this.g1 = i2;
} else if (i3 == 1) {
this.i1 = i2;
} else if (i3 == 2) {
this.j1 = i2;
} else if (i3 == 3) {
this.k1 = i2;
}
Q4(z3);
if (this.Q0 != null) {
int i5 = 0;
while (true) {
org.telegram.ui.Components.j9[] j9VarArr = this.Q0;
if (i5 >= j9VarArr.length) {
break;
}
if (j9VarArr[i5] != null) {
j9VarArr[i5].g(i3, i2);
}
i5++;
}
}
if (this.j1 != 0) {
if (this.a1 != null && org.telegram.ui.ActionBar.w.i1().J()) {
this.a1.setTwoSided(true);
}
Drawable background = this.D0.getBackground();
if (background instanceof sg3) {
sg3Var = (sg3) background;
} else {
sg3Var = new sg3();
sg3Var.y(this.D0);
if (this.F1) {
sg3Var.s(false);
}
}
sg3Var.u(this.g1, this.i1, this.j1, this.k1);
this.D0.setBackground(sg3Var);
this.q1 = sg3Var.j();
this.r1 = 754974720;
} else {
if (this.i1 != 0) {
this.D0.setBackground(new GradientDrawable(org.telegram.ui.Components.o.m(this.o1), new int[]{this.g1, this.i1}));
i4 = AndroidUtilities.getAverageColor(this.g1, this.i1);
} else {
this.D0.setBackgroundColor(this.g1);
i4 = this.g1;
}
int patternColor = AndroidUtilities.getPatternColor(i4);
this.r1 = patternColor;
this.q1 = patternColor;
}
if (!org.telegram.ui.ActionBar.w.n2("chat_serviceBackground") || (this.D0.getBackground() instanceof sg3)) {
int i6 = this.r1;
org.telegram.ui.ActionBar.w.Q(new int[]{i6, i6, i6, i6}, this.D0.getBackground());
} else if (org.telegram.ui.ActionBar.w.o1() instanceof sg3) {
int r1 = org.telegram.ui.ActionBar.w.r1("chat_serviceBackground");
org.telegram.ui.ActionBar.w.Q(new int[]{r1, r1, r1, r1}, this.D0.getBackground());
}
ImageView imageView = this.M0;
if (imageView != null) {
imageView.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("chat_serviceText"), PorterDuff.Mode.MULTIPLY));
}
ImageView imageView2 = this.N0;
if (imageView2 != null) {
imageView2.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("chat_serviceText"), PorterDuff.Mode.MULTIPLY));
}
org.telegram.messenger.p110.pf pfVar = this.D0;
if (pfVar != null) {
pfVar.getImageReceiver().setColorFilter(new PorterDuffColorFilter(this.q1, this.v1));
this.D0.getImageReceiver().setAlpha(Math.abs(this.s1));
this.D0.invalidate();
if (org.telegram.ui.ActionBar.w.i1().J() && (this.D0.getBackground() instanceof sg3)) {
org.telegram.ui.Components.p6 p6Var = this.a1;
if (p6Var != null) {
p6Var.setTwoSided(true);
}
if (this.s1 < 0.0f) {
this.D0.getImageReceiver().setGradientBitmap(((sg3) this.D0.getBackground()).f());
}
} else {
this.D0.getImageReceiver().setGradientBitmap(null);
org.telegram.ui.Components.p6 p6Var2 = this.a1;
if (p6Var2 != null) {
p6Var2.setTwoSided(false);
}
}
org.telegram.ui.Components.p6 p6Var3 = this.a1;
if (p6Var3 != null) {
p6Var3.setProgress(this.s1);
}
}
org.telegram.ui.Components.h6 h6Var = this.B0;
if (h6Var != null) {
h6Var.G2();
}
FrameLayout frameLayout = this.E0;
if (frameLayout != null) {
int childCount = frameLayout.getChildCount();
for (int i7 = 0; i7 < childCount; i7++) {
this.E0.getChildAt(i7).invalidate();
}
}
FrameLayout frameLayout2 = this.F0;
if (frameLayout2 != null) {
int childCount2 = frameLayout2.getChildCount();
for (int i8 = 0; i8 < childCount2; i8++) {
this.F0.getChildAt(i8).invalidate();
}
}
me4 me4Var = this.I0;
if (me4Var != null) {
me4Var.s("chat_serviceBackground", "chat_serviceBackground", "chat_serviceText", "chat_serviceText");
}
}
private void H4(boolean z2) {
int patternColor;
org.telegram.messenger.p110.pf pfVar;
ImageView imageView;
ImageView imageView2;
FrameLayout frameLayout;
FrameLayout frameLayout2;
ColorDrawable colorDrawable;
?? r10;
qc5 qc5Var;
int i2;
org.telegram.messenger.p110.pf pfVar2;
ImageLocation forPhoto;
String str;
ImageLocation forPhoto2;
MediaController.SearchImage searchImage;
int i3 = this.q;
if (i3 == 0 && this.x == null) {
this.D0.setBackground(org.telegram.ui.ActionBar.w.o1());
} else if (i3 == 2) {
Object obj = this.D1;
if (obj instanceof d17) {
?? r1 = (d17) obj;
qc5Var = z2 ? FileLoader.getClosestPhotoSizeWithSize(r1.i.thumbs, 100) : null;
pfVar2 = this.D0;
forPhoto = ImageLocation.getForDocument(r1.i);
str = this.K1;
forPhoto2 = ImageLocation.getForDocument(qc5Var, r1.i);
i2 = r1.i.size;
searchImage = r1;
} else if (obj instanceof Cif.i) {
Cif.i iVar = (Cif.i) obj;
this.o1 = iVar.f;
G4(iVar.b, 0, true, false);
int i4 = iVar.c;
if (i4 != 0) {
G4(i4, 1, true, false);
}
G4(iVar.d, 2, true, false);
G4(iVar.e, 3, true, false);
d17 d17Var = this.d1;
if (d17Var != null) {
org.telegram.messenger.p110.pf pfVar3 = this.D0;
ImageLocation forDocument = ImageLocation.getForDocument(d17Var.i);
String str2 = this.K1;
d17 d17Var2 = this.d1;
pfVar3.k(forDocument, str2, null, null, "jpg", d17Var2.i.size, 1, d17Var2);
} else if ("d".equals(iVar.a)) {
Point point = AndroidUtilities.displaySize;
int min = Math.min(point.x, point.y);
Point point2 = AndroidUtilities.displaySize;
this.D0.setImageBitmap(SvgHelper.getBitmap(R.raw.default_pattern, min, Math.max(point2.x, point2.y), Build.VERSION.SDK_INT >= 29 ? 1459617792 : sg3.k(iVar.b, iVar.c, iVar.d, iVar.e)));
}
} else if (obj instanceof Cif.j) {
Bitmap bitmap = this.E1;
if (bitmap != null) {
this.D0.setImageBitmap(bitmap);
} else {
Cif.j jVar = (Cif.j) obj;
File file = jVar.e;
if (file != null || (file = jVar.d) != null) {
this.D0.c(file.getAbsolutePath(), this.K1, null);
} else if ("t".equals(jVar.a)) {
org.telegram.messenger.p110.pf pfVar4 = this.D0;
pfVar4.setImageDrawable(org.telegram.ui.ActionBar.w.i2(false, pfVar4));
} else {
int i5 = jVar.b;
if (i5 != 0) {
this.D0.setImageResource(i5);
}
}
}
} else if (obj instanceof MediaController.SearchImage) {
MediaController.SearchImage searchImage2 = (MediaController.SearchImage) obj;
pc5 pc5Var = searchImage2.photo;
if (pc5Var != null) {
qc5 closestPhotoSizeWithSize = FileLoader.getClosestPhotoSizeWithSize(pc5Var.g, 100);
qc5 closestPhotoSizeWithSize2 = FileLoader.getClosestPhotoSizeWithSize(searchImage2.photo.g, this.L1, true);
qc5Var = closestPhotoSizeWithSize2 != closestPhotoSizeWithSize ? closestPhotoSizeWithSize2 : null;
i2 = qc5Var != null ? qc5Var.e : 0;
pfVar2 = this.D0;
forPhoto = ImageLocation.getForPhoto(qc5Var, searchImage2.photo);
str = this.K1;
forPhoto2 = ImageLocation.getForPhoto(closestPhotoSizeWithSize, searchImage2.photo);
searchImage = searchImage2;
} else {
this.D0.d(searchImage2.imageUrl, this.K1, searchImage2.thumbUrl, "100_100_b");
}
}
pfVar2.k(forPhoto, str, forPhoto2, "100_100_b", "jpg", i2, 1, searchImage);
} else {
o.c cVar = this.x1;
if (cVar != null) {
cVar.dispose();
this.x1 = null;
}
int E1 = org.telegram.ui.ActionBar.w.E1("chat_wallpaper");
int i6 = (int) this.x.j;
if (i6 != 0) {
E1 = i6;
}
int E12 = org.telegram.ui.ActionBar.w.E1("chat_wallpaper_gradient_to");
long j2 = this.x.k;
int i7 = (int) j2;
if (i7 == 0 && j2 != 0) {
E12 = 0;
} else if (i7 != 0) {
E12 = i7;
}
int E13 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to2");
long j3 = this.x.l;
int i8 = (int) j3;
if (i8 == 0 && j3 != 0) {
E13 = 0;
} else if (i8 != 0) {
E13 = i8;
}
int E14 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to3");
w.u uVar = this.x;
long j4 = uVar.m;
int i9 = (int) j4;
if (i9 == 0 && j4 != 0) {
E14 = 0;
} else if (i9 != 0) {
E14 = i9;
}
if (TextUtils.isEmpty(uVar.o) || org.telegram.ui.ActionBar.w.l2()) {
Drawable o1 = org.telegram.ui.ActionBar.w.o1();
if (o1 != null) {
if (o1 instanceof sg3) {
((sg3) o1).y(this.D0);
}
this.D0.setBackground(o1);
}
} else {
if (E13 != 0) {
Drawable background = this.D0.getBackground();
if (background instanceof sg3) {
r10 = (sg3) background;
} else {
sg3 sg3Var = new sg3();
sg3Var.y(this.D0);
r10 = sg3Var;
if (this.F1) {
sg3Var.s(false);
r10 = sg3Var;
}
}
r10.u(E1, E12, E13, E14);
colorDrawable = r10;
} else if (E12 != 0) {
?? oVar = new org.telegram.ui.Components.o(org.telegram.ui.Components.o.m(this.x.n), new int[]{E1, E12});
this.x1 = oVar.u(o.f.c(), new z(), 100L);
colorDrawable = oVar;
} else {
colorDrawable = new ColorDrawable(E1);
}
this.D0.setBackground(colorDrawable);
d17 d17Var3 = this.d1;
if (d17Var3 != null) {
org.telegram.messenger.p110.pf pfVar5 = this.D0;
ImageLocation forDocument2 = ImageLocation.getForDocument(d17Var3.i);
String str3 = this.K1;
d17 d17Var4 = this.d1;
pfVar5.k(forDocument2, str3, null, null, "jpg", d17Var4.i.size, 1, d17Var4);
}
}
if (E12 == 0) {
patternColor = AndroidUtilities.getPatternColor(E1);
} else if (E13 != 0) {
this.q1 = sg3.k(E1, E12, E13, E14);
this.r1 = 754974720;
pfVar = this.D0;
if (pfVar != null) {
pfVar.getImageReceiver().setColorFilter(new PorterDuffColorFilter(this.q1, this.v1));
this.D0.getImageReceiver().setAlpha(Math.abs(this.s1));
this.D0.invalidate();
if (org.telegram.ui.ActionBar.w.i1().J() && (this.D0.getBackground() instanceof sg3)) {
org.telegram.ui.Components.p6 p6Var = this.a1;
if (p6Var != null) {
p6Var.setTwoSided(true);
}
if (this.s1 < 0.0f) {
this.D0.getImageReceiver().setGradientBitmap(((sg3) this.D0.getBackground()).f());
}
} else {
this.D0.getImageReceiver().setGradientBitmap(null);
org.telegram.ui.Components.p6 p6Var2 = this.a1;
if (p6Var2 != null) {
p6Var2.setTwoSided(false);
}
}
org.telegram.ui.Components.p6 p6Var3 = this.a1;
if (p6Var3 != null) {
p6Var3.setProgress(this.s1);
}
}
if (this.Q0 != null) {
int i10 = 0;
while (true) {
org.telegram.ui.Components.j9[] j9VarArr = this.Q0;
if (i10 >= j9VarArr.length) {
break;
}
j9VarArr[i10].g(0, E1);
this.Q0[i10].g(1, E12);
this.Q0[i10].g(2, E13);
this.Q0[i10].g(3, E14);
i10++;
}
}
imageView = this.M0;
if (imageView != null) {
imageView.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("chat_serviceText"), PorterDuff.Mode.MULTIPLY));
}
imageView2 = this.N0;
if (imageView2 != null) {
imageView2.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("chat_serviceText"), PorterDuff.Mode.MULTIPLY));
}
frameLayout = this.E0;
if (frameLayout != null) {
int childCount = frameLayout.getChildCount();
for (int i11 = 0; i11 < childCount; i11++) {
this.E0.getChildAt(i11).invalidate();
}
}
frameLayout2 = this.F0;
if (frameLayout2 != null) {
int childCount2 = frameLayout2.getChildCount();
for (int i12 = 0; i12 < childCount2; i12++) {
this.F0.getChildAt(i12).invalidate();
}
}
} else {
patternColor = AndroidUtilities.getPatternColor(AndroidUtilities.getAverageColor(E1, E12));
}
this.r1 = patternColor;
this.q1 = patternColor;
pfVar = this.D0;
if (pfVar != null) {
}
if (this.Q0 != null) {
}
imageView = this.M0;
if (imageView != null) {
}
imageView2 = this.N0;
if (imageView2 != null) {
}
frameLayout = this.E0;
if (frameLayout != null) {
}
frameLayout2 = this.F0;
if (frameLayout2 != null) {
}
}
this.F1 = false;
}
private void L4() {
if (this.A0 == null || this.R0 == null || this.x.g == 0) {
return;
}
final SharedPreferences globalMainSettings = MessagesController.getGlobalMainSettings();
if (globalMainSettings.getBoolean("bganimationhint", false)) {
return;
}
if (this.G0 == null) {
es1 es1Var = new es1(c0(), 8);
this.G0 = es1Var;
es1Var.setShowingDuration(5000L);
this.G0.setAlpha(0.0f);
this.G0.setVisibility(4);
this.G0.setText(LocaleController.getString("BackgroundAnimateInfo", R.string.BackgroundAnimateInfo));
this.G0.setExtraTranslationY(AndroidUtilities.dp(6.0f));
this.s0.addView(this.G0, g52.b(-2, -2.0f, 51, 10.0f, 0.0f, 10.0f, 0.0f));
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
org.telegram.ui.ff.this.z4(globalMainSettings);
}
}, 500L);
}
public void M4(int i2, boolean z2, boolean z3) {
FrameLayout frameLayout;
int i3;
FrameLayout frameLayout2;
FrameLayout frameLayout3;
FrameLayout frameLayout4;
ObjectAnimator ofFloat;
ObjectAnimator ofFloat2;
int indexOf;
boolean z4 = z2 && i2 == 1 && this.d1 != null;
if (z2) {
if (i2 != 0) {
this.e1 = this.d1;
this.t1 = this.s1;
this.X0.j();
ArrayList<Object> arrayList = this.b1;
if (arrayList != null) {
d17 d17Var = this.d1;
if (d17Var == null) {
indexOf = 0;
} else {
indexOf = arrayList.indexOf(d17Var) + (this.q == 2 ? 1 : 0);
}
this.Y0.H2(indexOf, (this.W0.getMeasuredWidth() - AndroidUtilities.dp(124.0f)) / 2);
}
} else if (this.q == 2) {
this.h1 = this.g1;
int i4 = this.i1;
this.l1 = i4;
int i5 = this.j1;
this.m1 = i5;
int i6 = this.k1;
this.n1 = i6;
int i7 = this.W;
this.p1 = i7;
this.d0.K(0, false, 4, i6 != 0 ? 4 : i5 != 0 ? 3 : i4 != 0 ? 2 : 1, false, i7, false);
this.d0.J(this.k1, 3);
this.d0.J(this.j1, 2);
this.d0.J(this.i1, 1);
this.d0.J(this.g1, 0);
}
}
int i8 = this.q;
if (i8 == 1 || i8 == 2) {
this.Q0[z4 ? (char) 2 : (char) 0].setVisibility(0);
}
if (i2 == 1 && !this.a1.d()) {
float f2 = this.s1;
if (f2 < 0.0f) {
float f3 = -f2;
this.s1 = f3;
this.a1.setProgress(f3);
}
}
if (!z3) {
char c2 = i2 == 0 ? (char) 1 : (char) 0;
if (z2) {
this.S0[i2].setVisibility(0);
int i9 = this.q;
if (i9 == 1) {
this.B0.setTranslationY(i2 == 1 ? -AndroidUtilities.dp(21.0f) : 0.0f);
this.Q0[2].setAlpha(z4 ? 1.0f : 0.0f);
this.Q0[0].setAlpha(z4 ? 0.0f : 1.0f);
FrameLayout[] frameLayoutArr = this.S0;
if (i2 == 1) {
frameLayout3 = frameLayoutArr[i2];
frameLayout3.setAlpha(1.0f);
} else {
frameLayoutArr[i2].setAlpha(1.0f);
frameLayout2 = this.S0[c2];
frameLayout2.setAlpha(0.0f);
}
} else if (i9 == 2) {
this.B0.setTranslationY((-AndroidUtilities.dp(i2 == 0 ? 343.0f : 316.0f)) + AndroidUtilities.dp(48.0f));
this.Q0[2].setAlpha(z4 ? 1.0f : 0.0f);
this.Q0[0].setAlpha(z4 ? 0.0f : 1.0f);
this.D0.setAlpha(0.0f);
if (this.S0[c2].getVisibility() == 0) {
this.S0[c2].setAlpha(0.0f);
this.S0[i2].setAlpha(1.0f);
frameLayout4 = this.S0[i2];
} else {
frameLayout4 = this.S0[i2];
}
frameLayout4.setTranslationY(0.0f);
} else {
FrameLayout[] frameLayoutArr2 = this.S0;
if (i2 == 1) {
frameLayout3 = frameLayoutArr2[i2];
frameLayout3.setAlpha(1.0f);
} else {
frameLayoutArr2[i2].setAlpha(1.0f);
frameLayout2 = this.S0[c2];
frameLayout2.setAlpha(0.0f);
}
}
this.d0.z();
} else {
this.B0.setTranslationY(0.0f);
this.S0[i2].setTranslationY(r8[i2].getMeasuredHeight());
this.Q0[0].setAlpha(1.0f);
this.Q0[2].setAlpha(1.0f);
this.D0.setAlpha(1.0f);
}
if (!z2 || this.S0[c2].getVisibility() != 0) {
if (!z2) {
frameLayout = this.S0[i2];
}
i3 = this.q;
if (i3 != 1 || i3 == 2) {
this.Q0[z4 ? (char) 0 : (char) 2].setVisibility(4);
return;
} else {
if (i2 == 1) {
this.S0[c2].setAlpha(0.0f);
return;
}
return;
}
}
this.S0[c2].setAlpha(1.0f);
frameLayout = this.S0[c2];
frameLayout.setVisibility(4);
i3 = this.q;
if (i3 != 1) {
}
this.Q0[z4 ? (char) 0 : (char) 2].setVisibility(4);
return;
}
this.u1 = new AnimatorSet();
ArrayList arrayList2 = new ArrayList();
int i10 = i2 == 0 ? 1 : 0;
if (z2) {
this.S0[i2].setVisibility(0);
int i11 = this.q;
if (i11 == 1) {
org.telegram.ui.Components.h6 h6Var = this.B0;
Property property = View.TRANSLATION_Y;
float[] fArr = new float[1];
fArr[0] = i2 == 1 ? -AndroidUtilities.dp(21.0f) : 0.0f;
arrayList2.add(ObjectAnimator.ofFloat(h6Var, (Property<org.telegram.ui.Components.h6, Float>) property, fArr));
org.telegram.ui.Components.j9 j9Var = this.Q0[2];
Property property2 = View.ALPHA;
float[] fArr2 = new float[1];
fArr2[0] = z4 ? 1.0f : 0.0f;
arrayList2.add(ObjectAnimator.ofFloat(j9Var, (Property<org.telegram.ui.Components.j9, Float>) property2, fArr2));
org.telegram.ui.Components.j9 j9Var2 = this.Q0[0];
Property property3 = View.ALPHA;
float[] fArr3 = new float[1];
fArr3[0] = z4 ? 0.0f : 1.0f;
arrayList2.add(ObjectAnimator.ofFloat(j9Var2, (Property<org.telegram.ui.Components.j9, Float>) property3, fArr3));
if (i2 == 1) {
ofFloat2 = ObjectAnimator.ofFloat(this.S0[i2], (Property<FrameLayout, Float>) View.ALPHA, 0.0f, 1.0f);
} else {
this.S0[i2].setAlpha(1.0f);
ofFloat2 = ObjectAnimator.ofFloat(this.S0[i10], (Property<FrameLayout, Float>) View.ALPHA, 0.0f);
}
} else if (i11 == 2) {
arrayList2.add(ObjectAnimator.ofFloat(this.B0, (Property<org.telegram.ui.Components.h6, Float>) View.TRANSLATION_Y, (-this.S0[i2].getMeasuredHeight()) + AndroidUtilities.dp(48.0f)));
org.telegram.ui.Components.j9 j9Var3 = this.Q0[2];
Property property4 = View.ALPHA;
float[] fArr4 = new float[1];
fArr4[0] = z4 ? 1.0f : 0.0f;
arrayList2.add(ObjectAnimator.ofFloat(j9Var3, (Property<org.telegram.ui.Components.j9, Float>) property4, fArr4));
org.telegram.ui.Components.j9 j9Var4 = this.Q0[0];
Property property5 = View.ALPHA;
float[] fArr5 = new float[1];
fArr5[0] = z4 ? 0.0f : 1.0f;
arrayList2.add(ObjectAnimator.ofFloat(j9Var4, (Property<org.telegram.ui.Components.j9, Float>) property5, fArr5));
arrayList2.add(ObjectAnimator.ofFloat(this.D0, (Property<org.telegram.messenger.p110.pf, Float>) View.ALPHA, 0.0f));
if (this.S0[i10].getVisibility() == 0) {
arrayList2.add(ObjectAnimator.ofFloat(this.S0[i10], (Property<FrameLayout, Float>) View.ALPHA, 0.0f));
arrayList2.add(ObjectAnimator.ofFloat(this.S0[i2], (Property<FrameLayout, Float>) View.ALPHA, 0.0f, 1.0f));
this.S0[i2].setTranslationY(0.0f);
this.u1.playTogether(arrayList2);
this.u1.addListener(new u(z2, i10, i2, z4));
this.u1.setInterpolator(zq0.g);
this.u1.setDuration(200L);
this.u1.start();
}
ofFloat = ObjectAnimator.ofFloat(this.S0[i2], (Property<FrameLayout, Float>) View.TRANSLATION_Y, r8[i2].getMeasuredHeight(), 0.0f);
} else if (i2 == 1) {
ofFloat2 = ObjectAnimator.ofFloat(this.S0[i2], (Property<FrameLayout, Float>) View.ALPHA, 0.0f, 1.0f);
} else {
this.S0[i2].setAlpha(1.0f);
ofFloat2 = ObjectAnimator.ofFloat(this.S0[i10], (Property<FrameLayout, Float>) View.ALPHA, 0.0f);
}
arrayList2.add(ofFloat2);
this.d0.z();
this.u1.playTogether(arrayList2);
this.u1.addListener(new u(z2, i10, i2, z4));
this.u1.setInterpolator(zq0.g);
this.u1.setDuration(200L);
this.u1.start();
}
arrayList2.add(ObjectAnimator.ofFloat(this.B0, (Property<org.telegram.ui.Components.h6, Float>) View.TRANSLATION_Y, 0.0f));
arrayList2.add(ObjectAnimator.ofFloat(this.S0[i2], (Property<FrameLayout, Float>) View.TRANSLATION_Y, r8[i2].getMeasuredHeight()));
arrayList2.add(ObjectAnimator.ofFloat(this.Q0[0], (Property<org.telegram.ui.Components.j9, Float>) View.ALPHA, 1.0f));
arrayList2.add(ObjectAnimator.ofFloat(this.Q0[2], (Property<org.telegram.ui.Components.j9, Float>) View.ALPHA, 0.0f));
ofFloat = ObjectAnimator.ofFloat(this.D0, (Property<org.telegram.messenger.p110.pf, Float>) View.ALPHA, 1.0f);
arrayList2.add(ofFloat);
this.u1.playTogether(arrayList2);
this.u1.addListener(new u(z2, i10, i2, z4));
this.u1.setInterpolator(zq0.g);
this.u1.setDuration(200L);
this.u1.start();
}
private void N4() {
if (this.H1 && this.z1 == null) {
Bitmap bitmap = this.E1;
if (bitmap != null) {
this.A1 = bitmap;
} else {
ImageReceiver imageReceiver = this.D0.getImageReceiver();
if (imageReceiver.hasNotThumb() || imageReceiver.hasStaticThumb()) {
this.A1 = imageReceiver.getBitmap();
bitmap = imageReceiver.getBitmap();
}
}
this.z1 = Utilities.blurWallpaper(bitmap);
}
if (!this.H1) {
H4(false);
return;
}
Bitmap bitmap2 = this.z1;
if (bitmap2 != null) {
this.D0.setImageBitmap(bitmap2);
}
}
private void O4(boolean z2, boolean z3) {
File httpFilePath;
String name;
int i2;
File file;
String str;
TextView textView;
FrameLayout frameLayout;
Object obj = this.d1;
if (obj == null) {
obj = this.D1;
}
boolean z4 = obj instanceof d17;
if (!z4 && !(obj instanceof MediaController.SearchImage)) {
me4 me4Var = this.I0;
if (me4Var != null) {
me4Var.u(4, z2, z3);
return;
}
return;
}
if (z3 && !this.J1) {
z3 = false;
}
if (z4) {
d17 d17Var = (d17) obj;
str = FileLoader.getAttachFileName(d17Var.i);
if (TextUtils.isEmpty(str)) {
return;
}
file = FileLoader.getPathToAttach(d17Var.i, true);
i2 = d17Var.i.size;
} else {
MediaController.SearchImage searchImage = (MediaController.SearchImage) obj;
pc5 pc5Var = searchImage.photo;
if (pc5Var != null) {
qc5 closestPhotoSizeWithSize = FileLoader.getClosestPhotoSizeWithSize(pc5Var.g, this.L1, true);
httpFilePath = FileLoader.getPathToAttach(closestPhotoSizeWithSize, true);
name = FileLoader.getAttachFileName(closestPhotoSizeWithSize);
i2 = closestPhotoSizeWithSize.e;
} else {
httpFilePath = ImageLoader.getHttpFilePath(searchImage.imageUrl, "jpg");
name = httpFilePath.getName();
i2 = searchImage.size;
}
String str2 = name;
file = httpFilePath;
str = str2;
if (TextUtils.isEmpty(str)) {
return;
}
}
boolean exists = file.exists();
if (exists) {
DownloadController.getInstance(this.d).removeLoadingFileObserver(this);
me4 me4Var2 = this.I0;
if (me4Var2 != null) {
me4Var2.C(1.0f, z3);
this.I0.u(4, z2, z3);
}
this.D0.invalidate();
if (this.q == 2) {
org.telegram.ui.ActionBar.a aVar = this.z0;
if (i2 != 0) {
aVar.setSubtitle(AndroidUtilities.formatFileSize(i2));
} else {
aVar.setSubtitle(null);
}
}
} else {
DownloadController.getInstance(this.d).addLoadingFileObserver(str, null, this);
if (this.I0 != null) {
FileLoader.getInstance(this.d).isLoadingFile(str);
Float fileProgress = ImageLoader.getInstance().getFileProgress(str);
if (fileProgress != null) {
this.I0.C(fileProgress.floatValue(), z3);
} else {
this.I0.C(0.0f, z3);
}
this.I0.u(10, z2, z3);
}
if (this.q == 2) {
this.z0.setSubtitle(LocaleController.getString("LoadingFullImage", R.string.LoadingFullImage));
}
this.D0.invalidate();
}
if (this.d1 == null && (frameLayout = this.E0) != null) {
frameLayout.setAlpha(exists ? 1.0f : 0.5f);
}
int i3 = this.q;
if (i3 == 0) {
this.k0.setEnabled(exists);
textView = this.k0;
} else if (i3 != 2) {
this.t.setEnabled(exists);
this.t.setAlpha(exists ? 1.0f : 0.5f);
} else {
this.J0.setEnabled(exists);
textView = this.C1;
}
}
private void P4() {
int i2 = this.q;
if (i2 == 1 || i2 == 2) {
if (this.d1 == null && (this.D1 instanceof Cif.i)) {
this.Q0[2].f(false, true);
}
this.Q0[this.d1 != null ? (char) 2 : (char) 0].setVisibility(0);
AnimatorSet animatorSet = new AnimatorSet();
Animator[] animatorArr = new Animator[2];
org.telegram.ui.Components.j9 j9Var = this.Q0[2];
Property property = View.ALPHA;
float[] fArr = new float[1];
fArr[0] = this.d1 != null ? 1.0f : 0.0f;
animatorArr[0] = ObjectAnimator.ofFloat(j9Var, (Property<org.telegram.ui.Components.j9, Float>) property, fArr);
org.telegram.ui.Components.j9 j9Var2 = this.Q0[0];
Property property2 = View.ALPHA;
float[] fArr2 = new float[1];
fArr2[0] = this.d1 != null ? 0.0f : 1.0f;
animatorArr[1] = ObjectAnimator.ofFloat(j9Var2, (Property<org.telegram.ui.Components.j9, Float>) property2, fArr2);
animatorSet.playTogether(animatorArr);
animatorSet.addListener(new s());
animatorSet.setInterpolator(zq0.g);
animatorSet.setDuration(200L);
animatorSet.start();
return;
}
boolean isEnabled = this.Q0[0].isEnabled();
d17 d17Var = this.d1;
if (isEnabled == (d17Var != null)) {
return;
}
if (d17Var == null) {
this.Q0[0].f(false, true);
}
this.Q0[0].setEnabled(this.d1 != null);
if (this.d1 != null) {
this.Q0[0].setVisibility(0);
}
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.Q0[1].getLayoutParams();
AnimatorSet animatorSet2 = new AnimatorSet();
int dp = (layoutParams.width + AndroidUtilities.dp(9.0f)) / 2;
Animator[] animatorArr2 = new Animator[1];
org.telegram.ui.Components.j9 j9Var3 = this.Q0[0];
Property property3 = View.ALPHA;
float[] fArr3 = new float[1];
fArr3[0] = this.d1 == null ? 0.0f : 1.0f;
animatorArr2[0] = ObjectAnimator.ofFloat(j9Var3, (Property<org.telegram.ui.Components.j9, Float>) property3, fArr3);
animatorSet2.playTogether(animatorArr2);
Animator[] animatorArr3 = new Animator[1];
org.telegram.ui.Components.j9 j9Var4 = this.Q0[0];
Property property4 = View.TRANSLATION_X;
float[] fArr4 = new float[1];
fArr4[0] = this.d1 != null ? 0.0f : dp;
animatorArr3[0] = ObjectAnimator.ofFloat(j9Var4, (Property<org.telegram.ui.Components.j9, Float>) property4, fArr4);
animatorSet2.playTogether(animatorArr3);
Animator[] animatorArr4 = new Animator[1];
org.telegram.ui.Components.j9 j9Var5 = this.Q0[1];
Property property5 = View.TRANSLATION_X;
float[] fArr5 = new float[1];
fArr5[0] = this.d1 == null ? -dp : 0.0f;
animatorArr4[0] = ObjectAnimator.ofFloat(j9Var5, (Property<org.telegram.ui.Components.j9, Float>) property5, fArr5);
animatorSet2.playTogether(animatorArr4);
animatorSet2.setInterpolator(zq0.g);
animatorSet2.setDuration(200L);
animatorSet2.addListener(new t());
animatorSet2.start();
}
private void Q4(boolean z2) {
boolean z3;
int i2;
if (Build.VERSION.SDK_INT >= 29) {
int i3 = this.q;
if (i3 == 0) {
w.u uVar = this.x;
i2 = uVar != null ? (int) uVar.l : org.telegram.ui.ActionBar.w.r1("key_chat_wallpaper_gradient_to2");
} else if (i3 == 1) {
i2 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to2");
long j2 = this.x.l;
int i4 = (int) j2;
if (i4 != 0 || j2 == 0) {
if (i4 != 0) {
i2 = i4;
}
}
i2 = 0;
} else {
Object obj = this.D1;
if (obj instanceof Cif.i) {
i2 = this.j1;
}
i2 = 0;
}
if (i2 == 0 || this.s1 < 0.0f) {
this.D0.getImageReceiver().setBlendMode(null);
} else {
this.D0.getImageReceiver().setBlendMode(BlendMode.SOFT_LIGHT);
}
}
if (this.K0 != null) {
int i5 = this.q;
if (i5 != 2) {
if (i5 == 1) {
int E1 = org.telegram.ui.ActionBar.w.E1("chat_wallpaper_gradient_to");
long j3 = this.x.k;
int i6 = (int) j3;
if (i6 == 0 && j3 != 0) {
E1 = 0;
} else if (i6 != 0) {
E1 = i6;
}
}
z3 = false;
}
boolean z4 = this.K0.getTag() != null;
this.K0.setTag(z3 ? 1 : null);
if (z4 != z3) {
if (z3) {
this.K0.setVisibility(0);
}
AnimatorSet animatorSet = this.O0;
if (animatorSet != null) {
animatorSet.cancel();
}
if (z2) {
AnimatorSet animatorSet2 = new AnimatorSet();
this.O0 = animatorSet2;
Animator[] animatorArr = new Animator[6];
FrameLayout frameLayout = this.K0;
Property property = View.ALPHA;
float[] fArr = new float[1];
fArr[0] = z3 ? 1.0f : 0.0f;
animatorArr[0] = ObjectAnimator.ofFloat(frameLayout, (Property<FrameLayout, Float>) property, fArr);
FrameLayout frameLayout2 = this.K0;
Property property2 = View.SCALE_X;
float[] fArr2 = new float[1];
fArr2[0] = z3 ? 1.0f : 0.0f;
animatorArr[1] = ObjectAnimator.ofFloat(frameLayout2, (Property<FrameLayout, Float>) property2, fArr2);
FrameLayout frameLayout3 = this.K0;
Property property3 = View.SCALE_Y;
float[] fArr3 = new float[1];
fArr3[0] = z3 ? 1.0f : 0.0f;
animatorArr[2] = ObjectAnimator.ofFloat(frameLayout3, (Property<FrameLayout, Float>) property3, fArr3);
org.telegram.ui.Components.j9 j9Var = this.Q0[0];
Property property4 = View.TRANSLATION_X;
float[] fArr4 = new float[1];
fArr4[0] = z3 ? AndroidUtilities.dp(34.0f) : 0.0f;
animatorArr[3] = ObjectAnimator.ofFloat(j9Var, (Property<org.telegram.ui.Components.j9, Float>) property4, fArr4);
org.telegram.ui.Components.j9 j9Var2 = this.Q0[1];
Property property5 = View.TRANSLATION_X;
float[] fArr5 = new float[1];
fArr5[0] = z3 ? -AndroidUtilities.dp(34.0f) : 0.0f;
animatorArr[4] = ObjectAnimator.ofFloat(j9Var2, (Property<org.telegram.ui.Components.j9, Float>) property5, fArr5);
org.telegram.ui.Components.j9 j9Var3 = this.Q0[2];
Property property6 = View.TRANSLATION_X;
float[] fArr6 = new float[1];
fArr6[0] = z3 ? AndroidUtilities.dp(34.0f) : 0.0f;
animatorArr[5] = ObjectAnimator.ofFloat(j9Var3, (Property<org.telegram.ui.Components.j9, Float>) property6, fArr6);
animatorSet2.playTogether(animatorArr);
this.O0.setDuration(180L);
this.O0.addListener(new x());
this.O0.setInterpolator(zq0.g);
this.O0.start();
} else {
this.K0.setAlpha(z3 ? 1.0f : 0.0f);
this.K0.setScaleX(z3 ? 1.0f : 0.0f);
this.K0.setScaleY(z3 ? 1.0f : 0.0f);
this.Q0[0].setTranslationX(z3 ? AndroidUtilities.dp(34.0f) : 0.0f);
this.Q0[1].setTranslationX(z3 ? -AndroidUtilities.dp(34.0f) : 0.0f);
this.Q0[2].setTranslationX(z3 ? AndroidUtilities.dp(34.0f) : 0.0f);
}
}
}
FrameLayout frameLayout4 = this.L0;
if (frameLayout4 != null) {
boolean z5 = frameLayout4.getTag() != null;
this.L0.setTag(1);
if (!z5) {
this.L0.setVisibility(0);
AnimatorSet animatorSet3 = this.P0;
if (animatorSet3 != null) {
animatorSet3.cancel();
}
if (!z2) {
this.L0.setAlpha(1.0f);
this.L0.setScaleX(1.0f);
this.L0.setScaleY(1.0f);
this.R0[0].setTranslationX(-AndroidUtilities.dp(34.0f));
this.R0[1].setTranslationX(AndroidUtilities.dp(34.0f));
return;
}
AnimatorSet animatorSet4 = new AnimatorSet();
this.P0 = animatorSet4;
animatorSet4.playTogether(ObjectAnimator.ofFloat(this.L0, (Property<FrameLayout, Float>) View.ALPHA, 1.0f), ObjectAnimator.ofFloat(this.L0, (Property<FrameLayout, Float>) View.SCALE_X, 1.0f), ObjectAnimator.ofFloat(this.L0, (Property<FrameLayout, Float>) View.SCALE_Y, 1.0f), ObjectAnimator.ofFloat(this.R0[0], (Property<org.telegram.ui.Components.j9, Float>) View.TRANSLATION_X, -AndroidUtilities.dp(34.0f)), ObjectAnimator.ofFloat(this.R0[1], (Property<org.telegram.ui.Components.j9, Float>) View.TRANSLATION_X, AndroidUtilities.dp(34.0f)));
this.P0.setDuration(180L);
this.P0.addListener(new y());
this.P0.setInterpolator(zq0.g);
this.P0.start();
}
}
}
private void R4(boolean z2) {
int childCount = this.W0.getChildCount();
for (int i2 = 0; i2 < childCount; i2++) {
View childAt = this.W0.getChildAt(i2);
if (childAt instanceof xs3) {
((xs3) childAt).t(z2);
}
}
}
private void S3() {
AnimatorSet animatorSet = this.H0;
if (animatorSet != null) {
animatorSet.cancel();
}
AnimatorSet animatorSet2 = new AnimatorSet();
this.H0 = animatorSet2;
if (this.G1) {
animatorSet2.playTogether(ObjectAnimator.ofFloat(this.D0, (Property<org.telegram.messenger.p110.pf, Float>) View.SCALE_X, this.B1), ObjectAnimator.ofFloat(this.D0, (Property<org.telegram.messenger.p110.pf, Float>) View.SCALE_Y, this.B1));
} else {
animatorSet2.playTogether(ObjectAnimator.ofFloat(this.D0, (Property<org.telegram.messenger.p110.pf, Float>) View.SCALE_X, 1.0f), ObjectAnimator.ofFloat(this.D0, (Property<org.telegram.messenger.p110.pf, Float>) View.SCALE_Y, 1.0f), ObjectAnimator.ofFloat(this.D0, (Property<org.telegram.messenger.p110.pf, Float>) View.TRANSLATION_X, 0.0f), ObjectAnimator.ofFloat(this.D0, (Property<org.telegram.messenger.p110.pf, Float>) View.TRANSLATION_Y, 0.0f));
}
this.H0.setInterpolator(zq0.g);
this.H0.addListener(new w());
this.H0.start();
}
private void T3(int i2, int i3) {
int size;
int i4;
View view;
int i5 = this.v;
if (i5 == 1) {
if (i3 == 0) {
this.x.c = i2;
org.telegram.ui.ActionBar.w.P2();
} else if (i3 == 1) {
this.x.d = i2;
org.telegram.ui.ActionBar.w.Q2(true, true);
this.B0.G2();
}
size = this.q0.size();
for (i4 = 0; i4 < size; i4++) {
org.telegram.ui.ActionBar.a0 a0Var = this.q0.get(i4);
a0Var.i(org.telegram.ui.ActionBar.w.r1(a0Var.c()), false, false);
}
this.v0.G2();
this.B0.G2();
view = this.i0;
if (view != null) {
view.invalidate();
return;
}
return;
}
if (i5 == 2) {
if (this.f0 == 0) {
this.x.j = i2;
} else if (i3 == 1) {
int E1 = org.telegram.ui.ActionBar.w.E1("chat_wallpaper_gradient_to");
if (i2 != 0 || E1 == 0) {
this.x.k = i2;
} else {
this.x.k = 4294967296L;
}
} else if (i3 == 2) {
int E12 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to2");
if (i2 != 0 || E12 == 0) {
this.x.l = i2;
} else {
this.x.l = 4294967296L;
}
} else if (i3 == 3) {
int E13 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to3");
if (i2 != 0 || E13 == 0) {
this.x.m = i2;
} else {
this.x.m = 4294967296L;
}
}
org.telegram.ui.ActionBar.w.Q2(true, false);
} else {
if (i5 == 3) {
int i6 = this.f0;
if (i6 == 0) {
this.x.e = i2;
} else if (i6 == 1) {
this.x.f = i2;
} else if (i6 == 2) {
w.u uVar = this.x;
int i7 = uVar.g;
uVar.g = i2;
if (i7 != 0 && i2 == 0) {
this.C0.s(0);
} else if (i7 == 0 && i2 != 0) {
this.C0.m(0);
L4();
}
} else {
this.x.h = i2;
}
int i8 = this.f0;
if (i8 >= 0) {
this.R0[1].g(i8, i2);
}
org.telegram.ui.ActionBar.w.Q2(true, true);
this.B0.G2();
}
size = this.q0.size();
while (i4 < size) {
}
this.v0.G2();
this.B0.G2();
view = this.i0;
if (view != null) {
}
}
this.d0.setHasChanges(Y3(this.v));
Q4(true);
size = this.q0.size();
while (i4 < size) {
}
this.v0.G2();
this.B0.G2();
view = this.i0;
if (view != null) {
}
}
public void U3(boolean z2) {
if (this.q == 2) {
if (z2) {
return;
}
D();
return;
}
org.telegram.ui.ActionBar.w.W();
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didSetNewWallpapper);
if (this.q == 1) {
if (this.o0) {
w.u uVar = this.x;
uVar.c = this.z;
uVar.d = this.A;
uVar.e = this.B;
uVar.f = this.G;
uVar.g = this.H;
uVar.h = this.I;
uVar.i = this.J;
uVar.j = this.Q;
uVar.k = this.R;
uVar.l = this.S;
uVar.m = this.T;
uVar.n = this.W;
uVar.o = this.V;
uVar.p = this.U;
}
org.telegram.ui.ActionBar.w.Y2(this.m0, false, true, false, false);
} else {
if (this.x != null) {
org.telegram.ui.ActionBar.w.Y2(this.m0, false, this.p0, false, false);
}
this.f.J0(false, false);
if (this.p0) {
w.v vVar = this.m0;
if (vVar.b != null && !org.telegram.ui.ActionBar.w.x2(vVar)) {
new File(this.m0.b).delete();
}
}
}
if (z2) {
return;
}
D();
}
public boolean V3() {
if (this.q == 1) {
w.u uVar = this.x;
if (uVar.c == this.z && uVar.d == this.A && uVar.e == this.B && uVar.f == this.G && uVar.g == this.H && uVar.h == this.I && uVar.i == this.J && uVar.j == this.Q && uVar.k == this.R && uVar.l == this.S && uVar.m == this.T && Math.abs(uVar.p - this.U) <= 0.001f) {
w.u uVar2 = this.x;
if (uVar2.n == this.W) {
String str = uVar2.o;
d17 d17Var = this.d1;
if (str.equals(d17Var != null ? d17Var.h : BuildConfig.FLAVOR)) {
d17 d17Var2 = this.d1;
if (d17Var2 != null) {
}
if (d17Var2 != null) {
}
}
}
}
i.C0142i c0142i = new i.C0142i(c0());
c0142i.u(LocaleController.getString("SaveChangesAlertTitle", R.string.SaveChangesAlertTitle));
c0142i.l(LocaleController.getString("SaveChangesAlertText", R.string.SaveChangesAlertText));
c0142i.s(LocaleController.getString("Save", R.string.Save), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
org.telegram.ui.ff.this.Z3(dialogInterface, i2);
}
});
c0142i.n(LocaleController.getString("PassportDiscard", R.string.PassportDiscard), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
org.telegram.ui.ff.this.a4(dialogInterface, i2);
}
});
o1(c0142i.a());
return false;
}
return true;
}
public int W3(String str) {
return this.r ? org.telegram.ui.ActionBar.w.F1(str) : org.telegram.ui.ActionBar.w.r1(str);
}
private List<org.telegram.ui.ActionBar.a0> X3() {
a0.a aVar = new a0.a() {
@Override
public void a(float f2) {
aa7.a(this, f2);
}
@Override
public final void b() {
org.telegram.ui.ff.this.t4();
}
};
ArrayList arrayList = new ArrayList();
arrayList.add(new org.telegram.ui.ActionBar.a0(this.u0, org.telegram.ui.ActionBar.a0.q, null, null, null, aVar, "windowBackgroundWhite"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.r0, org.telegram.ui.ActionBar.a0.F, null, null, null, null, "actionBarDefault"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.q, null, null, null, null, "actionBarDefault"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.y, null, null, null, null, "actionBarDefaultSelector"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.x, null, null, null, null, "actionBarDefaultTitle"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.R, null, null, null, null, "actionBarDefaultSearch"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.Q, null, null, null, null, "actionBarDefaultSearchPlaceholder"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.z0, org.telegram.ui.ActionBar.a0.q, null, null, null, null, "actionBarDefault"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.z0, org.telegram.ui.ActionBar.a0.x, null, null, null, null, "actionBarDefaultTitle"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.z0, org.telegram.ui.ActionBar.a0.A, null, null, null, null, "actionBarDefaultSubtitle"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.z0, org.telegram.ui.ActionBar.a0.y, null, null, null, null, "actionBarDefaultSelector"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.z0, org.telegram.ui.ActionBar.a0.V, null, null, null, aVar, "actionBarDefaultSubmenuBackground"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.z0, org.telegram.ui.ActionBar.a0.U, null, null, null, aVar, "actionBarDefaultSubmenuItem"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.v0, org.telegram.ui.ActionBar.a0.F, null, null, null, null, "actionBarDefault"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, org.telegram.ui.ActionBar.a0.F, null, null, null, null, "actionBarDefault"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.x0, org.telegram.ui.ActionBar.a0.t, null, null, null, null, "chats_actionIcon"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.x0, org.telegram.ui.ActionBar.a0.v, null, null, null, null, "chats_actionBackground"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.x0, org.telegram.ui.ActionBar.a0.v | org.telegram.ui.ActionBar.a0.G, null, null, null, null, "chats_actionPressedBackground"));
if (!this.r) {
arrayList.add(new org.telegram.ui.ActionBar.a0(this.j0, org.telegram.ui.ActionBar.a0.q, null, null, null, null, "windowBackgroundWhite"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.l0, org.telegram.ui.ActionBar.a0.s, null, null, null, null, "chat_fieldOverlayText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.k0, org.telegram.ui.ActionBar.a0.s, null, null, null, null, "chat_fieldOverlayText"));
}
ColorPicker colorPicker = this.d0;
if (colorPicker != null) {
colorPicker.I(arrayList);
}
if (this.S0 != null) {
for (int i2 = 0; i2 < this.S0.length; i2++) {
arrayList.add(new org.telegram.ui.ActionBar.a0(this.S0[i2], 0, null, null, new Drawable[]{org.telegram.ui.ActionBar.w.H2}, null, "chat_messagePanelShadow"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.S0[i2], 0, null, org.telegram.ui.ActionBar.w.X1, null, null, "chat_messagePanelBackground"));
}
for (int i3 = 0; i3 < this.V0.length; i3++) {
arrayList.add(new org.telegram.ui.ActionBar.a0(this.V0[i3], 0, null, null, new Drawable[]{org.telegram.ui.ActionBar.w.H2}, null, "chat_messagePanelShadow"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.V0[i3], 0, null, org.telegram.ui.ActionBar.w.X1, null, null, "chat_messagePanelBackground"));
}
arrayList.add(new org.telegram.ui.ActionBar.a0(this.J0, 0, null, null, new Drawable[]{org.telegram.ui.ActionBar.w.H2}, null, "chat_messagePanelShadow"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.J0, 0, null, org.telegram.ui.ActionBar.w.X1, null, null, "chat_messagePanelBackground"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.C1, org.telegram.ui.ActionBar.a0.s, null, null, null, null, "chat_fieldOverlayText"));
for (int i4 = 0; i4 < this.U0.length; i4++) {
arrayList.add(new org.telegram.ui.ActionBar.a0(this.U0[i4], org.telegram.ui.ActionBar.a0.s, null, null, null, null, "chat_fieldOverlayText"));
}
for (int i5 = 0; i5 < this.T0.length; i5++) {
arrayList.add(new org.telegram.ui.ActionBar.a0(this.T0[i5], org.telegram.ui.ActionBar.a0.s, null, null, null, null, "chat_fieldOverlayText"));
}
arrayList.add(new org.telegram.ui.ActionBar.a0(this.a1, 0, new Class[]{org.telegram.ui.Components.p6.class}, new String[]{"innerPaint1"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "player_progressBackground"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.a1, 0, new Class[]{org.telegram.ui.Components.p6.class}, new String[]{"outerPaint1"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "player_progress"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.Z0, 0, new Class[]{rr1.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteBlueHeader"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{org.telegram.ui.ActionBar.w.K2, org.telegram.ui.ActionBar.w.O2}, null, "chat_inBubble"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{org.telegram.ui.ActionBar.w.L2, org.telegram.ui.ActionBar.w.P2}, null, "chat_inBubbleSelected"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, org.telegram.ui.ActionBar.w.K2.n(), null, "chat_inBubbleShadow"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, org.telegram.ui.ActionBar.w.O2.n(), null, "chat_inBubbleShadow"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{this.Z, this.b0}, null, "chat_outBubble"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{this.Z, this.b0}, null, "chat_outBubbleGradient"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{this.Z, this.b0}, null, "chat_outBubbleGradient2"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{this.Z, this.b0}, null, "chat_outBubbleGradient3"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{org.telegram.ui.ActionBar.w.N2, org.telegram.ui.ActionBar.w.R2}, null, "chat_outBubbleSelected"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, org.telegram.ui.ActionBar.w.M2.n(), null, "chat_outBubbleShadow"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, org.telegram.ui.ActionBar.w.Q2.n(), null, "chat_outBubbleShadow"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_messageTextIn"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_messageTextOut"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{org.telegram.ui.ActionBar.w.U2}, null, "chat_outSentCheck"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{org.telegram.ui.ActionBar.w.V2}, null, "chat_outSentCheckSelected"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{org.telegram.ui.ActionBar.w.W2, org.telegram.ui.ActionBar.w.Y2}, null, "chat_outSentCheckRead"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{org.telegram.ui.ActionBar.w.X2, org.telegram.ui.ActionBar.w.Z2}, null, "chat_outSentCheckReadSelected"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, new Drawable[]{org.telegram.ui.ActionBar.w.b3, org.telegram.ui.ActionBar.w.c3}, null, "chat_mediaSentCheck"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_inReplyLine"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_outReplyLine"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_inReplyNameText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_outReplyNameText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_inReplyMessageText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_outReplyMessageText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_inReplyMediaMessageSelectedText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_outReplyMediaMessageSelectedText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_inTimeText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_outTimeText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_inTimeSelectedText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.B0, 0, new Class[]{ed0.class}, null, null, null, "chat_outTimeSelectedText"));
}
return arrayList;
}
private boolean Y3(int i2) {
int E1;
long j2;
if (this.o0) {
return false;
}
if (i2 == 1 || i2 == 2) {
long j3 = this.Q;
if (j3 == 0) {
int E12 = org.telegram.ui.ActionBar.w.E1("chat_wallpaper");
int i3 = (int) this.x.j;
if (i3 == 0) {
i3 = E12;
}
if (i3 != E12) {
return true;
}
} else if (j3 != this.x.j) {
return true;
}
long j4 = this.R;
if (j4 == 0 && this.S == 0 && this.T == 0) {
for (int i4 = 0; i4 < 3; i4++) {
if (i4 == 0) {
E1 = org.telegram.ui.ActionBar.w.E1("chat_wallpaper_gradient_to");
j2 = this.x.k;
} else if (i4 == 1) {
E1 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to2");
j2 = this.x.l;
} else {
E1 = org.telegram.ui.ActionBar.w.E1("key_chat_wallpaper_gradient_to3");
j2 = this.x.m;
}
int i5 = (int) j2;
if (i5 == 0 && j2 != 0) {
i5 = 0;
} else if (i5 == 0) {
i5 = E1;
}
if (i5 != E1) {
return true;
}
}
} else {
w.u uVar = this.x;
if (j4 != uVar.k || this.S != uVar.l || this.T != uVar.m) {
return true;
}
}
if (this.x.n != this.W) {
return true;
}
}
if (i2 == 1 || i2 == 3) {
int i6 = this.z;
w.u uVar2 = this.x;
if (i6 != uVar2.d) {
return true;
}
int i7 = this.B;
if (i7 == 0) {
int i8 = uVar2.e;
if (i8 != 0 && i8 != uVar2.c) {
return true;
}
} else if (i7 != uVar2.e) {
return true;
}
int i9 = this.G;
if (i9 != 0) {
if (i9 != uVar2.f) {
return true;
}
} else if (uVar2.f != 0) {
return true;
}
int i10 = this.H;
if (i10 != 0) {
if (i10 != uVar2.g) {
return true;
}
} else if (uVar2.g != 0) {
return true;
}
int i11 = this.I;
if (i11 != 0) {
if (i11 != uVar2.h) {
return true;
}
} else if (uVar2.h != 0) {
return true;
}
if (this.J != uVar2.i) {
return true;
}
}
return false;
}
public void Z3(DialogInterface dialogInterface, int i2) {
this.z0.getActionBarMenuOnItemClick().b(4);
}
public void a4(DialogInterface dialogInterface, int i2) {
U3(false);
}
public static void b4(View view, int i2) {
}
public void c4(int i2, View view) {
if (this.u1 != null) {
return;
}
if (this.q == 2) {
M4(i2, false, true);
} else {
M4(0, true, true);
}
}
public void d4(View view, int i2) {
boolean z2 = this.d1 != null;
F4(i2);
if (z2 == (this.d1 == null)) {
S3();
P4();
}
R4(true);
this.Q0[1].f(this.d1 != null, true);
this.W0.G2();
int left = view.getLeft();
int right = view.getRight();
int dp = AndroidUtilities.dp(52.0f);
int i3 = left - dp;
if (i3 < 0) {
this.W0.s1(i3, 0);
return;
}
int i4 = right + dp;
if (i4 > this.W0.getMeasuredWidth()) {
org.telegram.ui.Components.h6 h6Var = this.W0;
h6Var.s1(i4 - h6Var.getMeasuredWidth(), 0);
}
}
public void e4() {
this.X = SystemClock.elapsedRealtime() + 1500;
this.s0.invalidate();
}
public void f4(View view) {
U3(false);
}
public void g4(View view) {
w.v N1 = org.telegram.ui.ActionBar.w.N1();
if (N1 == null) {
return;
}
int i2 = N1.T;
w.u A = i2 >= 0 ? N1.U.get(i2) : N1.A(false);
if (this.x != null) {
B4();
org.telegram.ui.ActionBar.w.Y2(this.m0, true, false, false, false);
org.telegram.ui.ActionBar.w.s0();
org.telegram.ui.ActionBar.w.c0(this.m0, this.n0);
this.f.J0(false, false);
} else {
this.f.J0(false, false);
File file = new File(this.m0.b);
w.v vVar = this.m0;
org.telegram.ui.ActionBar.w.f0(file, vVar.a, vVar.p, false);
MessagesController.getInstance(this.m0.o).saveTheme(this.m0, null, false, false);
SharedPreferences.Editor edit = ApplicationLoader.applicationContext.getSharedPreferences("themeconfig", 0).edit();
edit.putString("lastDayTheme", this.m0.C());
edit.commit();
}
D();
if (this.q == 0) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didApplyNewTheme, N1, A, Boolean.valueOf(this.p0));
}
}
public void h4(ImageReceiver imageReceiver, boolean z2, boolean z3, boolean z4) {
if (this.D1 instanceof Cif.i) {
return;
}
Drawable drawable = imageReceiver.getDrawable();
if (!z2 || drawable == null) {
return;
}
if (!org.telegram.ui.ActionBar.w.n2("chat_serviceBackground") || (this.D0.getBackground() instanceof sg3)) {
org.telegram.ui.ActionBar.w.Q(AndroidUtilities.calcDrawableColor(drawable), drawable);
}
this.B0.G2();
FrameLayout frameLayout = this.E0;
if (frameLayout != null) {
int childCount = frameLayout.getChildCount();
for (int i2 = 0; i2 < childCount; i2++) {
this.E0.getChildAt(i2).invalidate();
}
}
FrameLayout frameLayout2 = this.F0;
if (frameLayout2 != null) {
int childCount2 = frameLayout2.getChildCount();
for (int i3 = 0; i3 < childCount2; i3++) {
this.F0.getChildAt(i3).invalidate();
}
}
me4 me4Var = this.I0;
if (me4Var != null) {
me4Var.s("chat_serviceBackground", "chat_serviceBackground", "chat_serviceText", "chat_serviceText");
}
if (!z3 && this.H1 && this.z1 == null) {
this.D0.getImageReceiver().setCrossfadeWithOldImage(false);
N4();
this.D0.getImageReceiver().setCrossfadeWithOldImage(true);
}
}
public void i4(View view) {
this.s.H0();
}
public void j4(View view, int i2, float f2, float f3) {
if (view instanceof ed0) {
ed0 ed0Var = (ed0) view;
D4(ed0Var.m3(f2, f3) ? ed0Var.getMessageObject().isOutOwner() ? 3 : 1 : 2);
}
}
public void k4(int i2, int i3, float f2) {
if (this.G1) {
this.D0.getBackground();
float scaleX = this.H0 != null ? (this.D0.getScaleX() - 1.0f) / (this.B1 - 1.0f) : 1.0f;
this.D0.setTranslationX(i2 * scaleX);
this.D0.setTranslationY(i3 * scaleX);
}
}
public void l4(View view) {
boolean copyFile;
boolean z2;
Object obj;
String str;
File pathToAttach;
File file;
int i2;
int i3;
int i4;
Object obj2;
k0 k0Var;
w.v i1 = org.telegram.ui.ActionBar.w.i1();
String z3 = i1.z(null, this.H1);
int i5 = 0;
String z4 = this.H1 ? i1.z(null, false) : z3;
File file2 = new File(ApplicationLoader.getFilesDirFixed(), z3);
Object obj3 = this.D1;
if (obj3 instanceof d17) {
try {
} catch (Exception e2) {
FileLog.e(e2);
}
if (this.A1 != null) {
FileOutputStream fileOutputStream = new FileOutputStream(file2);
this.A1.compress(Bitmap.CompressFormat.JPEG, 87, fileOutputStream);
fileOutputStream.close();
} else {
ImageReceiver imageReceiver = this.D0.getImageReceiver();
if (imageReceiver.hasNotThumb() || imageReceiver.hasStaticThumb()) {
Bitmap bitmap = imageReceiver.getBitmap();
FileOutputStream fileOutputStream2 = new FileOutputStream(file2);
bitmap.compress(Bitmap.CompressFormat.JPEG, 87, fileOutputStream2);
fileOutputStream2.close();
}
copyFile = false;
if (!copyFile) {
try {
copyFile = AndroidUtilities.copyFile(FileLoader.getPathToAttach(((d17) this.D1).i, true), file2);
} catch (Exception e3) {
FileLog.e(e3);
}
}
}
copyFile = true;
if (!copyFile) {
}
} else {
if (obj3 instanceof Cif.i) {
if (this.d1 != null) {
try {
Bitmap bitmap2 = this.D0.getImageReceiver().getBitmap();
Bitmap createBitmap = Bitmap.createBitmap(bitmap2.getWidth(), bitmap2.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(createBitmap);
if (this.j1 == 0) {
if (this.i1 != 0) {
GradientDrawable gradientDrawable = new GradientDrawable(org.telegram.ui.Components.o.m(this.o1), new int[]{this.g1, this.i1});
gradientDrawable.setBounds(0, 0, createBitmap.getWidth(), createBitmap.getHeight());
gradientDrawable.draw(canvas);
} else {
canvas.drawColor(this.g1);
}
}
Paint paint = new Paint(2);
paint.setColorFilter(new PorterDuffColorFilter(this.q1, this.v1));
paint.setAlpha((int) (Math.abs(this.s1) * 255.0f));
canvas.drawBitmap(bitmap2, 0.0f, 0.0f, paint);
FileOutputStream fileOutputStream3 = new FileOutputStream(file2);
if (this.j1 != 0) {
createBitmap.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream3);
} else {
createBitmap.compress(Bitmap.CompressFormat.JPEG, 87, fileOutputStream3);
}
fileOutputStream3.close();
} catch (Throwable th) {
FileLog.e(th);
}
}
} else if (obj3 instanceof Cif.j) {
Cif.j jVar = (Cif.j) obj3;
if (jVar.b == 0 && !"t".equals(jVar.a)) {
try {
File file3 = jVar.e;
if (file3 == null) {
file3 = jVar.d;
}
z2 = file3.equals(file2);
if (z2) {
copyFile = true;
} else {
try {
copyFile = AndroidUtilities.copyFile(file3, file2);
} catch (Exception e4) {
e = e4;
FileLog.e(e);
copyFile = false;
if (this.H1) {
}
int i6 = 45;
obj = this.D1;
if (obj instanceof d17) {
}
i2 = 0;
i3 = 0;
i4 = 0;
file = null;
w.q qVar = new w.q();
qVar.a = z4;
qVar.b = z3;
qVar.c = str;
qVar.i = this.H1;
qVar.j = this.G1;
qVar.d = i5;
qVar.e = i2;
qVar.f = i3;
qVar.g = i4;
qVar.h = i6;
qVar.k = this.s1;
obj2 = this.D1;
if (obj2 instanceof Cif.i) {
}
MessagesController.getInstance(this.d).saveWallpaperToServer(file, qVar, str != null, 0L);
if (copyFile) {
}
k0Var = this.M1;
if (k0Var != null) {
}
D();
}
}
} catch (Exception e5) {
e = e5;
z2 = false;
}
if (this.H1) {
try {
FileOutputStream fileOutputStream4 = new FileOutputStream(new File(ApplicationLoader.getFilesDirFixed(), z4));
this.z1.compress(Bitmap.CompressFormat.JPEG, 87, fileOutputStream4);
fileOutputStream4.close();
copyFile = true;
} catch (Throwable th2) {
FileLog.e(th2);
copyFile = false;
}
}
int i62 = 45;
obj = this.D1;
if (obj instanceof d17) {
str = ((d17) obj).h;
} else {
if (!(obj instanceof Cif.i)) {
if (obj instanceof Cif.j) {
Cif.j jVar2 = (Cif.j) obj;
str = jVar2.a;
pathToAttach = jVar2.d;
} else if (obj instanceof MediaController.SearchImage) {
MediaController.SearchImage searchImage = (MediaController.SearchImage) obj;
pc5 pc5Var = searchImage.photo;
pathToAttach = pc5Var != null ? FileLoader.getPathToAttach(FileLoader.getClosestPhotoSizeWithSize(pc5Var.g, this.L1, true), true) : ImageLoader.getHttpFilePath(searchImage.imageUrl, "jpg");
str = BuildConfig.FLAVOR;
} else {
str = "d";
i5 = 0;
}
file = pathToAttach;
i5 = 0;
i2 = 0;
i3 = 0;
i4 = 0;
w.q qVar2 = new w.q();
qVar2.a = z4;
qVar2.b = z3;
qVar2.c = str;
qVar2.i = this.H1;
qVar2.j = this.G1;
qVar2.d = i5;
qVar2.e = i2;
qVar2.f = i3;
qVar2.g = i4;
qVar2.h = i62;
qVar2.k = this.s1;
obj2 = this.D1;
if (obj2 instanceof Cif.i) {
}
MessagesController.getInstance(this.d).saveWallpaperToServer(file, qVar2, str != null, 0L);
if (copyFile) {
}
k0Var = this.M1;
if (k0Var != null) {
}
D();
}
if (!"d".equals(((Cif.i) obj).a)) {
d17 d17Var = this.d1;
String str2 = d17Var != null ? d17Var.h : "c";
int i7 = this.g1;
i2 = this.i1;
i3 = this.j1;
i4 = this.k1;
str = str2;
i62 = this.o1;
i5 = i7;
file = null;
w.q qVar22 = new w.q();
qVar22.a = z4;
qVar22.b = z3;
qVar22.c = str;
qVar22.i = this.H1;
qVar22.j = this.G1;
qVar22.d = i5;
qVar22.e = i2;
qVar22.f = i3;
qVar22.g = i4;
qVar22.h = i62;
qVar22.k = this.s1;
obj2 = this.D1;
if (obj2 instanceof Cif.i) {
Cif.i iVar = (Cif.i) obj2;
String str3 = ("c".equals(str) || "t".equals(str) || "d".equals(str)) ? null : str;
float f2 = iVar.i;
if (f2 < 0.0f && !org.telegram.ui.ActionBar.w.i1().J()) {
f2 *= -1.0f;
}
if (iVar.m != null && iVar.b == i5 && iVar.c == i2 && iVar.d == i3 && iVar.e == i4 && TextUtils.equals(iVar.a, str3) && iVar.f == i62 && (this.d1 == null || Math.abs(f2 - this.s1) < 0.001f)) {
m27 m27Var = iVar.m;
qVar22.l = m27Var.a;
qVar22.m = m27Var.g;
}
}
MessagesController.getInstance(this.d).saveWallpaperToServer(file, qVar22, str != null, 0L);
if (copyFile) {
org.telegram.ui.ActionBar.w.b0 = org.telegram.ui.ActionBar.w.r1("chat_serviceBackground");
org.telegram.ui.ActionBar.w.i1().Y("t".equals(qVar22.c) ? null : qVar22);
org.telegram.ui.ActionBar.w.S2();
if (!z2) {
ImageLoader.getInstance().removeImage(ImageLoader.getHttpFileName(file2.getAbsolutePath()) + "@100_100");
}
}
k0Var = this.M1;
if (k0Var != null) {
k0Var.a();
}
D();
}
str = "d";
}
i2 = 0;
i3 = 0;
i4 = 0;
file = null;
w.q qVar222 = new w.q();
qVar222.a = z4;
qVar222.b = z3;
qVar222.c = str;
qVar222.i = this.H1;
qVar222.j = this.G1;
qVar222.d = i5;
qVar222.e = i2;
qVar222.f = i3;
qVar222.g = i4;
qVar222.h = i62;
qVar222.k = this.s1;
obj2 = this.D1;
if (obj2 instanceof Cif.i) {
}
MessagesController.getInstance(this.d).saveWallpaperToServer(file, qVar222, str != null, 0L);
if (copyFile) {
}
k0Var = this.M1;
if (k0Var != null) {
}
D();
}
} else {
if (obj3 instanceof MediaController.SearchImage) {
MediaController.SearchImage searchImage2 = (MediaController.SearchImage) obj3;
pc5 pc5Var2 = searchImage2.photo;
try {
copyFile = AndroidUtilities.copyFile(pc5Var2 != null ? FileLoader.getPathToAttach(FileLoader.getClosestPhotoSizeWithSize(pc5Var2.g, this.L1, true), true) : ImageLoader.getHttpFilePath(searchImage2.imageUrl, "jpg"), file2);
} catch (Exception e6) {
FileLog.e(e6);
}
}
copyFile = false;
}
copyFile = true;
}
z2 = false;
if (this.H1) {
}
int i622 = 45;
obj = this.D1;
if (obj instanceof d17) {
}
i2 = 0;
i3 = 0;
i4 = 0;
file = null;
w.q qVar2222 = new w.q();
qVar2222.a = z4;
qVar2222.b = z3;
qVar2222.c = str;
qVar2222.i = this.H1;
qVar2222.j = this.G1;
qVar2222.d = i5;
qVar2222.e = i2;
qVar2222.f = i3;
qVar2222.g = i4;
qVar2222.h = i622;
qVar2222.k = this.s1;
obj2 = this.D1;
if (obj2 instanceof Cif.i) {
}
MessagesController.getInstance(this.d).saveWallpaperToServer(file, qVar2222, str != null, 0L);
if (copyFile) {
}
k0Var = this.M1;
if (k0Var != null) {
}
D();
}
public void m4(int i2, org.telegram.ui.Components.j9 j9Var, View view) {
boolean z2;
if (this.E0.getAlpha() == 1.0f && this.u1 == null) {
int i3 = this.q;
if ((i3 == 1 || (this.D1 instanceof Cif.i)) && i2 == 2) {
j9Var.f(!j9Var.e(), true);
} else {
if (i2 == 1 && (i3 == 1 || (this.D1 instanceof Cif.i))) {
if (this.Q0[1].e()) {
this.f1 = this.d1;
this.D0.setImageDrawable(null);
this.d1 = null;
this.G1 = false;
O4(false, true);
S3();
if (this.S0[1].getVisibility() == 0) {
if (this.q == 1) {
M4(0, true, true);
}
}
this.Q0[1].f(this.d1 != null, true);
R4(true);
this.W0.G2();
P4();
return;
}
F4(this.f1 != null ? -1 : 0);
if (this.q == 1) {
M4(1, true, true);
this.Q0[1].f(this.d1 != null, true);
R4(true);
this.W0.G2();
P4();
return;
}
M4(i2, z2, true);
this.Q0[1].f(this.d1 != null, true);
R4(true);
this.W0.G2();
P4();
return;
}
if (this.D1 instanceof Cif.i) {
M4(i2, this.S0[i2].getVisibility() != 0, true);
return;
}
if (i3 == 1) {
return;
}
j9Var.f(!j9Var.e(), true);
if (i2 == 0) {
boolean e2 = j9Var.e();
this.H1 = e2;
if (e2) {
this.D0.getImageReceiver().setForceCrossfade(true);
}
N4();
return;
}
}
boolean e3 = j9Var.e();
this.G1 = e3;
this.y1.c(e3);
S3();
}
}
public void n4(int i2, org.telegram.ui.Components.j9 j9Var, View view) {
if (this.F0.getAlpha() == 1.0f && i2 == 0) {
j9Var.f(!j9Var.e(), true);
this.x.i = j9Var.e();
org.telegram.ui.ActionBar.w.Q2(true, true);
this.B0.G2();
}
}
public void o4(int i2, View view) {
if (this.u1 != null) {
return;
}
if (i2 == 0) {
this.o1 = this.p1;
G4(this.n1, 3, true, true);
G4(this.m1, 2, true, true);
G4(this.l1, 1, true, true);
G4(this.h1, 0, true, true);
} else {
d17 d17Var = this.e1;
this.d1 = d17Var;
if (d17Var == null) {
this.D0.setImageDrawable(null);
} else {
org.telegram.messenger.p110.pf pfVar = this.D0;
ImageLocation forDocument = ImageLocation.getForDocument(d17Var.i);
String str = this.K1;
d17 d17Var2 = this.d1;
pfVar.k(forDocument, str, null, null, "jpg", d17Var2.i.size, 1, d17Var2);
}
this.Q0[1].f(this.d1 != null, false);
float f2 = this.t1;
this.s1 = f2;
this.a1.setProgress(f2);
this.D0.getImageReceiver().setAlpha(this.s1);
O4(false, true);
R4(true);
}
if (this.q == 2) {
M4(i2, false, true);
return;
}
if (this.d1 == null) {
if (this.G1) {
this.G1 = false;
this.Q0[0].f(false, true);
S3();
}
P4();
}
M4(0, true, true);
}
public void p4(i95 i95Var) {
if (i95Var instanceof d17) {
d17 d17Var = (d17) i95Var;
if (d17Var.e) {
this.d1 = d17Var;
H4(false);
O4(false, false);
this.b1.add(0, this.d1);
j0 j0Var = this.X0;
if (j0Var != null) {
j0Var.j();
}
}
}
}
public void q4(final i95 i95Var, ov5 ov5Var) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
org.telegram.ui.ff.this.p4(i95Var);
}
});
}
public void r4(i95 i95Var) {
w.u uVar;
d17 d17Var;
if (i95Var instanceof lg5) {
lg5 lg5Var = (lg5) i95Var;
this.b1.clear();
this.c1.clear();
int size = lg5Var.b.size();
boolean z2 = false;
for (int i2 = 0; i2 < size; i2++) {
if (lg5Var.b.get(i2) instanceof d17) {
d17 d17Var2 = (d17) lg5Var.b.get(i2);
if (d17Var2.e) {
ga5 ga5Var = d17Var2.i;
if (ga5Var != null && !this.c1.containsKey(Long.valueOf(ga5Var.id))) {
this.b1.add(d17Var2);
this.c1.put(Long.valueOf(d17Var2.i.id), d17Var2);
}
w.u uVar2 = this.x;
if (uVar2 != null && uVar2.o.equals(d17Var2.h)) {
this.d1 = d17Var2;
H4(false);
O4(false, false);
} else if (this.x == null) {
d17 d17Var3 = this.d1;
if (d17Var3 != null) {
if (!d17Var3.h.equals(d17Var2.h)) {
}
}
}
z2 = true;
}
}
}
if (!z2 && (d17Var = this.d1) != null) {
this.b1.add(0, d17Var);
}
j0 j0Var = this.X0;
if (j0Var != null) {
j0Var.j();
}
MessagesStorage.getInstance(this.d).putWallpapers(lg5Var.b, 1);
}
if (this.d1 != null || (uVar = this.x) == null || TextUtils.isEmpty(uVar.o)) {
return;
}
oe5 oe5Var = new oe5();
b36 b36Var = new b36();
b36Var.a = this.x.o;
oe5Var.a = b36Var;
ConnectionsManager.getInstance(this.d).bindRequestToGuid(K().sendRequest(oe5Var, new RequestDelegate() {
@Override
public final void run(i95 i95Var2, ov5 ov5Var) {
org.telegram.ui.ff.this.q4(i95Var2, ov5Var);
}
}), this.k);
}
public void s4(final i95 i95Var, ov5 ov5Var) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
org.telegram.ui.ff.this.r4(i95Var);
}
});
}
public void t4() {
org.telegram.ui.ActionBar.d dVar = this.s;
if (dVar != null) {
dVar.u0(org.telegram.ui.ActionBar.w.r1("actionBarDefaultSubmenuBackground"));
this.s.D0(org.telegram.ui.ActionBar.w.r1("actionBarDefaultSubmenuItem"), false);
}
Drawable drawable = this.w;
if (drawable != null) {
drawable.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"), PorterDuff.Mode.MULTIPLY));
}
}
public void u4() {
this.h0 = false;
T3(this.e0, this.f0);
this.f0 = -1;
}
public void w4(DialogInterface dialogInterface, int i2) {
w.u uVar = this.x;
if (uVar.j == 4294967296L) {
uVar.j = 0L;
uVar.k = 0L;
uVar.l = 0L;
uVar.m = 0L;
Q4(false);
org.telegram.ui.ActionBar.w.P2();
}
this.y = true;
org.telegram.ui.ActionBar.w.T2(true);
E4(2, false);
}
public void x4(DialogInterface dialogInterface, int i2) {
if (org.telegram.ui.ActionBar.w.u2()) {
w.u uVar = this.x;
w.q qVar = uVar.y;
uVar.j = qVar.d;
uVar.k = qVar.e;
uVar.l = qVar.f;
uVar.m = qVar.g;
uVar.n = qVar.h;
String str = qVar.c;
uVar.o = str;
float f2 = qVar.k;
uVar.p = f2;
this.s1 = f2;
if (str != null && !"c".equals(str)) {
int size = this.b1.size();
int i3 = 0;
while (true) {
if (i3 >= size) {
break;
}
d17 d17Var = (d17) this.b1.get(i3);
if (d17Var.e && this.x.o.equals(d17Var.h)) {
this.d1 = d17Var;
break;
}
i3++;
}
} else {
this.d1 = null;
}
this.y = true;
this.Q0[1].f(this.d1 != null, true);
Q4(false);
org.telegram.ui.ActionBar.w.P2();
}
Drawable background = this.D0.getBackground();
if (background instanceof sg3) {
sg3 sg3Var = (sg3) background;
sg3Var.B(100, null);
if (org.telegram.ui.ActionBar.w.i1().J()) {
if (this.s1 < 0.0f) {
this.D0.getImageReceiver().setGradientBitmap(sg3Var.f());
}
org.telegram.ui.Components.p6 p6Var = this.a1;
if (p6Var != null) {
p6Var.setTwoSided(true);
}
} else {
float f3 = this.s1;
if (f3 < 0.0f) {
this.s1 = -f3;
}
}
}
org.telegram.ui.Components.p6 p6Var2 = this.a1;
if (p6Var2 != null) {
p6Var2.setProgress(this.s1);
}
org.telegram.ui.ActionBar.w.T2(true);
E4(2, false);
}
public void y4(DialogInterface dialogInterface, int i2) {
w.u uVar = this.x;
if (uVar.j == 4294967296L) {
uVar.j = 0L;
uVar.k = 0L;
uVar.l = 0L;
uVar.m = 0L;
Q4(false);
org.telegram.ui.ActionBar.w.P2();
}
this.y = true;
org.telegram.ui.ActionBar.w.T2(true);
E4(2, false);
}
public void z4(SharedPreferences sharedPreferences) {
if (this.v != 3) {
return;
}
sharedPreferences.edit().putBoolean("bganimationhint", true).commit();
this.G0.l(this.R0[0], true);
}
@Override
public boolean E0() {
String str;
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.emojiLoaded);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.invalidateMotionBackground);
int i2 = this.q;
if (i2 == 1 || i2 == 0) {
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didSetNewWallpapper);
}
int i3 = this.q;
if (i3 == 2 || i3 == 1) {
org.telegram.ui.ActionBar.w.c3(true);
}
if (this.q == 0 && this.x == null) {
this.G1 = org.telegram.ui.ActionBar.w.z2();
} else {
if (SharedConfig.getDevicePerformanceClass() == 0) {
Point point = AndroidUtilities.displaySize;
int min = Math.min(point.x, point.y);
Point point2 = AndroidUtilities.displaySize;
str = ((int) (min / AndroidUtilities.density)) + "_" + ((int) (Math.max(point2.x, point2.y) / AndroidUtilities.density)) + "_f";
} else {
str = ((int) (1080.0f / AndroidUtilities.density)) + "_" + ((int) (1920.0f / AndroidUtilities.density)) + "_f";
}
this.K1 = str;
Point point3 = AndroidUtilities.displaySize;
this.L1 = Math.min(1920, Math.max(point3.x, point3.y));
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.wallpapersNeedReload);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.wallpapersDidLoad);
this.w1 = DownloadController.getInstance(this.d).generateObserverTag();
if (this.b1 == null) {
this.b1 = new ArrayList<>();
MessagesStorage.getInstance(this.d).getWallpapers();
}
}
return super.E0();
}
@Override
public void F0() {
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.emojiLoaded);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.invalidateMotionBackground);
FrameLayout frameLayout = this.s0;
if (frameLayout != null && this.Y != null) {
frameLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this.Y);
}
int i2 = this.q;
if (i2 == 2 || i2 == 1) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
org.telegram.ui.ActionBar.w.c3(false);
}
});
}
int i3 = this.q;
if (i3 == 2) {
Bitmap bitmap = this.z1;
if (bitmap != null) {
bitmap.recycle();
this.z1 = null;
}
org.telegram.ui.ActionBar.w.P();
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetNewWallpapper, new Object[0]);
} else if (i3 == 1 || i3 == 0) {
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didSetNewWallpapper);
}
if (this.q != 0 || this.x != null) {
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.wallpapersNeedReload);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.wallpapersDidLoad);
}
super.F0();
}
@Override
public void H0() {
super.H0();
if (this.G1) {
this.y1.c(false);
}
}
public void I4(k0 k0Var) {
this.M1 = k0Var;
}
public void J4(boolean z2, boolean z3) {
this.H1 = z2;
this.G1 = z3;
}
public void K4(ArrayList<Object> arrayList) {
this.b1 = arrayList;
if (this.q == 1 || (this.D1 instanceof Cif.i)) {
Cif.i iVar = (Cif.i) this.D1;
if (iVar.g != 0) {
int i2 = 0;
int size = arrayList.size();
while (true) {
if (i2 >= size) {
break;
}
d17 d17Var = (d17) this.b1.get(i2);
if (d17Var.a == iVar.g) {
this.d1 = d17Var;
break;
}
i2++;
}
this.s1 = iVar.i;
}
}
}
@Override
public void M0() {
super.M0();
h0 h0Var = this.w0;
if (h0Var != null) {
h0Var.j();
}
i0 i0Var = this.C0;
if (i0Var != null) {
i0Var.j();
}
if (this.G1) {
this.y1.c(true);
}
AndroidUtilities.requestAdjustResize(c0(), this.k);
AndroidUtilities.removeAdjustResize(c0(), this.k);
}
@Override
public void Q0(boolean z2, boolean z3) {
super.Q0(z2, z3);
if (z2 || this.q != 2) {
return;
}
org.telegram.ui.ActionBar.w.P();
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetNewWallpapper, new Object[0]);
}
@Override
public int Y() {
return super.Y();
}
@Override
public void didReceivedNotification(int i2, int i3, Object... objArr) {
d17 d17Var;
if (i2 == NotificationCenter.emojiLoaded) {
org.telegram.ui.Components.h6 h6Var = this.v0;
if (h6Var == null) {
return;
}
int childCount = h6Var.getChildCount();
for (int i4 = 0; i4 < childCount; i4++) {
View childAt = this.v0.getChildAt(i4);
if (childAt instanceof ww0) {
((ww0) childAt).b0(0);
}
}
return;
}
if (i2 == NotificationCenter.invalidateMotionBackground) {
org.telegram.ui.Components.h6 h6Var2 = this.B0;
if (h6Var2 != null) {
h6Var2.G2();
return;
}
return;
}
if (i2 == NotificationCenter.didSetNewWallpapper) {
if (this.A0 != null) {
H4(true);
return;
}
return;
}
if (i2 == NotificationCenter.wallpapersNeedReload) {
Object obj = this.D1;
if (obj instanceof Cif.j) {
Cif.j jVar = (Cif.j) obj;
if (jVar.a == null) {
jVar.a = (String) objArr[0];
return;
}
return;
}
return;
}
if (i2 == NotificationCenter.wallpapersDidLoad) {
ArrayList arrayList = (ArrayList) objArr[0];
this.b1.clear();
this.c1.clear();
int size = arrayList.size();
boolean z2 = false;
for (int i5 = 0; i5 < size; i5++) {
m27 m27Var = (m27) arrayList.get(i5);
if ((m27Var instanceof d17) && m27Var.e) {
ga5 ga5Var = m27Var.i;
if (ga5Var != null && !this.c1.containsKey(Long.valueOf(ga5Var.id))) {
this.b1.add(m27Var);
this.c1.put(Long.valueOf(m27Var.i.id), m27Var);
}
w.u uVar = this.x;
if (uVar != null && uVar.o.equals(m27Var.h)) {
this.d1 = (d17) m27Var;
H4(false);
O4(false, false);
} else if (this.x == null) {
d17 d17Var2 = this.d1;
if (d17Var2 != null) {
if (!d17Var2.h.equals(m27Var.h)) {
}
}
}
z2 = true;
}
}
if (!z2 && (d17Var = this.d1) != null) {
this.b1.add(0, d17Var);
}
j0 j0Var = this.X0;
if (j0Var != null) {
j0Var.j();
}
long j2 = 0;
int size2 = arrayList.size();
for (int i6 = 0; i6 < size2; i6++) {
m27 m27Var2 = (m27) arrayList.get(i6);
if (m27Var2 instanceof d17) {
j2 = MediaDataController.calcHash(j2, m27Var2.a);
}
}
pe5 pe5Var = new pe5();
pe5Var.a = j2;
ConnectionsManager.getInstance(this.d).bindRequestToGuid(ConnectionsManager.getInstance(this.d).sendRequest(pe5Var, new RequestDelegate() {
@Override
public final void run(i95 i95Var, ov5 ov5Var) {
org.telegram.ui.ff.this.s4(i95Var, ov5Var);
}
}), this.k);
}
}
@Override
public int getObserverTag() {
return this.w1;
}
@Override
public void onFailedDownload(String str, boolean z2) {
O4(true, z2);
}
@Override
public void onProgressDownload(String str, long j2, long j3) {
me4 me4Var = this.I0;
if (me4Var != null) {
me4Var.C(Math.min(1.0f, ((float) j2) / ((float) j3)), this.J1);
if (this.I0.c() != 10) {
O4(false, true);
}
}
}
@Override
public void onProgressUpload(String str, long j2, long j3, boolean z2) {
}
@Override
public void onSuccessDownload(String str) {
me4 me4Var = this.I0;
if (me4Var != null) {
me4Var.C(1.0f, this.J1);
}
O4(false, true);
}
@Override
public boolean s0(MotionEvent motionEvent) {
return false;
}
@Override
public boolean x0() {
if (!V3()) {
return false;
}
U3(true);
return true;
}
@Override
@SuppressLint({"Recycle"})
public View z(Context context) {
org.telegram.ui.ActionBar.a aVar;
String formatDateOnline;
int i2;
int i3;
org.telegram.ui.Components.h6 h6Var;
int dp;
int dp2;
float f2;
int i4;
int i5;
Object obj;
int i6;
String str;
int i7;
final int i8;
final int i9;
int i10;
int i11;
int i12;
org.telegram.ui.Components.j9 j9Var;
boolean z2;
w.u uVar;
int dp3;
FrameLayout.LayoutParams layoutParams;
this.m = true;
if (AndroidUtilities.isTablet()) {
this.g.setOccupyStatusBar(false);
}
this.u0 = new FrameLayout(context);
this.g.z().b(0, org.telegram.messenger.R.drawable.ic_ab_search).A0(true).y0(new k(this)).setSearchFieldHint(LocaleController.getString("Search", R.string.Search));
this.g.setBackButtonDrawable(new st2());
this.g.setAddToContainer(false);
this.g.setTitle(LocaleController.getString("ThemePreview", R.string.ThemePreview));
v vVar = new v(context);
this.u0 = vVar;
vVar.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"));
this.u0.addView(this.g, g52.a(-1, -2.0f));
org.telegram.ui.Components.h6 h6Var2 = new org.telegram.ui.Components.h6(context);
this.v0 = h6Var2;
h6Var2.setVerticalScrollBarEnabled(true);
this.v0.setItemAnimator(null);
this.v0.setLayoutAnimation(null);
this.v0.setLayoutManager(new androidx.recyclerview.widget.o(context, 1, false));
this.v0.setVerticalScrollbarPosition(LocaleController.isRTL ? 1 : 2);
this.v0.setPadding(0, 0, 0, AndroidUtilities.dp(this.q != 0 ? 12.0f : 0.0f));
this.v0.setOnItemClickListener(new h6.m() {
@Override
public final void a(View view, int i13) {
org.telegram.ui.ff.b4(view, i13);
}
});
this.u0.addView(this.v0, g52.c(-1, -1, 51));
ImageView imageView = new ImageView(context);
this.x0 = imageView;
imageView.setScaleType(ImageView.ScaleType.CENTER);
Drawable Y0 = org.telegram.ui.ActionBar.w.Y0(AndroidUtilities.dp(56.0f), org.telegram.ui.ActionBar.w.r1("chats_actionBackground"), org.telegram.ui.ActionBar.w.r1("chats_actionPressedBackground"));
int i13 = Build.VERSION.SDK_INT;
if (i13 < 21) {
Drawable mutate = context.getResources().getDrawable(org.telegram.messenger.R.drawable.floating_shadow).mutate();
mutate.setColorFilter(new PorterDuffColorFilter(com.batch.android.messaging.view.roundimage.b.v, PorterDuff.Mode.MULTIPLY));
jj0 jj0Var = new jj0(mutate, Y0, 0, 0);
jj0Var.e(AndroidUtilities.dp(56.0f), AndroidUtilities.dp(56.0f));
Y0 = jj0Var;
}
this.x0.setBackgroundDrawable(Y0);
this.x0.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("chats_actionIcon"), PorterDuff.Mode.MULTIPLY));
this.x0.setImageResource(org.telegram.messenger.R.drawable.floating_pencil);
if (i13 >= 21) {
StateListAnimator stateListAnimator = new StateListAnimator();
int[] iArr = {android.R.attr.state_pressed};
ImageView imageView2 = this.x0;
Property property = View.TRANSLATION_Z;
stateListAnimator.addState(iArr, ObjectAnimator.ofFloat(imageView2, (Property<ImageView, Float>) property, AndroidUtilities.dp(2.0f), AndroidUtilities.dp(4.0f)).setDuration(200L));
stateListAnimator.addState(new int[0], ObjectAnimator.ofFloat(this.x0, (Property<ImageView, Float>) property, AndroidUtilities.dp(4.0f), AndroidUtilities.dp(2.0f)).setDuration(200L));
this.x0.setStateListAnimator(stateListAnimator);
this.x0.setOutlineProvider(new a0(this));
}
FrameLayout frameLayout = this.u0;
ImageView imageView3 = this.x0;
int i14 = i13 >= 21 ? 56 : 60;
float f3 = i13 >= 21 ? 56.0f : 60.0f;
boolean z3 = LocaleController.isRTL;
frameLayout.addView(imageView3, g52.b(i14, f3, (z3 ? 3 : 5) | 80, z3 ? 14.0f : 0.0f, 0.0f, z3 ? 0.0f : 14.0f, 14.0f));
h0 h0Var = new h0(context);
this.w0 = h0Var;
this.v0.setAdapter(h0Var);
this.A0 = new b0(context);
this.C0 = new i0(context);
this.z0 = y(context);
if (AndroidUtilities.isTablet()) {
this.z0.setOccupyStatusBar(false);
}
this.z0.setBackButtonDrawable(new org.telegram.messenger.p110.Cif(false));
this.z0.setActionBarMenuOnItemClick(new c0());
d0 d0Var = new d0(context);
this.D0 = d0Var;
this.A0.addView(d0Var, g52.b(-1, -1.0f, 51, 0.0f, 0.0f, 0.0f, 48.0f));
if (this.q == 2) {
this.D0.getImageReceiver().setDelegate(new ImageReceiver.ImageReceiverDelegate() {
@Override
public final void didSetImage(ImageReceiver imageReceiver, boolean z4, boolean z5, boolean z6) {
org.telegram.ui.ff.this.h4(imageReceiver, z4, z5, z6);
}
@Override
public void onAnimationReady(ImageReceiver imageReceiver) {
tv1.a(this, imageReceiver);
}
});
}
if (!this.C0.e) {
int i15 = this.q;
if (i15 == 2) {
this.z0.setTitle(LocaleController.getString("BackgroundPreview", R.string.BackgroundPreview));
if (!BuildVars.DEBUG_PRIVATE_VERSION || org.telegram.ui.ActionBar.w.i1().A(false) == null) {
Object obj2 = this.D1;
if (obj2 instanceof Cif.i) {
}
}
this.z0.z().b(5, org.telegram.messenger.R.drawable.msg_share_filled);
} else if (i15 == 1) {
org.telegram.ui.ActionBar.b z4 = this.z0.z();
this.t = z4.h(4, LocaleController.getString("Save", R.string.Save).toUpperCase());
e0 e0Var = new e0(context, z4, 0, 0);
this.s = e0Var;
e0Var.setSubMenuOpenSide(1);
this.s.G(2, LocaleController.getString("ColorPickerBackground", R.string.ColorPickerBackground));
this.s.G(1, LocaleController.getString("ColorPickerMainColor", R.string.ColorPickerMainColor));
this.s.G(3, LocaleController.getString("ColorPickerMyMessages", R.string.ColorPickerMyMessages));
this.s.z0(false);
this.s.setForceSmoothKeyboard(true);
this.z0.addView(this.s, g52.b(-2, -1.0f, 51, AndroidUtilities.isTablet() ? 64.0f : 56.0f, 0.0f, 40.0f, 0.0f));
this.s.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
org.telegram.ui.ff.this.i4(view);
}
});
TextView textView = new TextView(context);
this.u = textView;
textView.setImportantForAccessibility(2);
this.u.setGravity(3);
this.u.setSingleLine(true);
this.u.setLines(1);
this.u.setMaxLines(1);
this.u.setEllipsize(TextUtils.TruncateAt.END);
this.u.setTextColor(org.telegram.ui.ActionBar.w.r1("actionBarDefaultTitle"));
this.u.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
this.u.setText(LocaleController.getString("ColorPickerMainColor", R.string.ColorPickerMainColor));
Drawable mutate2 = context.getResources().getDrawable(org.telegram.messenger.R.drawable.ic_arrow_drop_down).mutate();
mutate2.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("actionBarDefaultTitle"), PorterDuff.Mode.MULTIPLY));
this.u.setCompoundDrawablesWithIntrinsicBounds((Drawable) null, (Drawable) null, mutate2, (Drawable) null);
this.u.setCompoundDrawablePadding(AndroidUtilities.dp(4.0f));
this.u.setPadding(0, 0, AndroidUtilities.dp(10.0f), 0);
this.s.addView(this.u, g52.b(-2, -2.0f, 16, 16.0f, 0.0f, 0.0f, 1.0f));
} else {
w.v vVar2 = this.m0;
cu6 cu6Var = vVar2.p;
String D = cu6Var != null ? cu6Var.h : vVar2.D();
int lastIndexOf = D.lastIndexOf(".attheme");
if (lastIndexOf >= 0) {
D = D.substring(0, lastIndexOf);
}
this.z0.setTitle(D);
cu6 cu6Var2 = this.m0.p;
if (cu6Var2 == null || (i2 = cu6Var2.l) <= 0) {
aVar = this.z0;
formatDateOnline = LocaleController.formatDateOnline((System.currentTimeMillis() / 1000) - 3600);
} else {
this.z0.setSubtitle(LocaleController.formatPluralString("ThemeInstallCount", i2));
}
}
this.B0 = new f0(context);
g0 g0Var = new g0();
g0Var.m0(false);
this.B0.setItemAnimator(g0Var);
this.B0.setVerticalScrollBarEnabled(true);
this.B0.setOverScrollMode(2);
i3 = this.q;
if (i3 != 2) {
h6Var = this.B0;
dp = AndroidUtilities.dp(4.0f);
f2 = 52.0f;
} else {
if (i3 != 1) {
h6Var = this.B0;
dp = AndroidUtilities.dp(4.0f);
dp2 = AndroidUtilities.dp(4.0f);
h6Var.setPadding(0, dp, 0, dp2);
this.B0.setClipToPadding(false);
this.B0.setLayoutManager(new androidx.recyclerview.widget.o(context, 1, true));
this.B0.setVerticalScrollbarPosition(LocaleController.isRTL ? 1 : 2);
if (this.q == 1) {
this.A0.addView(this.B0, g52.b(-1, -1.0f, 51, 0.0f, 0.0f, 0.0f, 273.0f));
this.B0.setOnItemClickListener(new h6.n() {
@Override
public final void a(View view, int i16, float f4, float f5) {
org.telegram.ui.ff.this.j4(view, i16, f4, f5);
}
@Override
public boolean b(View view, int i16) {
return kg4.a(this, view, i16);
}
@Override
public void c(View view, int i16, float f4, float f5) {
kg4.b(this, view, i16, f4, f5);
}
});
i4 = -1;
} else {
i4 = -1;
this.A0.addView(this.B0, g52.c(-1, -1, 51));
}
this.B0.setOnScrollListener(new a());
this.A0.addView(this.z0, g52.a(i4, -2.0f));
org.telegram.ui.Components.k9 k9Var = new org.telegram.ui.Components.k9(context);
this.y1 = k9Var;
k9Var.b(new k9.a() {
@Override
public final void a(int i16, int i17, float f4) {
org.telegram.ui.ff.this.k4(i16, i17, f4);
}
});
i5 = this.q;
String str2 = "chat_fieldOverlayText";
if (i5 != 1 || i5 == 2) {
me4 me4Var = new me4(this.D0);
this.I0 = me4Var;
me4Var.s("chat_serviceBackground", "chat_serviceBackground", "chat_serviceText", "chat_serviceText");
if (this.q == 2) {
b bVar = new b(this, context);
this.J0 = bVar;
bVar.setWillNotDraw(false);
this.J0.setPadding(0, AndroidUtilities.dp(3.0f), 0, 0);
this.A0.addView(this.J0, g52.c(-1, 51, 80));
this.J0.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
org.telegram.ui.ff.this.l4(view);
}
});
TextView textView2 = new TextView(context);
this.C1 = textView2;
textView2.setTextSize(1, 15.0f);
this.C1.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
this.C1.setTextColor(org.telegram.ui.ActionBar.w.r1("chat_fieldOverlayText"));
this.C1.setText(LocaleController.getString("SetBackground", R.string.SetBackground));
this.J0.addView(this.C1, g52.c(-2, -2, 17));
}
Rect rect = new Rect();
Drawable mutate3 = context.getResources().getDrawable(org.telegram.messenger.R.drawable.sheet_shadow_round).mutate();
this.w = mutate3;
mutate3.getPadding(rect);
this.w.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"), PorterDuff.Mode.MULTIPLY));
TextPaint textPaint = new TextPaint(1);
textPaint.setTextSize(AndroidUtilities.dp(14.0f));
textPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
if (this.q != 1) {
Object obj3 = this.D1;
if (!(obj3 instanceof Cif.i)) {
if (!(obj3 instanceof Cif.j) || !"t".equals(((Cif.j) obj3).a)) {
i6 = 2;
String[] strArr = new String[i6];
int[] iArr2 = new int[i6];
this.Q0 = new org.telegram.ui.Components.j9[i6];
if (i6 == 0) {
this.E0 = new FrameLayout(context);
if (this.q == 1 || (this.D1 instanceof Cif.i)) {
strArr[0] = LocaleController.getString("BackgroundColors", R.string.BackgroundColors);
strArr[1] = LocaleController.getString("BackgroundPattern", R.string.BackgroundPattern);
strArr[2] = LocaleController.getString("BackgroundMotion", R.string.BackgroundMotion);
} else {
strArr[0] = LocaleController.getString("BackgroundBlurred", R.string.BackgroundBlurred);
strArr[1] = LocaleController.getString("BackgroundMotion", R.string.BackgroundMotion);
}
int i16 = 0;
i7 = 0;
while (i16 < i6) {
iArr2[i16] = (int) Math.ceil(textPaint.measureText(strArr[i16]));
i7 = Math.max(i7, iArr2[i16]);
i16++;
str2 = str2;
}
str = str2;
c cVar = new c(context);
this.K0 = cVar;
cVar.setWillNotDraw(false);
this.K0.setVisibility(this.i1 != 0 ? 0 : 4);
this.K0.setScaleX(this.i1 != 0 ? 1.0f : 0.1f);
this.K0.setScaleY(this.i1 != 0 ? 1.0f : 0.1f);
this.K0.setAlpha(this.i1 != 0 ? 1.0f : 0.0f);
this.K0.setTag(this.i1 != 0 ? 1 : null);
this.E0.addView(this.K0, g52.c(48, 48, 17));
this.K0.setOnClickListener(new d());
ImageView imageView4 = new ImageView(context);
this.M0 = imageView4;
imageView4.setScaleType(ImageView.ScaleType.CENTER);
this.M0.setImageResource(org.telegram.messenger.R.drawable.bg_rotate_large);
this.K0.addView(this.M0, g52.c(-2, -2, 17));
} else {
str = "chat_fieldOverlayText";
i7 = 0;
}
i8 = 0;
while (i8 < i6) {
this.Q0[i8] = new org.telegram.ui.Components.j9(context, ((this.q == 1 || (this.D1 instanceof Cif.i)) && i8 == 0) ? false : true, this.D0);
this.Q0[i8].setBackgroundColor(this.g1);
this.Q0[i8].h(strArr[i8], iArr2[i8], i7);
if (this.q != 1 && !(this.D1 instanceof Cif.i)) {
j9Var = this.Q0[i8];
if (i8 == 0) {
z2 = this.H1;
j9Var.f(z2, false);
dp3 = AndroidUtilities.dp(56.0f) + i7;
layoutParams = new FrameLayout.LayoutParams(dp3, -2);
layoutParams.gravity = 17;
if (i6 == 3) {
}
this.E0.addView(this.Q0[i8], layoutParams);
org.telegram.ui.Components.j9[] j9VarArr = this.Q0;
final org.telegram.ui.Components.j9 j9Var2 = j9VarArr[i8];
j9VarArr[i8].setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
org.telegram.ui.ff.this.m4(i8, j9Var2, view);
}
});
if (i8 != 2) {
}
i8++;
}
z2 = this.G1;
j9Var.f(z2, false);
dp3 = AndroidUtilities.dp(56.0f) + i7;
layoutParams = new FrameLayout.LayoutParams(dp3, -2);
layoutParams.gravity = 17;
if (i6 == 3) {
}
this.E0.addView(this.Q0[i8], layoutParams);
org.telegram.ui.Components.j9[] j9VarArr2 = this.Q0;
final org.telegram.ui.Components.j9 j9Var22 = j9VarArr2[i8];
j9VarArr2[i8].setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
org.telegram.ui.ff.this.m4(i8, j9Var22, view);
}
});
if (i8 != 2) {
}
i8++;
} else if (i8 == 1) {
j9Var = this.Q0[i8];
z2 = (this.d1 == null && ((uVar = this.x) == null || TextUtils.isEmpty(uVar.o))) ? false : true;
j9Var.f(z2, false);
dp3 = AndroidUtilities.dp(56.0f) + i7;
layoutParams = new FrameLayout.LayoutParams(dp3, -2);
layoutParams.gravity = 17;
if (i6 == 3 ? i8 != 1 : !(i8 == 0 || i8 == 2)) {
layoutParams.rightMargin = (dp3 / 2) + AndroidUtilities.dp(10.0f);
} else {
layoutParams.leftMargin = (dp3 / 2) + AndroidUtilities.dp(10.0f);
}
this.E0.addView(this.Q0[i8], layoutParams);
org.telegram.ui.Components.j9[] j9VarArr22 = this.Q0;
final org.telegram.ui.Components.j9 j9Var222 = j9VarArr22[i8];
j9VarArr22[i8].setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
org.telegram.ui.ff.this.m4(i8, j9Var222, view);
}
});
if (i8 != 2) {
this.Q0[i8].setAlpha(0.0f);
this.Q0[i8].setVisibility(4);
}
i8++;
} else {
if (i8 == 2) {
j9Var = this.Q0[i8];
z2 = this.G1;
j9Var.f(z2, false);
}
dp3 = AndroidUtilities.dp(56.0f) + i7;
layoutParams = new FrameLayout.LayoutParams(dp3, -2);
layoutParams.gravity = 17;
if (i6 == 3) {
layoutParams.rightMargin = (dp3 / 2) + AndroidUtilities.dp(10.0f);
} else {
layoutParams.rightMargin = (dp3 / 2) + AndroidUtilities.dp(10.0f);
}
this.E0.addView(this.Q0[i8], layoutParams);
org.telegram.ui.Components.j9[] j9VarArr222 = this.Q0;
final org.telegram.ui.Components.j9 j9Var2222 = j9VarArr222[i8];
j9VarArr222[i8].setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
org.telegram.ui.ff.this.m4(i8, j9Var2222, view);
}
});
if (i8 != 2) {
}
i8++;
}
}
if (this.q == 1) {
int[] iArr3 = new int[2];
this.R0 = new org.telegram.ui.Components.j9[2];
this.F0 = new FrameLayout(context);
String[] strArr2 = {LocaleController.getString("BackgroundAnimate", R.string.BackgroundAnimate), LocaleController.getString("BackgroundColors", R.string.BackgroundColors)};
int i17 = 0;
for (int i18 = 0; i18 < 2; i18++) {
iArr3[i18] = (int) Math.ceil(textPaint.measureText(strArr2[i18]));
i17 = Math.max(i17, iArr3[i18]);
}
e eVar = new e(context);
this.L0 = eVar;
eVar.setWillNotDraw(false);
this.L0.setVisibility(this.x.f != 0 ? 0 : 4);
this.L0.setScaleX(this.x.f != 0 ? 1.0f : 0.1f);
this.L0.setScaleY(this.x.f != 0 ? 1.0f : 0.1f);
this.L0.setAlpha(this.x.f != 0 ? 1.0f : 0.0f);
this.F0.addView(this.L0, g52.c(48, 48, 17));
this.L0.setOnClickListener(new f());
ImageView imageView5 = new ImageView(context);
this.N0 = imageView5;
imageView5.setScaleType(ImageView.ScaleType.CENTER);
this.N0.setImageResource(org.telegram.messenger.R.drawable.bg_rotate_large);
this.L0.addView(this.N0, g52.c(-2, -2, 17));
final int i19 = 0;
while (i19 < 2) {
this.R0[i19] = new org.telegram.ui.Components.j9(context, i19 == 0, this.D0);
this.R0[i19].h(strArr2[i19], iArr3[i19], i17);
if (i19 == 0) {
this.R0[i19].f(this.x.i, false);
}
int dp4 = AndroidUtilities.dp(56.0f) + i17;
FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(dp4, -2);
layoutParams2.gravity = 17;
int dp5 = (dp4 / 2) + AndroidUtilities.dp(10.0f);
if (i19 == 1) {
layoutParams2.leftMargin = dp5;
} else {
layoutParams2.rightMargin = dp5;
}
this.F0.addView(this.R0[i19], layoutParams2);
org.telegram.ui.Components.j9[] j9VarArr3 = this.R0;
final org.telegram.ui.Components.j9 j9Var3 = j9VarArr3[i19];
j9VarArr3[i19].setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
org.telegram.ui.ff.this.n4(i19, j9Var3, view);
}
});
i19++;
}
}
if (this.q != 1 || (this.D1 instanceof Cif.i)) {
this.H1 = false;
i9 = 0;
while (i9 < 2) {
this.S0[i9] = new g(context, i9, rect);
if (i9 == 1 || this.q == 2) {
this.S0[i9].setVisibility(4);
}
this.S0[i9].setWillNotDraw(false);
if (this.q == 2) {
i12 = i9 == 0 ? 321 : 316;
i10 = 83;
i11 = -1;
} else {
i10 = 83;
i11 = -1;
i12 = i9 == 0 ? 273 : 316;
}
FrameLayout.LayoutParams c2 = g52.c(i11, i12, i10);
if (i9 == 0) {
c2.height += AndroidUtilities.dp(12.0f) + rect.top;
this.S0[i9].setPadding(0, AndroidUtilities.dp(12.0f) + rect.top, 0, 0);
}
this.A0.addView(this.S0[i9], c2);
if (i9 == 1 || this.q == 2) {
this.V0[i9] = new h(this, context);
this.V0[i9].setWillNotDraw(false);
this.V0[i9].setPadding(0, AndroidUtilities.dp(3.0f), 0, 0);
this.V0[i9].setClickable(true);
this.S0[i9].addView(this.V0[i9], g52.c(-1, 51, 80));
this.T0[i9] = new TextView(context);
this.T0[i9].setTextSize(1, 15.0f);
this.T0[i9].setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
this.T0[i9].setTextColor(org.telegram.ui.ActionBar.w.r1(str));
this.T0[i9].setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase());
this.T0[i9].setGravity(17);
this.T0[i9].setPadding(AndroidUtilities.dp(21.0f), 0, AndroidUtilities.dp(21.0f), 0);
this.T0[i9].setBackgroundDrawable(org.telegram.ui.ActionBar.w.S0(org.telegram.ui.ActionBar.w.r1("listSelectorSDK21"), 0));
this.V0[i9].addView(this.T0[i9], g52.c(-2, -1, 51));
this.T0[i9].setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
org.telegram.ui.ff.this.o4(i9, view);
}
});
this.U0[i9] = new TextView(context);
this.U0[i9].setTextSize(1, 15.0f);
this.U0[i9].setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
this.U0[i9].setTextColor(org.telegram.ui.ActionBar.w.r1(str));
this.U0[i9].setText(LocaleController.getString("ApplyTheme", R.string.ApplyTheme).toUpperCase());
this.U0[i9].setGravity(17);
this.U0[i9].setPadding(AndroidUtilities.dp(21.0f), 0, AndroidUtilities.dp(21.0f), 0);
this.U0[i9].setBackgroundDrawable(org.telegram.ui.ActionBar.w.S0(org.telegram.ui.ActionBar.w.r1("listSelectorSDK21"), 0));
this.V0[i9].addView(this.U0[i9], g52.c(-2, -1, 53));
this.U0[i9].setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
org.telegram.ui.ff.this.c4(i9, view);
}
});
}
if (i9 == 1) {
TextView textView3 = new TextView(context);
textView3.setLines(1);
textView3.setSingleLine(true);
textView3.setText(LocaleController.getString("BackgroundChoosePattern", R.string.BackgroundChoosePattern));
textView3.setTextColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteBlackText"));
textView3.setTextSize(1, 20.0f);
textView3.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
textView3.setPadding(AndroidUtilities.dp(21.0f), AndroidUtilities.dp(6.0f), AndroidUtilities.dp(21.0f), AndroidUtilities.dp(8.0f));
textView3.setEllipsize(TextUtils.TruncateAt.MIDDLE);
textView3.setGravity(16);
this.S0[i9].addView(textView3, g52.b(-1, 48.0f, 51, 0.0f, 21.0f, 0.0f, 0.0f));
i iVar = new i(this, context);
this.W0 = iVar;
androidx.recyclerview.widget.o oVar = new androidx.recyclerview.widget.o(context, 0, false);
this.Y0 = oVar;
iVar.setLayoutManager(oVar);
org.telegram.ui.Components.h6 h6Var3 = this.W0;
j0 j0Var = new j0(context);
this.X0 = j0Var;
h6Var3.setAdapter(j0Var);
this.W0.h(new j(this));
this.S0[i9].addView(this.W0, g52.b(-1, 100.0f, 51, 0.0f, 76.0f, 0.0f, 0.0f));
this.W0.setOnItemClickListener(new h6.m() {
@Override
public final void a(View view, int i20) {
org.telegram.ui.ff.this.d4(view, i20);
}
});
rr1 rr1Var = new rr1(context);
this.Z0 = rr1Var;
rr1Var.setText(LocaleController.getString("BackgroundIntensity", R.string.BackgroundIntensity));
this.S0[i9].addView(this.Z0, g52.b(-1, -2.0f, 51, 0.0f, 175.0f, 0.0f, 0.0f));
l lVar = new l(this, context);
this.a1 = lVar;
lVar.setProgress(this.s1);
this.a1.setReportChanges(true);
this.a1.setDelegate(new m());
this.S0[i9].addView(this.a1, g52.b(-1, 38.0f, 51, 5.0f, 211.0f, 5.0f, 0.0f));
} else {
ColorPicker colorPicker = new ColorPicker(context, this.o0, new n());
this.d0 = colorPicker;
if (this.q == 1) {
this.S0[i9].addView(colorPicker, g52.c(-1, -1, 1));
if (this.m0.J()) {
this.d0.setMinBrightness(0.2f);
} else {
this.d0.setMinBrightness(0.05f);
this.d0.setMaxBrightness(0.8f);
}
this.d0.K(1, Y3(1), 2, this.x.d != 0 ? 2 : 1, false, 0, false);
this.d0.J(this.x.c, 0);
int i20 = this.x.d;
if (i20 != 0) {
this.d0.J(i20, 1);
}
} else {
this.S0[i9].addView(colorPicker, g52.b(-1, -1.0f, 1, 0.0f, 0.0f, 0.0f, 48.0f));
}
}
i9++;
}
}
O4(false, false);
if (!this.D0.getImageReceiver().hasBitmapImage()) {
this.A0.setBackgroundColor(com.batch.android.messaging.view.roundimage.b.v);
}
if (this.q != 1 && !(this.D1 instanceof Cif.i)) {
this.D0.getImageReceiver().setCrossfadeWithOldImage(true);
}
}
i6 = 0;
String[] strArr3 = new String[i6];
int[] iArr22 = new int[i6];
this.Q0 = new org.telegram.ui.Components.j9[i6];
if (i6 == 0) {
}
i8 = 0;
while (i8 < i6) {
}
if (this.q == 1) {
}
if (this.q != 1) {
}
this.H1 = false;
i9 = 0;
while (i9 < 2) {
}
O4(false, false);
if (!this.D0.getImageReceiver().hasBitmapImage()) {
}
if (this.q != 1) {
this.D0.getImageReceiver().setCrossfadeWithOldImage(true);
}
}
}
obj = this.D1;
if ((obj instanceof Cif.i) || !"d".equals(((Cif.i) obj).a)) {
i6 = 3;
String[] strArr32 = new String[i6];
int[] iArr222 = new int[i6];
this.Q0 = new org.telegram.ui.Components.j9[i6];
if (i6 == 0) {
}
i8 = 0;
while (i8 < i6) {
}
if (this.q == 1) {
}
if (this.q != 1) {
}
this.H1 = false;
i9 = 0;
while (i9 < 2) {
}
O4(false, false);
if (!this.D0.getImageReceiver().hasBitmapImage()) {
}
if (this.q != 1) {
}
}
i6 = 0;
String[] strArr322 = new String[i6];
int[] iArr2222 = new int[i6];
this.Q0 = new org.telegram.ui.Components.j9[i6];
if (i6 == 0) {
}
i8 = 0;
while (i8 < i6) {
}
if (this.q == 1) {
}
if (this.q != 1) {
}
this.H1 = false;
i9 = 0;
while (i9 < 2) {
}
O4(false, false);
if (!this.D0.getImageReceiver().hasBitmapImage()) {
}
if (this.q != 1) {
}
} else {
str = "chat_fieldOverlayText";
}
this.B0.setAdapter(this.C0);
o oVar2 = new o(context);
this.s0 = oVar2;
oVar2.setWillNotDraw(false);
FrameLayout frameLayout2 = this.s0;
this.e = frameLayout2;
ViewTreeObserver viewTreeObserver = frameLayout2.getViewTreeObserver();
ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public final void onGlobalLayout() {
org.telegram.ui.ff.this.e4();
}
};
this.Y = onGlobalLayoutListener;
viewTreeObserver.addOnGlobalLayoutListener(onGlobalLayoutListener);
androidx.viewpager.widget.b bVar2 = new androidx.viewpager.widget.b(context);
this.r0 = bVar2;
bVar2.b(new p());
this.r0.setAdapter(new q());
AndroidUtilities.setViewPagerEdgeEffectColor(this.r0, org.telegram.ui.ActionBar.w.r1("actionBarDefault"));
this.s0.addView(this.r0, g52.b(-1, -1.0f, 51, 0.0f, 0.0f, 0.0f, this.q == 0 ? 48.0f : 0.0f));
UndoView undoView = new UndoView(context, this);
this.t0 = undoView;
undoView.setAdditionalTranslationY(AndroidUtilities.dp(51.0f));
this.s0.addView(this.t0, g52.b(-1, -2.0f, 83, 8.0f, 0.0f, 8.0f, 8.0f));
if (this.q == 0) {
View view = new View(context);
view.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("dialogShadowLine"));
FrameLayout.LayoutParams layoutParams3 = new FrameLayout.LayoutParams(-1, 1, 83);
layoutParams3.bottomMargin = AndroidUtilities.dp(48.0f);
this.s0.addView(view, layoutParams3);
FrameLayout frameLayout3 = new FrameLayout(context);
this.j0 = frameLayout3;
frameLayout3.setBackgroundColor(W3("windowBackgroundWhite"));
this.s0.addView(this.j0, g52.c(-1, 48, 83));
r rVar = new r(context);
this.i0 = rVar;
this.j0.addView(rVar, g52.c(22, 8, 17));
TextView textView4 = new TextView(context);
this.l0 = textView4;
textView4.setTextSize(1, 14.0f);
String str3 = str;
this.l0.setTextColor(W3(str3));
this.l0.setGravity(17);
this.l0.setBackgroundDrawable(org.telegram.ui.ActionBar.w.S0(251658240, 0));
this.l0.setPadding(AndroidUtilities.dp(29.0f), 0, AndroidUtilities.dp(29.0f), 0);
this.l0.setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase());
this.l0.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
this.j0.addView(this.l0, g52.c(-2, -1, 51));
this.l0.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
org.telegram.ui.ff.this.f4(view2);
}
});
TextView textView5 = new TextView(context);
this.k0 = textView5;
textView5.setTextSize(1, 14.0f);
this.k0.setTextColor(W3(str3));
this.k0.setGravity(17);
this.k0.setBackgroundDrawable(org.telegram.ui.ActionBar.w.S0(251658240, 0));
this.k0.setPadding(AndroidUtilities.dp(29.0f), 0, AndroidUtilities.dp(29.0f), 0);
this.k0.setText(LocaleController.getString("ApplyTheme", R.string.ApplyTheme).toUpperCase());
this.k0.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
this.j0.addView(this.k0, g52.c(-2, -1, 53));
this.k0.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
org.telegram.ui.ff.this.g4(view2);
}
});
}
if (this.q == 1 && !org.telegram.ui.ActionBar.w.l2() && this.x.j != 4294967296L) {
D4(2);
}
this.q0 = X3();
H4(true);
Q4(false);
if (this.I1) {
M4(0, true, false);
}
return this.e;
}
h6Var = this.B0;
dp = AndroidUtilities.dp(4.0f);
f2 = 16.0f;
}
dp2 = AndroidUtilities.dp(f2);
h6Var.setPadding(0, dp, 0, dp2);
this.B0.setClipToPadding(false);
this.B0.setLayoutManager(new androidx.recyclerview.widget.o(context, 1, true));
this.B0.setVerticalScrollbarPosition(LocaleController.isRTL ? 1 : 2);
if (this.q == 1) {
}
this.B0.setOnScrollListener(new a());
this.A0.addView(this.z0, g52.a(i4, -2.0f));
org.telegram.ui.Components.k9 k9Var2 = new org.telegram.ui.Components.k9(context);
this.y1 = k9Var2;
k9Var2.b(new k9.a() {
@Override
public final void a(int i162, int i172, float f4) {
org.telegram.ui.ff.this.k4(i162, i172, f4);
}
});
i5 = this.q;
String str22 = "chat_fieldOverlayText";
if (i5 != 1) {
}
me4 me4Var2 = new me4(this.D0);
this.I0 = me4Var2;
me4Var2.s("chat_serviceBackground", "chat_serviceBackground", "chat_serviceText", "chat_serviceText");
if (this.q == 2) {
}
Rect rect2 = new Rect();
Drawable mutate32 = context.getResources().getDrawable(org.telegram.messenger.R.drawable.sheet_shadow_round).mutate();
this.w = mutate32;
mutate32.getPadding(rect2);
this.w.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"), PorterDuff.Mode.MULTIPLY));
TextPaint textPaint2 = new TextPaint(1);
textPaint2.setTextSize(AndroidUtilities.dp(14.0f));
textPaint2.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
if (this.q != 1) {
}
obj = this.D1;
if (obj instanceof Cif.i) {
}
i6 = 3;
String[] strArr3222 = new String[i6];
int[] iArr22222 = new int[i6];
this.Q0 = new org.telegram.ui.Components.j9[i6];
if (i6 == 0) {
}
i8 = 0;
while (i8 < i6) {
}
if (this.q == 1) {
}
if (this.q != 1) {
}
this.H1 = false;
i9 = 0;
while (i9 < 2) {
}
O4(false, false);
if (!this.D0.getImageReceiver().hasBitmapImage()) {
}
if (this.q != 1) {
}
this.B0.setAdapter(this.C0);
o oVar22 = new o(context);
this.s0 = oVar22;
oVar22.setWillNotDraw(false);
FrameLayout frameLayout22 = this.s0;
this.e = frameLayout22;
ViewTreeObserver viewTreeObserver2 = frameLayout22.getViewTreeObserver();
ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener2 = new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public final void onGlobalLayout() {
org.telegram.ui.ff.this.e4();
}
};
this.Y = onGlobalLayoutListener2;
viewTreeObserver2.addOnGlobalLayoutListener(onGlobalLayoutListener2);
androidx.viewpager.widget.b bVar22 = new androidx.viewpager.widget.b(context);
this.r0 = bVar22;
bVar22.b(new p());
this.r0.setAdapter(new q());
AndroidUtilities.setViewPagerEdgeEffectColor(this.r0, org.telegram.ui.ActionBar.w.r1("actionBarDefault"));
this.s0.addView(this.r0, g52.b(-1, -1.0f, 51, 0.0f, 0.0f, 0.0f, this.q == 0 ? 48.0f : 0.0f));
UndoView undoView2 = new UndoView(context, this);
this.t0 = undoView2;
undoView2.setAdditionalTranslationY(AndroidUtilities.dp(51.0f));
this.s0.addView(this.t0, g52.b(-1, -2.0f, 83, 8.0f, 0.0f, 8.0f, 8.0f));
if (this.q == 0) {
}
if (this.q == 1) {
D4(2);
}
this.q0 = X3();
H4(true);
Q4(false);
if (this.I1) {
}
return this.e;
}
this.z0.setTitle("Telegram Beta Chat");
aVar = this.z0;
formatDateOnline = LocaleController.formatPluralString("Members", 505);
aVar.setSubtitle(formatDateOnline);
this.B0 = new f0(context);
g0 g0Var2 = new g0();
g0Var2.m0(false);
this.B0.setItemAnimator(g0Var2);
this.B0.setVerticalScrollBarEnabled(true);
this.B0.setOverScrollMode(2);
i3 = this.q;
if (i3 != 2) {
}
dp2 = AndroidUtilities.dp(f2);
h6Var.setPadding(0, dp, 0, dp2);
this.B0.setClipToPadding(false);
this.B0.setLayoutManager(new androidx.recyclerview.widget.o(context, 1, true));
this.B0.setVerticalScrollbarPosition(LocaleController.isRTL ? 1 : 2);
if (this.q == 1) {
}
this.B0.setOnScrollListener(new a());
this.A0.addView(this.z0, g52.a(i4, -2.0f));
org.telegram.ui.Components.k9 k9Var22 = new org.telegram.ui.Components.k9(context);
this.y1 = k9Var22;
k9Var22.b(new k9.a() {
@Override
public final void a(int i162, int i172, float f4) {
org.telegram.ui.ff.this.k4(i162, i172, f4);
}
});
i5 = this.q;
String str222 = "chat_fieldOverlayText";
if (i5 != 1) {
}
me4 me4Var22 = new me4(this.D0);
this.I0 = me4Var22;
me4Var22.s("chat_serviceBackground", "chat_serviceBackground", "chat_serviceText", "chat_serviceText");
if (this.q == 2) {
}
Rect rect22 = new Rect();
Drawable mutate322 = context.getResources().getDrawable(org.telegram.messenger.R.drawable.sheet_shadow_round).mutate();
this.w = mutate322;
mutate322.getPadding(rect22);
this.w.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"), PorterDuff.Mode.MULTIPLY));
TextPaint textPaint22 = new TextPaint(1);
textPaint22.setTextSize(AndroidUtilities.dp(14.0f));
textPaint22.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
if (this.q != 1) {
}
obj = this.D1;
if (obj instanceof Cif.i) {
}
i6 = 3;
String[] strArr32222 = new String[i6];
int[] iArr222222 = new int[i6];
this.Q0 = new org.telegram.ui.Components.j9[i6];
if (i6 == 0) {
}
i8 = 0;
while (i8 < i6) {
}
if (this.q == 1) {
}
if (this.q != 1) {
}
this.H1 = false;
i9 = 0;
while (i9 < 2) {
}
O4(false, false);
if (!this.D0.getImageReceiver().hasBitmapImage()) {
}
if (this.q != 1) {
}
this.B0.setAdapter(this.C0);
o oVar222 = new o(context);
this.s0 = oVar222;
oVar222.setWillNotDraw(false);
FrameLayout frameLayout222 = this.s0;
this.e = frameLayout222;
ViewTreeObserver viewTreeObserver22 = frameLayout222.getViewTreeObserver();
ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener22 = new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public final void onGlobalLayout() {
org.telegram.ui.ff.this.e4();
}
};
this.Y = onGlobalLayoutListener22;
viewTreeObserver22.addOnGlobalLayoutListener(onGlobalLayoutListener22);
androidx.viewpager.widget.b bVar222 = new androidx.viewpager.widget.b(context);
this.r0 = bVar222;
bVar222.b(new p());
this.r0.setAdapter(new q());
AndroidUtilities.setViewPagerEdgeEffectColor(this.r0, org.telegram.ui.ActionBar.w.r1("actionBarDefault"));
this.s0.addView(this.r0, g52.b(-1, -1.0f, 51, 0.0f, 0.0f, 0.0f, this.q == 0 ? 48.0f : 0.0f));
UndoView undoView22 = new UndoView(context, this);
this.t0 = undoView22;
undoView22.setAdditionalTranslationY(AndroidUtilities.dp(51.0f));
this.s0.addView(this.t0, g52.b(-1, -2.0f, 83, 8.0f, 0.0f, 8.0f, 8.0f));
if (this.q == 0) {
}
if (this.q == 1) {
}
this.q0 = X3();
H4(true);
Q4(false);
if (this.I1) {
}
return this.e;
}
}