导航菜单

页面标题

页面副标题

Plus 12 v10.13.1.1 - ThemingChatActivity.java 源代码

正在查看: Plus 12 v10.13.1.1 应用的 ThemingChatActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package org.telegram.ui;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.Toast;
import java.util.ArrayList;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.ApplicationLoader;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.R;
import org.telegram.messenger.SharedConfig;
import org.telegram.ui.ActionBar.AlertDialog;
import org.telegram.ui.ActionBar.BaseFragment;
import org.telegram.ui.ActionBar.INavigationLayout;
import org.telegram.ui.ActionBar.Theme;
import org.telegram.ui.Cells.HeaderCell;
import org.telegram.ui.Cells.ShadowSectionCell;
import org.telegram.ui.Cells.TextCheckCell;
import org.telegram.ui.Cells.TextColorCell;
import org.telegram.ui.Cells.TextDetailSettingsCell;
import org.telegram.ui.Cells.TextSettingsCell;

public class ThemingChatActivity extends BaseFragment {
    public int attachBGColorRow;
    public int attachBGGradientColorRow;
    public int attachBGGradientRow;
    public int attachTextColorRow;
    public int avatarAlignTopRow;
    public int avatarMarginLeftRow;
    public int avatarRadiusRow;
    public int avatarSizeRow;
    public int bubblesRow;
    public int checksColorRow;
    public int checksRow;
    public int commandColorCheckRow;
    public int commandColorRow;
    public int contactNameColorRow;
    public int dateBubbleColorRow;
    public int dateColorRow;
    public int dateSizeRow;
    public int editTextBGColorRow;
    public int editTextBGGradientColorRow;
    public int editTextBGGradientRow;
    public int editTextColorRow;
    public int editTextIconsColorRow;
    public int editTextSizeRow;
    public int emojiViewBGColorRow;
    public int emojiViewBGGradientColorRow;
    public int emojiViewBGGradientRow;
    public int emojiViewTabColorRow;
    public int emojiViewTabIconColorRow;
    public int forwardLeftNameColorRow;
    public int forwardRightNameColorRow;
    public int gradientBGColorRow;
    public int gradientBGRow;
    public int headerAvatarRadiusRow;
    public int headerColorRow;
    public int headerGradientColorRow;
    public int headerGradientRow;
    public int headerIconsColorRow;
    public int headerSection2Row;
    public int hideStatusIndicatorCheckRow;
    public int lBubbleColorRow;
    public int lLinkColorRow;
    public int lTextColorRow;
    public int lTimeColorRow;
    public ListAdapter listAdapter;
    public ListView listView;
    public int memberColorCheckRow;
    public int memberColorRow;
    public int muteColorRow;
    public int nameColorRow;
    public int nameSizeRow;
    public int onlineColorRow;
    public int ownAvatarAlignTopRow;
    public int quickBarColorRow;
    public int quickBarNamesColorRow;
    public int rBubbleColorRow;
    public int rLinkColorRow;
    public int rTextColorRow;
    public int rTimeColorRow;
    public int rowCount;
    public int rowsSection2Row;
    public int rowsSectionRow;
    public int scrollToPosition;
    public int selectedMessageBGColorRow;
    public int sendColorRow;
    public int showContactAvatar;
    public int showOwnAvatar;
    public int showOwnAvatarGroup;
    public boolean showPrefix;
    public int showUsernameCheckRow;
    public int solidBGColorCheckRow;
    public int solidBGColorRow;
    public int statusColorRow;
    public int statusSizeRow;
    public int textSizeRow;
    public int timeSizeRow;
    public int typingColorRow;

    public ThemingChatActivity() {
    }

    public ThemingChatActivity(Bundle args) {
        super(args);
    }

    public boolean onFragmentCreate() {
        super.onFragmentCreate();
        this.rowCount = 0;
        int i = 0 + 1;
        this.rowCount = i;
        this.headerSection2Row = 0;
        int i2 = i + 1;
        this.rowCount = i2;
        this.headerColorRow = i;
        int i3 = i2 + 1;
        this.rowCount = i3;
        this.headerGradientRow = i2;
        int i4 = i3 + 1;
        this.rowCount = i4;
        this.headerGradientColorRow = i3;
        int i5 = i4 + 1;
        this.rowCount = i5;
        this.headerIconsColorRow = i4;
        int i6 = i5 + 1;
        this.rowCount = i6;
        this.headerAvatarRadiusRow = i5;
        int i7 = i6 + 1;
        this.rowCount = i7;
        this.nameSizeRow = i6;
        int i8 = i7 + 1;
        this.rowCount = i8;
        this.nameColorRow = i7;
        int i9 = i8 + 1;
        this.rowCount = i9;
        this.statusSizeRow = i8;
        int i10 = i9 + 1;
        this.rowCount = i10;
        this.statusColorRow = i9;
        int i11 = i10 + 1;
        this.rowCount = i11;
        this.onlineColorRow = i10;
        int i12 = i11 + 1;
        this.rowCount = i12;
        this.typingColorRow = i11;
        int i13 = i12 + 1;
        this.rowCount = i13;
        this.rowsSectionRow = i12;
        int i14 = i13 + 1;
        this.rowCount = i14;
        this.rowsSection2Row = i13;
        int i15 = i14 + 1;
        this.rowCount = i15;
        this.solidBGColorCheckRow = i14;
        int i16 = i15 + 1;
        this.rowCount = i16;
        this.solidBGColorRow = i15;
        int i17 = i16 + 1;
        this.rowCount = i17;
        this.gradientBGRow = i16;
        int i18 = i17 + 1;
        this.rowCount = i18;
        this.gradientBGColorRow = i17;
        int i19 = i18 + 1;
        this.rowCount = i19;
        this.showContactAvatar = i18;
        int i20 = i19 + 1;
        this.rowCount = i20;
        this.avatarAlignTopRow = i19;
        int i21 = i20 + 1;
        this.rowCount = i21;
        this.showOwnAvatar = i20;
        int i22 = i21 + 1;
        this.rowCount = i22;
        this.showOwnAvatarGroup = i21;
        int i23 = i22 + 1;
        this.rowCount = i23;
        this.ownAvatarAlignTopRow = i22;
        int i24 = i23 + 1;
        this.rowCount = i24;
        this.avatarRadiusRow = i23;
        int i25 = i24 + 1;
        this.rowCount = i25;
        this.avatarSizeRow = i24;
        int i26 = i25 + 1;
        this.rowCount = i26;
        this.avatarMarginLeftRow = i25;
        int i27 = i26 + 1;
        this.rowCount = i27;
        this.hideStatusIndicatorCheckRow = i26;
        int i28 = i27 + 1;
        this.rowCount = i28;
        this.textSizeRow = i27;
        int i29 = i28 + 1;
        this.rowCount = i29;
        this.rTextColorRow = i28;
        int i30 = i29 + 1;
        this.rowCount = i30;
        this.rLinkColorRow = i29;
        int i31 = i30 + 1;
        this.rowCount = i31;
        this.lTextColorRow = i30;
        int i32 = i31 + 1;
        this.rowCount = i32;
        this.lLinkColorRow = i31;
        int i33 = i32 + 1;
        this.rowCount = i33;
        this.selectedMessageBGColorRow = i32;
        int i34 = i33 + 1;
        this.rowCount = i34;
        this.commandColorCheckRow = i33;
        int i35 = i34 + 1;
        this.rowCount = i35;
        this.commandColorRow = i34;
        int i36 = i35 + 1;
        this.rowCount = i36;
        this.timeSizeRow = i35;
        int i37 = i36 + 1;
        this.rowCount = i37;
        this.rTimeColorRow = i36;
        int i38 = i37 + 1;
        this.rowCount = i38;
        this.lTimeColorRow = i37;
        int i39 = i38 + 1;
        this.rowCount = i39;
        this.checksColorRow = i38;
        int i40 = i39 + 1;
        this.rowCount = i40;
        this.dateSizeRow = i39;
        int i41 = i40 + 1;
        this.rowCount = i41;
        this.dateColorRow = i40;
        int i42 = i41 + 1;
        this.rowCount = i42;
        this.bubblesRow = i41;
        int i43 = i42 + 1;
        this.rowCount = i43;
        this.checksRow = i42;
        int i44 = i43 + 1;
        this.rowCount = i44;
        this.rBubbleColorRow = i43;
        int i45 = i44 + 1;
        this.rowCount = i45;
        this.lBubbleColorRow = i44;
        int i46 = i45 + 1;
        this.rowCount = i46;
        this.dateBubbleColorRow = i45;
        int i47 = i46 + 1;
        this.rowCount = i47;
        this.memberColorCheckRow = i46;
        int i48 = i47 + 1;
        this.rowCount = i48;
        this.memberColorRow = i47;
        int i49 = i48 + 1;
        this.rowCount = i49;
        this.contactNameColorRow = i48;
        int i50 = i49 + 1;
        this.rowCount = i50;
        this.forwardRightNameColorRow = i49;
        int i51 = i50 + 1;
        this.rowCount = i51;
        this.forwardLeftNameColorRow = i50;
        int i52 = i51 + 1;
        this.rowCount = i52;
        this.showUsernameCheckRow = i51;
        int i53 = i52 + 1;
        this.rowCount = i53;
        this.sendColorRow = i52;
        int i54 = i53 + 1;
        this.rowCount = i54;
        this.editTextSizeRow = i53;
        int i55 = i54 + 1;
        this.rowCount = i55;
        this.editTextColorRow = i54;
        int i56 = i55 + 1;
        this.rowCount = i56;
        this.editTextBGColorRow = i55;
        int i57 = i56 + 1;
        this.rowCount = i57;
        this.editTextBGGradientRow = i56;
        int i58 = i57 + 1;
        this.rowCount = i58;
        this.editTextBGGradientColorRow = i57;
        int i59 = i58 + 1;
        this.rowCount = i59;
        this.editTextIconsColorRow = i58;
        int i60 = i59 + 1;
        this.rowCount = i60;
        this.attachBGColorRow = i59;
        int i61 = i60 + 1;
        this.rowCount = i61;
        this.attachBGGradientRow = i60;
        int i62 = i61 + 1;
        this.rowCount = i62;
        this.attachBGGradientColorRow = i61;
        int i63 = i62 + 1;
        this.rowCount = i63;
        this.attachTextColorRow = i62;
        int i64 = i63 + 1;
        this.rowCount = i64;
        this.emojiViewBGColorRow = i63;
        int i65 = i64 + 1;
        this.rowCount = i65;
        this.emojiViewBGGradientRow = i64;
        int i66 = i65 + 1;
        this.rowCount = i66;
        this.emojiViewBGGradientColorRow = i65;
        int i67 = i66 + 1;
        this.rowCount = i67;
        this.emojiViewTabIconColorRow = i66;
        int i68 = i67 + 1;
        this.rowCount = i68;
        this.emojiViewTabColorRow = i67;
        int i69 = i68 + 1;
        this.rowCount = i69;
        this.quickBarColorRow = i68;
        this.rowCount = i69 + 1;
        this.quickBarNamesColorRow = i69;
        this.showPrefix = ApplicationLoader.applicationContext.getSharedPreferences("plusconfig", 0).getBoolean("chatShowPrefix", true);
        Bundle bundle = ((BaseFragment) this).arguments;
        if (bundle != null) {
            this.scrollToPosition = bundle.getInt("scroll_to_position", 0);
        }
        return true;
    }

    public void onFragmentDestroy() {
        super.onFragmentDestroy();
    }

    public final void clickItem(final int position) {
        try {
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public final void run() {
                    ThemingChatActivity.this.lambda$clickItem$1(position);
                }
            }, 300L);
        } catch (Exception e) {
            FileLog.e(e);
        }
    }

    public void lambda$clickItem$1(int i) {
        ListView listView = this.listView;
        listView.performItemClick(listView, i, listView.getItemIdAtPosition(i));
        View viewByPosition = getViewByPosition(i);
        if (viewByPosition == null || !(viewByPosition instanceof TextCheckCell)) {
            return;
        }
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public final void run() {
                ThemingChatActivity.this.lambda$clickItem$0();
            }
        }, 200L);
    }

    public void lambda$clickItem$0() {
        this.listAdapter.notifyDataSetChanged();
    }

    public final View getViewByPosition(int pos) {
        int firstVisiblePosition = this.listView.getFirstVisiblePosition();
        int childCount = (this.listView.getChildCount() + firstVisiblePosition) - 1;
        if (pos < firstVisiblePosition || pos > childCount) {
            return this.listView.getAdapter().getView(pos, null, this.listView);
        }
        return this.listView.getChildAt(pos - firstVisiblePosition);
    }

    public android.view.View createView(android.content.Context r5) {
        throw new UnsupportedOperationException("Method not decompiled: org.telegram.ui.ThemingChatActivity.createView(android.content.Context):android.view.View");
    }

    public class AnonymousClass4 implements AdapterView.OnItemLongClickListener {
        public AnonymousClass4() {
        }

        @Override
        public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) {
            if (ThemingChatActivity.this.getParentActivity() == null) {
                return false;
            }
            final String obj = view.getTag() != null ? view.getTag().toString() : "";
            AlertDialog.Builder builder = new AlertDialog.Builder(ThemingChatActivity.this.getParentActivity());
            ArrayList arrayList = new ArrayList();
            final ArrayList arrayList2 = new ArrayList();
            if (obj != null && !obj.isEmpty()) {
                builder.setTitle(obj);
            }
            arrayList.add(LocaleController.getString("CopyLink", R.string.CopyLink));
            arrayList2.add(0);
            arrayList.add(LocaleController.getString("ShareLink", R.string.ShareLink));
            arrayList2.add(2);
            arrayList.add(LocaleController.getString("Reset", R.string.Reset));
            arrayList2.add(1);
            final String prefix = ThemingChatActivity.this.getPrefix(i);
            builder.setItems((CharSequence[]) arrayList.toArray(new CharSequence[arrayList.size()]), new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i2) {
                    int intValue = ((Integer) arrayList2.get(i2)).intValue();
                    final String format = String.format("https://t.me/thememods/%s", prefix);
                    if (intValue == 0) {
                        try {
                            ((ClipboardManager) ApplicationLoader.applicationContext.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("label", format));
                            AndroidUtilities.runOnUIThread(new Runnable() {
                                @Override
                                public void run() {
                                    if (ThemingChatActivity.this.getParentActivity() != null) {
                                        Toast.makeText(ThemingChatActivity.this.getParentActivity(), format, 0).show();
                                    }
                                }
                            });
                            return;
                        } catch (Exception e) {
                            FileLog.e(e);
                            return;
                        }
                    }
                    if (intValue == 1) {
                        ThemingChatActivity.this.resetPref(obj);
                        return;
                    }
                    if (intValue == 2) {
                        try {
                            Intent intent = new Intent("android.intent.action.SEND");
                            intent.setType("text/plain");
                            intent.putExtra("android.intent.extra.TEXT", format);
                            ThemingChatActivity.this.getParentActivity().startActivityForResult(Intent.createChooser(intent, LocaleController.getString("ShareLink", R.string.ShareLink)), 500);
                        } catch (Exception e2) {
                            FileLog.e(e2);
                        }
                    }
                }
            });
            ThemingChatActivity.this.showDialog(builder.create());
            return true;
        }
    }

    public final void resetPref(String key) {
        SharedPreferences.Editor edit = ApplicationLoader.applicationContext.getSharedPreferences("theme", 0).edit();
        edit.remove(key);
        edit.commit();
        Theme.updateChatColors();
        ListView listView = this.listView;
        if (listView != null) {
            listView.invalidateViews();
        }
        refreshTheme();
    }

    public final void commitInt(String key, int value) {
        Theme.setPlusColor(key, value, false);
        SharedPreferences.Editor edit = ApplicationLoader.applicationContext.getSharedPreferences("theme", 0).edit();
        edit.putInt(key, value);
        edit.apply();
        ListView listView = this.listView;
        if (listView != null) {
            listView.invalidateViews();
        }
        refreshTheme();
    }

    public final void refreshTheme() {
        Theme.applyPlusTheme();
        INavigationLayout iNavigationLayout = ((BaseFragment) this).parentLayout;
        if (iNavigationLayout != null) {
            iNavigationLayout.rebuildAllFragmentViews(false, false);
        }
    }

    public void onResume() {
        super.onResume();
        ListAdapter listAdapter = this.listAdapter;
        if (listAdapter != null) {
            listAdapter.notifyDataSetChanged();
        }
        fixLayout();
    }

    public final void updateTheme() {
        ((BaseFragment) this).actionBar.setBackgroundColor(Theme.prefActionbarColor);
        ((BaseFragment) this).actionBar.setTitleColor(Theme.prefActionbarTitleColor);
        Drawable drawable = getParentActivity().getResources().getDrawable(R.drawable.ic_ab_back);
        drawable.setColorFilter(Theme.prefActionbarIconsColor, PorterDuff.Mode.MULTIPLY);
        ((BaseFragment) this).actionBar.setBackButtonDrawable(drawable);
        ((BaseFragment) this).actionBar.setItemsColor(Theme.prefActionbarIconsColor, false);
    }

    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        fixLayout();
    }

    public final void fixLayout() {
        View view = ((BaseFragment) this).fragmentView;
        if (view == null) {
            return;
        }
        view.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
            @Override
            public boolean onPreDraw() {
                View view2 = ((BaseFragment) ThemingChatActivity.this).fragmentView;
                if (view2 == null) {
                    return false;
                }
                view2.getViewTreeObserver().removeOnPreDrawListener(this);
                return false;
            }
        });
    }

    public final String getPrefix(int i) {
        if (i == this.headerSection2Row) {
            return "2.1 ";
        }
        int i2 = this.rowsSection2Row;
        if (i == i2) {
            return "2.2 ";
        }
        if (i < i2) {
            return "2.1." + i + " ";
        }
        return "2.2." + (i - this.rowsSection2Row) + " ";
    }

    public class ListAdapter extends BaseAdapter {
        public Context mContext;

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

        @Override
        public Object getItem(int i) {
            return null;
        }

        @Override
        public long getItemId(int i) {
            return i;
        }

        @Override
        public int getViewTypeCount() {
            return 6;
        }

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

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

        public ListAdapter(Context context) {
            this.mContext = context;
        }

        @Override
        public boolean isEnabled(int i) {
            return i == ThemingChatActivity.this.headerColorRow || i == ThemingChatActivity.this.headerGradientRow || (AndroidUtilities.getIntDef("chatHeaderGradient", 0) != 0 && i == ThemingChatActivity.this.headerGradientColorRow) || i == ThemingChatActivity.this.muteColorRow || i == ThemingChatActivity.this.headerIconsColorRow || i == ThemingChatActivity.this.headerAvatarRadiusRow || i == ThemingChatActivity.this.rBubbleColorRow || i == ThemingChatActivity.this.lBubbleColorRow || i == ThemingChatActivity.this.bubblesRow || i == ThemingChatActivity.this.checksRow || i == ThemingChatActivity.this.solidBGColorCheckRow || ((Theme.chatSolidBGColorCheck && i == ThemingChatActivity.this.solidBGColorRow) || ((Theme.chatSolidBGColorCheck && i == ThemingChatActivity.this.gradientBGRow) || ((AndroidUtilities.getIntDef("chatGradientBG", 0) != 0 && i == ThemingChatActivity.this.gradientBGColorRow) || i == ThemingChatActivity.this.avatarRadiusRow || i == ThemingChatActivity.this.avatarSizeRow || i == ThemingChatActivity.this.avatarMarginLeftRow || i == ThemingChatActivity.this.avatarAlignTopRow || i == ThemingChatActivity.this.ownAvatarAlignTopRow || i == ThemingChatActivity.this.showContactAvatar || i == ThemingChatActivity.this.showOwnAvatar || i == ThemingChatActivity.this.showOwnAvatarGroup || i == ThemingChatActivity.this.hideStatusIndicatorCheckRow || i == ThemingChatActivity.this.nameColorRow || i == ThemingChatActivity.this.nameSizeRow || i == ThemingChatActivity.this.statusColorRow || i == ThemingChatActivity.this.onlineColorRow || i == ThemingChatActivity.this.typingColorRow || i == ThemingChatActivity.this.statusSizeRow || i == ThemingChatActivity.this.textSizeRow || i == ThemingChatActivity.this.timeSizeRow || ((AndroidUtilities.getBoolPref("chatCommandColorCheck") && i == ThemingChatActivity.this.commandColorRow) || i == ThemingChatActivity.this.commandColorCheckRow || i == ThemingChatActivity.this.dateColorRow || i == ThemingChatActivity.this.dateSizeRow || i == ThemingChatActivity.this.dateBubbleColorRow || i == ThemingChatActivity.this.rTextColorRow || i == ThemingChatActivity.this.rLinkColorRow || i == ThemingChatActivity.this.lTextColorRow || i == ThemingChatActivity.this.lLinkColorRow || i == ThemingChatActivity.this.rTimeColorRow || i == ThemingChatActivity.this.lTimeColorRow || i == ThemingChatActivity.this.checksColorRow || i == ThemingChatActivity.this.memberColorCheckRow || ((Theme.chatMemberColorCheck && i == ThemingChatActivity.this.memberColorRow) || i == ThemingChatActivity.this.contactNameColorRow || i == ThemingChatActivity.this.forwardRightNameColorRow || i == ThemingChatActivity.this.forwardLeftNameColorRow || i == ThemingChatActivity.this.showUsernameCheckRow || i == ThemingChatActivity.this.editTextSizeRow || i == ThemingChatActivity.this.editTextColorRow || i == ThemingChatActivity.this.editTextIconsColorRow || i == ThemingChatActivity.this.sendColorRow || i == ThemingChatActivity.this.editTextBGColorRow || i == ThemingChatActivity.this.editTextBGGradientRow || ((AndroidUtilities.getIntDef("chatEditTextBGGradient", 0) != 0 && i == ThemingChatActivity.this.editTextBGGradientColorRow) || i == ThemingChatActivity.this.attachBGColorRow || i == ThemingChatActivity.this.attachBGGradientRow || ((AndroidUtilities.getIntDef("chatAttachBGGradient", 0) != 0 && i == ThemingChatActivity.this.attachBGGradientColorRow) || i == ThemingChatActivity.this.attachTextColorRow || i == ThemingChatActivity.this.emojiViewBGColorRow || i == ThemingChatActivity.this.emojiViewBGGradientRow || ((AndroidUtilities.getIntDef("chatEmojiViewBGGradient", 0) != 0 && i == ThemingChatActivity.this.emojiViewBGGradientColorRow) || i == ThemingChatActivity.this.emojiViewTabIconColorRow || i == ThemingChatActivity.this.emojiViewTabColorRow || i == ThemingChatActivity.this.selectedMessageBGColorRow || i == ThemingChatActivity.this.quickBarColorRow || i == ThemingChatActivity.this.quickBarNamesColorRow))))))));
        }

        @Override
        public int getCount() {
            return ThemingChatActivity.this.rowCount;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            View textDetailSettingsCell;
            int i2;
            boolean z;
            int i3;
            boolean z2;
            int i4;
            boolean z3;
            boolean z4;
            int i5;
            int itemViewType = getItemViewType(i);
            String prefix = ThemingChatActivity.this.showPrefix ? ThemingChatActivity.this.getPrefix(i) : "";
            SharedPreferences sharedPreferences = ApplicationLoader.applicationContext.getSharedPreferences("theme", 0);
            if (itemViewType == 0) {
                if (view == null) {
                    textDetailSettingsCell = new ShadowSectionCell(this.mContext);
                }
                textDetailSettingsCell = view;
            } else if (itemViewType == 1) {
                if (view == null) {
                    textDetailSettingsCell = new HeaderCell(this.mContext);
                    textDetailSettingsCell.setBackgroundColor(-1);
                } else {
                    textDetailSettingsCell = view;
                }
                if (i == ThemingChatActivity.this.headerSection2Row) {
                    ((HeaderCell) textDetailSettingsCell).setText(prefix + LocaleController.getString("Header", R.string.Header));
                } else if (i == ThemingChatActivity.this.rowsSection2Row) {
                    ((HeaderCell) textDetailSettingsCell).setText(prefix + LocaleController.getString("ChatList2", R.string.ChatList2));
                }
            } else if (itemViewType == 2) {
                textDetailSettingsCell = view == null ? new TextSettingsCell(this.mContext) : view;
                TextSettingsCell textSettingsCell = (TextSettingsCell) textDetailSettingsCell;
                textSettingsCell.setMultilineText();
                if (i == ThemingChatActivity.this.headerAvatarRadiusRow) {
                    textSettingsCell.setTag("chatHeaderAvatarRadius");
                    textSettingsCell.setTextAndValue(prefix + LocaleController.getString("AvatarRadius", R.string.AvatarRadius), String.format("%d", Integer.valueOf(sharedPreferences.getInt("chatHeaderAvatarRadius", AndroidUtilities.isTablet() ? 35 : 32))), true);
                } else if (i == ThemingChatActivity.this.avatarRadiusRow) {
                    textSettingsCell.setTag("chatAvatarRadius");
                    textSettingsCell.setTextAndValue(prefix + LocaleController.getString("AvatarRadius", R.string.AvatarRadius), String.format("%d", Integer.valueOf(sharedPreferences.getInt("chatAvatarRadius", AndroidUtilities.isTablet() ? 35 : 32))), true);
                } else if (i == ThemingChatActivity.this.avatarSizeRow) {
                    textSettingsCell.setTag("chatAvatarSize");
                    textSettingsCell.setTextAndValue(prefix + LocaleController.getString("AvatarSize", R.string.AvatarSize), String.format("%d", Integer.valueOf(sharedPreferences.getInt("chatAvatarSize", AndroidUtilities.isTablet() ? 45 : 42))), true);
                } else if (i == ThemingChatActivity.this.avatarMarginLeftRow) {
                    textSettingsCell.setTag("chatAvatarMarginLeft");
                    textSettingsCell.setTextAndValue(prefix + LocaleController.getString("AvatarMarginLeft", R.string.AvatarMarginLeft), String.format("%d", Integer.valueOf(sharedPreferences.getInt("chatAvatarMarginLeft", 6))), true);
                } else {
                    if (i == ThemingChatActivity.this.nameSizeRow) {
                        textSettingsCell.setTag("chatNameSize");
                        textSettingsCell.setTextAndValue(prefix + LocaleController.getString("NameSize", R.string.NameSize), String.format("%d", Integer.valueOf(sharedPreferences.getInt("chatNameSize", AndroidUtilities.isTablet() ? 20 : 18))), true);
                    } else if (i == ThemingChatActivity.this.statusSizeRow) {
                        textSettingsCell.setTag("chatStatusSize");
                        textSettingsCell.setTextAndValue(prefix + LocaleController.getString("StatusSize", R.string.StatusSize), String.format("%d", Integer.valueOf(sharedPreferences.getInt("chatStatusSize", AndroidUtilities.isTablet() ? 16 : 14))), true);
                    } else if (i == ThemingChatActivity.this.textSizeRow) {
                        textSettingsCell.setTag("chatTextSize");
                        textSettingsCell.setTextAndValue(prefix + LocaleController.getString("TextSize", R.string.TextSize), String.format("%d", Integer.valueOf(sharedPreferences.getInt("chatTextSize", AndroidUtilities.isTablet() ? 18 : 16))), true);
                    } else if (i == ThemingChatActivity.this.timeSizeRow) {
                        textSettingsCell.setTag("chatTimeSize");
                        textSettingsCell.setTextAndValue(prefix + LocaleController.getString("TimeSize", R.string.TimeSize), String.format("%d", Integer.valueOf(sharedPreferences.getInt("chatTimeSize", AndroidUtilities.isTablet() ? 14 : 12))), true);
                    } else if (i == ThemingChatActivity.this.dateSizeRow) {
                        textSettingsCell.setTag("chatDateSize");
                        textSettingsCell.setTextAndValue(prefix + LocaleController.getString("DateSize", R.string.DateSize), String.format("%d", Integer.valueOf(sharedPreferences.getInt("chatDateSize", AndroidUtilities.isTablet() ? 18 : SharedConfig.fontSize - 2))), true);
                    } else if (i == ThemingChatActivity.this.editTextSizeRow) {
                        textSettingsCell.setTag("chatEditTextSize");
                        textSettingsCell.setTextAndValue(prefix + LocaleController.getString("EditTextSize", R.string.EditTextSize), String.format("%d", Integer.valueOf(Theme.chatEditTextSize)), true);
                    } else if (i == ThemingChatActivity.this.bubblesRow) {
                        textSettingsCell.setTag("chatBubbleStyle");
                        Theme.chatBubbleStyle = sharedPreferences.getString("chatBubbleStyle", Theme.bubblesNamesArray[0]);
                        textSettingsCell.setTextAndValue(prefix + LocaleController.getString("BubbleStyle", R.string.BubbleStyle), Theme.chatBubbleStyle, true);
                    } else if (i == ThemingChatActivity.this.checksRow) {
                        textSettingsCell.setTag("chatCheckStyle");
                        Theme.chatCheckStyle = sharedPreferences.getString("chatCheckStyle", Theme.checksNamesArray[0]);
                        textSettingsCell.setTextAndValue(prefix + LocaleController.getString("CheckStyle", R.string.CheckStyle), Theme.chatCheckStyle, true);
                    }
                }
            } else if (itemViewType == 4) {
                textDetailSettingsCell = view == null ? new TextCheckCell(this.mContext) : view;
                TextCheckCell textCheckCell = (TextCheckCell) textDetailSettingsCell;
                textCheckCell.setMultilineText();
                if (i == ThemingChatActivity.this.solidBGColorCheckRow) {
                    textCheckCell.setTag("chatSolidBGColorCheck");
                    textCheckCell.setTextAndCheck(prefix + LocaleController.getString("SetSolidBGColor", R.string.SetSolidBGColor), Theme.chatSolidBGColorCheck, false);
                } else if (i == ThemingChatActivity.this.commandColorCheckRow) {
                    textCheckCell.setTag("chatCommandColorCheck");
                    textCheckCell.setTextAndCheck(prefix + LocaleController.getString("CommandColorCheck", R.string.CommandColorCheck), sharedPreferences.getBoolean("chatCommandColorCheck", false), false);
                } else if (i == ThemingChatActivity.this.memberColorCheckRow) {
                    textCheckCell.setTag("chatMemberColorCheck");
                    textCheckCell.setTextAndCheck(prefix + LocaleController.getString("SetMemberColor", R.string.SetMemberColor), Theme.chatMemberColorCheck, false);
                } else if (i == ThemingChatActivity.this.showUsernameCheckRow) {
                    textCheckCell.setTag("chatShowUsernameCheck");
                    textCheckCell.setTextAndCheck(prefix + LocaleController.getString("ShowUsername", R.string.ShowUsername), Theme.chatShowUsernameCheck, true);
                } else if (i == ThemingChatActivity.this.avatarAlignTopRow) {
                    textCheckCell.setTag("chatAvatarAlignTop");
                    textCheckCell.setTextAndCheck(prefix + LocaleController.getString("AvatarAlignTop", R.string.AvatarAlignTop), Theme.chatAvatarAlignTop, true);
                } else if (i == ThemingChatActivity.this.ownAvatarAlignTopRow) {
                    textCheckCell.setTag("chatOwnAvatarAlignTop");
                    textCheckCell.setTextAndCheck(prefix + LocaleController.getString("OwnAvatarAlignTop", R.string.OwnAvatarAlignTop), Theme.chatOwnAvatarAlignTop, true);
                } else if (i == ThemingChatActivity.this.showContactAvatar) {
                    textCheckCell.setTag("chatShowContactAvatar");
                    textCheckCell.setTextAndCheck(prefix + LocaleController.getString("ShowContactAvatar", R.string.ShowContactAvatar), Theme.chatShowContactAvatar, true);
                } else if (i == ThemingChatActivity.this.showOwnAvatar) {
                    textCheckCell.setTag("chatShowOwnAvatar");
                    textCheckCell.setTextAndCheck(prefix + LocaleController.getString("ShowOwnAvatar", R.string.ShowOwnAvatar), Theme.chatShowOwnAvatar, true);
                } else if (i == ThemingChatActivity.this.showOwnAvatarGroup) {
                    textCheckCell.setTag("chatShowOwnAvatarGroup");
                    textCheckCell.setTextAndCheck(prefix + LocaleController.getString("ShowOwnAvatarGroup", R.string.ShowOwnAvatarGroup), Theme.chatShowOwnAvatarGroup, true);
                } else if (i == ThemingChatActivity.this.hideStatusIndicatorCheckRow) {
                    textCheckCell.setTag("chatHideStatusIndicator");
                    textCheckCell.setTextAndCheck(prefix + LocaleController.getString("HideStatusIndicator", R.string.HideStatusIndicator), Theme.chatHideStatusIndicator, true);
                }
            } else if (itemViewType == 3) {
                textDetailSettingsCell = view == null ? new TextColorCell(this.mContext) : view;
                TextColorCell textColorCell = (TextColorCell) textDetailSettingsCell;
                textColorCell.setMultilineText();
                int i6 = sharedPreferences.getInt("themeColor", -16738680);
                int intDarkerColor = AndroidUtilities.getIntDarkerColor("themeColor", 21);
                int intDarkerColor2 = AndroidUtilities.getIntDarkerColor("themeColor", -64);
                if (i == ThemingChatActivity.this.headerColorRow) {
                    textColorCell.setTag("chatHeaderColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("HeaderColor", R.string.HeaderColor), sharedPreferences.getInt("chatHeaderColor", i6), false);
                } else if (i == ThemingChatActivity.this.headerGradientColorRow) {
                    textColorCell.setTag("chatHeaderGradientColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("HeaderColor", R.string.RowGradientColor), sharedPreferences.getInt("chatHeaderGradient", 0) != 0 ? sharedPreferences.getInt("chatHeaderGradientColor", Theme.defColor) : 0, true);
                } else if (i == ThemingChatActivity.this.headerIconsColorRow) {
                    textColorCell.setTag("chatHeaderIconsColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("HeaderIconsColor", R.string.HeaderIconsColor), sharedPreferences.getInt("chatHeaderIconsColor", -1), true);
                } else if (i == ThemingChatActivity.this.solidBGColorRow) {
                    textColorCell.setTag("chatSolidBGColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("SolidBGColor", R.string.SolidBGColor), Theme.chatSolidBGColorCheck ? Theme.chatSolidBGColor : 0, false);
                } else if (i == ThemingChatActivity.this.gradientBGColorRow) {
                    textColorCell.setTag("chatGradientBGColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("RowGradientColor", R.string.RowGradientColor), (Theme.chatGradientBG == 0 || !Theme.chatSolidBGColorCheck) ? 0 : Theme.chatGradientBGColor, true);
                } else if (i == ThemingChatActivity.this.memberColorRow) {
                    textColorCell.setTag("chatMemberColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("MemberColor", R.string.MemberColor), sharedPreferences.getBoolean("chatMemberColorCheck", false) ? sharedPreferences.getInt("chatMemberColor", intDarkerColor) : 0, true);
                } else if (i == ThemingChatActivity.this.contactNameColorRow) {
                    textColorCell.setTag("chatContactNameColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("SharedContactNameColor", R.string.SharedContactNameColor), sharedPreferences.getInt("chatContactNameColor", i6), true);
                    textColorCell.setMultilineText();
                } else if (i == ThemingChatActivity.this.forwardRightNameColorRow) {
                    textColorCell.setTag("chatForwardRColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("ForwardRightNameColor", R.string.ForwardRightNameColor), sharedPreferences.getInt("chatForwardRColor", intDarkerColor), true);
                } else if (i == ThemingChatActivity.this.forwardLeftNameColorRow) {
                    textColorCell.setTag("chatForwardLColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("ForwardLeftNameColor", R.string.ForwardLeftNameColor), sharedPreferences.getInt("chatForwardLColor", intDarkerColor), true);
                } else if (i == ThemingChatActivity.this.muteColorRow) {
                    textColorCell.setTag("chatMuteColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("MuteColor", R.string.MuteColor), sharedPreferences.getInt("chatMuteColor", -1), true);
                } else if (i == ThemingChatActivity.this.rBubbleColorRow) {
                    textColorCell.setTag("chatRBubbleColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("RBubbleColor", R.string.RBubbleColor), sharedPreferences.getInt("chatRBubbleColor", AndroidUtilities.getDefBubbleColor()), true);
                    textColorCell.setMultilineText();
                } else if (i == ThemingChatActivity.this.lBubbleColorRow) {
                    textColorCell.setTag("chatLBubbleColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("LBubbleColor", R.string.LBubbleColor), sharedPreferences.getInt("chatLBubbleColor", -1), true);
                    textColorCell.setMultilineText();
                } else if (i == ThemingChatActivity.this.rTextColorRow) {
                    textColorCell.setTag("chatRTextColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("RTextColor", R.string.RTextColor), sharedPreferences.getInt("chatRTextColor", -16777216), true);
                } else if (i == ThemingChatActivity.this.lTextColorRow) {
                    textColorCell.setTag("chatLTextColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("LTextColor", R.string.LTextColor), sharedPreferences.getInt("chatLTextColor", -16777216), true);
                } else if (i == ThemingChatActivity.this.selectedMessageBGColorRow) {
                    textColorCell.setTag("chatSelectedMsgBGColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("SelectedMsgBGColor", R.string.SelectedMsgBGColor), sharedPreferences.getInt("chatSelectedMsgBGColor", 1713809050), true);
                    textColorCell.setMultilineText();
                } else if (i == ThemingChatActivity.this.rLinkColorRow) {
                    textColorCell.setTag("chatRLinkColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("RLinkColor", R.string.RLinkColor), sharedPreferences.getInt("chatRLinkColor", i6), true);
                } else if (i == ThemingChatActivity.this.lLinkColorRow) {
                    textColorCell.setTag("chatLLinkColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("LLinkColor", R.string.LLinkColor), sharedPreferences.getInt("chatLLinkColor", i6), true);
                } else if (i == ThemingChatActivity.this.nameColorRow) {
                    textColorCell.setTag("chatNameColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("NameColor", R.string.NameColor), Theme.chatNameColor, true);
                } else if (i == ThemingChatActivity.this.statusColorRow) {
                    textColorCell.setTag("chatStatusColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("StatusColor", R.string.StatusColor), sharedPreferences.getInt("chatStatusColor", intDarkerColor2), true);
                } else if (i == ThemingChatActivity.this.onlineColorRow) {
                    textColorCell.setTag("chatOnlineColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("OnlineColor", R.string.OnlineColor), sharedPreferences.getInt("chatOnlineColor", sharedPreferences.getInt("chatStatusColor", intDarkerColor2)), true);
                } else if (i == ThemingChatActivity.this.typingColorRow) {
                    textColorCell.setTag("chatTypingColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("TypingColor", R.string.TypingColor), sharedPreferences.getInt("chatTypingColor", sharedPreferences.getInt("chatStatusColor", intDarkerColor2)), false);
                } else if (i == ThemingChatActivity.this.rTimeColorRow) {
                    textColorCell.setTag("chatRTimeColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("RTimeColor", R.string.RTimeColor), sharedPreferences.getInt("chatRTimeColor", intDarkerColor), true);
                } else if (i == ThemingChatActivity.this.lTimeColorRow) {
                    textColorCell.setTag("chatLTimeColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("LTimeColor", R.string.LTimeColor), sharedPreferences.getInt("chatLTimeColor", -6182221), true);
                } else if (i == ThemingChatActivity.this.checksColorRow) {
                    textColorCell.setTag("chatChecksColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("ChecksColor", R.string.ChecksColor), sharedPreferences.getInt("chatChecksColor", i6), true);
                } else if (i == ThemingChatActivity.this.commandColorRow) {
                    textColorCell.setTag("chatCommandColor");
                    String str = prefix + LocaleController.getString("CommandColor", R.string.CommandColor);
                    if (sharedPreferences.getBoolean("chatCommandColorCheck", false)) {
                        i5 = sharedPreferences.getInt("chatCommandColor", Theme.defColor);
                        z4 = true;
                    } else {
                        z4 = true;
                        i5 = 0;
                    }
                    textColorCell.setTextAndColor(str, i5, z4);
                } else if (i == ThemingChatActivity.this.dateColorRow) {
                    textColorCell.setTag("chatDateColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("DateColor", R.string.DateColor), sharedPreferences.getInt("chatDateColor", -1), true);
                } else if (i == ThemingChatActivity.this.dateBubbleColorRow) {
                    textColorCell.setTag("chatDateBubbleColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("DateBubbleColor", R.string.DateBubbleColor), sharedPreferences.getInt("chatDateBubbleColor", 1719044499), true);
                } else if (i == ThemingChatActivity.this.sendColorRow) {
                    textColorCell.setTag("chatSendIconColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("SendIcon", R.string.SendIcon), sharedPreferences.getInt("chatSendIconColor", sharedPreferences.getInt("chatEditTextIconsColor", i6)), true);
                } else if (i == ThemingChatActivity.this.editTextColorRow) {
                    textColorCell.setTag("chatEditTextColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("EditTextColor", R.string.EditTextColor), Theme.chatEditTextColor, true);
                } else if (i == ThemingChatActivity.this.editTextBGColorRow) {
                    textColorCell.setTag("chatEditTextBGColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("EditTextBGColor", R.string.EditTextBGColor), Theme.chatEditTextBGColor, false);
                } else if (i == ThemingChatActivity.this.editTextBGGradientColorRow) {
                    textColorCell.setTag("chatEditTextBGGradient");
                    String str2 = prefix + LocaleController.getString("RowGradientColor", R.string.RowGradientColor);
                    if (sharedPreferences.getInt("chatEditTextBGGradient", 0) == 0) {
                        z3 = true;
                        i4 = 0;
                    } else {
                        i4 = sharedPreferences.getInt("chatEditTextBGGradientColor", -1);
                        z3 = true;
                    }
                    textColorCell.setTextAndColor(str2, i4, z3);
                } else if (i == ThemingChatActivity.this.attachBGColorRow) {
                    textColorCell.setTag("chatAttachBGColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("AttachBGColor", R.string.AttachBGColor), sharedPreferences.getInt("chatAttachBGColor", -1), false);
                } else if (i == ThemingChatActivity.this.attachBGGradientColorRow) {
                    textColorCell.setTag("chatAttachBGGradient");
                    String str3 = prefix + LocaleController.getString("RowGradientColor", R.string.RowGradientColor);
                    if (sharedPreferences.getInt("chatAttachBGGradient", 0) == 0) {
                        z2 = true;
                        i3 = 0;
                    } else {
                        i3 = sharedPreferences.getInt("chatAttachBGGradientColor", -1);
                        z2 = true;
                    }
                    textColorCell.setTextAndColor(str3, i3, z2);
                } else if (i == ThemingChatActivity.this.attachTextColorRow) {
                    textColorCell.setTag("chatAttachTextColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("AttachTextColor", R.string.AttachTextColor), sharedPreferences.getInt("chatAttachTextColor", -9079435), true);
                } else if (i == ThemingChatActivity.this.editTextIconsColorRow) {
                    textColorCell.setTag("chatEditTextIconsColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("EditTextIconsColor", R.string.EditTextIconsColor), sharedPreferences.getInt("chatEditTextIconsColor", -5395027), true);
                } else if (i == ThemingChatActivity.this.emojiViewBGColorRow) {
                    textColorCell.setTag("chatEmojiViewBGColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("EmojiViewBGColor", R.string.EmojiViewBGColor), sharedPreferences.getInt("chatEmojiViewBGColor", -657673), false);
                } else if (i == ThemingChatActivity.this.emojiViewBGGradientColorRow) {
                    textColorCell.setTag("chatEmojiViewBGGradientColor");
                    String str4 = prefix + LocaleController.getString("RowGradientColor", R.string.RowGradientColor);
                    if (sharedPreferences.getInt("chatEmojiViewBGGradient", 0) == 0) {
                        z = true;
                        i2 = 0;
                    } else {
                        i2 = sharedPreferences.getInt("chatEmojiViewBGGradientColor", -657673);
                        z = true;
                    }
                    textColorCell.setTextAndColor(str4, i2, z);
                } else if (i == ThemingChatActivity.this.emojiViewTabIconColorRow) {
                    textColorCell.setTag("chatEmojiViewTabIconColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("EmojiViewTabIconColor", R.string.EmojiViewTabIconColor), sharedPreferences.getInt("chatEmojiViewTabIconColor", -5723992), true);
                } else if (i == ThemingChatActivity.this.emojiViewTabColorRow) {
                    textColorCell.setTag("chatEmojiViewTabColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("EmojiViewTabColor", R.string.EmojiViewTabColor), sharedPreferences.getInt("chatEmojiViewTabColor", AndroidUtilities.getIntDarkerColor("themeColor", -21)), true);
                } else if (i == ThemingChatActivity.this.quickBarColorRow) {
                    textColorCell.setTag("chatQuickBarColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("QuickBarColor", R.string.QuickBarColor), sharedPreferences.getInt("chatQuickBarColor", -1), true);
                } else if (i == ThemingChatActivity.this.quickBarNamesColorRow) {
                    textColorCell.setTag("chatQuickBarNamesColor");
                    textColorCell.setTextAndColor(prefix + LocaleController.getString("QuickBarNamesColor", R.string.QuickBarNamesColor), sharedPreferences.getInt("chatQuickBarNamesColor", -14606047), false);
                }
            } else {
                if (itemViewType == 5) {
                    textDetailSettingsCell = view == null ? new TextDetailSettingsCell(this.mContext) : view;
                    TextDetailSettingsCell textDetailSettingsCell2 = (TextDetailSettingsCell) textDetailSettingsCell;
                    if (i == ThemingChatActivity.this.gradientBGRow) {
                        textDetailSettingsCell2.setMultilineDetail(false);
                        int i7 = Theme.chatGradientBG;
                        if (i7 == 0) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
                        } else if (i7 == 1) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
                        } else if (i7 == 2) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
                        } else if (i7 == 3) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
                        } else if (i7 == 4) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
                        }
                    } else if (i == ThemingChatActivity.this.headerGradientRow) {
                        textDetailSettingsCell2.setMultilineDetail(false);
                        int i8 = sharedPreferences.getInt("chatHeaderGradient", 0);
                        if (i8 == 0) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
                        } else if (i8 == 1) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
                        } else if (i8 == 2) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
                        } else if (i8 == 3) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
                        } else if (i8 == 4) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
                        }
                    } else if (i == ThemingChatActivity.this.editTextBGGradientRow) {
                        textDetailSettingsCell2.setMultilineDetail(false);
                        int i9 = sharedPreferences.getInt("chatEditTextBGGradient", 0);
                        if (i9 == 0) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
                        } else if (i9 == 1) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
                        } else if (i9 == 2) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
                        } else if (i9 == 3) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
                        } else if (i9 == 4) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
                        }
                    } else if (i == ThemingChatActivity.this.attachBGGradientRow) {
                        textDetailSettingsCell2.setMultilineDetail(false);
                        int i10 = sharedPreferences.getInt("chatAttachBGGradient", 0);
                        if (i10 == 0) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
                        } else if (i10 == 1) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
                        } else if (i10 == 2) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
                        } else if (i10 == 3) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
                        } else if (i10 == 4) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
                        }
                    } else if (i == ThemingChatActivity.this.emojiViewBGGradientRow) {
                        textDetailSettingsCell2.setMultilineDetail(false);
                        int i11 = sharedPreferences.getInt("chatEmojiViewBGGradient", 0);
                        if (i11 == 0) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientDisabled", R.string.RowGradientDisabled), false);
                        } else if (i11 == 1) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTopBottom", R.string.RowGradientTopBottom), false);
                        } else if (i11 == 2) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientLeftRight", R.string.RowGradientLeftRight), false);
                        } else if (i11 == 3) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientTLBR", R.string.RowGradientTLBR), false);
                        } else if (i11 == 4) {
                            textDetailSettingsCell2.setTextAndValue(prefix + LocaleController.getString("RowGradient", R.string.RowGradient), LocaleController.getString("RowGradientBLTR", R.string.RowGradientBLTR), false);
                        }
                    }
                }
                textDetailSettingsCell = view;
            }
            if (textDetailSettingsCell != null) {
                textDetailSettingsCell.setBackgroundColor(Theme.usePlusTheme ? Theme.prefBGColor : Theme.getColor(Theme.key_windowBackgroundWhite));
            }
            return textDetailSettingsCell;
        }

        @Override
        public int getItemViewType(int i) {
            if (i == ThemingChatActivity.this.rowsSectionRow) {
                return 0;
            }
            if (i == ThemingChatActivity.this.headerSection2Row || i == ThemingChatActivity.this.rowsSection2Row) {
                return 1;
            }
            if (i == ThemingChatActivity.this.headerAvatarRadiusRow || i == ThemingChatActivity.this.avatarRadiusRow || i == ThemingChatActivity.this.avatarSizeRow || i == ThemingChatActivity.this.avatarMarginLeftRow || i == ThemingChatActivity.this.nameSizeRow || i == ThemingChatActivity.this.statusSizeRow || i == ThemingChatActivity.this.textSizeRow || i == ThemingChatActivity.this.timeSizeRow || i == ThemingChatActivity.this.dateSizeRow || i == ThemingChatActivity.this.editTextSizeRow || i == ThemingChatActivity.this.bubblesRow || i == ThemingChatActivity.this.checksRow) {
                return 2;
            }
            if (i == ThemingChatActivity.this.headerColorRow || i == ThemingChatActivity.this.headerGradientColorRow || i == ThemingChatActivity.this.muteColorRow || i == ThemingChatActivity.this.headerIconsColorRow || i == ThemingChatActivity.this.solidBGColorRow || i == ThemingChatActivity.this.gradientBGColorRow || i == ThemingChatActivity.this.rBubbleColorRow || i == ThemingChatActivity.this.lBubbleColorRow || i == ThemingChatActivity.this.nameColorRow || i == ThemingChatActivity.this.statusColorRow || i == ThemingChatActivity.this.onlineColorRow || i == ThemingChatActivity.this.typingColorRow || i == ThemingChatActivity.this.commandColorRow || i == ThemingChatActivity.this.dateColorRow || i == ThemingChatActivity.this.dateBubbleColorRow || i == ThemingChatActivity.this.rTextColorRow || i == ThemingChatActivity.this.rLinkColorRow || i == ThemingChatActivity.this.lTextColorRow || i == ThemingChatActivity.this.lLinkColorRow || i == ThemingChatActivity.this.rTimeColorRow || i == ThemingChatActivity.this.lTimeColorRow || i == ThemingChatActivity.this.checksColorRow || i == ThemingChatActivity.this.memberColorRow || i == ThemingChatActivity.this.contactNameColorRow || i == ThemingChatActivity.this.forwardRightNameColorRow || i == ThemingChatActivity.this.forwardLeftNameColorRow || i == ThemingChatActivity.this.sendColorRow || i == ThemingChatActivity.this.editTextColorRow || i == ThemingChatActivity.this.editTextBGColorRow || i == ThemingChatActivity.this.editTextBGGradientColorRow || i == ThemingChatActivity.this.editTextIconsColorRow || i == ThemingChatActivity.this.attachBGColorRow || i == ThemingChatActivity.this.attachBGGradientColorRow || i == ThemingChatActivity.this.attachTextColorRow || i == ThemingChatActivity.this.emojiViewBGColorRow || i == ThemingChatActivity.this.emojiViewBGGradientColorRow || i == ThemingChatActivity.this.emojiViewTabIconColorRow || i == ThemingChatActivity.this.emojiViewTabColorRow || i == ThemingChatActivity.this.selectedMessageBGColorRow || i == ThemingChatActivity.this.quickBarColorRow || i == ThemingChatActivity.this.quickBarNamesColorRow) {
                return 3;
            }
            if (i == ThemingChatActivity.this.solidBGColorCheckRow || i == ThemingChatActivity.this.commandColorCheckRow || i == ThemingChatActivity.this.memberColorCheckRow || i == ThemingChatActivity.this.showUsernameCheckRow || i == ThemingChatActivity.this.avatarAlignTopRow || i == ThemingChatActivity.this.ownAvatarAlignTopRow || i == ThemingChatActivity.this.showContactAvatar || i == ThemingChatActivity.this.showOwnAvatar || i == ThemingChatActivity.this.showOwnAvatarGroup || i == ThemingChatActivity.this.hideStatusIndicatorCheckRow) {
                return 4;
            }
            return (i == ThemingChatActivity.this.headerGradientRow || i == ThemingChatActivity.this.gradientBGRow || i == ThemingChatActivity.this.editTextBGGradientRow || i == ThemingChatActivity.this.attachBGGradientRow || i == ThemingChatActivity.this.emojiViewBGGradientRow) ? 5 : 2;
        }
    }
}