CheetahGram v8.5.4版本的 MD5 值为:3d14e79cc242c314d3933620ff3ab030

以下内容为反编译后的 lh2.java 源代码,内容仅作参考


package org.telegram.messenger.p110;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.util.SparseIntArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.i;
import androidx.recyclerview.widget.u;
import co.cheetah.gram.R;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.ApplicationLoader;
import org.telegram.messenger.ChatObject;
import org.telegram.messenger.ContactsController;
import org.telegram.messenger.DocumentObject;
import org.telegram.messenger.Emoji;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.ImageLocation;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.MediaDataController;
import org.telegram.messenger.MessagesController;
import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.UserConfig;
import org.telegram.messenger.p110.i72;
import org.telegram.messenger.p110.lh2;
import org.telegram.tgnet.RequestDelegate;
import org.telegram.ui.ActionBar.a;
import org.telegram.ui.ActionBar.a0;
import org.telegram.ui.ActionBar.i;
import org.telegram.ui.Components.h6;
import org.telegram.ui.Components.w4;
import org.telegram.ui.ProfileActivity;
import uk.co.chrisjenx.calligraphy.BuildConfig;

public class lh2 extends org.telegram.ui.ActionBar.k {
    private int A;
    private int B;
    private int G;
    private int H;
    private int I;
    private int J;
    private int Q;
    private int R;
    private int S;
    private int T;
    private int U;
    private int V;
    private int W;
    private int X;
    private int Y;
    private int Z;
    private int a0;
    private int b0;
    private int c0;
    private int d0;
    private int e0;
    boolean f0;
    private int g0;
    Drawable h0;
    Drawable i0;
    boolean j0;
    boolean k0;
    boolean l0;
    boolean m0;
    private int n0;
    private boolean o0;
    private hg4 p0;
    private k q;
    private org.telegram.ui.Components.h6 r;
    private u95 s;
    private v95 t;
    private org.telegram.ui.Components.g4 t0;
    private sp5 u;
    private long v;
    long v0;
    private boolean w;
    private boolean w0;
    private long x;
    private boolean x0;
    private int y;
    private int z;
    private ArrayList<sp5> q0 = new ArrayList<>();
    private ArrayList<sp5> r0 = new ArrayList<>();
    private HashMap<Long, f27> s0 = new HashMap<>();
    private ArrayList<vo5> u0 = new ArrayList<>();
    Runnable y0 = new a();
    boolean z0 = false;
    private final i72.i A0 = new f();
    int B0 = -1;

    public class a implements Runnable {
        a() {
        }

        @Override
        public void run() {
            if (lh2.this.r == null) {
                return;
            }
            for (int i = 0; i < lh2.this.r.getChildCount(); i++) {
                View childAt = lh2.this.r.getChildAt(i);
                if (childAt instanceof j) {
                    j jVar = (j) childAt;
                    if (jVar.o) {
                        jVar.k(jVar.d, jVar.e);
                    }
                }
            }
            AndroidUtilities.runOnUIThread(this, 500L);
        }
    }

    class b extends a.h {
        b() {
        }

        @Override
        public void b(int i) {
            if (i == -1) {
                lh2.this.D();
            }
        }
    }

    class c extends FrameLayout {
        c(Context context) {
            super(context);
        }

        @Override
        protected void onAttachedToWindow() {
            super.onAttachedToWindow();
            AndroidUtilities.runOnUIThread(lh2.this.y0, 500L);
        }

        @Override
        protected void onDetachedFromWindow() {
            super.onDetachedFromWindow();
            AndroidUtilities.cancelRunOnUIThread(lh2.this.y0);
        }
    }

    class d extends androidx.recyclerview.widget.o {
        d(lh2 lh2Var, Context context, int i, boolean z) {
            super(context, i, z);
        }

        @Override
        public boolean N1() {
            return false;
        }
    }

    class e extends u.t {
        final androidx.recyclerview.widget.o a;

        e(androidx.recyclerview.widget.o oVar) {
            this.a = oVar;
        }

        @Override
        public void b(androidx.recyclerview.widget.u uVar, int i, int i2) {
            super.b(uVar, i, i2);
            lh2 lh2Var = lh2.this;
            if (!lh2Var.j0 || lh2Var.f0) {
                return;
            }
            if (lh2.this.g0 - this.a.f2() < 10) {
                lh2.this.Z2(true);
            }
        }
    }

    public class f implements i72.i {
        f() {
        }

        public void f(i95 i95Var) {
            g c3 = lh2.this.c3();
            lh2.this.q0.add(0, (sp5) i95Var);
            if (lh2.this.t != null) {
                lh2.this.t.W++;
                lh2.this.X().saveChatLinksCount(lh2.this.x, lh2.this.t.W);
            }
            lh2.this.e3(c3);
        }

        @Override
        public void a(sp5 sp5Var, i95 i95Var) {
            if (i95Var instanceof ub6) {
                sp5 sp5Var2 = (sp5) ((ub6) i95Var).a;
                lh2.this.G2(sp5Var2);
                for (int i = 0; i < lh2.this.q0.size(); i++) {
                    if (((sp5) lh2.this.q0.get(i)).e.equals(sp5Var.e)) {
                        if (!sp5Var2.b) {
                            lh2.this.q0.set(i, sp5Var2);
                            lh2.this.f3(true);
                            return;
                        } else {
                            g c3 = lh2.this.c3();
                            lh2.this.q0.remove(i);
                            lh2.this.r0.add(0, sp5Var2);
                            lh2.this.e3(c3);
                            return;
                        }
                    }
                }
            }
        }

        @Override
        public void b(sp5 sp5Var) {
            lh2.this.a3(sp5Var);
        }

        @Override
        public void c(final i95 i95Var) {
            if (i95Var instanceof sp5) {
                AndroidUtilities.runOnUIThread(new Runnable() {
                    @Override
                    public final void run() {
                        lh2.f.this.f(i95Var);
                    }
                }, 200L);
            }
        }

        @Override
        public void d(sp5 sp5Var) {
            for (int i = 0; i < lh2.this.r0.size(); i++) {
                if (((sp5) lh2.this.r0.get(i)).e.equals(sp5Var.e)) {
                    g c3 = lh2.this.c3();
                    lh2.this.r0.remove(i);
                    lh2.this.e3(c3);
                    return;
                }
            }
        }
    }

    public class g extends i.b {
        int a;
        int b;
        int c;
        int d;
        int e;
        int f;
        int g;
        SparseIntArray h;
        SparseIntArray i;
        ArrayList<sp5> j;
        ArrayList<sp5> k;

        private g() {
            this.h = new SparseIntArray();
            this.i = new SparseIntArray();
            this.j = new ArrayList<>();
            this.k = new ArrayList<>();
        }

        g(lh2 lh2Var, a aVar) {
            this();
        }

        private void g(int i, int i2, SparseIntArray sparseIntArray) {
            if (i2 >= 0) {
                sparseIntArray.put(i2, i);
            }
        }

        @Override
        public boolean a(int i, int i2) {
            return b(i, i2);
        }

        @Override
        public boolean b(int i, int i2) {
            ArrayList arrayList;
            int i3;
            if (((i < this.b || i >= this.c) && (i < this.d || i >= this.e)) || ((i2 < lh2.this.H || i2 >= lh2.this.I) && (i2 < lh2.this.Q || i2 >= lh2.this.R))) {
                if (i >= this.f && i < this.g && i2 >= lh2.this.d0 && i2 < lh2.this.e0) {
                    return i - this.f == i2 - lh2.this.d0;
                }
                int i4 = this.h.get(i, -1);
                return i4 >= 0 && i4 == this.i.get(i2, -1);
            }
            if (i2 < lh2.this.H || i2 >= lh2.this.I) {
                arrayList = lh2.this.r0;
                i3 = lh2.this.Q;
            } else {
                arrayList = lh2.this.q0;
                i3 = lh2.this.H;
            }
            sp5 sp5Var = (sp5) arrayList.get(i2 - i3);
            int i5 = this.b;
            return ((i < i5 || i >= this.c) ? this.k.get(i - this.d) : this.j.get(i - i5)).e.equals(sp5Var.e);
        }

        @Override
        public int d() {
            return lh2.this.g0;
        }

        @Override
        public int e() {
            return this.a;
        }

        public void f(SparseIntArray sparseIntArray) {
            sparseIntArray.clear();
            g(1, lh2.this.y, sparseIntArray);
            g(2, lh2.this.z, sparseIntArray);
            g(3, lh2.this.A, sparseIntArray);
            g(4, lh2.this.B, sparseIntArray);
            g(5, lh2.this.G, sparseIntArray);
            g(6, lh2.this.U, sparseIntArray);
            g(7, lh2.this.W, sparseIntArray);
            g(8, lh2.this.X, sparseIntArray);
            g(9, lh2.this.Z, sparseIntArray);
            g(10, lh2.this.a0, sparseIntArray);
            g(11, lh2.this.b0, sparseIntArray);
            g(12, lh2.this.Y, sparseIntArray);
            g(13, lh2.this.J, sparseIntArray);
        }
    }

    private static class h extends LinearLayout implements NotificationCenter.NotificationCenterDelegate {
        private pf a;
        private final int b;

        public h(Context context) {
            super(context);
            this.b = UserConfig.selectedAccount;
            setPadding(0, AndroidUtilities.dp(12.0f), 0, AndroidUtilities.dp(12.0f));
            setOrientation(1);
            pf pfVar = new pf(context);
            this.a = pfVar;
            addView(pfVar, g52.m(104, 104, 49, 0, 2, 0, 0));
        }

        private void a() {
            ah6 stickerSetByName = MediaDataController.getInstance(this.b).getStickerSetByName(AndroidUtilities.STICKERS_PLACEHOLDER_PACK_NAME);
            if (stickerSetByName == null) {
                stickerSetByName = MediaDataController.getInstance(this.b).getStickerSetByEmojiOrName(AndroidUtilities.STICKERS_PLACEHOLDER_PACK_NAME);
            }
            ah6 ah6Var = stickerSetByName;
            if (ah6Var == null || ah6Var.c.size() < 4) {
                MediaDataController.getInstance(this.b).loadStickersByEmojiOrName(AndroidUtilities.STICKERS_PLACEHOLDER_PACK_NAME, false, ah6Var == null);
            } else {
                ga5 ga5Var = ah6Var.c.get(3);
                this.a.g(ImageLocation.getForDocument(ga5Var), "104_104", "tgs", DocumentObject.getSvgThumb(ga5Var, "windowBackgroundGray", 1.0f), ah6Var);
            }
        }

        @Override
        public void didReceivedNotification(int i, int i2, Object... objArr) {
            if (i == NotificationCenter.diceStickersDidLoad && AndroidUtilities.STICKERS_PLACEHOLDER_PACK_NAME.equals((String) objArr[0])) {
                a();
            }
        }

        @Override
        protected void onAttachedToWindow() {
            super.onAttachedToWindow();
            a();
            NotificationCenter.getInstance(this.b).addObserver(this, NotificationCenter.diceStickersDidLoad);
        }

        @Override
        protected void onDetachedFromWindow() {
            super.onDetachedFromWindow();
            NotificationCenter.getInstance(this.b).removeObserver(this, NotificationCenter.diceStickersDidLoad);
        }
    }

    public class i extends FrameLayout {
        private h a;
        private TextView b;

        public i(lh2 lh2Var, Context context) {
            super(context);
            int i;
            String str;
            h hVar = new h(context);
            this.a = hVar;
            addView(hVar, g52.b(-2, -2.0f, 49, 0.0f, 10.0f, 0.0f, 0.0f));
            TextView textView = new TextView(context);
            this.b = textView;
            textView.setTextColor(org.telegram.ui.ActionBar.w.r1("chats_message"));
            this.b.setTextSize(1, 14.0f);
            this.b.setGravity(17);
            TextView textView2 = this.b;
            if (lh2Var.w) {
                i = R.string.PrimaryLinkHelpChannel;
                str = "PrimaryLinkHelpChannel";
            } else {
                i = R.string.PrimaryLinkHelp;
                str = "PrimaryLinkHelp";
            }
            textView2.setText(LocaleController.getString(str, i));
            addView(this.b, g52.b(-1, -2.0f, 51, 52.0f, 143.0f, 52.0f, 18.0f));
        }

        @Override
        protected void onMeasure(int i, int i2) {
            super.onMeasure(View.MeasureSpec.makeMeasureSpec(View.MeasureSpec.getSize(i), 1073741824), i2);
        }
    }

    public class j extends FrameLayout {
        int a;
        TextView b;
        TextView c;
        sp5 d;
        int e;
        Paint f;
        Paint g;
        RectF h;
        ImageView i;
        int j;
        float k;
        float l;
        boolean m;
        boolean n;
        boolean o;
        private ed7 p;

        public j(Context context) {
            super(context);
            this.f = new Paint(1);
            this.g = new Paint(1);
            this.h = new RectF();
            this.k = 1.0f;
            this.p = new ed7();
            this.g.setStyle(Paint.Style.STROKE);
            this.g.setStrokeCap(Paint.Cap.ROUND);
            LinearLayout linearLayout = new LinearLayout(context);
            linearLayout.setOrientation(1);
            addView(linearLayout, g52.b(-1, -2.0f, 16, 70.0f, 0.0f, 30.0f, 0.0f));
            TextView textView = new TextView(context);
            this.b = textView;
            textView.setTextSize(1, 16.0f);
            this.b.setTextColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteBlackText"));
            this.b.setLines(1);
            this.b.setEllipsize(TextUtils.TruncateAt.END);
            TextView textView2 = new TextView(context);
            this.c = textView2;
            textView2.setTextSize(1, 13.0f);
            this.c.setTextColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteGrayText"));
            linearLayout.addView(this.b, g52.f(-1, -2));
            linearLayout.addView(this.c, g52.h(-1, -2, 0.0f, 6.0f, 0.0f, 0.0f));
            ImageView imageView = new ImageView(context);
            this.i = imageView;
            imageView.setImageDrawable(androidx.core.content.a.f(context, org.telegram.messenger.R.drawable.ic_ab_other));
            this.i.setScaleType(ImageView.ScaleType.CENTER);
            this.i.setColorFilter(org.telegram.ui.ActionBar.w.r1("stickers_menu"));
            this.i.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    lh2.j.this.j(view);
                }
            });
            this.i.setBackground(org.telegram.ui.ActionBar.w.S0(org.telegram.ui.ActionBar.w.r1("listSelectorSDK21"), 1));
            addView(this.i, g52.c(40, 48, 21));
            setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"));
            setWillNotDraw(false);
        }

        private int e(int i, float f) {
            return i == 3 ? org.telegram.ui.ActionBar.w.r1("chat_attachAudioBackground") : i == 1 ? f > 0.5f ? hj0.c(org.telegram.ui.ActionBar.w.r1("chat_attachLocationBackground"), org.telegram.ui.ActionBar.w.r1("chat_attachPollBackground"), 1.0f - ((f - 0.5f) / 0.5f)) : hj0.c(org.telegram.ui.ActionBar.w.r1("chat_attachPollBackground"), org.telegram.ui.ActionBar.w.r1("chat_attachAudioBackground"), 1.0f - (f / 0.5f)) : i == 2 ? org.telegram.ui.ActionBar.w.r1("chat_attachPollBackground") : i == 4 ? org.telegram.ui.ActionBar.w.r1("chats_unreadCounterMuted") : org.telegram.ui.ActionBar.w.r1("featuredStickers_addButton");
        }

        private boolean f(int i) {
            return i == 2 || i == 1;
        }

        public void g(sp5 sp5Var, DialogInterface dialogInterface, int i) {
            lh2.this.a3(sp5Var);
        }

        public void h(sp5 sp5Var, DialogInterface dialogInterface, int i) {
            lh2.this.E2(sp5Var);
        }

        public void i(ArrayList arrayList, DialogInterface dialogInterface, int i) {
            i.C0142i c0142i;
            String string;
            DialogInterface.OnClickListener onClickListener;
            int intValue = ((Integer) arrayList.get(i)).intValue();
            try {
                if (intValue != 0) {
                    if (intValue != 1) {
                        if (intValue == 2) {
                            lh2.this.F2(this.d);
                            return;
                        }
                        if (intValue == 3) {
                            final sp5 sp5Var = this.d;
                            c0142i = new i.C0142i(lh2.this.c0());
                            c0142i.l(LocaleController.getString("RevokeAlert", R.string.RevokeAlert));
                            c0142i.u(LocaleController.getString("RevokeLink", R.string.RevokeLink));
                            string = LocaleController.getString("RevokeButton", R.string.RevokeButton);
                            onClickListener = new DialogInterface.OnClickListener() {
                                @Override
                                public final void onClick(DialogInterface dialogInterface2, int i2) {
                                    lh2.j.this.g(sp5Var, dialogInterface2, i2);
                                }
                            };
                        } else {
                            if (intValue != 4) {
                                return;
                            }
                            final sp5 sp5Var2 = this.d;
                            c0142i = new i.C0142i(lh2.this.c0());
                            c0142i.u(LocaleController.getString("DeleteLink", R.string.DeleteLink));
                            c0142i.l(LocaleController.getString("DeleteLinkHelp", R.string.DeleteLinkHelp));
                            string = LocaleController.getString("Delete", R.string.Delete);
                            onClickListener = new DialogInterface.OnClickListener() {
                                @Override
                                public final void onClick(DialogInterface dialogInterface2, int i2) {
                                    lh2.j.this.h(sp5Var2, dialogInterface2, i2);
                                }
                            };
                        }
                        c0142i.s(string, onClickListener);
                        c0142i.n(LocaleController.getString("Cancel", R.string.Cancel), null);
                        lh2.this.o1(c0142i.a());
                        return;
                    }
                    if (this.d.e == null) {
                        return;
                    }
                    Intent intent = new Intent("android.intent.action.SEND");
                    intent.setType("text/plain");
                    intent.putExtra("android.intent.extra.TEXT", this.d.e);
                    lh2.this.r1(Intent.createChooser(intent, LocaleController.getString("InviteToGroupByLink", R.string.InviteToGroupByLink)), 500);
                } else {
                    if (this.d.e == null) {
                        return;
                    }
                    ((ClipboardManager) ApplicationLoader.applicationContext.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText(com.batch.android.module.k.f, this.d.e));
                    org.telegram.ui.Components.b0.g(lh2.this).J();
                }
            } catch (Exception e) {
                FileLog.e(e);
            }
        }

        public void j(View view) {
            boolean z;
            int i;
            if (this.d == null) {
                return;
            }
            ArrayList arrayList = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            final ArrayList arrayList3 = new ArrayList();
            if (this.d.b) {
                arrayList.add(LocaleController.getString("Delete", R.string.Delete));
                arrayList2.add(Integer.valueOf(org.telegram.messenger.R.drawable.msg_delete));
                i = 4;
            } else {
                arrayList.add(LocaleController.getString("CopyLink", R.string.CopyLink));
                arrayList2.add(Integer.valueOf(org.telegram.messenger.R.drawable.msg_copy));
                arrayList3.add(0);
                arrayList.add(LocaleController.getString("ShareLink", R.string.ShareLink));
                arrayList2.add(Integer.valueOf(org.telegram.messenger.R.drawable.msg_share));
                arrayList3.add(1);
                if (!this.d.c && lh2.this.x0) {
                    arrayList.add(LocaleController.getString("EditLink", R.string.EditLink));
                    arrayList2.add(Integer.valueOf(org.telegram.messenger.R.drawable.msg_edit));
                    arrayList3.add(2);
                }
                if (!lh2.this.x0) {
                    z = false;
                    i.C0142i c0142i = new i.C0142i(lh2.this.c0());
                    c0142i.k((CharSequence[]) arrayList.toArray(new CharSequence[0]), AndroidUtilities.toIntArray(arrayList2), new DialogInterface.OnClickListener() {
                        @Override
                        public final void onClick(DialogInterface dialogInterface, int i2) {
                            lh2.j.this.i(arrayList3, dialogInterface, i2);
                        }
                    });
                    c0142i.u(LocaleController.getString("InviteLink", R.string.InviteLink));
                    org.telegram.ui.ActionBar.i a = c0142i.a();
                    c0142i.C();
                    if (z) {
                        return;
                    }
                    a.G0(arrayList.size() - 1, org.telegram.ui.ActionBar.w.r1("dialogTextRed2"), org.telegram.ui.ActionBar.w.r1("dialogRedIcon"));
                    return;
                }
                arrayList.add(LocaleController.getString("RevokeLink", R.string.RevokeLink));
                arrayList2.add(Integer.valueOf(org.telegram.messenger.R.drawable.msg_delete));
                i = 3;
            }
            arrayList3.add(Integer.valueOf(i));
            z = true;
            i.C0142i c0142i2 = new i.C0142i(lh2.this.c0());
            c0142i2.k((CharSequence[]) arrayList.toArray(new CharSequence[0]), AndroidUtilities.toIntArray(arrayList2), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i2) {
                    lh2.j.this.i(arrayList3, dialogInterface, i2);
                }
            });
            c0142i2.u(LocaleController.getString("InviteLink", R.string.InviteLink));
            org.telegram.ui.ActionBar.i a2 = c0142i2.a();
            c0142i2.C();
            if (z) {
            }
        }

        public void k(sp5 sp5Var, int i) {
            TextView textView;
            String str;
            String str2;
            int i2;
            String formatPluralString;
            SpannableStringBuilder spannableStringBuilder;
            int i3;
            String str3;
            String string;
            int i4;
            this.o = false;
            sp5 sp5Var2 = this.d;
            if (sp5Var2 == null || sp5Var == null || !sp5Var2.e.equals(sp5Var.e)) {
                this.a = -1;
                this.k = 1.0f;
            }
            this.d = sp5Var;
            this.e = i;
            if (sp5Var == null) {
                return;
            }
            if (TextUtils.isEmpty(sp5Var.m)) {
                if (sp5Var.e.startsWith("https://t.me/+")) {
                    textView = this.b;
                    str2 = sp5Var.e;
                    i2 = 14;
                } else if (sp5Var.e.startsWith("https://t.me/joinchat/")) {
                    textView = this.b;
                    str2 = sp5Var.e;
                    i2 = 22;
                } else if (sp5Var.e.startsWith("https://")) {
                    textView = this.b;
                    str2 = sp5Var.e;
                    i2 = 8;
                } else {
                    textView = this.b;
                    str = sp5Var.e;
                    textView.setText(str);
                }
                str = str2.substring(i2);
                textView.setText(str);
            } else {
                SpannableStringBuilder spannableStringBuilder2 = new SpannableStringBuilder(sp5Var.m);
                Emoji.replaceEmoji(spannableStringBuilder2, this.b.getPaint().getFontMetricsInt(), (int) this.b.getPaint().getTextSize(), false);
                this.b.setText(spannableStringBuilder2);
            }
            int i5 = sp5Var.k;
            if (i5 == 0 && sp5Var.j == 0 && sp5Var.l == 0) {
                formatPluralString = LocaleController.getString("NoOneJoinedYet", R.string.NoOneJoinedYet);
            } else {
                int i6 = sp5Var.j;
                if (i6 > 0 && i5 == 0 && !sp5Var.o && !sp5Var.b) {
                    formatPluralString = LocaleController.formatPluralString("CanJoin", i6);
                } else if (i6 > 0 && sp5Var.o && sp5Var.b) {
                    formatPluralString = LocaleController.formatPluralString("PeopleJoined", sp5Var.k) + ", " + LocaleController.formatPluralString("PeopleJoinedRemaining", sp5Var.j - sp5Var.k);
                } else {
                    formatPluralString = i5 > 0 ? LocaleController.formatPluralString("PeopleJoined", i5) : BuildConfig.FLAVOR;
                    if (sp5Var.l > 0) {
                        if (sp5Var.k > 0) {
                            formatPluralString = formatPluralString + ", ";
                        }
                        formatPluralString = formatPluralString + LocaleController.formatPluralString("JoinRequests", sp5Var.l);
                    }
                }
            }
            if (sp5Var.c && !sp5Var.b) {
                SpannableStringBuilder spannableStringBuilder3 = new SpannableStringBuilder(formatPluralString);
                m11 m11Var = new m11();
                m11Var.a(AndroidUtilities.dp(1.5f));
                spannableStringBuilder3.append((CharSequence) "  .  ").setSpan(m11Var, spannableStringBuilder3.length() - 3, spannableStringBuilder3.length() - 2, 0);
                spannableStringBuilder3.append((CharSequence) LocaleController.getString("Permanent", R.string.Permanent));
                this.c.setText(spannableStringBuilder3);
                return;
            }
            if (sp5Var.o || sp5Var.b) {
                if (sp5Var.b && sp5Var.k == 0) {
                    formatPluralString = LocaleController.getString("NoOneJoined", R.string.NoOneJoined);
                }
                spannableStringBuilder = new SpannableStringBuilder(formatPluralString);
                m11 m11Var2 = new m11();
                m11Var2.a(AndroidUtilities.dp(1.5f));
                spannableStringBuilder.append((CharSequence) "  .  ").setSpan(m11Var2, spannableStringBuilder.length() - 3, spannableStringBuilder.length() - 2, 0);
                boolean z = sp5Var.b;
                if (!z && (i4 = sp5Var.j) > 0 && sp5Var.k >= i4) {
                    i3 = R.string.LinkLimitReached;
                    str3 = "LinkLimitReached";
                } else if (z) {
                    i3 = R.string.Revoked;
                    str3 = "Revoked";
                } else {
                    i3 = R.string.Expired;
                    str3 = "Expired";
                }
                string = LocaleController.getString(str3, i3);
            } else {
                if (sp5Var.i <= 0) {
                    this.c.setText(formatPluralString);
                    return;
                }
                spannableStringBuilder = new SpannableStringBuilder(formatPluralString);
                m11 m11Var3 = new m11();
                m11Var3.a(AndroidUtilities.dp(1.5f));
                spannableStringBuilder.append((CharSequence) "  .  ").setSpan(m11Var3, spannableStringBuilder.length() - 3, spannableStringBuilder.length() - 2, 0);
                long currentTimeMillis = (sp5Var.i * 1000) - (System.currentTimeMillis() + (lh2.this.v0 * 1000));
                if (currentTimeMillis < 0) {
                    currentTimeMillis = 0;
                }
                if (currentTimeMillis <= 86400000) {
                    long j = currentTimeMillis / 1000;
                    int i7 = (int) (j % 60);
                    long j2 = j / 60;
                    int i8 = (int) (j2 % 60);
                    int i9 = (int) (j2 / 60);
                    Locale locale = Locale.ENGLISH;
                    spannableStringBuilder.append((CharSequence) String.format(locale, "%02d", Integer.valueOf(i9))).append((CharSequence) String.format(locale, ":%02d", Integer.valueOf(i8))).append((CharSequence) String.format(locale, ":%02d", Integer.valueOf(i7)));
                    this.o = true;
                    this.c.setText(spannableStringBuilder);
                }
                string = LocaleController.formatPluralString("DaysLeft", (int) (currentTimeMillis / 86400000));
            }
            spannableStringBuilder.append((CharSequence) string);
            this.c.setText(spannableStringBuilder);
        }

        @Override
        protected void onDraw(Canvas canvas) {
            int i;
            float f;
            float f2;
            Drawable drawable;
            if (this.d == null) {
                return;
            }
            int dp = AndroidUtilities.dp(36.0f);
            int measuredHeight = getMeasuredHeight() / 2;
            sp5 sp5Var = this.d;
            if (sp5Var.o || sp5Var.b) {
                i = sp5Var.b ? 4 : 3;
                f = 1.0f;
                f2 = 0.0f;
            } else {
                int i2 = sp5Var.i;
                if (i2 > 0 || sp5Var.j > 0) {
                    if (i2 > 0) {
                        long currentTimeMillis = System.currentTimeMillis() + (lh2.this.v0 * 1000);
                        sp5 sp5Var2 = this.d;
                        long j = sp5Var2.i * 1000;
                        int i3 = sp5Var2.h;
                        if (i3 <= 0) {
                            i3 = sp5Var2.g;
                        }
                        long j2 = i3 * 1000;
                        f = 1.0f - (((float) (currentTimeMillis - j2)) / ((float) (j - j2)));
                    } else {
                        f = 1.0f;
                    }
                    int i4 = this.d.j;
                    f2 = Math.min(f, i4 > 0 ? (i4 - r2.k) / i4 : 1.0f);
                    if (f2 <= 0.0f) {
                        this.d.o = true;
                        AndroidUtilities.updateVisibleRows(lh2.this.r);
                        i = 3;
                    } else {
                        i = 1;
                    }
                } else {
                    f = 1.0f;
                    f2 = 0.0f;
                    i = 0;
                }
            }
            int i5 = this.a;
            if (i != i5 && i5 >= 0) {
                this.j = i5;
                this.k = 0.0f;
                if (!f(i5) || f(i)) {
                    this.m = false;
                } else {
                    this.m = true;
                }
            }
            this.a = i;
            float f3 = this.k;
            if (f3 != 1.0f) {
                float f4 = f3 + 0.064f;
                this.k = f4;
                if (f4 >= 1.0f) {
                    this.k = 1.0f;
                    this.m = false;
                } else {
                    invalidate();
                }
            }
            int c = this.k != 1.0f ? hj0.c(e(this.j, f2), e(i, f2), this.k) : e(i, f2);
            this.f.setColor(c);
            canvas.drawCircle(dp, measuredHeight, AndroidUtilities.dp(32.0f) / 2.0f, this.f);
            boolean z = this.m;
            if (!z) {
                sp5 sp5Var3 = this.d;
                if (!sp5Var3.o) {
                    if (sp5Var3.i > 0) {
                    }
                }
                if (this.d.b) {
                    lh2.this.h0.setBounds(dp - AndroidUtilities.dp(12.0f), measuredHeight - AndroidUtilities.dp(12.0f), dp + AndroidUtilities.dp(12.0f), measuredHeight + AndroidUtilities.dp(12.0f));
                    drawable = lh2.this.h0;
                } else {
                    lh2.this.i0.setBounds(dp - AndroidUtilities.dp(12.0f), measuredHeight - AndroidUtilities.dp(12.0f), dp + AndroidUtilities.dp(12.0f), measuredHeight + AndroidUtilities.dp(12.0f));
                    drawable = lh2.this.i0;
                }
                drawable.draw(canvas);
                if (this.n) {
                    return;
                }
                canvas.drawLine(AndroidUtilities.dp(70.0f), getMeasuredHeight() - 1, getMeasuredWidth() + AndroidUtilities.dp(23.0f), getMeasuredHeight(), org.telegram.ui.ActionBar.w.l0);
                return;
            }
            if (z) {
                f = this.l;
            }
            float f5 = f;
            this.g.setColor(c);
            this.h.set(dp - AndroidUtilities.dp(20.0f), measuredHeight - AndroidUtilities.dp(20.0f), AndroidUtilities.dp(20.0f) + dp, AndroidUtilities.dp(20.0f) + measuredHeight);
            if (this.k == 1.0f || (f(this.j) && !this.m)) {
                float f6 = (-f5) * 360.0f;
                canvas.drawArc(this.h, -90.0f, f6, false, this.g);
                this.p.a(canvas, this.g, this.h, f6, 1.0f);
            } else {
                canvas.save();
                float f7 = this.m ? 1.0f - this.k : this.k;
                double d = 0.3f * f7;
                Double.isNaN(d);
                float f8 = (float) (d + 0.7d);
                canvas.scale(f8, f8, this.h.centerX(), this.h.centerY());
                float f9 = (-f5) * 360.0f;
                canvas.drawArc(this.h, -90.0f, f9, false, this.g);
                this.p.a(canvas, this.g, this.h, f9, f7);
                canvas.restore();
            }
            if (!((org.telegram.ui.ActionBar.k) lh2.this).n) {
                invalidate();
            }
            this.l = f5;
            if (this.d.b) {
            }
            drawable.draw(canvas);
            if (this.n) {
            }
        }

        @Override
        protected void onMeasure(int i, int i2) {
            super.onMeasure(i, View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(64.0f), 1073741824));
            this.g.setStrokeWidth(AndroidUtilities.dp(2.0f));
        }
    }

    public class k extends h6.s {
        private Context c;

        class a implements w4.g {
            final org.telegram.ui.Components.w4 a;

            a(org.telegram.ui.Components.w4 w4Var) {
                this.a = w4Var;
            }

            @Override
            public void a() {
                u62.a(this);
            }

            @Override
            public void b() {
                lh2.this.b3();
            }

            @Override
            public void c() {
                lh2 lh2Var = lh2.this;
                Context context = this.a.getContext();
                sp5 sp5Var = lh2.this.u;
                v95 v95Var = lh2.this.t;
                HashMap hashMap = lh2.this.s0;
                lh2 lh2Var2 = lh2.this;
                lh2Var.t0 = new org.telegram.ui.Components.g4(context, sp5Var, v95Var, hashMap, lh2Var2, lh2Var2.x, true, lh2.this.w);
                lh2.this.t0.show();
            }

            @Override
            public void d() {
                u62.b(this);
            }
        }

        public k(Context context) {
            this.c = context;
        }

        @Override
        public void B(u.d0 d0Var) {
            View view = d0Var.a;
            if (view instanceof sg2) {
                ((sg2) view).d();
            }
        }

        @Override
        public boolean G(u.d0 d0Var) {
            int j = d0Var.j();
            if (lh2.this.Z == j || lh2.this.G == j) {
                return true;
            }
            if (j >= lh2.this.H && j < lh2.this.I) {
                return true;
            }
            if ((j < lh2.this.Q || j >= lh2.this.R) && j != lh2.this.W) {
                return j >= lh2.this.d0 && j < lh2.this.e0;
            }
            return true;
        }

        @Override
        public int e() {
            return lh2.this.g0;
        }

        @Override
        public int g(int i) {
            if (i == lh2.this.y) {
                return 0;
            }
            if (i == lh2.this.z || i == lh2.this.U || i == lh2.this.b0 || i == lh2.this.Y) {
                return 1;
            }
            if (i == lh2.this.A) {
                return 2;
            }
            if (i == lh2.this.G) {
                return 3;
            }
            if (i == lh2.this.B || i == lh2.this.S || i == lh2.this.V || i == lh2.this.a0 || i == lh2.this.c0) {
                return 4;
            }
            if (i >= lh2.this.H && i < lh2.this.I) {
                return 5;
            }
            if (i >= lh2.this.Q && i < lh2.this.R) {
                return 5;
            }
            if (i == lh2.this.J) {
                return 6;
            }
            if (i == lh2.this.T) {
                return 7;
            }
            if (i == lh2.this.W) {
                return 8;
            }
            if (i == lh2.this.X) {
                return 9;
            }
            if (i != lh2.this.Z) {
                return (i < lh2.this.d0 || i >= lh2.this.e0) ? 1 : 10;
            }
            return 10;
        }

        @Override
        public void u(u.d0 d0Var, int i) {
            int i2;
            String str;
            sp5 sp5Var;
            int i3;
            f27 f27Var;
            int l = d0Var.l();
            boolean z = true;
            if (l == 1) {
                rr1 rr1Var = (rr1) d0Var.a;
                if (i == lh2.this.z) {
                    if (lh2.this.w0 && lh2.this.v == lh2.this.G().getUserConfig().clientUserId) {
                        i2 = R.string.PublicLink;
                        str = "PublicLink";
                    } else if (lh2.this.v == lh2.this.G().getUserConfig().clientUserId) {
                        i2 = R.string.ChannelInviteLinkTitle;
                        str = "ChannelInviteLinkTitle";
                    } else {
                        i2 = R.string.PermanentLinkForThisAdmin;
                        str = "PermanentLinkForThisAdmin";
                    }
                } else if (i == lh2.this.U) {
                    i2 = R.string.RevokedLinks;
                    str = "RevokedLinks";
                } else if (i == lh2.this.Y) {
                    i2 = R.string.LinksCreatedByThisAdmin;
                    str = "LinksCreatedByThisAdmin";
                } else {
                    if (i != lh2.this.b0) {
                        return;
                    }
                    i2 = R.string.LinksCreatedByOtherAdmins;
                    str = "LinksCreatedByOtherAdmins";
                }
                rr1Var.setText(LocaleController.getString(str, i2));
                return;
            }
            if (l == 2) {
                org.telegram.ui.Components.w4 w4Var = (org.telegram.ui.Components.w4) d0Var.a;
                w4Var.setCanEdit(lh2.this.v == lh2.this.G().getUserConfig().clientUserId);
                if (lh2.this.w0 && lh2.this.v == lh2.this.G().getUserConfig().clientUserId) {
                    if (lh2.this.t != null) {
                        w4Var.setLink("https://t.me/" + lh2.this.s.v);
                        w4Var.K(0, null);
                        w4Var.u(true);
                        return;
                    }
                    return;
                }
                w4Var.u(!lh2.this.x0);
                if (lh2.this.u == null) {
                    w4Var.setLink(null);
                    w4Var.I(null, lh2.this.x);
                    return;
                } else {
                    sp5 sp5Var2 = lh2.this.u;
                    w4Var.setLink(sp5Var2.e);
                    w4Var.I(sp5Var2, lh2.this.x);
                    return;
                }
            }
            if (l == 3) {
                l lVar = (l) d0Var.a;
                Drawable drawable = this.c.getResources().getDrawable(org.telegram.messenger.R.drawable.poll_add_circle);
                Drawable drawable2 = this.c.getResources().getDrawable(org.telegram.messenger.R.drawable.poll_add_plus);
                drawable.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("switchTrackChecked"), PorterDuff.Mode.MULTIPLY));
                drawable2.setColorFilter(new PorterDuffColorFilter(org.telegram.ui.ActionBar.w.r1("checkboxCheck"), PorterDuff.Mode.MULTIPLY));
                lVar.a(LocaleController.getString("CreateNewLink", R.string.CreateNewLink), new jj0(drawable, drawable2), !lh2.this.q0.isEmpty());
                return;
            }
            if (l == 5) {
                if (i < lh2.this.H || i >= lh2.this.I) {
                    sp5Var = (sp5) lh2.this.r0.get(i - lh2.this.Q);
                } else {
                    sp5Var = (sp5) lh2.this.q0.get(i - lh2.this.H);
                }
                j jVar = (j) d0Var.a;
                jVar.k(sp5Var, i - lh2.this.H);
                jVar.n = z;
                return;
            }
            if (l != 10) {
                return;
            }
            sg2 sg2Var = (sg2) d0Var.a;
            if (i == lh2.this.Z) {
                f27Var = lh2.this.W().getUser(Long.valueOf(lh2.this.v));
                i3 = lh2.this.n0;
            } else {
                vo5 vo5Var = (vo5) lh2.this.u0.get(i - lh2.this.d0);
                f27 f27Var2 = (f27) lh2.this.s0.get(Long.valueOf(vo5Var.a));
                i3 = vo5Var.b;
                if (i != lh2.this.e0 - 1) {
                    f27Var = f27Var2;
                    if (f27Var == null) {
                        sg2Var.e(f27Var, ContactsController.formatName(f27Var.b, f27Var.c), LocaleController.formatPluralString("InviteLinkCount", i3), z);
                        return;
                    }
                    return;
                }
                f27Var = f27Var2;
            }
            z = false;
            if (f27Var == null) {
            }
        }

        @Override
        public u.d0 w(ViewGroup viewGroup, int i) {
            View view;
            View view2;
            View view3;
            switch (i) {
                case 1:
                    view = new rr1(this.c, 23);
                    view.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"));
                    view3 = view;
                    break;
                case 2:
                    Context context = this.c;
                    lh2 lh2Var = lh2.this;
                    org.telegram.ui.Components.w4 w4Var = new org.telegram.ui.Components.w4(context, lh2Var, null, lh2Var.x, true, lh2.this.w);
                    w4Var.setPermanent(true);
                    w4Var.setDelegate(new a(w4Var));
                    view = w4Var;
                    view.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"));
                    view3 = view;
                    break;
                case 3:
                    view = new l(this.c);
                    view.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"));
                    view3 = view;
                    break;
                case 4:
                    view3 = new iv4(this.c);
                    break;
                case 5:
                    view3 = new j(this.c);
                    break;
                case 6:
                    ah1 ah1Var = new ah1(this.c);
                    ah1Var.setIsSingleCell(true);
                    ah1Var.setViewType(9);
                    ah1Var.g(false);
                    view = ah1Var;
                    view.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"));
                    view3 = view;
                    break;
                case 7:
                    View iv4Var = new iv4(this.c);
                    iv4Var.setBackground(org.telegram.ui.ActionBar.w.h2(this.c, org.telegram.messenger.R.drawable.greydivider_bottom, "windowBackgroundGrayShadow"));
                    view2 = iv4Var;
                    view3 = view2;
                    break;
                case 8:
                    o87 o87Var = new o87(this.c);
                    o87Var.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"));
                    o87Var.c(LocaleController.getString("DeleteAllRevokedLinks", R.string.DeleteAllRevokedLinks), false);
                    o87Var.setTextColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteRedText5"));
                    view3 = o87Var;
                    break;
                case 9:
                    i77 i77Var = new i77(this.c);
                    i77Var.setText(LocaleController.getString("CreateNewLinkHelp", R.string.CreateNewLinkHelp));
                    i77Var.setBackground(org.telegram.ui.ActionBar.w.h2(this.c, org.telegram.messenger.R.drawable.greydivider_bottom, "windowBackgroundGrayShadow"));
                    view2 = i77Var;
                    view3 = view2;
                    break;
                case 10:
                    FrameLayout sg2Var = new sg2(this.c, 8, 6, false);
                    sg2Var.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"));
                    view3 = sg2Var;
                    break;
                default:
                    View iVar = new i(lh2.this, this.c);
                    iVar.setBackgroundDrawable(org.telegram.ui.ActionBar.w.h2(this.c, org.telegram.messenger.R.drawable.greydivider_bottom, "windowBackgroundWhite"));
                    view3 = iVar;
                    break;
            }
            view3.setLayoutParams(new u.p(-1, -2));
            return new h6.j(view3);
        }
    }

    public static class l extends FrameLayout {
        private az4 a;
        private ImageView b;
        boolean c;

        public l(Context context) {
            super(context);
            az4 az4Var = new az4(context);
            this.a = az4Var;
            az4Var.setTextSize(16);
            this.a.setGravity(LocaleController.isRTL ? 5 : 3);
            this.a.setTextColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteBlueText2"));
            this.a.setTag("windowBackgroundWhiteBlueText2");
            addView(this.a);
            ImageView imageView = new ImageView(context);
            this.b = imageView;
            imageView.setScaleType(ImageView.ScaleType.CENTER);
            addView(this.b);
            setWillNotDraw(false);
        }

        public void a(String str, Drawable drawable, boolean z) {
            this.a.i(str);
            this.b.setImageDrawable(drawable);
            this.c = z;
        }

        @Override
        protected void onDraw(Canvas canvas) {
            super.onDraw(canvas);
            if (this.c) {
                canvas.drawLine(AndroidUtilities.dp(70.0f), getMeasuredHeight() - 1, getMeasuredWidth() + AndroidUtilities.dp(23.0f), getMeasuredHeight(), org.telegram.ui.ActionBar.w.l0);
            }
        }

        @Override
        protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
            int dp;
            int i5 = i3 - i;
            int textHeight = ((i4 - i2) - this.a.getTextHeight()) / 2;
            if (LocaleController.isRTL) {
                dp = (getMeasuredWidth() - this.a.getMeasuredWidth()) - AndroidUtilities.dp(this.b.getVisibility() == 0 ? 70.0f : 25.0f);
            } else {
                dp = AndroidUtilities.dp(this.b.getVisibility() == 0 ? 70.0f : 25.0f);
            }
            az4 az4Var = this.a;
            az4Var.layout(dp, textHeight, az4Var.getMeasuredWidth() + dp, this.a.getMeasuredHeight() + textHeight);
            int dp2 = !LocaleController.isRTL ? (AndroidUtilities.dp(70.0f) - this.b.getMeasuredWidth()) / 2 : (i5 - this.b.getMeasuredWidth()) - AndroidUtilities.dp(25.0f);
            ImageView imageView = this.b;
            imageView.layout(dp2, 0, imageView.getMeasuredWidth() + dp2, this.b.getMeasuredHeight());
        }

        @Override
        protected void onMeasure(int i, int i2) {
            int size = View.MeasureSpec.getSize(i);
            AndroidUtilities.dp(48.0f);
            this.a.measure(View.MeasureSpec.makeMeasureSpec(size - AndroidUtilities.dp(94.0f), Integer.MIN_VALUE), View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(20.0f), 1073741824));
            this.b.measure(View.MeasureSpec.makeMeasureSpec(size, Integer.MIN_VALUE), View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(50.0f), 1073741824));
            setMeasuredDimension(size, AndroidUtilities.dp(50.0f));
        }
    }

    public lh2(long j2, long j3, int i2) {
        boolean z = false;
        this.x = j2;
        this.n0 = i2;
        u95 chat = MessagesController.getInstance(this.d).getChat(Long.valueOf(j2));
        this.s = chat;
        this.w = ChatObject.isChannel(chat) && !this.s.o;
        this.v = j3 == 0 ? G().getUserConfig().clientUserId : j3;
        f27 user = W().getUser(Long.valueOf(this.v));
        if (this.v == G().getUserConfig().clientUserId || (user != null && !user.n)) {
            z = true;
        }
        this.x0 = z;
    }

    public boolean H2(View view, int i2) {
        if ((i2 < this.H || i2 >= this.I) && (i2 < this.Q || i2 >= this.R)) {
            return false;
        }
        ((j) view).i.callOnClick();
        view.performHapticFeedback(0, 2);
        return true;
    }

    public void I2(ov5 ov5Var) {
        this.k0 = false;
        if (ov5Var == null) {
            g c3 = c3();
            this.r0.clear();
            e3(c3);
        }
    }

    public void J2(i95 i95Var, final ov5 ov5Var) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                lh2.this.I2(ov5Var);
            }
        });
    }

    public void K2(DialogInterface dialogInterface, int i2) {
        db6 db6Var = new db6();
        db6Var.a = W().getInputPeer(-this.x);
        db6Var.b = this.v == l0().getClientUserId() ? W().getInputUser(l0().getCurrentUser()) : W().getInputUser(this.v);
        this.k0 = true;
        K().sendRequest(db6Var, new RequestDelegate() {
            @Override
            public final void run(i95 i95Var, ov5 ov5Var) {
                lh2.this.J2(i95Var, ov5Var);
            }
        });
    }

    public void L2(Context context, View view, int i2) {
        org.telegram.ui.ActionBar.k kVar;
        if (i2 == this.Z) {
            f27 f27Var = this.s0.get(Long.valueOf(this.u.f));
            if (f27Var == null) {
                return;
            }
            Bundle bundle = new Bundle();
            bundle.putLong("user_id", f27Var.a);
            MessagesController.getInstance(UserConfig.selectedAccount).putUser(f27Var, false);
            kVar = new ProfileActivity(bundle);
        } else {
            if (i2 != this.G) {
                int i3 = this.H;
                if (i2 >= i3 && i2 < this.I) {
                    org.telegram.ui.Components.g4 g4Var = new org.telegram.ui.Components.g4(context, this.q0.get(i2 - i3), this.t, this.s0, this, this.x, false, this.w);
                    this.t0 = g4Var;
                    g4Var.b0(this.x0);
                    this.t0.show();
                    return;
                }
                int i4 = this.Q;
                if (i2 >= i4 && i2 < this.R) {
                    org.telegram.ui.Components.g4 g4Var2 = new org.telegram.ui.Components.g4(context, this.r0.get(i2 - i4), this.t, this.s0, this, this.x, false, this.w);
                    this.t0 = g4Var2;
                    g4Var2.show();
                    return;
                }
                if (i2 == this.W) {
                    if (this.k0) {
                        return;
                    }
                    i.C0142i c0142i = new i.C0142i(c0());
                    c0142i.u(LocaleController.getString("DeleteAllRevokedLinks", R.string.DeleteAllRevokedLinks));
                    c0142i.l(LocaleController.getString("DeleteAllRevokedLinkHelp", R.string.DeleteAllRevokedLinkHelp));
                    c0142i.s(LocaleController.getString("Delete", R.string.Delete), new DialogInterface.OnClickListener() {
                        @Override
                        public final void onClick(DialogInterface dialogInterface, int i5) {
                            lh2.this.K2(dialogInterface, i5);
                        }
                    });
                    c0142i.n(LocaleController.getString("Cancel", R.string.Cancel), null);
                    o1(c0142i.a());
                    return;
                }
                int i5 = this.d0;
                if (i2 < i5 || i2 >= this.e0) {
                    return;
                }
                vo5 vo5Var = this.u0.get(i2 - i5);
                if (this.s0.containsKey(Long.valueOf(vo5Var.a))) {
                    W().putUser(this.s0.get(Long.valueOf(vo5Var.a)), false);
                }
                lh2 lh2Var = new lh2(this.x, vo5Var.a, vo5Var.b);
                lh2Var.d3(this.t, null);
                S0(lh2Var);
                return;
            }
            i72 i72Var = new i72(0, this.x);
            i72Var.g2(this.A0);
            kVar = i72Var;
        }
        S0(kVar);
    }

    public void M2(ov5 ov5Var, sp5 sp5Var) {
        if (ov5Var == null) {
            this.A0.d(sp5Var);
        }
    }

    public void N2(final sp5 sp5Var, i95 i95Var, final ov5 ov5Var) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                lh2.this.M2(ov5Var, sp5Var);
            }
        });
    }

    public void O2() {
        org.telegram.ui.Components.h6 h6Var = this.r;
        if (h6Var != null) {
            int childCount = h6Var.getChildCount();
            for (int i2 = 0; i2 < childCount; i2++) {
                View childAt = this.r.getChildAt(i2);
                if (childAt instanceof sg2) {
                    ((sg2) childAt).g(0);
                }
                if (childAt instanceof org.telegram.ui.Components.w4) {
                    ((org.telegram.ui.Components.w4) childAt).M();
                }
            }
        }
        org.telegram.ui.Components.g4 g4Var = this.t0;
        if (g4Var != null) {
            g4Var.e0();
        }
    }

    public void P2(ov5 ov5Var, i95 i95Var) {
        hg4 hg4Var;
        this.f0 = false;
        if (ov5Var == null) {
            ma6 ma6Var = (ma6) i95Var;
            for (int i2 = 0; i2 < ma6Var.a.size(); i2++) {
                vo5 vo5Var = ma6Var.a.get(i2);
                if (vo5Var.a != G().getUserConfig().clientUserId) {
                    this.u0.add(vo5Var);
                }
            }
            for (int i3 = 0; i3 < ma6Var.b.size(); i3++) {
                f27 f27Var = ma6Var.b.get(i3);
                this.s0.put(Long.valueOf(f27Var.a), f27Var);
            }
        }
        int i4 = this.g0;
        this.m0 = true;
        this.j0 = false;
        if (this.u0.size() > 0 && (hg4Var = this.p0) != null && !this.n && this.o0) {
            hg4Var.g(i4 + 1);
        }
        if (!this.j0 || this.q0.size() + this.r0.size() + this.u0.size() >= 5) {
            Y0();
        }
        if (!this.j0 && !this.z0) {
            this.j0 = true;
            this.z0 = true;
            Z2(false);
        }
        f3(true);
    }

    public void Q2(final ov5 ov5Var, final i95 i95Var) {
        Z().doOnIdle(new Runnable() {
            @Override
            public final void run() {
                lh2.this.P2(ov5Var, i95Var);
            }
        });
    }

    public void R2(final i95 i95Var, final ov5 ov5Var) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                lh2.this.Q2(ov5Var, i95Var);
            }
        });
    }

    public void S2(sp5 sp5Var, ov5 ov5Var, i95 i95Var, boolean z) {
        boolean z2;
        boolean z3;
        g c3 = c3();
        this.f0 = false;
        this.j0 = false;
        if (sp5Var != null) {
            this.u = sp5Var;
            v95 v95Var = this.t;
            if (v95Var != null) {
                v95Var.e = sp5Var;
            }
        }
        if (ov5Var == null) {
            wb6 wb6Var = (wb6) i95Var;
            if (z) {
                for (int i2 = 0; i2 < wb6Var.b.size(); i2++) {
                    sp5 sp5Var2 = (sp5) wb6Var.b.get(i2);
                    G2(sp5Var2);
                    this.r0.add(sp5Var2);
                }
            } else {
                if (this.v != G().getUserConfig().clientUserId && this.q0.size() == 0 && wb6Var.b.size() > 0) {
                    this.u = (sp5) wb6Var.b.get(0);
                    wb6Var.b.remove(0);
                }
                for (int i3 = 0; i3 < wb6Var.b.size(); i3++) {
                    sp5 sp5Var3 = (sp5) wb6Var.b.get(i3);
                    G2(sp5Var3);
                    this.q0.add(sp5Var3);
                }
            }
            for (int i4 = 0; i4 < wb6Var.c.size(); i4++) {
                this.s0.put(Long.valueOf(wb6Var.c.get(i4).a), wb6Var.c.get(i4));
            }
            int i5 = this.g0;
            if (wb6Var.b.size() == 0) {
                this.j0 = false;
            } else {
                this.j0 = !z ? this.q0.size() + 1 >= wb6Var.a : this.r0.size() + 1 >= wb6Var.a;
            }
            if (wb6Var.b.size() <= 0 || !this.o0) {
                z2 = true;
            } else {
                hg4 hg4Var = this.p0;
                if (hg4Var != null && !this.n) {
                    hg4Var.g(i5 + 1);
                }
                z2 = false;
            }
            v95 v95Var2 = this.t;
            if (v95Var2 != null && !z) {
                v95Var2.W = wb6Var.a;
                X().saveChatLinksCount(this.x, this.t.W);
            }
        } else {
            this.j0 = false;
            z2 = false;
        }
        if (this.j0 || this.z0 || this.v != G().getUserConfig().clientUserId) {
            if (this.j0 || this.z0) {
                z3 = false;
                if (this.j0 || this.q0.size() + this.r0.size() + this.u0.size() >= 5) {
                    Y0();
                }
                if (z3) {
                    Z2(false);
                }
                if (!z2 && this.q != null && this.r.getChildCount() > 0) {
                    e3(c3);
                    return;
                }
                f3(true);
            }
            this.j0 = true;
            this.z0 = true;
        } else {
            this.j0 = true;
            this.l0 = true;
        }
        z3 = true;
        if (this.j0) {
        }
        Y0();
        if (z3) {
        }
        if (!z2) {
        }
        f3(true);
    }

    public void T2(final sp5 sp5Var, final ov5 ov5Var, final i95 i95Var, final boolean z) {
        Z().doOnIdle(new Runnable() {
            @Override
            public final void run() {
                lh2.this.S2(sp5Var, ov5Var, i95Var, z);
            }
        });
    }

    public void U2(sp5 sp5Var, final boolean z, final i95 i95Var, final ov5 ov5Var) {
        sp5 sp5Var2;
        if (ov5Var == null) {
            wb6 wb6Var = (wb6) i95Var;
            if (wb6Var.b.size() > 0 && sp5Var != null) {
                for (int i2 = 0; i2 < wb6Var.b.size(); i2++) {
                    if (((sp5) wb6Var.b.get(i2)).e.equals(sp5Var.e)) {
                        sp5Var2 = (sp5) wb6Var.b.remove(i2);
                        break;
                    }
                }
            }
        }
        sp5Var2 = null;
        final sp5 sp5Var3 = sp5Var2;
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                lh2.this.T2(sp5Var3, ov5Var, i95Var, z);
            }
        });
    }

    public void V2(ov5 ov5Var, i95 i95Var, sp5 sp5Var) {
        if (ov5Var == null) {
            if (i95Var instanceof vb6) {
                vb6 vb6Var = (vb6) i95Var;
                if (!this.w0) {
                    this.u = (sp5) vb6Var.c;
                }
                sp5Var.b = true;
                g c3 = c3();
                if (this.w0 && this.v == G().getUserConfig().getClientUserId()) {
                    this.q0.remove(sp5Var);
                    this.q0.add(0, (sp5) vb6Var.c);
                } else if (this.u != null) {
                    this.u = (sp5) vb6Var.c;
                }
                this.r0.add(0, sp5Var);
                e3(c3);
            } else {
                this.A0.a(sp5Var, i95Var);
                v95 v95Var = this.t;
                if (v95Var != null) {
                    int i2 = v95Var.W - 1;
                    v95Var.W = i2;
                    if (i2 < 0) {
                        v95Var.W = 0;
                    }
                    X().saveChatLinksCount(this.x, this.t.W);
                }
            }
            if (c0() != null) {
                org.telegram.ui.Components.b0.E(this).z(R.raw.linkbroken, LocaleController.getString("InviteRevokedHint", R.string.InviteRevokedHint)).J();
            }
        }
    }

    public void W2(final sp5 sp5Var, final i95 i95Var, final ov5 ov5Var) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                lh2.this.V2(ov5Var, i95Var, sp5Var);
            }
        });
    }

    public void X2(ov5 ov5Var, i95 i95Var, sp5 sp5Var) {
        if (ov5Var == null) {
            sp5 sp5Var2 = (sp5) i95Var;
            this.u = sp5Var2;
            v95 v95Var = this.t;
            if (v95Var != null) {
                v95Var.e = sp5Var2;
            }
            if (c0() == null) {
                return;
            }
            sp5Var.b = true;
            g c3 = c3();
            this.r0.add(0, sp5Var);
            e3(c3);
            org.telegram.ui.Components.b0.E(this).z(R.raw.linkbroken, LocaleController.getString("InviteRevokedHint", R.string.InviteRevokedHint)).J();
        }
    }

    public void Y2(final sp5 sp5Var, final i95 i95Var, final ov5 ov5Var) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                lh2.this.X2(ov5Var, i95Var, sp5Var);
            }
        });
    }

    public void Z2(boolean z) {
        ArrayList<sp5> arrayList;
        int sendRequest;
        if (!this.l0 || this.m0) {
            yc6 yc6Var = new yc6();
            yc6Var.c = W().getInputPeer(-this.x);
            long j2 = this.v;
            long clientUserId = l0().getClientUserId();
            MessagesController W = W();
            yc6Var.d = j2 == clientUserId ? W.getInputUser(l0().getCurrentUser()) : W.getInputUser(this.v);
            final boolean z2 = this.z0;
            if (z2) {
                yc6Var.b = true;
                if (!this.r0.isEmpty()) {
                    yc6Var.a |= 4;
                    ArrayList<sp5> arrayList2 = this.r0;
                    yc6Var.f = arrayList2.get(arrayList2.size() - 1).e;
                    arrayList = this.r0;
                    yc6Var.e = arrayList.get(arrayList.size() - 1).g;
                }
                this.f0 = true;
                final sp5 sp5Var = !this.w0 ? null : this.u;
                sendRequest = K().sendRequest(yc6Var, new RequestDelegate() {
                    @Override
                    public final void run(i95 i95Var, ov5 ov5Var) {
                        lh2.this.U2(sp5Var, z2, i95Var, ov5Var);
                    }
                });
            } else {
                if (!this.q0.isEmpty()) {
                    yc6Var.a |= 4;
                    ArrayList<sp5> arrayList3 = this.q0;
                    yc6Var.f = arrayList3.get(arrayList3.size() - 1).e;
                    arrayList = this.q0;
                    yc6Var.e = arrayList.get(arrayList.size() - 1).g;
                }
                this.f0 = true;
                if (!this.w0) {
                }
                sendRequest = K().sendRequest(yc6Var, new RequestDelegate() {
                    @Override
                    public final void run(i95 i95Var, ov5 ov5Var) {
                        lh2.this.U2(sp5Var, z2, i95Var, ov5Var);
                    }
                });
            }
        } else {
            this.f0 = true;
            fc6 fc6Var = new fc6();
            fc6Var.a = W().getInputPeer(-this.x);
            sendRequest = K().sendRequest(fc6Var, new RequestDelegate() {
                @Override
                public final void run(i95 i95Var, ov5 ov5Var) {
                    lh2.this.R2(i95Var, ov5Var);
                }
            });
        }
        K().bindRequestToGuid(sendRequest, J());
        if (z) {
            f3(true);
        }
    }

    public void b3() {
        if (this.v != G().getUserConfig().clientUserId) {
            a3(this.u);
            return;
        }
        tb6 tb6Var = new tb6();
        tb6Var.d = W().getInputPeer(-this.x);
        tb6Var.b = true;
        final sp5 sp5Var = this.u;
        this.u = null;
        this.t.e = null;
        int sendRequest = K().sendRequest(tb6Var, new RequestDelegate() {
            @Override
            public final void run(i95 i95Var, ov5 ov5Var) {
                lh2.this.Y2(sp5Var, i95Var, ov5Var);
            }
        });
        AndroidUtilities.updateVisibleRows(this.r);
        K().bindRequestToGuid(sendRequest, this.k);
    }

    public g c3() {
        g gVar = new g(this, null);
        gVar.f(gVar.h);
        gVar.b = this.H;
        gVar.c = this.I;
        gVar.d = this.Q;
        gVar.e = this.R;
        gVar.f = this.d0;
        gVar.g = this.e0;
        gVar.a = this.g0;
        gVar.j.clear();
        gVar.j.addAll(this.q0);
        gVar.k.clear();
        gVar.k.addAll(this.r0);
        return gVar;
    }

    public void e3(g gVar) {
        if (this.n || this.q == null || this.r == null) {
            f3(true);
            return;
        }
        f3(false);
        gVar.f(gVar.i);
        androidx.recyclerview.widget.i.a(gVar).d(this.q);
        AndroidUtilities.updateVisibleRows(this.r);
    }

    public void f3(boolean z) {
        u95 chat = MessagesController.getInstance(this.d).getChat(Long.valueOf(this.x));
        this.s = chat;
        if (chat == null) {
            return;
        }
        this.Z = -1;
        this.a0 = -1;
        this.H = -1;
        this.I = -1;
        this.J = -1;
        this.Q = -1;
        this.R = -1;
        this.U = -1;
        this.S = -1;
        this.T = -1;
        this.W = -1;
        this.V = -1;
        this.X = -1;
        this.y = -1;
        this.G = -1;
        this.e0 = -1;
        this.d0 = -1;
        this.c0 = -1;
        this.b0 = -1;
        this.Y = -1;
        this.B = -1;
        this.g0 = 0;
        boolean z2 = this.v != G().getUserConfig().clientUserId;
        int i2 = this.g0;
        int i3 = i2 + 1;
        this.g0 = i3;
        if (z2) {
            this.Z = i2;
            this.g0 = i3 + 1;
            this.a0 = i3;
        } else {
            this.y = i2;
        }
        int i4 = this.g0;
        int i5 = i4 + 1;
        this.g0 = i5;
        this.z = i4;
        int i6 = i5 + 1;
        this.g0 = i6;
        this.A = i5;
        if (!z2) {
            int i7 = i6 + 1;
            this.g0 = i7;
            this.B = i6;
            this.g0 = i7 + 1;
            this.G = i7;
        } else if (!this.q0.isEmpty()) {
            int i8 = this.g0;
            int i9 = i8 + 1;
            this.g0 = i9;
            this.B = i8;
            this.g0 = i9 + 1;
            this.Y = i9;
        }
        if (!this.q0.isEmpty()) {
            int i10 = this.g0;
            this.H = i10;
            int size = i10 + this.q0.size();
            this.g0 = size;
            this.I = size;
        }
        if (!z2 && this.q0.isEmpty() && this.G >= 0 && (!this.f0 || this.l0 || this.z0)) {
            int i11 = this.g0;
            this.g0 = i11 + 1;
            this.X = i11;
        }
        if (!z2 && this.u0.size() > 0) {
            if ((!this.q0.isEmpty() || this.G >= 0) && this.X == -1) {
                int i12 = this.g0;
                this.g0 = i12 + 1;
                this.c0 = i12;
            }
            int i13 = this.g0;
            int i14 = i13 + 1;
            this.g0 = i14;
            this.b0 = i13;
            this.d0 = i14;
            int size2 = i14 + this.u0.size();
            this.g0 = size2;
            this.e0 = size2;
        }
        if (!this.r0.isEmpty()) {
            if (this.d0 >= 0 || (((!this.q0.isEmpty() || this.G >= 0) && this.X == -1) || (z2 && this.H == -1))) {
                int i15 = this.g0;
                this.g0 = i15 + 1;
                this.S = i15;
            }
            int i16 = this.g0;
            int i17 = i16 + 1;
            this.g0 = i17;
            this.U = i16;
            this.Q = i17;
            int size3 = i17 + this.r0.size();
            this.g0 = size3;
            this.R = size3;
            int i18 = size3 + 1;
            this.g0 = i18;
            this.V = size3;
            this.g0 = i18 + 1;
            this.W = i18;
        }
        if (!this.l0 && !this.z0 && ((this.f0 || this.j0) && !z2)) {
            int i19 = this.g0;
            this.g0 = i19 + 1;
            this.J = i19;
        }
        if (!this.q0.isEmpty() || !this.r0.isEmpty()) {
            int i20 = this.g0;
            this.g0 = i20 + 1;
            this.T = i20;
        }
        k kVar = this.q;
        if (kVar == null || !z) {
            return;
        }
        kVar.j();
    }

    public void E2(final sp5 sp5Var) {
        za6 za6Var = new za6();
        za6Var.b = sp5Var.e;
        za6Var.a = W().getInputPeer(-this.x);
        K().sendRequest(za6Var, new RequestDelegate() {
            @Override
            public final void run(i95 i95Var, ov5 ov5Var) {
                lh2.this.N2(sp5Var, i95Var, ov5Var);
            }
        });
    }

    public void F2(sp5 sp5Var) {
        i72 i72Var = new i72(1, this.x);
        i72Var.g2(this.A0);
        i72Var.h2(sp5Var);
        S0(i72Var);
    }

    public void G2(sp5 sp5Var) {
        boolean z = true;
        if (sp5Var.i <= 0) {
            int i2 = sp5Var.j;
            if (i2 <= 0) {
            }
        }
    }

    @Override
    public void M0() {
        super.M0();
        k kVar = this.q;
        if (kVar != null) {
            kVar.j();
        }
    }

    @Override
    public void O0(boolean z, boolean z2) {
        org.telegram.ui.Components.g4 g4Var;
        super.O0(z, z2);
        if (z) {
            this.o0 = true;
            if (z2 && (g4Var = this.t0) != null && g4Var.Z) {
                g4Var.show();
            }
        }
        NotificationCenter.getInstance(this.d).onAnimationFinish(this.B0);
    }

    @Override
    public void Q0(boolean z, boolean z2) {
        super.Q0(z, z2);
        this.B0 = NotificationCenter.getInstance(this.d).setAnimationInProgress(this.B0, null);
    }

    public void a3(final sp5 sp5Var) {
        rb6 rb6Var = new rb6();
        rb6Var.d = sp5Var.e;
        rb6Var.b = true;
        rb6Var.c = W().getInputPeer(-this.x);
        K().sendRequest(rb6Var, new RequestDelegate() {
            @Override
            public final void run(i95 i95Var, ov5 ov5Var) {
                lh2.this.W2(sp5Var, i95Var, ov5Var);
            }
        });
    }

    public void d3(v95 v95Var, na5 na5Var) {
        this.t = v95Var;
        this.u = (sp5) na5Var;
        this.w0 = !TextUtils.isEmpty(this.s.v);
        Z2(true);
    }

    @Override
    public ArrayList<org.telegram.ui.ActionBar.a0> i0() {
        ArrayList<org.telegram.ui.ActionBar.a0> arrayList = new ArrayList<>();
        a0.a aVar = new a0.a() {
            @Override
            public void a(float f2) {
                aa7.a(this, f2);
            }

            @Override
            public final void b() {
                lh2.this.O2();
            }
        };
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, org.telegram.ui.ActionBar.a0.u, new Class[]{rr1.class, l.class, org.telegram.ui.Components.w4.class, j.class}, null, null, null, "windowBackgroundWhite"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.e, org.telegram.ui.ActionBar.a0.q | org.telegram.ui.ActionBar.a0.I, null, null, null, null, "windowBackgroundGray"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.e, org.telegram.ui.ActionBar.a0.I | org.telegram.ui.ActionBar.a0.q, null, null, null, null, "windowBackgroundWhite"));
        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.r, 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.w, null, null, null, null, "actionBarDefaultIcon"));
        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.y, null, null, null, null, "actionBarDefaultSelector"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, org.telegram.ui.ActionBar.a0.C, null, null, null, null, "listSelectorSDK21"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 0, new Class[]{View.class}, org.telegram.ui.ActionBar.w.l0, null, null, "divider"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, org.telegram.ui.ActionBar.a0.v, new Class[]{i77.class}, null, null, null, "windowBackgroundGrayShadow"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 0, new Class[]{i77.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteGrayText4"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 0, new Class[]{sg2.class}, new String[]{"nameTextView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteBlackText"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 0, new Class[]{sg2.class}, new String[]{"statusColor"}, (Paint[]) null, (Drawable[]) null, aVar, "windowBackgroundWhiteGrayText"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 0, new Class[]{sg2.class}, new String[]{"statusOnlineColor"}, (Paint[]) null, (Drawable[]) null, aVar, "windowBackgroundWhiteBlueText"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 0, new Class[]{sg2.class}, null, org.telegram.ui.ActionBar.w.s0, null, "avatar_text"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(null, 0, null, null, null, aVar, "avatar_backgroundRed"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(null, 0, null, null, null, aVar, "avatar_backgroundOrange"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(null, 0, null, null, null, aVar, "avatar_backgroundViolet"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(null, 0, null, null, null, aVar, "avatar_backgroundGreen"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(null, 0, null, null, null, aVar, "avatar_backgroundCyan"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(null, 0, null, null, null, aVar, "avatar_backgroundBlue"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(null, 0, null, null, null, aVar, "avatar_backgroundPink"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 0, new Class[]{i.class}, new String[]{"messageTextView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "chats_message"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, org.telegram.ui.ActionBar.a0.I, new Class[]{qg2.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteBlackText"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, org.telegram.ui.ActionBar.a0.I, new Class[]{qg2.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "chats_unreadCounterMuted"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, org.telegram.ui.ActionBar.a0.I, new Class[]{qg2.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteBlueButton"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, org.telegram.ui.ActionBar.a0.I, new Class[]{qg2.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteBlueIcon"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 0, new Class[]{l.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteBlueText2"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, org.telegram.ui.ActionBar.a0.v, new Class[]{l.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "switchTrackChecked"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 0, new Class[]{l.class}, new String[]{"imageView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "checkboxCheck"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 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.r, 0, new Class[]{j.class}, new String[]{"titleView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteBlackText"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, 0, new Class[]{j.class}, new String[]{"subtitleView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteGrayText"));
        arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, org.telegram.ui.ActionBar.a0.t, new Class[]{j.class}, new String[]{"optionsView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "stickers_menu"));
        return arrayList;
    }

    @Override
    public boolean v0() {
        return true;
    }

    @Override
    public View z(final Context context) {
        this.g.setBackButtonImage(org.telegram.messenger.R.drawable.ic_ab_back);
        this.g.setAllowOverlayTitle(true);
        this.g.setTitle(LocaleController.getString("InviteLinks", R.string.InviteLinks));
        this.g.setActionBarMenuOnItemClick(new b());
        c cVar = new c(context);
        this.e = cVar;
        cVar.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundGray"));
        this.e.setTag("windowBackgroundGray");
        FrameLayout frameLayout = (FrameLayout) this.e;
        this.r = new org.telegram.ui.Components.h6(context);
        d dVar = new d(this, context, 1, false);
        this.r.setLayoutManager(dVar);
        org.telegram.ui.Components.h6 h6Var = this.r;
        k kVar = new k(context);
        this.q = kVar;
        h6Var.setAdapter(kVar);
        this.r.setOnScrollListener(new e(dVar));
        this.p0 = new hg4(this.r, false);
        androidx.recyclerview.widget.h hVar = new androidx.recyclerview.widget.h();
        hVar.m0(false);
        hVar.U(false);
        this.r.setItemAnimator(hVar);
        this.r.setVerticalScrollbarPosition(LocaleController.isRTL ? 1 : 2);
        frameLayout.addView(this.r, g52.a(-1, -1.0f));
        this.r.setOnItemClickListener(new h6.m() {
            @Override
            public final void a(View view, int i2) {
                lh2.this.L2(context, view, i2);
            }
        });
        this.r.setOnItemLongClickListener(new h6.o() {
            @Override
            public final boolean a(View view, int i2) {
                boolean H2;
                H2 = lh2.this.H2(view, i2);
                return H2;
            }
        });
        this.h0 = androidx.core.content.a.f(context, org.telegram.messenger.R.drawable.msg_link_1);
        this.i0 = androidx.core.content.a.f(context, org.telegram.messenger.R.drawable.msg_link_2);
        this.h0.setColorFilter(new PorterDuffColorFilter(-1, PorterDuff.Mode.MULTIPLY));
        f3(true);
        this.v0 = K().getCurrentTime() - (System.currentTimeMillis() / 1000);
        return this.e;
    }
}