[prefs] move some settings to premium section
This commit is contained in:
@@ -28,7 +28,6 @@ import org.telegram.messenger.ApplicationLoader;
|
||||
import org.telegram.messenger.LocaleController;
|
||||
import org.telegram.messenger.R;
|
||||
import org.telegram.messenger.SharedConfig;
|
||||
import org.telegram.messenger.UserConfig;
|
||||
import org.telegram.ui.ActionBar.AlertDialog;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
import org.telegram.ui.Cells.HeaderCell;
|
||||
@@ -49,7 +48,6 @@ public class AppearancePreferencesActivity extends BasePreferencesActivity {
|
||||
|
||||
private ValueAnimator statusBarColorAnimate;
|
||||
private Parcelable recyclerViewState = null;
|
||||
private UserConfig me = UserConfig.getInstance(UserConfig.selectedAccount);
|
||||
|
||||
private int applicationHeaderRow;
|
||||
private int fabShapeRow;
|
||||
@@ -104,7 +102,7 @@ public class AppearancePreferencesActivity extends BasePreferencesActivity {
|
||||
|
||||
drawerHeaderRow = newRow();
|
||||
|
||||
if (me != null && me.isPremium()) statusRow = newRow();
|
||||
statusRow = getUserConfig().isPremium() ? newRow() : -1;
|
||||
newGroupRow = newRow();
|
||||
newSecretChatRow = newRow();
|
||||
newChannelRow = newRow();
|
||||
|
||||
@@ -35,7 +35,6 @@ import org.telegram.messenger.LocaleController;
|
||||
import org.telegram.messenger.NotificationCenter;
|
||||
import org.telegram.messenger.R;
|
||||
import org.telegram.messenger.SharedConfig;
|
||||
import org.telegram.messenger.UserConfig;
|
||||
import org.telegram.ui.ActionBar.ActionBarMenu;
|
||||
import org.telegram.ui.ActionBar.ActionBarMenuItem;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
@@ -57,8 +56,6 @@ public class ChatsPreferencesActivity extends BasePreferencesActivity implements
|
||||
private StickerSizeCell stickerSizeCell;
|
||||
private StickerShapeCell stickerShapeCell;
|
||||
|
||||
private UserConfig me = UserConfig.getInstance(UserConfig.selectedAccount);
|
||||
|
||||
private int stickerSizeHeaderRow;
|
||||
private int stickerSizeRow;
|
||||
|
||||
@@ -69,8 +66,6 @@ public class ChatsPreferencesActivity extends BasePreferencesActivity implements
|
||||
private int stickersHeaderRow;
|
||||
private int hideStickerTimeRow;
|
||||
private int unlimitedRecentStickersRow;
|
||||
private int premiumAutoPlaybackRow;
|
||||
private int hidePremiumStickersTabRow;
|
||||
private int sendMessageBeforeSendStickerRow;
|
||||
private int stickersDividerRow;
|
||||
|
||||
@@ -239,8 +234,6 @@ public class ChatsPreferencesActivity extends BasePreferencesActivity implements
|
||||
stickersHeaderRow = newRow();
|
||||
hideStickerTimeRow = newRow();
|
||||
unlimitedRecentStickersRow = newRow();
|
||||
premiumAutoPlaybackRow = newRow();
|
||||
if (me != null && me.isPremium()) hidePremiumStickersTabRow = newRow();
|
||||
sendMessageBeforeSendStickerRow = newRow();
|
||||
stickersDividerRow = newRow();
|
||||
|
||||
@@ -283,16 +276,6 @@ public class ChatsPreferencesActivity extends BasePreferencesActivity implements
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(ExteraConfig.sendMessageBeforeSendSticker);
|
||||
}
|
||||
} else if (position == premiumAutoPlaybackRow) {
|
||||
ExteraConfig.togglePremiumAutoPlayback();
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(ExteraConfig.premiumAutoPlayback);
|
||||
}
|
||||
} else if (position == hidePremiumStickersTabRow) {
|
||||
ExteraConfig.toggleHidePremiumStickersTab();
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(ExteraConfig.hidePremiumStickersTab);
|
||||
}
|
||||
} else if (position == hideSendAsChannelRow) {
|
||||
ExteraConfig.toggleHideSendAsChannel();
|
||||
if (view instanceof TextCheckCell) {
|
||||
@@ -449,10 +432,6 @@ public class ChatsPreferencesActivity extends BasePreferencesActivity implements
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("StickerTime", R.string.StickerTime), ExteraConfig.hideStickerTime, true);
|
||||
} else if (position == unlimitedRecentStickersRow) {
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("UnlimitedRecentStickers", R.string.UnlimitedRecentStickers), ExteraConfig.unlimitedRecentStickers, true);
|
||||
} else if (position == premiumAutoPlaybackRow) {
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("PremiumAutoPlayback", R.string.PremiumAutoPlayback), ExteraConfig.premiumAutoPlayback, true);
|
||||
} else if (position == hidePremiumStickersTabRow) {
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("HidePremiumStickersTab", R.string.HidePremiumStickersTab), ExteraConfig.hidePremiumStickersTab, true);
|
||||
} else if (position == sendMessageBeforeSendStickerRow) {
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("SendMessageBeforeSendSticker", R.string.SendMessageBeforeSendSticker), ExteraConfig.sendMessageBeforeSendSticker, false);
|
||||
} else if (position == hideSendAsChannelRow) {
|
||||
|
||||
@@ -64,7 +64,6 @@ public class GeneralPreferencesActivity extends BasePreferencesActivity {
|
||||
private int chatsOnTitleRow;
|
||||
private int disableVibrationRow;
|
||||
private int forceTabletModeRow;
|
||||
private int disableAnimatedAvatarsRow;
|
||||
private int generalDividerRow;
|
||||
|
||||
private int profileHeaderRow;
|
||||
@@ -73,6 +72,12 @@ public class GeneralPreferencesActivity extends BasePreferencesActivity {
|
||||
private int hidePhoneNumberRow;
|
||||
private int profileDividerRow;
|
||||
|
||||
private int premiumHeaderRow;
|
||||
private int disableAnimatedAvatarsRow;
|
||||
private int premiumAutoPlaybackRow;
|
||||
private int hidePremiumStickersTabRow;
|
||||
private int premiumDividerRow;
|
||||
|
||||
private int archiveHeaderRow;
|
||||
private int archiveOnPullRow;
|
||||
private int disableUnarchiveSwipeRow;
|
||||
@@ -223,7 +228,6 @@ public class GeneralPreferencesActivity extends BasePreferencesActivity {
|
||||
formatTimeWithSecondsRow = newRow();
|
||||
chatsOnTitleRow = newRow();
|
||||
disableVibrationRow = newRow();
|
||||
disableAnimatedAvatarsRow = newRow();
|
||||
forceTabletModeRow = newRow();
|
||||
generalDividerRow = newRow();
|
||||
|
||||
@@ -233,6 +237,12 @@ public class GeneralPreferencesActivity extends BasePreferencesActivity {
|
||||
showDCRow = newRow();
|
||||
profileDividerRow = newRow();
|
||||
|
||||
premiumHeaderRow = newRow();
|
||||
disableAnimatedAvatarsRow = newRow();
|
||||
premiumAutoPlaybackRow = newRow();
|
||||
hidePremiumStickersTabRow = getUserConfig().isPremium() ? newRow() : -1;
|
||||
premiumDividerRow = newRow();
|
||||
|
||||
archiveHeaderRow = newRow();
|
||||
archiveOnPullRow = newRow();
|
||||
disableUnarchiveSwipeRow = newRow();
|
||||
@@ -314,6 +324,16 @@ public class GeneralPreferencesActivity extends BasePreferencesActivity {
|
||||
((TextCheckCell) view).setChecked(ExteraConfig.showDC);
|
||||
}
|
||||
parentLayout.rebuildAllFragmentViews(false, false);
|
||||
} else if (position == premiumAutoPlaybackRow) {
|
||||
ExteraConfig.togglePremiumAutoPlayback();
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(ExteraConfig.premiumAutoPlayback);
|
||||
}
|
||||
} else if (position == hidePremiumStickersTabRow) {
|
||||
ExteraConfig.toggleHidePremiumStickersTab();
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(ExteraConfig.hidePremiumStickersTab);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,6 +388,8 @@ public class GeneralPreferencesActivity extends BasePreferencesActivity {
|
||||
headerCell.setText(LocaleController.getString("Profile", R.string.Profile));
|
||||
} else if (position == avatarCornersHeaderRow) {
|
||||
headerCell.setText(LocaleController.getString("AvatarCorners", R.string.AvatarCorners));
|
||||
} else if (position == premiumHeaderRow) {
|
||||
headerCell.setText(LocaleController.getString("TelegramPremium", R.string.TelegramPremium));
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
@@ -397,6 +419,10 @@ public class GeneralPreferencesActivity extends BasePreferencesActivity {
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("ShowID", R.string.ShowID), ExteraConfig.showID, true);
|
||||
} else if (position == showDCRow) {
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("ShowDC", R.string.ShowDC), ExteraConfig.showDC, false);
|
||||
} else if (position == premiumAutoPlaybackRow) {
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("PremiumAutoPlayback", R.string.PremiumAutoPlayback), ExteraConfig.premiumAutoPlayback, hidePremiumStickersTabRow != -1);
|
||||
} else if (position == hidePremiumStickersTabRow) {
|
||||
textCheckCell.setTextAndCheck(LocaleController.getString("HidePremiumStickersTab", R.string.HidePremiumStickersTab), ExteraConfig.hidePremiumStickersTab, false);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
@@ -413,9 +439,10 @@ public class GeneralPreferencesActivity extends BasePreferencesActivity {
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (position == generalDividerRow || position == profileDividerRow || position == avatarCornersDividerRow) {
|
||||
if (position == generalDividerRow || position == profileDividerRow || position == avatarCornersDividerRow || position == premiumDividerRow) {
|
||||
return 1;
|
||||
} else if (position == generalHeaderRow || position == archiveHeaderRow || position == profileHeaderRow || position == avatarCornersHeaderRow) {
|
||||
} else if (position == generalHeaderRow || position == archiveHeaderRow || position == profileHeaderRow ||
|
||||
position == premiumHeaderRow || position == avatarCornersHeaderRow) {
|
||||
return 3;
|
||||
} else if (position == forcePacmanAnimationInfoRow) {
|
||||
return 8;
|
||||
|
||||
Reference in New Issue
Block a user