fix: Premium Preview
This commit is contained in:
parent
9fff7f9eda
commit
75b4710c72
@ -1086,7 +1086,26 @@ public class PremiumPreviewFragment extends BaseFragment implements Notification
|
|||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
public void updatePremiumTiers() {
|
public void updatePremiumTiers() {
|
||||||
subscriptionTiers.clear();
|
long pricePerYearMax = 0;
|
||||||
|
if (getMediaDataController().getPremiumPromo() != null) {
|
||||||
|
for (TLRPC.TL_premiumSubscriptionOption option : getMediaDataController().getPremiumPromo().period_options) {
|
||||||
|
SubscriptionTier subscriptionTier = new SubscriptionTier(option);
|
||||||
|
subscriptionTiers.add(subscriptionTier);
|
||||||
|
if (subscriptionTier.getPricePerYear() > pricePerYearMax) {
|
||||||
|
pricePerYearMax = subscriptionTier.getPricePerYear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (SubscriptionTier tier : subscriptionTiers) {
|
||||||
|
tier.setPricePerYearRegular(pricePerYearMax);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < subscriptionTiers.size(); i++) {
|
||||||
|
SubscriptionTier tier = subscriptionTiers.get(i);
|
||||||
|
if (tier.getMonths() == 1) {
|
||||||
|
selectedTierIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
// NekoX: remove
|
// NekoX: remove
|
||||||
updateButtonText(false);
|
updateButtonText(false);
|
||||||
tierListView.getAdapter().notifyDataSetChanged();
|
tierListView.getAdapter().notifyDataSetChanged();
|
||||||
|
Loading…
Reference in New Issue
Block a user