mirror of https://github.com/NekoX-Dev/NekoX.git
415 lines
23 KiB
Java
415 lines
23 KiB
Java
package tw.nekomimi.nekogram.settings;
|
|
|
|
import android.animation.Animator;
|
|
import android.animation.AnimatorListenerAdapter;
|
|
import android.animation.AnimatorSet;
|
|
import android.annotation.SuppressLint;
|
|
import android.content.Context;
|
|
import android.view.Gravity;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.WindowManager;
|
|
import android.widget.FrameLayout;
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
import org.telegram.messenger.AndroidUtilities;
|
|
import org.telegram.messenger.BuildConfig;
|
|
import org.telegram.messenger.LocaleController;
|
|
import org.telegram.messenger.R;
|
|
import org.telegram.messenger.SharedConfig;
|
|
import org.telegram.tgnet.TLRPC;
|
|
import org.telegram.ui.ActionBar.ActionBar;
|
|
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.AlertsCreator;
|
|
import org.telegram.ui.Components.LayoutHelper;
|
|
import org.telegram.ui.Components.RecyclerListView;
|
|
import org.telegram.ui.Components.UndoView;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import tw.nekomimi.nekogram.NekoConfig;
|
|
import tw.nekomimi.nekogram.NekoXConfig;
|
|
|
|
@SuppressLint("RtlHardcoded")
|
|
public class NekoExperimentalSettingsActivity extends BaseFragment {
|
|
|
|
private RecyclerListView listView;
|
|
private ListAdapter listAdapter;
|
|
private AnimatorSet animatorSet;
|
|
|
|
private boolean sensitiveCanChange = false;
|
|
private boolean sensitiveEnabled = false;
|
|
|
|
private int rowCount;
|
|
|
|
private int experimentRow;
|
|
private int smoothKeyboardRow;
|
|
private int increaseVoiceMessageQualityRow;
|
|
private int mediaPreviewRow;
|
|
private int proxyAutoSwitchRow;
|
|
private int disableFilteringRow;
|
|
private int ignoreContentRestrictionsRow;
|
|
private int unlimitedFavedStickersRow;
|
|
private int unlimitedPinnedDialogsRow;
|
|
private int enableStickerPinRow;
|
|
private int experiment2Row;
|
|
|
|
private UndoView tooltip;
|
|
|
|
@Override
|
|
public boolean onFragmentCreate() {
|
|
super.onFragmentCreate();
|
|
|
|
updateRows();
|
|
|
|
return true;
|
|
}
|
|
|
|
@SuppressLint("NewApi")
|
|
@Override
|
|
public View createView(Context context) {
|
|
actionBar.setBackButtonImage(R.drawable.ic_ab_back);
|
|
actionBar.setTitle(LocaleController.getString("Experiment", R.string.Experiment));
|
|
|
|
if (AndroidUtilities.isTablet()) {
|
|
actionBar.setOccupyStatusBar(false);
|
|
}
|
|
actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
|
|
@Override
|
|
public void onItemClick(int id) {
|
|
if (id == -1) {
|
|
finishFragment();
|
|
}
|
|
}
|
|
});
|
|
|
|
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);
|
|
listView.setOnItemClickListener((view, position, x, y) -> {
|
|
if (position == disableFilteringRow) {
|
|
sensitiveEnabled = !sensitiveEnabled;
|
|
TLRPC.TL_account_setContentSettings req = new TLRPC.TL_account_setContentSettings();
|
|
req.sensitive_enabled = sensitiveEnabled;
|
|
AlertDialog progressDialog = new AlertDialog(getParentActivity(), 3);
|
|
progressDialog.show();
|
|
getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
|
progressDialog.dismiss();
|
|
if (error == null) {
|
|
if (response instanceof TLRPC.TL_boolTrue && view instanceof TextCheckCell) {
|
|
((TextCheckCell) view).setChecked(sensitiveEnabled);
|
|
}
|
|
} else {
|
|
AndroidUtilities.runOnUIThread(() -> AlertsCreator.processError(currentAccount, error, this, req));
|
|
}
|
|
}));
|
|
} else if (position == ignoreContentRestrictionsRow) {
|
|
NekoConfig.toggleIgnoreContentRestrictions();
|
|
if (view instanceof TextCheckCell) {
|
|
((TextCheckCell) view).setChecked(NekoConfig.ignoreContentRestrictions);
|
|
}
|
|
} else if (position == unlimitedFavedStickersRow) {
|
|
NekoConfig.toggleUnlimitedFavedStickers();
|
|
if (view instanceof TextCheckCell) {
|
|
((TextCheckCell) view).setChecked(NekoConfig.unlimitedFavedStickers);
|
|
}
|
|
} else if (position == smoothKeyboardRow) {
|
|
SharedConfig.toggleSmoothKeyboard();
|
|
if (view instanceof TextCheckCell) {
|
|
((TextCheckCell) view).setChecked(SharedConfig.smoothKeyboard);
|
|
}
|
|
if (SharedConfig.smoothKeyboard && getParentActivity() != null) {
|
|
getParentActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
|
}
|
|
if (SharedConfig.smoothKeyboard) {
|
|
tooltip.setInfoText(AndroidUtilities.replaceTags(LocaleController.formatString("BetaWarning", R.string.BetaWarning)));
|
|
tooltip.showWithAction(0, UndoView.ACTION_CACHE_WAS_CLEARED, null, null);
|
|
}
|
|
} else if (position == unlimitedPinnedDialogsRow) {
|
|
NekoConfig.toggleUnlimitedPinnedDialogs();
|
|
if (view instanceof TextCheckCell) {
|
|
((TextCheckCell) view).setChecked(NekoConfig.unlimitedPinnedDialogs);
|
|
}
|
|
} else if (position == mediaPreviewRow) {
|
|
NekoConfig.toggleMediaPreview();
|
|
if (view instanceof TextCheckCell) {
|
|
((TextCheckCell) view).setChecked(NekoConfig.mediaPreview);
|
|
}
|
|
if (NekoConfig.mediaPreview) {
|
|
tooltip.setInfoText(AndroidUtilities.replaceTags(LocaleController.formatString("BetaWarning", R.string.BetaWarning)));
|
|
tooltip.showWithAction(0, UndoView.ACTION_CACHE_WAS_CLEARED, null, null);
|
|
}
|
|
} else if (position == proxyAutoSwitchRow) {
|
|
NekoConfig.toggleProxyAutoSwitch();
|
|
if (view instanceof TextCheckCell) {
|
|
((TextCheckCell) view).setChecked(NekoConfig.proxyAutoSwitch);
|
|
}
|
|
} else if (position == increaseVoiceMessageQualityRow) {
|
|
NekoConfig.toggleIncreaseVoiceMessageQuality();
|
|
if (view instanceof TextCheckCell) {
|
|
((TextCheckCell) view).setChecked(NekoConfig.increaseVoiceMessageQuality);
|
|
}
|
|
tooltip.showWithAction(0, UndoView.ACTION_NEED_RESATRT, null, null);
|
|
} else if (position == enableStickerPinRow) {
|
|
NekoXConfig.toggleEnableStickerPin();
|
|
if (view instanceof TextCheckCell) {
|
|
((TextCheckCell) view).setChecked(NekoXConfig.enableStickerPin);
|
|
}
|
|
if (NekoConfig.mediaPreview) {
|
|
tooltip.setInfoText(AndroidUtilities.replaceTags(LocaleController.formatString("EnableStickerPinTip", R.string.EnableStickerPinTip)));
|
|
tooltip.showWithAction(0, UndoView.ACTION_CACHE_WAS_CLEARED, null, null);
|
|
}
|
|
}
|
|
});
|
|
|
|
tooltip = new UndoView(context);
|
|
frameLayout.addView(tooltip, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.BOTTOM | Gravity.LEFT, 8, 0, 8, 8));
|
|
|
|
return fragmentView;
|
|
}
|
|
|
|
@Override
|
|
public void onResume() {
|
|
super.onResume();
|
|
if (listAdapter != null) {
|
|
checkSensitive();
|
|
listAdapter.notifyDataSetChanged();
|
|
}
|
|
}
|
|
|
|
private void updateRows() {
|
|
rowCount = 0;
|
|
|
|
experimentRow = rowCount++;
|
|
smoothKeyboardRow = !AndroidUtilities.isTablet() ? rowCount++ : -1;
|
|
increaseVoiceMessageQualityRow = rowCount++;
|
|
mediaPreviewRow = rowCount++;
|
|
proxyAutoSwitchRow = rowCount++;
|
|
disableFilteringRow = rowCount++;
|
|
ignoreContentRestrictionsRow = !BuildConfig.VERSION_NAME.contains("play") || NekoXConfig.developerMode ? rowCount++ : -1;
|
|
unlimitedFavedStickersRow = rowCount++;
|
|
unlimitedPinnedDialogsRow = rowCount++;
|
|
enableStickerPinRow = rowCount++;
|
|
experiment2Row = rowCount++;
|
|
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 checkSensitive() {
|
|
TLRPC.TL_account_getContentSettings req = new TLRPC.TL_account_getContentSettings();
|
|
getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
|
if (error == null) {
|
|
TLRPC.TL_account_contentSettings settings = (TLRPC.TL_account_contentSettings) response;
|
|
sensitiveEnabled = settings.sensitive_enabled;
|
|
sensitiveCanChange = settings.sensitive_can_change;
|
|
int count = listView.getChildCount();
|
|
ArrayList<Animator> animators = new ArrayList<>();
|
|
for (int a = 0; a < count; a++) {
|
|
View child = listView.getChildAt(a);
|
|
RecyclerListView.Holder holder = (RecyclerListView.Holder) listView.getChildViewHolder(child);
|
|
int position = holder.getAdapterPosition();
|
|
if (position == disableFilteringRow) {
|
|
TextCheckCell checkCell = (TextCheckCell) holder.itemView;
|
|
checkCell.setChecked(sensitiveEnabled);
|
|
checkCell.setEnabled(sensitiveCanChange, animators);
|
|
if (sensitiveCanChange) {
|
|
if (!animators.isEmpty()) {
|
|
if (animatorSet != null) {
|
|
animatorSet.cancel();
|
|
}
|
|
animatorSet = new AnimatorSet();
|
|
animatorSet.playTogether(animators);
|
|
animatorSet.addListener(new AnimatorListenerAdapter() {
|
|
@Override
|
|
public void onAnimationEnd(Animator animator) {
|
|
if (animator.equals(animatorSet)) {
|
|
animatorSet = null;
|
|
}
|
|
}
|
|
});
|
|
animatorSet.setDuration(150);
|
|
animatorSet.start();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
} else {
|
|
AndroidUtilities.runOnUIThread(() -> AlertsCreator.processError(currentAccount, error, this, req));
|
|
}
|
|
}));
|
|
}
|
|
|
|
private class ListAdapter extends RecyclerListView.SelectionAdapter {
|
|
|
|
private Context mContext;
|
|
|
|
public ListAdapter(Context context) {
|
|
mContext = context;
|
|
}
|
|
|
|
@Override
|
|
public int getItemCount() {
|
|
return rowCount;
|
|
}
|
|
|
|
@Override
|
|
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
|
|
switch (holder.getItemViewType()) {
|
|
case 1: {
|
|
if (position == experiment2Row) {
|
|
holder.itemView.setBackground(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
|
|
} else {
|
|
holder.itemView.setBackground(Theme.getThemedDrawable(mContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow));
|
|
}
|
|
break;
|
|
}
|
|
case 3: {
|
|
TextCheckCell textCell = (TextCheckCell) holder.itemView;
|
|
textCell.setEnabled(true, null);
|
|
if (position == disableFilteringRow) {
|
|
textCell.setTextAndValueAndCheck(LocaleController.getString("SensitiveDisableFiltering", R.string.SensitiveDisableFiltering), LocaleController.getString("SensitiveAbout", R.string.SensitiveAbout), sensitiveEnabled, true, true);
|
|
textCell.setEnabled(sensitiveCanChange, null);
|
|
} else if (position == ignoreContentRestrictionsRow) {
|
|
textCell.setTextAndValueAndCheck(LocaleController.getString("IgnoreContentRestrictions", R.string.IgnoreContentRestrictions), LocaleController.getString("IgnoreContentRestrictionsNotice", R.string.IgnoreContentRestrictionsNotice), NekoConfig.ignoreContentRestrictions, true, true);
|
|
} else if (position == unlimitedFavedStickersRow) {
|
|
textCell.setTextAndValueAndCheck(LocaleController.getString("UnlimitedFavoredStickers", R.string.UnlimitedFavoredStickers), LocaleController.getString("UnlimitedFavoredStickersAbout", R.string.UnlimitedFavoredStickersAbout), NekoConfig.unlimitedFavedStickers, true, true);
|
|
} else if (position == smoothKeyboardRow) {
|
|
textCell.setTextAndCheck(LocaleController.getString("DebugMenuEnableSmoothKeyboard", R.string.DebugMenuEnableSmoothKeyboard), SharedConfig.smoothKeyboard, true);
|
|
} else if (position == unlimitedPinnedDialogsRow) {
|
|
textCell.setTextAndValueAndCheck(LocaleController.getString("UnlimitedPinnedDialogs", R.string.UnlimitedPinnedDialogs), LocaleController.getString("UnlimitedPinnedDialogsAbout", R.string.UnlimitedPinnedDialogsAbout), NekoConfig.unlimitedPinnedDialogs, true, false);
|
|
} else if (position == mediaPreviewRow) {
|
|
textCell.setTextAndCheck(LocaleController.getString("MediaPreview", R.string.MediaPreview), NekoConfig.mediaPreview, true);
|
|
} else if (position == proxyAutoSwitchRow) {
|
|
textCell.setTextAndCheck(LocaleController.getString("ProxyAutoSwitch", R.string.ProxyAutoSwitch), NekoConfig.proxyAutoSwitch, true);
|
|
} else if (position == increaseVoiceMessageQualityRow) {
|
|
textCell.setTextAndCheck(LocaleController.getString("IncreaseVoiceMessageQuality", R.string.IncreaseVoiceMessageQuality), NekoConfig.increaseVoiceMessageQuality, true);
|
|
} else if (position == enableStickerPinRow) {
|
|
textCell.setTextAndValueAndCheck(LocaleController.getString("EnableStickerPin", R.string.EnableStickerPin), LocaleController.getString("EnableStickerPinAbout", R.string.EnableStickerPinAbout), NekoXConfig.enableStickerPin, true,true);
|
|
}
|
|
break;
|
|
}
|
|
case 4: {
|
|
HeaderCell headerCell = (HeaderCell) holder.itemView;
|
|
if (position == experimentRow) {
|
|
headerCell.setText(LocaleController.getString("Experiment", R.string.Experiment));
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public boolean isEnabled(RecyclerView.ViewHolder holder) {
|
|
int type = holder.getItemViewType();
|
|
return type == 3;
|
|
}
|
|
|
|
@Override
|
|
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
|
View view = null;
|
|
switch (viewType) {
|
|
case 1:
|
|
view = new ShadowSectionCell(mContext);
|
|
break;
|
|
case 3:
|
|
view = new TextCheckCell(mContext);
|
|
view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
|
break;
|
|
case 4:
|
|
view = new HeaderCell(mContext);
|
|
view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
|
break;
|
|
case 5:
|
|
view = new NotificationsCheckCell(mContext);
|
|
view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
|
break;
|
|
case 6:
|
|
view = new TextDetailSettingsCell(mContext);
|
|
view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
|
break;
|
|
case 7:
|
|
view = new TextInfoPrivacyCell(mContext);
|
|
view.setBackground(Theme.getThemedDrawable(mContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow));
|
|
break;
|
|
}
|
|
//noinspection ConstantConditions
|
|
view.setLayoutParams(new RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT));
|
|
return new RecyclerListView.Holder(view);
|
|
}
|
|
|
|
@Override
|
|
public int getItemViewType(int position) {
|
|
if (position == experiment2Row) {
|
|
return 1;
|
|
} else if (position == experimentRow) {
|
|
return 4;
|
|
}
|
|
return 3;
|
|
}
|
|
}
|
|
}
|