2020-05-28 09:29:33 +02:00
|
|
|
package tw.nekomimi.nekogram.settings;
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.graphics.Canvas;
|
|
|
|
import android.graphics.Paint;
|
|
|
|
import android.text.TextPaint;
|
|
|
|
import android.view.Gravity;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
import android.widget.FrameLayout;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
|
|
import org.telegram.messenger.AndroidUtilities;
|
|
|
|
import org.telegram.messenger.LocaleController;
|
2020-07-31 17:47:36 +02:00
|
|
|
import org.telegram.messenger.MediaController;
|
2020-05-28 09:29:33 +02:00
|
|
|
import org.telegram.messenger.NotificationCenter;
|
|
|
|
import org.telegram.messenger.R;
|
|
|
|
import org.telegram.ui.ActionBar.ActionBar;
|
|
|
|
import org.telegram.ui.ActionBar.ActionBarMenu;
|
|
|
|
import org.telegram.ui.ActionBar.ActionBarMenuItem;
|
|
|
|
import org.telegram.ui.ActionBar.AlertDialog;
|
|
|
|
import org.telegram.ui.ActionBar.BaseFragment;
|
|
|
|
import org.telegram.ui.ActionBar.Theme;
|
|
|
|
import org.telegram.ui.ActionBar.ThemeDescription;
|
|
|
|
import org.telegram.ui.Cells.EmptyCell;
|
|
|
|
import org.telegram.ui.Cells.HeaderCell;
|
|
|
|
import org.telegram.ui.Cells.NotificationsCheckCell;
|
|
|
|
import org.telegram.ui.Cells.ShadowSectionCell;
|
|
|
|
import org.telegram.ui.Cells.TextCheckCell;
|
|
|
|
import org.telegram.ui.Cells.TextDetailSettingsCell;
|
|
|
|
import org.telegram.ui.Cells.TextInfoPrivacyCell;
|
|
|
|
import org.telegram.ui.Cells.TextSettingsCell;
|
|
|
|
import org.telegram.ui.Components.LayoutHelper;
|
|
|
|
import org.telegram.ui.Components.RecyclerListView;
|
|
|
|
import org.telegram.ui.Components.SeekBarView;
|
2021-11-21 16:27:45 +01:00
|
|
|
import org.telegram.ui.Components.UndoView;
|
2020-05-28 09:29:33 +02:00
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2021-08-28 16:05:34 +02:00
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.stream.Collectors;
|
2020-05-28 09:29:33 +02:00
|
|
|
|
2020-06-25 17:25:38 +02:00
|
|
|
import kotlin.Unit;
|
|
|
|
import tw.nekomimi.nekogram.NekoXConfig;
|
2022-01-17 08:45:37 +01:00
|
|
|
import tw.nekomimi.nekogram.ui.PopupBuilder;
|
|
|
|
import tw.nekomimi.nekogram.config.CellGroup;
|
|
|
|
import tw.nekomimi.nekogram.NekoConfig;
|
|
|
|
import tw.nekomimi.nekogram.config.cell.AbstractConfigCell;
|
|
|
|
import tw.nekomimi.nekogram.config.cell.ConfigCellCustom;
|
|
|
|
import tw.nekomimi.nekogram.config.cell.ConfigCellDivider;
|
|
|
|
import tw.nekomimi.nekogram.config.cell.ConfigCellHeader;
|
|
|
|
import tw.nekomimi.nekogram.config.cell.ConfigCellSelectBox;
|
|
|
|
import tw.nekomimi.nekogram.config.cell.ConfigCellTextCheck;
|
|
|
|
import tw.nekomimi.nekogram.config.cell.ConfigCellTextDetail;
|
|
|
|
import tw.nekomimi.nekogram.config.cell.ConfigCellTextInput;
|
2020-05-28 09:29:33 +02:00
|
|
|
|
|
|
|
@SuppressLint("RtlHardcoded")
|
2020-06-14 06:02:04 +02:00
|
|
|
public class NekoChatSettingsActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate {
|
2020-05-28 09:29:33 +02:00
|
|
|
|
2021-11-10 18:24:03 +01:00
|
|
|
private final CellGroup cellGroup = new CellGroup(this);
|
2021-11-11 13:35:44 +01:00
|
|
|
|
2022-01-17 08:45:37 +01:00
|
|
|
private final AbstractConfigCell header0 = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("StickerSize")));
|
|
|
|
private final AbstractConfigCell stickerSizeRow = cellGroup.appendCell(new ConfigCellCustom(998, true));
|
|
|
|
private final AbstractConfigCell divider0 = cellGroup.appendCell(new ConfigCellDivider());
|
|
|
|
private final AbstractConfigCell header1 = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("Chat")));
|
|
|
|
private final AbstractConfigCell unreadBadgeOnBackButton = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.unreadBadgeOnBackButton));
|
|
|
|
private final AbstractConfigCell ignoreBlockedRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.ignoreBlocked, LocaleController.getString("IgnoreBlockedAbout")));
|
|
|
|
private final AbstractConfigCell ignoreMutedCountRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.ignoreMutedCount));
|
|
|
|
private final AbstractConfigCell disableChatActionRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableChatAction));
|
|
|
|
private final AbstractConfigCell disableChoosingStickerRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableChoosingSticker));
|
|
|
|
private final AbstractConfigCell disablePhotoSideActionRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disablePhotoSideAction));
|
|
|
|
private final AbstractConfigCell hideKeyboardOnChatScrollRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.hideKeyboardOnChatScroll));
|
|
|
|
private final AbstractConfigCell disableVibrationRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableVibration));
|
|
|
|
private final AbstractConfigCell skipOpenLinkConfirmRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.skipOpenLinkConfirm));
|
|
|
|
private final AbstractConfigCell rearVideoMessagesRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.rearVideoMessages));
|
|
|
|
private final AbstractConfigCell confirmAVRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.confirmAVMessage));
|
|
|
|
private final AbstractConfigCell useChatAttachMediaMenuRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.useChatAttachMediaMenu, LocaleController.getString("UseChatAttachEnterMenuNotice")));
|
|
|
|
private final AbstractConfigCell disableLinkPreviewByDefaultRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableLinkPreviewByDefault, LocaleController.getString("DisableLinkPreviewByDefaultNotice")));
|
|
|
|
private final AbstractConfigCell sendCommentAfterForwardRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.sendCommentAfterForward));
|
|
|
|
private final AbstractConfigCell disableProximityEventsRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableProximityEvents));
|
|
|
|
private final AbstractConfigCell disableTrendingRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableTrending));
|
|
|
|
private final AbstractConfigCell dontSendGreetingStickerRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.dontSendGreetingSticker));
|
|
|
|
private final AbstractConfigCell hideTimeForStickerRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.hideTimeForSticker));
|
|
|
|
private final AbstractConfigCell hideGroupStickerRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.hideGroupSticker));
|
|
|
|
private final AbstractConfigCell takeGIFasVideoRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.takeGIFasVideo));
|
|
|
|
private final AbstractConfigCell showSeconds = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.showSeconds));
|
|
|
|
private final AbstractConfigCell maxRecentStickerCountRow = cellGroup.appendCell(new ConfigCellCustom(CellGroup.ITEM_TYPE_TEXT_SETTINGS_CELL, true));
|
|
|
|
private final AbstractConfigCell disableSwipeToNextRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableSwipeToNext));
|
|
|
|
private final AbstractConfigCell disableRemoteEmojiInteractionsRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableRemoteEmojiInteractions));
|
|
|
|
private final AbstractConfigCell mapPreviewRow = cellGroup.appendCell(new ConfigCellSelectBox(null, NekoConfig.mapPreviewProvider,
|
2021-10-29 07:52:52 +02:00
|
|
|
new String[]{
|
|
|
|
LocaleController.getString("MapPreviewProviderTelegram", R.string.MapPreviewProviderTelegram),
|
|
|
|
LocaleController.getString("MapPreviewProviderYandex", R.string.MapPreviewProviderYandex),
|
|
|
|
LocaleController.getString("MapPreviewProviderNobody", R.string.MapPreviewProviderNobody)
|
|
|
|
}, null));
|
2022-01-17 08:45:37 +01:00
|
|
|
private final AbstractConfigCell messageMenuRow = cellGroup.appendCell(new ConfigCellSelectBox(LocaleController.getString("MessageMenu"), null, null, () -> {
|
2021-10-29 07:52:52 +02:00
|
|
|
showMessageMenuAlert();
|
|
|
|
}));
|
2022-01-21 08:24:30 +01:00
|
|
|
private final AbstractConfigCell reactionsRow = cellGroup.appendCell(new ConfigCellSelectBox(null, NekoConfig.reactions,
|
|
|
|
new String[]{
|
|
|
|
LocaleController.getString("doubleTapSendReactions", R.string.doubleTapSendReactions),
|
|
|
|
LocaleController.getString("doubleTapShowReactions", R.string.doubleTapShowReactions),
|
|
|
|
LocaleController.getString("ReactionsDisabled", R.string.ReactionsDisabled),
|
|
|
|
}, null));
|
2022-01-17 08:45:37 +01:00
|
|
|
private final AbstractConfigCell repeatConfirmRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.repeatConfirm));
|
|
|
|
private final AbstractConfigCell rememberAllBackMessagesRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.rememberAllBackMessages));
|
|
|
|
private final AbstractConfigCell hideSendAsChannelRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.hideSendAsChannel));
|
2022-01-17 10:57:56 +01:00
|
|
|
private final AbstractConfigCell showSpoilersDirectlyRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.showSpoilersDirectly));
|
2022-01-17 08:45:37 +01:00
|
|
|
private final AbstractConfigCell divider1 = cellGroup.appendCell(new ConfigCellDivider());
|
|
|
|
private final AbstractConfigCell header2 = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("AutoDownload")));
|
|
|
|
private final AbstractConfigCell win32Row = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableAutoDownloadingWin32Executable));
|
|
|
|
private final AbstractConfigCell archiveRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableAutoDownloadingArchive));
|
|
|
|
private final AbstractConfigCell divider2 = cellGroup.appendCell(new ConfigCellDivider());
|
|
|
|
private final AbstractConfigCell header3 = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("Folder")));
|
|
|
|
private final AbstractConfigCell showTabsOnForwardRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.showTabsOnForward));
|
|
|
|
private final AbstractConfigCell hideAllTabRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.hideAllTab, LocaleController.getString("HideAllTabAbout")));
|
|
|
|
private final AbstractConfigCell pressTitleToOpenAllChatsRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.pressTitleToOpenAllChats));
|
|
|
|
private final AbstractConfigCell tabsTitleTypeRow = cellGroup.appendCell(new ConfigCellSelectBox(null, NekoConfig.tabsTitleType,
|
2021-10-29 07:52:52 +02:00
|
|
|
new String[]{
|
|
|
|
LocaleController.getString("TabTitleTypeText", R.string.TabTitleTypeText),
|
|
|
|
LocaleController.getString("TabTitleTypeIcon", R.string.TabTitleTypeIcon),
|
|
|
|
LocaleController.getString("TabTitleTypeMix", R.string.TabTitleTypeMix)
|
|
|
|
}, null));
|
2022-01-17 08:45:37 +01:00
|
|
|
private final AbstractConfigCell divider3 = cellGroup.appendCell(new ConfigCellDivider());
|
2021-11-21 16:27:45 +01:00
|
|
|
|
2021-11-10 18:24:03 +01:00
|
|
|
private RecyclerListView listView;
|
|
|
|
private ListAdapter listAdapter;
|
|
|
|
private ActionBarMenuItem menuItem;
|
|
|
|
private StickerSizeCell stickerSizeCell;
|
2021-11-21 16:27:45 +01:00
|
|
|
private UndoView tooltip;
|
2020-05-28 09:29:33 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onFragmentCreate() {
|
|
|
|
super.onFragmentCreate();
|
|
|
|
|
2021-06-25 18:02:05 +02:00
|
|
|
// NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.emojiDidLoad);
|
2020-05-28 09:29:33 +02:00
|
|
|
updateRows();
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@SuppressLint("NewApi")
|
|
|
|
@Override
|
|
|
|
public View createView(Context context) {
|
|
|
|
actionBar.setBackButtonImage(R.drawable.ic_ab_back);
|
|
|
|
actionBar.setTitle(LocaleController.getString("Chat", R.string.Chat));
|
|
|
|
|
|
|
|
if (AndroidUtilities.isTablet()) {
|
|
|
|
actionBar.setOccupyStatusBar(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
ActionBarMenu menu = actionBar.createMenu();
|
|
|
|
menuItem = menu.addItem(0, R.drawable.ic_ab_other);
|
|
|
|
menuItem.setContentDescription(LocaleController.getString("AccDescrMoreOptions", R.string.AccDescrMoreOptions));
|
|
|
|
menuItem.addSubItem(1, R.drawable.msg_reset, LocaleController.getString("ResetStickerSize", R.string.ResetStickerSize));
|
2022-01-17 08:45:37 +01:00
|
|
|
menuItem.setVisibility(NekoConfig.stickerSize.Float() != 14.0f ? View.VISIBLE : View.GONE);
|
2020-05-28 09:29:33 +02:00
|
|
|
|
|
|
|
actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
|
|
|
|
@Override
|
|
|
|
public void onItemClick(int id) {
|
|
|
|
if (id == -1) {
|
|
|
|
finishFragment();
|
|
|
|
} else if (id == 1) {
|
2022-01-17 08:45:37 +01:00
|
|
|
NekoConfig.stickerSize.setConfigFloat(14.0f);
|
2020-05-28 09:29:33 +02:00
|
|
|
menuItem.setVisibility(View.GONE);
|
|
|
|
stickerSizeCell.invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-11-03 08:01:01 +01:00
|
|
|
// Before listAdapter
|
2022-01-20 08:41:31 +01:00
|
|
|
if (!NekoXConfig.isDeveloper()) {
|
2021-11-11 07:56:48 +01:00
|
|
|
cellGroup.rows.remove(disableChatActionRow);
|
|
|
|
cellGroup.rows.remove(disableChoosingStickerRow);
|
2021-12-08 15:27:48 +01:00
|
|
|
cellGroup.rows.remove(ignoreBlockedRow);
|
2022-01-17 08:45:37 +01:00
|
|
|
NekoConfig.disableChatAction.setConfigBool(false);
|
|
|
|
NekoConfig.disableChoosingSticker.setConfigBool(false);
|
|
|
|
NekoConfig.ignoreBlocked.setConfigBool(false);
|
2021-11-11 07:56:48 +01:00
|
|
|
}
|
2021-11-03 08:01:01 +01:00
|
|
|
|
2020-05-28 09:29:33 +02:00
|
|
|
listAdapter = new ListAdapter(context);
|
|
|
|
|
|
|
|
fragmentView = new FrameLayout(context);
|
|
|
|
fragmentView.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundGray));
|
|
|
|
FrameLayout frameLayout = (FrameLayout) fragmentView;
|
|
|
|
|
|
|
|
listView = new RecyclerListView(context);
|
|
|
|
listView.setVerticalScrollBarEnabled(false);
|
|
|
|
listView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false));
|
|
|
|
frameLayout.addView(listView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.LEFT));
|
|
|
|
listView.setAdapter(listAdapter);
|
2021-10-29 07:52:52 +02:00
|
|
|
|
|
|
|
// Fragment: Set OnClick Callbacks
|
2020-05-28 09:29:33 +02:00
|
|
|
listView.setOnItemClickListener((view, position, x, y) -> {
|
2022-01-17 08:45:37 +01:00
|
|
|
AbstractConfigCell a = cellGroup.rows.get(position);
|
|
|
|
if (a instanceof ConfigCellTextCheck) {
|
|
|
|
((ConfigCellTextCheck) a).onClick((TextCheckCell) view);
|
|
|
|
} else if (a instanceof ConfigCellSelectBox) {
|
|
|
|
((ConfigCellSelectBox) a).onClick(view);
|
|
|
|
} else if (a instanceof ConfigCellTextInput) {
|
|
|
|
((ConfigCellTextInput) a).onClick();
|
|
|
|
} else if (a instanceof ConfigCellTextDetail) {
|
|
|
|
RecyclerListView.OnItemClickListener o = ((ConfigCellTextDetail) a).onItemClickListener;
|
2021-10-29 07:52:52 +02:00
|
|
|
if (o != null) {
|
|
|
|
try {
|
|
|
|
o.onItemClick(view, position);
|
|
|
|
} catch (Exception e) {
|
|
|
|
}
|
2020-05-28 09:29:33 +02:00
|
|
|
}
|
2022-01-17 08:45:37 +01:00
|
|
|
} else if (a instanceof ConfigCellCustom) { // Custom onclick
|
2021-11-10 18:24:03 +01:00
|
|
|
if (position == cellGroup.rows.indexOf(maxRecentStickerCountRow)) {
|
2021-10-29 07:52:52 +02:00
|
|
|
final int[] counts = {20, 30, 40, 50, 80, 100, 120, 150, 180, 200};
|
|
|
|
List<String> types = Arrays.stream(counts)
|
|
|
|
.filter(i -> i <= getMessagesController().maxRecentStickersCount)
|
|
|
|
.mapToObj(String::valueOf)
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
PopupBuilder builder = new PopupBuilder(view);
|
|
|
|
builder.setItems(types, (i, str) -> {
|
2022-01-17 08:45:37 +01:00
|
|
|
NekoConfig.maxRecentStickerCount.setConfigInt(Integer.parseInt(str.toString()));
|
2021-10-29 07:52:52 +02:00
|
|
|
listAdapter.notifyItemChanged(position);
|
|
|
|
return Unit.INSTANCE;
|
|
|
|
});
|
|
|
|
builder.show();
|
2020-05-28 09:29:33 +02:00
|
|
|
}
|
2021-10-29 07:52:52 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Cells: Set OnSettingChanged Callbacks
|
2021-11-10 18:24:03 +01:00
|
|
|
cellGroup.callBackSettingsChanged = (key, newValue) -> {
|
2022-01-17 08:45:37 +01:00
|
|
|
if (key.equals(NekoConfig.hideAllTab.getKey())) {
|
2020-05-28 09:29:33 +02:00
|
|
|
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated);
|
2022-01-17 08:45:37 +01:00
|
|
|
} else if (key.equals(NekoConfig.pressTitleToOpenAllChats.getKey())) {
|
2021-04-25 09:40:52 +02:00
|
|
|
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated);
|
2022-01-17 08:45:37 +01:00
|
|
|
} else if (key.equals(NekoConfig.tabsTitleType.getKey())) {
|
2021-10-29 07:52:52 +02:00
|
|
|
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated);
|
2022-01-17 08:45:37 +01:00
|
|
|
} else if (key.equals(NekoConfig.disableProximityEvents.getKey())) {
|
2020-07-31 17:47:36 +02:00
|
|
|
MediaController.getInstance().recreateProximityWakeLock();
|
2022-01-17 08:45:37 +01:00
|
|
|
} else if (key.equals(NekoConfig.showSeconds.getKey())) {
|
2021-11-21 16:27:45 +01:00
|
|
|
tooltip.showWithAction(0, UndoView.ACTION_NEED_RESATRT, null, null);
|
2020-05-28 09:29:33 +02:00
|
|
|
}
|
2021-10-29 07:52:52 +02:00
|
|
|
};
|
2020-05-28 09:29:33 +02:00
|
|
|
|
2021-10-30 04:29:17 +02:00
|
|
|
//Cells: Set ListAdapter
|
2021-11-10 18:24:03 +01:00
|
|
|
cellGroup.setListAdapter(listView, listAdapter);
|
2021-10-30 04:29:17 +02:00
|
|
|
|
2021-11-21 16:27:45 +01:00
|
|
|
tooltip = new UndoView(context);
|
|
|
|
frameLayout.addView(tooltip, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.BOTTOM | Gravity.LEFT, 8, 0, 8, 8));
|
|
|
|
|
2020-05-28 09:29:33 +02:00
|
|
|
return fragmentView;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
if (listAdapter != null) {
|
|
|
|
listAdapter.notifyDataSetChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void updateRows() {
|
|
|
|
if (listAdapter != null) {
|
|
|
|
listAdapter.notifyDataSetChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ArrayList<ThemeDescription> getThemeDescriptions() {
|
|
|
|
ArrayList<ThemeDescription> themeDescriptions = new ArrayList<>();
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[]{EmptyCell.class, TextSettingsCell.class, TextCheckCell.class, HeaderCell.class, TextDetailSettingsCell.class, NotificationsCheckCell.class}, null, null, null, Theme.key_windowBackgroundWhite));
|
|
|
|
themeDescriptions.add(new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundGray));
|
|
|
|
|
|
|
|
themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_avatar_backgroundActionBarBlue));
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_LISTGLOWCOLOR, null, null, null, null, Theme.key_avatar_backgroundActionBarBlue));
|
|
|
|
themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_avatar_actionBarIconBlue));
|
|
|
|
themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_actionBarDefaultTitle));
|
|
|
|
themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_avatar_actionBarSelectorBlue));
|
|
|
|
themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SUBMENUBACKGROUND, null, null, null, null, Theme.key_actionBarDefaultSubmenuBackground));
|
|
|
|
themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SUBMENUITEM, null, null, null, null, Theme.key_actionBarDefaultSubmenuItem));
|
|
|
|
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector));
|
|
|
|
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{View.class}, Theme.dividerPaint, null, null, Theme.key_divider));
|
|
|
|
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{ShadowSectionCell.class}, null, null, null, Theme.key_windowBackgroundGrayShadow));
|
|
|
|
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{TextSettingsCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{TextSettingsCell.class}, new String[]{"valueTextView"}, null, null, null, Theme.key_windowBackgroundWhiteValueText));
|
|
|
|
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{NotificationsCheckCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{NotificationsCheckCell.class}, new String[]{"valueTextView"}, null, null, null, Theme.key_windowBackgroundWhiteGrayText2));
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{NotificationsCheckCell.class}, new String[]{"checkBox"}, null, null, null, Theme.key_switchTrack));
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{NotificationsCheckCell.class}, new String[]{"checkBox"}, null, null, null, Theme.key_switchTrackChecked));
|
|
|
|
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{TextCheckCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{TextCheckCell.class}, new String[]{"valueTextView"}, null, null, null, Theme.key_windowBackgroundWhiteGrayText2));
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{TextCheckCell.class}, new String[]{"checkBox"}, null, null, null, Theme.key_switchTrack));
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{TextCheckCell.class}, new String[]{"checkBox"}, null, null, null, Theme.key_switchTrackChecked));
|
|
|
|
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{HeaderCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader));
|
|
|
|
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{TextDetailSettingsCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
|
|
|
|
themeDescriptions.add(new ThemeDescription(listView, 0, new Class[]{TextDetailSettingsCell.class}, new String[]{"valueTextView"}, null, null, null, Theme.key_windowBackgroundWhiteGrayText2));
|
|
|
|
|
|
|
|
return themeDescriptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
private void showMessageMenuAlert() {
|
|
|
|
if (getParentActivity() == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Context context = getParentActivity();
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
|
|
|
builder.setTitle(LocaleController.getString("MessageMenu", R.string.MessageMenu));
|
|
|
|
|
|
|
|
LinearLayout linearLayout = new LinearLayout(context);
|
|
|
|
linearLayout.setOrientation(LinearLayout.VERTICAL);
|
|
|
|
|
|
|
|
LinearLayout linearLayoutInviteContainer = new LinearLayout(context);
|
|
|
|
linearLayoutInviteContainer.setOrientation(LinearLayout.VERTICAL);
|
|
|
|
linearLayout.addView(linearLayoutInviteContainer, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
|
|
|
|
|
2021-12-16 09:23:20 +01:00
|
|
|
int count = NekoXConfig.developerMode ? 11 : 10;
|
2020-05-28 09:29:33 +02:00
|
|
|
for (int a = 0; a < count; a++) {
|
|
|
|
TextCheckCell textCell = new TextCheckCell(context);
|
|
|
|
switch (a) {
|
|
|
|
case 0: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("DeleteDownloadedFile", R.string.DeleteDownloadedFile), NekoConfig.showDeleteDownloadedFile.Bool(), false);
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("AddToSavedMessages", R.string.AddToSavedMessages), NekoConfig.showAddToSavedMessages.Bool(), false);
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("Repeat", R.string.Repeat), NekoConfig.showRepeat.Bool(), false);
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 3: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("ViewHistory", R.string.ViewHistory), NekoConfig.showViewHistory.Bool(), false);
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2020-06-25 17:25:38 +02:00
|
|
|
case 4: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("Translate", R.string.Translate), NekoConfig.showTranslate.Bool(), false);
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2020-06-25 17:25:38 +02:00
|
|
|
case 5: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("ReportChat", R.string.ReportChat), NekoConfig.showReport.Bool(), false);
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2020-06-25 17:25:38 +02:00
|
|
|
case 6: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("EditAdminRights", R.string.EditAdminRights), NekoConfig.showAdminActions.Bool(), false);
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2020-06-25 17:25:38 +02:00
|
|
|
case 7: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("ChangePermissions", R.string.ChangePermissions), NekoConfig.showChangePermissions.Bool(), false);
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2020-06-25 17:25:38 +02:00
|
|
|
case 8: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("Hide", R.string.Hide), NekoConfig.showMessageHide.Bool(), false);
|
2021-04-13 06:51:17 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 9: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("ShareMessages", R.string.ShareMessages), NekoConfig.showShareMessages.Bool(), false);
|
2021-12-16 09:23:20 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 10: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndCheck(LocaleController.getString("MessageDetails", R.string.MessageDetails), NekoConfig.showMessageDetails.Bool(), false);
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
textCell.setTag(a);
|
|
|
|
textCell.setBackground(Theme.getSelectorDrawable(false));
|
|
|
|
linearLayoutInviteContainer.addView(textCell, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
|
|
|
|
textCell.setOnClickListener(v2 -> {
|
|
|
|
Integer tag = (Integer) v2.getTag();
|
|
|
|
switch (tag) {
|
|
|
|
case 0: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showDeleteDownloadedFile.toggleConfigBool());
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showAddToSavedMessages.toggleConfigBool());
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showRepeat.toggleConfigBool());
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 3: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showViewHistory.toggleConfigBool());
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2020-06-25 17:25:38 +02:00
|
|
|
case 4: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showTranslate.toggleConfigBool());
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2020-06-25 17:25:38 +02:00
|
|
|
case 5: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showReport.toggleConfigBool());
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2020-06-25 17:25:38 +02:00
|
|
|
case 6: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showAdminActions.toggleConfigBool());
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2020-06-25 17:25:38 +02:00
|
|
|
case 7: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showChangePermissions.toggleConfigBool());
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
2020-06-25 17:25:38 +02:00
|
|
|
case 8: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showMessageHide.toggleConfigBool());
|
2021-04-13 06:51:17 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 9: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showShareMessages.toggleConfigBool());
|
2021-12-16 09:23:20 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 10: {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setChecked(NekoConfig.showMessageDetails.toggleConfigBool());
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
|
|
|
|
builder.setView(linearLayout);
|
|
|
|
showDialog(builder.create());
|
|
|
|
}
|
|
|
|
|
2020-06-14 06:02:04 +02:00
|
|
|
@Override
|
|
|
|
public void didReceivedNotification(int id, int account, Object... args) {
|
2021-06-25 18:02:05 +02:00
|
|
|
/* if (id == NotificationCenter.emojiDidLoad) {
|
2020-06-14 06:02:04 +02:00
|
|
|
if (listView != null) {
|
|
|
|
listView.invalidateViews();
|
|
|
|
}
|
2021-06-25 18:02:05 +02:00
|
|
|
}*/
|
2020-06-14 06:02:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onFragmentDestroy() {
|
|
|
|
super.onFragmentDestroy();
|
2021-06-25 18:02:05 +02:00
|
|
|
// NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.emojiDidLoad);
|
2020-06-14 06:02:04 +02:00
|
|
|
}
|
|
|
|
|
2020-05-28 09:29:33 +02:00
|
|
|
private class StickerSizeCell extends FrameLayout {
|
|
|
|
|
2021-11-10 18:24:03 +01:00
|
|
|
private final StickerSizePreviewMessagesCell messagesCell;
|
|
|
|
private final SeekBarView sizeBar;
|
|
|
|
private final int startStickerSize = 2;
|
|
|
|
private final int endStickerSize = 20;
|
2020-05-28 09:29:33 +02:00
|
|
|
|
2021-11-10 18:24:03 +01:00
|
|
|
private final TextPaint textPaint;
|
2020-05-28 09:29:33 +02:00
|
|
|
|
|
|
|
public StickerSizeCell(Context context) {
|
|
|
|
super(context);
|
|
|
|
|
|
|
|
setWillNotDraw(false);
|
|
|
|
|
|
|
|
textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
|
|
|
|
textPaint.setTextSize(AndroidUtilities.dp(16));
|
|
|
|
|
|
|
|
sizeBar = new SeekBarView(context);
|
|
|
|
sizeBar.setReportChanges(true);
|
|
|
|
sizeBar.setDelegate(new SeekBarView.SeekBarViewDelegate() {
|
|
|
|
@Override
|
|
|
|
public void onSeekBarDrag(boolean stop, float progress) {
|
2022-01-17 08:45:37 +01:00
|
|
|
NekoConfig.stickerSize.setConfigFloat(startStickerSize + (endStickerSize - startStickerSize) * progress);
|
2020-05-28 09:29:33 +02:00
|
|
|
StickerSizeCell.this.invalidate();
|
|
|
|
menuItem.setVisibility(View.VISIBLE);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSeekBarPressed(boolean pressed) {
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
addView(sizeBar, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 38, Gravity.LEFT | Gravity.TOP, 9, 5, 43, 11));
|
|
|
|
|
|
|
|
messagesCell = new StickerSizePreviewMessagesCell(context, parentLayout);
|
|
|
|
addView(messagesCell, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 0, 53, 0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onDraw(Canvas canvas) {
|
|
|
|
textPaint.setColor(Theme.getColor(Theme.key_windowBackgroundWhiteValueText));
|
2022-01-17 08:45:37 +01:00
|
|
|
canvas.drawText("" + Math.round(NekoConfig.stickerSize.Float()), getMeasuredWidth() - AndroidUtilities.dp(39), AndroidUtilities.dp(28), textPaint);
|
2020-05-28 09:29:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
|
|
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
2022-01-17 08:45:37 +01:00
|
|
|
sizeBar.setProgress((NekoConfig.stickerSize.Float() - startStickerSize) / (float) (endStickerSize - startStickerSize));
|
2020-05-28 09:29:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void invalidate() {
|
|
|
|
super.invalidate();
|
|
|
|
messagesCell.invalidate();
|
|
|
|
sizeBar.invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-29 07:52:52 +02:00
|
|
|
//impl ListAdapter
|
2020-05-28 09:29:33 +02:00
|
|
|
private class ListAdapter extends RecyclerListView.SelectionAdapter {
|
|
|
|
|
2021-11-10 18:24:03 +01:00
|
|
|
private final Context mContext;
|
2020-05-28 09:29:33 +02:00
|
|
|
|
|
|
|
public ListAdapter(Context context) {
|
|
|
|
mContext = context;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getItemCount() {
|
2021-11-10 18:24:03 +01:00
|
|
|
return cellGroup.rows.size();
|
2021-10-29 07:52:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isEnabled(RecyclerView.ViewHolder holder) {
|
|
|
|
int position = holder.getAdapterPosition();
|
2022-01-17 08:45:37 +01:00
|
|
|
AbstractConfigCell a = cellGroup.rows.get(position);
|
2021-10-29 07:52:52 +02:00
|
|
|
if (a != null) {
|
|
|
|
return a.isEnabled();
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getItemViewType(int position) {
|
2022-01-17 08:45:37 +01:00
|
|
|
AbstractConfigCell a = cellGroup.rows.get(position);
|
2021-10-29 07:52:52 +02:00
|
|
|
if (a != null) {
|
|
|
|
return a.getType();
|
|
|
|
}
|
2021-11-10 18:24:03 +01:00
|
|
|
return CellGroup.ITEM_TYPE_TEXT_DETAIL;
|
2020-05-28 09:29:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
|
2022-01-17 08:45:37 +01:00
|
|
|
AbstractConfigCell a = cellGroup.rows.get(position);
|
2021-10-29 07:52:52 +02:00
|
|
|
if (a != null) {
|
2022-01-17 08:45:37 +01:00
|
|
|
if (a instanceof ConfigCellCustom) {
|
2021-10-29 07:52:52 +02:00
|
|
|
// Custom binds
|
|
|
|
if (holder.itemView instanceof TextSettingsCell) {
|
|
|
|
TextSettingsCell textCell = (TextSettingsCell) holder.itemView;
|
2021-11-10 18:24:03 +01:00
|
|
|
if (position == cellGroup.rows.indexOf(maxRecentStickerCountRow)) {
|
2022-01-17 08:45:37 +01:00
|
|
|
textCell.setTextAndValue(LocaleController.getString("maxRecentStickerCount", R.string.maxRecentStickerCount), String.valueOf(NekoConfig.maxRecentStickerCount.Int()), true);
|
2020-05-28 09:29:33 +02:00
|
|
|
}
|
|
|
|
}
|
2021-10-29 07:52:52 +02:00
|
|
|
} else {
|
|
|
|
// Default binds
|
|
|
|
a.onBindViewHolder(holder);
|
2020-05-28 09:29:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
|
|
|
View view = null;
|
|
|
|
switch (viewType) {
|
2021-11-10 18:24:03 +01:00
|
|
|
case CellGroup.ITEM_TYPE_DIVIDER:
|
2020-05-28 09:29:33 +02:00
|
|
|
view = new ShadowSectionCell(mContext);
|
|
|
|
break;
|
2021-11-10 18:24:03 +01:00
|
|
|
case CellGroup.ITEM_TYPE_TEXT_SETTINGS_CELL:
|
2020-05-28 09:29:33 +02:00
|
|
|
view = new TextSettingsCell(mContext);
|
|
|
|
view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
|
|
|
break;
|
2021-11-10 18:24:03 +01:00
|
|
|
case CellGroup.ITEM_TYPE_TEXT_CHECK:
|
2020-05-28 09:29:33 +02:00
|
|
|
view = new TextCheckCell(mContext);
|
|
|
|
view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
|
|
|
break;
|
2021-11-10 18:24:03 +01:00
|
|
|
case CellGroup.ITEM_TYPE_HEADER:
|
2020-05-28 09:29:33 +02:00
|
|
|
view = new HeaderCell(mContext);
|
|
|
|
view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
|
|
|
break;
|
2021-11-10 18:24:03 +01:00
|
|
|
case CellGroup.ITEM_TYPE_TEXT_DETAIL:
|
2020-05-28 09:29:33 +02:00
|
|
|
view = new TextDetailSettingsCell(mContext);
|
|
|
|
view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
|
|
|
break;
|
2021-11-10 18:24:03 +01:00
|
|
|
case CellGroup.ITEM_TYPE_TEXT:
|
2020-05-28 09:29:33 +02:00
|
|
|
view = new TextInfoPrivacyCell(mContext);
|
2021-10-29 07:52:52 +02:00
|
|
|
// view.setBackground(Theme.getThemedDrawable(mContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow));
|
2020-05-28 09:29:33 +02:00
|
|
|
break;
|
2021-10-29 07:52:52 +02:00
|
|
|
case 998:
|
2020-05-28 09:29:33 +02:00
|
|
|
view = stickerSizeCell = new StickerSizeCell(mContext);
|
|
|
|
view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
//noinspection ConstantConditions
|
|
|
|
view.setLayoutParams(new RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT));
|
|
|
|
return new RecyclerListView.Holder(view);
|
|
|
|
}
|
|
|
|
}
|
2021-10-29 07:52:52 +02:00
|
|
|
}
|