mirror of
https://github.com/FromGram/android.git
synced 2026-11-18 12:31:39 +03:00
update to 12.2.1 (6292)
This commit is contained in:
@@ -59,7 +59,7 @@ public class GiftAuctionController extends BaseController {
|
||||
return;
|
||||
}
|
||||
|
||||
auction.subscription = false;
|
||||
auction.subscription = listeners.has(giftId);
|
||||
if (auction.resubscribe != null) {
|
||||
AndroidUtilities.cancelRunOnUIThread(auction.resubscribe);
|
||||
auction.resubscribe = null;
|
||||
@@ -151,13 +151,6 @@ public class GiftAuctionController extends BaseController {
|
||||
}
|
||||
|
||||
final boolean hasBid = auction.hasBid();
|
||||
if (!hasBid && params == null) {
|
||||
if (whenDone != null) {
|
||||
whenDone.run(false, "NO_PARAMS");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
auction.pendingBid = true;
|
||||
|
||||
|
||||
@@ -175,6 +168,10 @@ public class GiftAuctionController extends BaseController {
|
||||
}
|
||||
invoice.message = params.message;
|
||||
invoice.hide_name = params.hideName;
|
||||
} else if (!hasBid) {
|
||||
// default params
|
||||
invoice.peer = new TLRPC.TL_inputPeerSelf();
|
||||
invoice.hide_name = false;
|
||||
}
|
||||
|
||||
req.invoice = invoice;
|
||||
|
||||
@@ -209,7 +209,7 @@ public class LiteMode {
|
||||
if (!preferences.contains("lite_mode5")) {
|
||||
if (preferences.contains("lite_mode4")) {
|
||||
defaultValue = preferences.getInt("lite_mode4", defaultValue);
|
||||
if (BuildVars.DEBUG_VERSION && SharedConfig.getDevicePerformanceClass() == SharedConfig.PERFORMANCE_CLASS_HIGH) {
|
||||
if (SharedConfig.getDevicePerformanceClass() == SharedConfig.PERFORMANCE_CLASS_HIGH) {
|
||||
defaultValue |= FLAG_LIQUID_GLASS;
|
||||
}
|
||||
preferences.edit().putInt("lite_mode5", defaultValue).apply();
|
||||
|
||||
@@ -4712,7 +4712,7 @@ public class MessageObject {
|
||||
messageText = replaceWithLink(AndroidUtilities.replaceTags(getString(R.string.ActionPrepaidGiftInbound)), "un1", obj);
|
||||
}
|
||||
} else if (UserObject.isService(getDialogId()) && action.from_id == null) {
|
||||
messageText = AndroidUtilities.replaceTags(getString(R.string.ActionGiftSomeone));
|
||||
messageText = AndroidUtilities.replaceTags(getString(action.auction_acquired ? R.string.ActionGiftAuctionSelf : R.string.ActionGiftSomeone));
|
||||
messageTextShort = getString(R.string.ActionStarGift);
|
||||
} else if (isForChannel) {
|
||||
messageText = AndroidUtilities.replaceTags(formatPluralStringComma("ActionGiftChannel", stars));
|
||||
|
||||
@@ -238,7 +238,11 @@ public class ActiveGiftAuctionsHintCell extends BlurredFrameLayout implements Gi
|
||||
}
|
||||
|
||||
private void updateTimer(long value) {
|
||||
textView.setText(AndroidUtilities.formatDurationNoHours((int) value, false), isAttachedToWindow());
|
||||
if (value == 0) {
|
||||
textView.setText(getString(R.string.Gift2AuctionPriceView));
|
||||
} else {
|
||||
textView.setText(AndroidUtilities.formatDurationNoHours((int) value, false), isAttachedToWindow());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package org.telegram.ui.Cells;
|
||||
|
||||
import static org.telegram.messenger.AndroidUtilities.dp;
|
||||
import static org.telegram.messenger.LocaleController.formatNumber;
|
||||
import static org.telegram.messenger.LocaleController.formatPluralStringComma;
|
||||
import static org.telegram.messenger.LocaleController.formatString;
|
||||
import static org.telegram.messenger.LocaleController.getString;
|
||||
@@ -1976,8 +1977,19 @@ public class ChatActionCell extends BaseCell implements DownloadController.FileD
|
||||
}
|
||||
final SpannableStringBuilder sb = new SpannableStringBuilder();
|
||||
final TLObject sender = MessagesController.getInstance(currentAccount).getUserOrChat(fromId);
|
||||
long toId = DialogObject.getPeerDialogId(action.to_id);
|
||||
final TLObject recipient = MessagesController.getInstance(currentAccount).getUserOrChat(toId);
|
||||
final boolean freeUpgrade = action.can_upgrade && !action.converted && action.upgrade_stars > 0 && !action.upgraded;
|
||||
if (self) {
|
||||
if (toId != 0 && action.auction_acquired && recipient != null) {
|
||||
sb.append(getString(R.string.Gift2ActionTitleTo)).append(" ");
|
||||
if (DialogObject.hasPhoto(recipient)) {
|
||||
sb.append("a ");
|
||||
final AvatarSpan avatarSpan = new AvatarSpan(this, currentAccount, 18);
|
||||
avatarSpan.setObject(recipient);
|
||||
sb.setSpan(avatarSpan, sb.length() - 2, sb.length() - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
sb.append(DialogObject.getShortName(recipient));
|
||||
} else if (self) {
|
||||
sb.append(getString(R.string.Gift2ActionSelfTitle));
|
||||
} else {
|
||||
sb.append(LocaleController.getString(action.prepaid_upgrade ? R.string.Gift2ActionUpgradeTitle : R.string.Gift2ActionTitle)).append(" ");
|
||||
@@ -2000,7 +2012,9 @@ public class ChatActionCell extends BaseCell implements DownloadController.FileD
|
||||
MessageObject.addEntitiesToText(title, action.message.entities, false, false, true, true);
|
||||
title = Emoji.replaceEmoji(title, giftTextPaint.getFontMetricsInt(), false, null);
|
||||
title = MessageObject.replaceAnimatedEmoji(title, action.message.entities, giftTextPaint.getFontMetricsInt());
|
||||
} else if (isForChannel) {
|
||||
} else if (action.auction_acquired) {
|
||||
title = formatString(R.string.Gift2ActionWonActionText, formatNumber(action.gift.stars, ','));
|
||||
} else if (isForChannel) {
|
||||
if (action.converted) {
|
||||
title = formatPluralStringComma("Gift2ActionConvertedInfo", (int) stars);
|
||||
} else if (canConvert && stars > 0) {
|
||||
|
||||
@@ -39867,13 +39867,7 @@ public class ChatActivity extends BaseFragment implements
|
||||
|
||||
@Override
|
||||
public void onDiceFinished() {
|
||||
if (fireworksOverlay.isStarted()) {
|
||||
return;
|
||||
}
|
||||
fireworksOverlay.start();
|
||||
try {
|
||||
fireworksOverlay.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
|
||||
} catch (Exception ignored) {};
|
||||
startFireworks();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44280,4 +44274,14 @@ public class ChatActivity extends BaseFragment implements
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void startFireworks() {
|
||||
if (fireworksOverlay == null || fireworksOverlay.isStarted()) {
|
||||
return;
|
||||
}
|
||||
fireworksOverlay.start();
|
||||
try {
|
||||
fireworksOverlay.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
|
||||
} catch (Exception ignored) {};
|
||||
}
|
||||
}
|
||||
+4
@@ -585,6 +585,7 @@ public abstract class BottomSheetWithRecyclerListView extends BottomSheet {
|
||||
return dp(56);
|
||||
}
|
||||
|
||||
protected boolean centerTitle;
|
||||
private boolean restore;
|
||||
protected void preDrawInternal(Canvas canvas, View parent) {
|
||||
restore = false;
|
||||
@@ -642,6 +643,9 @@ public abstract class BottomSheetWithRecyclerListView extends BottomSheet {
|
||||
actionBar.backButtonImageView.setScaleY(t);
|
||||
SimpleTextView titleTextView = actionBar.getTitleTextView();
|
||||
titleTextView.setTranslationX(AndroidUtilities.lerp(dp(21) - titleTextView.getLeft(), 0.0f, t));
|
||||
if (centerTitle) {
|
||||
titleTextView.setTranslationX((actionBar.getMeasuredWidth() - titleTextView.getTextWidth()) / 2f - titleTextView.getLeft());
|
||||
}
|
||||
actionBar.setTranslationY(actionBarY);
|
||||
top -= AndroidUtilities.lerp(0, headerTotalHeight - headerHeight - headerPaddingTop - headerPaddingBottom + dp(13), t);
|
||||
actionBar.getBackground().setBounds(0, AndroidUtilities.lerp(actionBar.getHeight(), 0, t), actionBar.getWidth(), actionBar.getHeight());
|
||||
|
||||
+7
@@ -119,6 +119,13 @@ public class CreateRtmpStreamBottomSheet extends BottomSheetWithRecyclerListView
|
||||
}
|
||||
}
|
||||
|
||||
DefaultItemAnimator itemAnimator = new DefaultItemAnimator();
|
||||
itemAnimator.setSupportsChangeAnimations(false);
|
||||
itemAnimator.setDelayAnimations(false);
|
||||
itemAnimator.setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT);
|
||||
itemAnimator.setDurations(350);
|
||||
recyclerListView.setItemAnimator(itemAnimator);
|
||||
|
||||
recyclerListView.setPadding(backgroundPaddingLeft, 0, backgroundPaddingLeft, hasButton ? dp(hasRevokeButton ? 72 + 52 : 72) : 0);
|
||||
fixNavigationBar();
|
||||
updateTitle();
|
||||
|
||||
@@ -56,6 +56,7 @@ public class AcquiredGiftsSheet extends BottomSheetWithRecyclerListView {
|
||||
super(context, null, false, false, false, false, ActionBarType.SLIDING, resourcesProvider);
|
||||
this.auction = auction;
|
||||
this.gifts = gifts;
|
||||
topPadding = 0.2f;
|
||||
|
||||
ignoreTouchActionBar = false;
|
||||
headerMoveTop = dp(12);
|
||||
|
||||
@@ -36,6 +36,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
|
||||
import org.telegram.messenger.AndroidUtilities;
|
||||
import org.telegram.messenger.DialogObject;
|
||||
import org.telegram.messenger.Emoji;
|
||||
import org.telegram.messenger.FileLog;
|
||||
import org.telegram.messenger.GiftAuctionController;
|
||||
@@ -52,6 +53,7 @@ import org.telegram.ui.ActionBar.AlertDialog;
|
||||
import org.telegram.ui.ActionBar.BaseFragment;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
import org.telegram.ui.Cells.HeaderCell;
|
||||
import org.telegram.ui.ChatActivity;
|
||||
import org.telegram.ui.Components.AnimatedEmojiSpan;
|
||||
import org.telegram.ui.Components.AnimatedTextView;
|
||||
import org.telegram.ui.Components.AvatarDrawable;
|
||||
@@ -63,6 +65,7 @@ import org.telegram.ui.Components.ColoredImageSpan;
|
||||
import org.telegram.ui.Components.CubicBezierInterpolator;
|
||||
import org.telegram.ui.Components.EditTextCaption;
|
||||
import org.telegram.ui.Components.LayoutHelper;
|
||||
import org.telegram.ui.Components.LinkSpanDrawable;
|
||||
import org.telegram.ui.Components.RecyclerListView;
|
||||
import org.telegram.ui.Components.ScaleStateListAnimator;
|
||||
import org.telegram.ui.Components.UItem;
|
||||
@@ -121,6 +124,8 @@ public class AuctionBidSheet extends BottomSheetWithRecyclerListView implements
|
||||
this.auction = auction;
|
||||
this.params = params;
|
||||
this.giftId = auction.giftId;
|
||||
centerTitle = true;
|
||||
topPadding = 0.2f;
|
||||
|
||||
auction = GiftAuctionController.getInstance(currentAccount).subscribeToGiftAuction(giftId, this);
|
||||
timer = new CountdownTimer(this::updateCountdownCell);
|
||||
@@ -190,10 +195,41 @@ public class AuctionBidSheet extends BottomSheetWithRecyclerListView implements
|
||||
horizontalLayout.addView(new View(context), LayoutHelper.createLinear(10, LayoutHelper.MATCH_PARENT, 0f));
|
||||
horizontalLayout.addView(giftsLeftCell, LayoutHelper.createLinear(0, LayoutHelper.MATCH_PARENT, 1f));
|
||||
|
||||
linearLayout.addView(horizontalLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 56, 16, 0, 16, 0));
|
||||
linearLayout.addView(horizontalLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 56, 16, 0, 16, 15));
|
||||
|
||||
if (auction.auctionUserState.acquired_count > 0) {
|
||||
boolean[] pending = new boolean[1];
|
||||
LinkSpanDrawable.LinksTextView itemsBought = new LinkSpanDrawable.LinksTextView(context, resourcesProvider);
|
||||
|
||||
selfBidderHeader = new HeaderCell(context, Theme.key_windowBackgroundWhiteBlueHeader, 21, 15, 0, false, true, resourcesProvider);
|
||||
itemsBought.setGravity(Gravity.CENTER);
|
||||
itemsBought.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
|
||||
itemsBought.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteLinkText, resourcesProvider));
|
||||
itemsBought.setLinkTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteLinkText, resourcesProvider));
|
||||
itemsBought.setOnClickListener((v) -> {
|
||||
if (pending[0]) {
|
||||
return;
|
||||
}
|
||||
pending[0] = true;
|
||||
GiftAuctionController.getInstance(currentAccount).getOrRequestAcquiredGifts(giftId, gifts -> {
|
||||
pending[0] = false;
|
||||
new AcquiredGiftsSheet(getContext(), resourcesProvider, this.auction, gifts).show();
|
||||
});
|
||||
});
|
||||
|
||||
SpannableStringBuilder emoji = new SpannableStringBuilder("*");
|
||||
emoji.setSpan(
|
||||
new AnimatedEmojiSpan(auction.giftDocumentId, itemsBought.getPaint().getFontMetricsInt()),
|
||||
0, emoji.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
);
|
||||
itemsBought.setText(TextUtils.concat(AndroidUtilities.replaceArrows(
|
||||
LocaleController.formatPluralSpannable("Gift2AuctionsItemsBought", auction.auctionUserState.acquired_count, emoji),
|
||||
true, dp(8f / 3f), dp(1))));
|
||||
|
||||
ScaleStateListAnimator.apply(itemsBought, 0.02f, 1.5f);
|
||||
linearLayout.addView(itemsBought, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 16, 4, 16, 4));
|
||||
}
|
||||
|
||||
selfBidderHeader = new HeaderCell(context, Theme.key_windowBackgroundWhiteBlueHeader, 21, 0, 0, false, true, resourcesProvider);
|
||||
linearLayout.addView(selfBidderHeader, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 0, 5, 0, 0));
|
||||
|
||||
selfBidderCell = new BidderCell(context, resourcesProvider);
|
||||
@@ -299,9 +335,9 @@ public class AuctionBidSheet extends BottomSheetWithRecyclerListView implements
|
||||
}
|
||||
*/
|
||||
minimumBid = 50; // Math.min(5000, minimumBid);
|
||||
maximumBid = topBid > 30000 ? 100000 : 50000;
|
||||
maximumBid = topBid > 100_000 ? (((int) topBid * 3 / 2000) * 1000) : (topBid > 30000 ? 100000 : 50000);
|
||||
|
||||
int[] steps_arr = new int[] { 50, 100, 500, 1_000, 2_000, 5_000, 7_500, 10_000, 25_000, 50_000, 100_000 };
|
||||
int[] steps_arr = new int[] { 50, 100, 500, 1_000, 2_000, 5_000, 7_500, 10_000, 25_000, 50_000, 100_000, 500_000, 1_000_000, 5_000_000, 10_000_000 };
|
||||
ArrayList<Integer> steps = new ArrayList<>();
|
||||
boolean wasSkipped = false;
|
||||
for (int i = 0; i < steps_arr.length; ++i) {
|
||||
@@ -336,6 +372,40 @@ public class AuctionBidSheet extends BottomSheetWithRecyclerListView implements
|
||||
slider.setSteps(100, steps_arr);
|
||||
}
|
||||
|
||||
private @Nullable Runnable closeParentSheet;
|
||||
private long lastRecipientDialogId;
|
||||
private long lastAcquiredCount;
|
||||
private boolean isFirstCheck = true;
|
||||
|
||||
private void checkAuctionParams() {
|
||||
final long dialogId = DialogObject.getPeerDialogId(auction.auctionUserState.peer);
|
||||
final long acquiredCount = auction.auctionUserState.acquired_count;
|
||||
|
||||
if (lastAcquiredCount < acquiredCount && !isFirstCheck) {
|
||||
final BaseFragment fragment = LaunchActivity.getLastFragment();
|
||||
if (fragment != null && lastRecipientDialogId != 0) {
|
||||
final ChatActivity chatActivity = ChatActivity.of(lastRecipientDialogId);
|
||||
chatActivity.whenFullyVisible(chatActivity::startFireworks);
|
||||
fragment.presentFragment(chatActivity);
|
||||
if (closeParentSheet != null) {
|
||||
closeParentSheet.run();
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
if (dialogId != 0) {
|
||||
lastRecipientDialogId = dialogId;
|
||||
}
|
||||
|
||||
lastAcquiredCount = acquiredCount;
|
||||
isFirstCheck = false;
|
||||
}
|
||||
|
||||
public void setCloseParentSheet(@Nullable Runnable closeParentSheet) {
|
||||
this.closeParentSheet = closeParentSheet;
|
||||
}
|
||||
|
||||
private final ColoredImageSpan[] refS = new ColoredImageSpan[1];
|
||||
private AnimatedEmojiSpan animatedEmojiSpan;
|
||||
private void updateTable(boolean animated) {
|
||||
@@ -382,10 +452,10 @@ public class AuctionBidSheet extends BottomSheetWithRecyclerListView implements
|
||||
updateSelfBidderHeader(animated);
|
||||
updateButtonText(animated);
|
||||
checkSliderSubText();
|
||||
checkAuctionParams();
|
||||
}
|
||||
|
||||
private void openProfile(long did) {
|
||||
dismiss();
|
||||
final BaseFragment lastFragment = LaunchActivity.getSafeLastFragment();
|
||||
if (lastFragment != null) {
|
||||
if (UserObject.isService(did)) return;
|
||||
@@ -401,6 +471,10 @@ public class AuctionBidSheet extends BottomSheetWithRecyclerListView implements
|
||||
args.putBoolean("open_gifts", true);
|
||||
lastFragment.presentFragment(new ProfileActivity(args));
|
||||
}
|
||||
if (closeParentSheet != null) {
|
||||
closeParentSheet.run();
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
private final BoolAnimator winningColor = new BoolAnimator(0, this::onColorFactorChanged, CubicBezierInterpolator.EASE_OUT_QUINT, 380);
|
||||
@@ -656,7 +730,7 @@ public class AuctionBidSheet extends BottomSheetWithRecyclerListView implements
|
||||
editText.setHintText(getString(R.string.Gift2AuctionPlaceACustomBidHint2));
|
||||
editText.setFocusable(true);
|
||||
editText.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(7)});
|
||||
editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(9)});
|
||||
editText.setLineColors(Theme.getColor(Theme.key_windowBackgroundWhiteInputField, resourcesProvider), Theme.getColor(Theme.key_windowBackgroundWhiteInputFieldActivated, resourcesProvider), Theme.getColor(Theme.key_text_RedRegular, resourcesProvider));
|
||||
editText.setImeOptions(EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
|
||||
editText.setBackgroundDrawable(null);
|
||||
|
||||
@@ -10,6 +10,7 @@ import static org.telegram.ui.Stars.StarGiftSheet.replaceUnderstood;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.ShapeDrawable;
|
||||
import android.graphics.drawable.shapes.OvalShape;
|
||||
import android.text.Layout;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
@@ -31,6 +32,7 @@ import org.telegram.messenger.MessagesController;
|
||||
import org.telegram.messenger.NotificationCenter;
|
||||
import org.telegram.messenger.R;
|
||||
import org.telegram.messenger.UserConfig;
|
||||
import org.telegram.messenger.Utilities;
|
||||
import org.telegram.tgnet.ConnectionsManager;
|
||||
import org.telegram.tgnet.TLObject;
|
||||
import org.telegram.tgnet.tl.TL_stars;
|
||||
@@ -56,6 +58,7 @@ import org.telegram.ui.PremiumFeatureCell;
|
||||
import org.telegram.ui.Stars.StarGiftSheet;
|
||||
import org.telegram.ui.Stars.StarsIntroActivity;
|
||||
import org.telegram.ui.Stories.recorder.ButtonWithCounterView;
|
||||
import org.telegram.ui.Stories.recorder.HintView2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -71,6 +74,7 @@ public class AuctionJoinSheet extends BottomSheetWithRecyclerListView implements
|
||||
private final ButtonSpan.TextViewButtons auctionRowCurrentRoundText;
|
||||
private final ButtonSpan.TextViewButtons auctionRowAveragePriceText;
|
||||
private final ButtonSpan.TextViewButtons auctionRowAvailabilityText;
|
||||
private final Utilities.Callback2<View, CharSequence> showHint;
|
||||
|
||||
private final TableRow auctionRowCurrentRound;
|
||||
private final TableRow auctionRowAveragePrice;
|
||||
@@ -87,10 +91,11 @@ public class AuctionJoinSheet extends BottomSheetWithRecyclerListView implements
|
||||
|
||||
private CharSequence emojiGiftText;
|
||||
|
||||
private AuctionJoinSheet(Context context, Theme.ResourcesProvider resourcesProvider, long dialogId, TL_stars.StarGift starGift) {
|
||||
private AuctionJoinSheet(Context context, Theme.ResourcesProvider resourcesProvider, long dialogId, TL_stars.StarGift starGift, Runnable closeParentSheet) {
|
||||
super(context, null, false, false, false, false, ActionBarType.FADING, resourcesProvider);
|
||||
this.starGift = starGift;
|
||||
this.giftId = starGift.id;
|
||||
topPadding = 0.2f;
|
||||
|
||||
fixNavigationBar();
|
||||
|
||||
@@ -156,13 +161,56 @@ public class AuctionJoinSheet extends BottomSheetWithRecyclerListView implements
|
||||
auctionRowCurrentRound = tableView.addRow(getString(R.string.Gift2AuctionTableCurrentRound), "", ref);
|
||||
auctionRowCurrentRoundText = ref[0];
|
||||
|
||||
final FrameLayout tableLayout = new FrameLayout(getContext());
|
||||
tableLayout.setClipChildren(false);
|
||||
tableLayout.setClipToPadding(false);
|
||||
tableLayout.addView(tableView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.FILL));
|
||||
|
||||
final HintView2[] hintView = new HintView2[1];
|
||||
showHint = (view, text) -> {
|
||||
if (hintView[0] != null) {
|
||||
hintView[0].hide();
|
||||
}
|
||||
text = AndroidUtilities.replaceTags(text);
|
||||
float x = view.getX() + ((View) view.getParent()).getX() + ((View) ((View) view.getParent()).getParent()).getX();
|
||||
float y = view.getY() + ((View) view.getParent()).getY() + ((View) ((View) view.getParent()).getParent()).getY();
|
||||
if (view instanceof ButtonSpan.TextViewButtons) {
|
||||
final ButtonSpan.TextViewButtons textView2 = (ButtonSpan.TextViewButtons) view;
|
||||
final Layout layout = textView2.getLayout();
|
||||
final CharSequence viewText = layout.getText();
|
||||
if (viewText instanceof Spanned) {
|
||||
ButtonSpan[] spans = ((Spanned) viewText).getSpans(0, viewText.length(), ButtonSpan.class);
|
||||
if (spans.length > 0 && spans[0] != null) {
|
||||
final int offset = ((Spanned) viewText).getSpanStart(spans[0]);
|
||||
x += layout.getPrimaryHorizontal(offset) + spans[0].getSize() / 2;
|
||||
y += layout.getLineTop(layout.getLineForOffset(offset));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final HintView2 thisHintView = hintView[0] = new HintView2(getContext(), HintView2.DIRECTION_BOTTOM);
|
||||
thisHintView.setMultilineText(true);
|
||||
thisHintView.setInnerPadding(11, 8, 11, 7);
|
||||
thisHintView.setRounding(10);
|
||||
thisHintView.setText(text);
|
||||
thisHintView.setOnHiddenListener(() -> AndroidUtilities.removeFromParent(thisHintView));
|
||||
thisHintView.setTranslationY(-dp(100) + y);
|
||||
thisHintView.setMaxWidthPx(dp(300));
|
||||
thisHintView.setPadding(dp(4), dp(4), dp(4), dp(4));
|
||||
thisHintView.setJointPx(0, x - dp(4));
|
||||
tableLayout.addView(thisHintView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 100, Gravity.TOP | Gravity.FILL_HORIZONTAL));
|
||||
thisHintView.show();
|
||||
};
|
||||
|
||||
|
||||
auctionRowAveragePrice = tableView.addRow(getString(R.string.GiftValueAveragePrice), "", ref);
|
||||
auctionRowAveragePrice.setOnClickListener(v -> showAveragePriceHint());
|
||||
auctionRowAveragePriceText = ref[0];
|
||||
|
||||
tableView.addRow(getString(R.string.Gift2AuctionTableCurrentAvailability), "", ref);
|
||||
auctionRowAvailabilityText = ref[0];
|
||||
|
||||
linearLayout.addView(tableView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 16, 0, 14, 18));
|
||||
linearLayout.addView(tableLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 16, 0, 14, 18));
|
||||
|
||||
boolean pending[] = new boolean[1];
|
||||
itemsBought = new LinkSpanDrawable.LinksTextView(context, resourcesProvider);
|
||||
@@ -200,16 +248,12 @@ public class AuctionJoinSheet extends BottomSheetWithRecyclerListView implements
|
||||
buttonView = new ButtonWithCounterView(context, resourcesProvider);
|
||||
buttonView.setOnClickListener(v -> {
|
||||
if (auction != null && !auction.isFinished()) {
|
||||
new SendGiftSheet(context, currentAccount, auction.gift, dialogId, () -> {
|
||||
dismiss();
|
||||
}, false, false) {
|
||||
new SendGiftSheet(context, currentAccount, auction.gift, dialogId, closeParentSheet, false, false) {
|
||||
@Override
|
||||
protected BulletinFactory getParentBulletinFactory() {
|
||||
return BulletinFactory.of(this.container, this.resourcesProvider);
|
||||
}
|
||||
}.show();
|
||||
|
||||
// new AuctionBidSheet(context, resourcesProvider, dialogId, auction).show();
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
@@ -226,11 +270,20 @@ public class AuctionJoinSheet extends BottomSheetWithRecyclerListView implements
|
||||
updateTable(false);
|
||||
}
|
||||
|
||||
private void showAveragePriceHint() {
|
||||
if (auction != null && auction.auctionStateFinished != null && auction.gift.title != null) {
|
||||
showHint.run(auctionRowAveragePriceText, formatString(R.string.Gift2AveragePriceHint, auction.auctionStateFinished.average_price, auction.gift.title));
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTable(boolean animated) {
|
||||
if (auction != null && auction.auctionStateFinished != null) {
|
||||
auctionRowStartTimeText.setText(LocaleController.formatDateTime(auction.auctionStateFinished.start_date, true));
|
||||
auctionRowEndTimeText.setText(LocaleController.formatDateTime(auction.auctionStateFinished.end_date, true));
|
||||
auctionRowAveragePriceText.setText(StarsIntroActivity.replaceStarsWithPlain("⭐️ " + LocaleController.formatNumber(auction.auctionStateFinished.average_price, ','), .8f));
|
||||
|
||||
SpannableStringBuilder ssb = new SpannableStringBuilder(StarsIntroActivity.replaceStarsWithPlain("⭐️ " + LocaleController.formatNumber(auction.auctionStateFinished.average_price, ','), .8f));
|
||||
ssb.append(" ").append(ButtonSpan.make("?", this::showAveragePriceHint, resourcesProvider));
|
||||
auctionRowAveragePriceText.setText(ssb);
|
||||
} else if (auction != null && auction.auctionStateActive != null) {
|
||||
auctionRowStartTimeText.setText(LocaleController.formatDateTime(auction.auctionStateActive.start_date, true));
|
||||
auctionRowEndTimeText.setText(LocaleController.formatDateTime(auction.auctionStateActive.end_date, true));
|
||||
@@ -244,7 +297,11 @@ public class AuctionJoinSheet extends BottomSheetWithRecyclerListView implements
|
||||
buttonView.setSubText(formatString(R.string.Gift2AuctionTimeLeft, LocaleController.formatTTLString(timeLeft)), animated);
|
||||
}
|
||||
|
||||
auctionRowAvailabilityText.setText(formatPluralString("Gift2Availability4Value", starGift.availability_remains,
|
||||
|
||||
|
||||
auctionRowAvailabilityText.setText(formatPluralString("Gift2Availability4Value",
|
||||
auction != null ? (auction.isFinished() ? 0 : auction.auctionStateActive != null ? auction.auctionStateActive.gifts_left : starGift.availability_remains):
|
||||
starGift.availability_remains,
|
||||
formatNumber(starGift.availability_total, ',')));
|
||||
|
||||
|
||||
@@ -391,10 +448,11 @@ public class AuctionJoinSheet extends BottomSheetWithRecyclerListView implements
|
||||
Theme.ResourcesProvider resourcesProvider,
|
||||
int currentAccount,
|
||||
long dialogId,
|
||||
long giftId) {
|
||||
long giftId,
|
||||
Runnable closeParentSheet) {
|
||||
GiftAuctionController.getInstance(currentAccount).getOrRequestAuction(giftId, (auction, err) -> {
|
||||
if (auction != null) {
|
||||
show(context, resourcesProvider, currentAccount, dialogId, auction);
|
||||
show(context, resourcesProvider, currentAccount, dialogId, auction, closeParentSheet);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -403,7 +461,8 @@ public class AuctionJoinSheet extends BottomSheetWithRecyclerListView implements
|
||||
Theme.ResourcesProvider resourcesProvider,
|
||||
int currentAccount,
|
||||
long dialogId,
|
||||
GiftAuctionController.Auction auction) {
|
||||
GiftAuctionController.Auction auction,
|
||||
Runnable closeParentSheet) {
|
||||
if (auction == null) {
|
||||
return; // loading
|
||||
}
|
||||
@@ -412,18 +471,21 @@ public class AuctionJoinSheet extends BottomSheetWithRecyclerListView implements
|
||||
final long bidPeer = DialogObject.getPeerDialogId(auction.auctionUserState.peer);
|
||||
if (dialogId != bidPeer && dialogId != 0 && bidPeer != 0) {
|
||||
openAuctionTransferAlert(context, resourcesProvider, currentAccount, bidPeer, dialogId, () -> {
|
||||
new SendGiftSheet(context, currentAccount, auction.gift, dialogId, null, false, false)
|
||||
new SendGiftSheet(context, currentAccount, auction.gift, dialogId, closeParentSheet, false, false)
|
||||
.show();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (auction.auctionUserState.bid_date > 0) {
|
||||
new AuctionBidSheet(context, resourcesProvider, null, auction).show();
|
||||
if (auction.auctionUserState.bid_date > 0 && !auction.isFinished()) {
|
||||
AuctionBidSheet auctionBidSheet = new AuctionBidSheet(context, resourcesProvider, null, auction);
|
||||
auctionBidSheet.setCloseParentSheet(closeParentSheet);
|
||||
auctionBidSheet.show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
new AuctionJoinSheet(context, resourcesProvider, dialogId, auction.gift).show();
|
||||
new AuctionJoinSheet(context, resourcesProvider, dialogId, auction.gift, closeParentSheet).show();
|
||||
}
|
||||
|
||||
public static void initActionBar(ActionBar actionBar, Context context, Theme.ResourcesProvider resourcesProvider, int currentAccount, TL_stars.StarGift starGift) {
|
||||
|
||||
@@ -544,7 +544,12 @@ public class GiftSheet extends BottomSheetWithRecyclerListView implements Notifi
|
||||
return;
|
||||
}
|
||||
if (gift.auction) {
|
||||
AuctionJoinSheet.show(context, resourcesProvider, currentAccount, dialogId, gift.id);
|
||||
AuctionJoinSheet.show(context, resourcesProvider, currentAccount, dialogId, gift.id, () -> {
|
||||
if (closeParentSheet != null) {
|
||||
closeParentSheet.run();
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -935,6 +940,11 @@ public class GiftSheet extends BottomSheetWithRecyclerListView implements Notifi
|
||||
}
|
||||
}).collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
|
||||
if (dialogId < 0) {
|
||||
gifts = gifts.stream().filter(gift -> !gift.auction).collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
|
||||
boolean myGiftsHaveUnique = false;
|
||||
if (dialogId != UserConfig.getInstance(currentAccount).getClientUserId()) {
|
||||
if (myGifts != null) {
|
||||
|
||||
@@ -419,9 +419,11 @@ public class SendGiftSheet extends BottomSheetWithRecyclerListView implements No
|
||||
|
||||
if (auction != null) {
|
||||
final AuctionBidSheet.Params p = new AuctionBidSheet.Params(dialogId, anonymous, getMessage());
|
||||
new AuctionBidSheet(context, resourcesProvider, p, auction)
|
||||
.show();
|
||||
AuctionBidSheet auctionSheet = new AuctionBidSheet(context, resourcesProvider, p, auction);
|
||||
auctionSheet.show();
|
||||
auctionSheet.setCloseParentSheet(closeParentSheet);
|
||||
|
||||
AndroidUtilities.hideKeyboard(messageEdit);
|
||||
dismiss();
|
||||
if (!isDismissed) {
|
||||
AndroidUtilities.runOnUIThread(this::dismiss, 500);
|
||||
|
||||
@@ -4384,7 +4384,7 @@ public class LaunchActivity extends BasePermissionsActivity implements INavigati
|
||||
.createSimpleBulletin(R.raw.error, getString(R.string.GiftAuctionNotFound))
|
||||
.show();
|
||||
} else if (res != null) {
|
||||
AuctionJoinSheet.show(LaunchActivity.this, null, currentAccount, 0, res.gift.id);
|
||||
AuctionJoinSheet.show(LaunchActivity.this, null, currentAccount, 0, res.gift.id, null);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -112,6 +112,8 @@ import java.util.List;
|
||||
|
||||
public class LiveCommentsView extends FrameLayout implements NotificationCenter.NotificationCenterDelegate {
|
||||
|
||||
public static final int MAX_MESSAGES_COUNT = 2_000;
|
||||
|
||||
public static class Message {
|
||||
public int id;
|
||||
public boolean fromAdmin;
|
||||
@@ -1350,6 +1352,9 @@ public class LiveCommentsView extends FrameLayout implements NotificationCenter.
|
||||
}
|
||||
messages.add(position, message);
|
||||
if (!isHistory) {
|
||||
if (messages.size() > MAX_MESSAGES_COUNT) {
|
||||
messages.subList(MAX_MESSAGES_COUNT, messages.size()).clear();
|
||||
}
|
||||
adapter.update(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -563,13 +563,27 @@ public class LivePlayer implements NotificationCenter.NotificationCenterDelegate
|
||||
instance.setOnStateUpdatedListener(new Instance.OnStateUpdatedListener() {
|
||||
@Override
|
||||
public void onStateUpdated(int state, boolean inTransition) {
|
||||
final boolean wasConnected = isConnected();
|
||||
connectionState = state;
|
||||
FileLog.d("[LivePlayer] connectionState = " + state);
|
||||
if (wasConnected != isConnected()) {
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.liveStoryUpdated, getCallId());
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
instance.resetGroupInstance(false, false);
|
||||
}
|
||||
|
||||
public boolean isConnected() {
|
||||
return (
|
||||
connectionState == Instance.STATE_ESTABLISHED ||
|
||||
connectionState == Instance.STATE_WAIT_INIT ||
|
||||
connectionState == Instance.STATE_WAIT_INIT_ACK
|
||||
);
|
||||
}
|
||||
|
||||
private final HashSet<Integer> srcs = new HashSet<>();
|
||||
private float volume = 1.0f;
|
||||
public void setVolume(float volume) {
|
||||
|
||||
@@ -4,13 +4,16 @@ import static org.telegram.messenger.AndroidUtilities.dp;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
|
||||
import org.telegram.messenger.AndroidUtilities;
|
||||
@@ -18,6 +21,7 @@ import org.telegram.messenger.R;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
import org.telegram.ui.Components.AnimatedTextView;
|
||||
import org.telegram.ui.Components.BackupImageView;
|
||||
import org.telegram.ui.Components.CircularProgressDrawable;
|
||||
import org.telegram.ui.Components.CubicBezierInterpolator;
|
||||
import org.telegram.ui.Components.LayoutHelper;
|
||||
import org.telegram.ui.Components.RLottieDrawable;
|
||||
@@ -28,8 +32,10 @@ import org.telegram.ui.Components.blur3.drawable.color.BlurredBackgroundColorPro
|
||||
public class MuteButton extends FrameLayout {
|
||||
|
||||
private final FrameLayout layout;
|
||||
private final View filledBackgroundView;
|
||||
private final ImageView image;
|
||||
private final StrokeDrawable background;
|
||||
private final View loadingView;
|
||||
|
||||
public MuteButton(Context context, BlurredBackgroundColorProvider colorProvider) {
|
||||
super(context);
|
||||
@@ -43,6 +49,25 @@ public class MuteButton extends FrameLayout {
|
||||
layout.setBackground(background);
|
||||
addView(layout, LayoutHelper.createFrame(40, 40, Gravity.CENTER));
|
||||
|
||||
filledBackgroundView = new View(context);
|
||||
filledBackgroundView.setBackground(Theme.createCircleDrawable(dp(40), 0xFF31AA28));
|
||||
layout.addView(filledBackgroundView, LayoutHelper.createFrame(38, 38, Gravity.CENTER));
|
||||
filledBackgroundView.setAlpha(0);
|
||||
filledBackgroundView.setScaleX(0);
|
||||
filledBackgroundView.setScaleY(0);
|
||||
|
||||
loadingView = new View(context) {
|
||||
private final CircularProgressDrawable progressDrawable = new CircularProgressDrawable(dp(36), dp(2), 0xFF31AA28);
|
||||
@Override
|
||||
protected void onDraw(@NonNull Canvas canvas) {
|
||||
final int p = dp(1);
|
||||
progressDrawable.setBounds(p, p, getWidth()-p-p, getHeight()-p-p);
|
||||
progressDrawable.draw(canvas);
|
||||
invalidate();
|
||||
}
|
||||
};
|
||||
addView(loadingView, LayoutHelper.createFrame(42, 42, Gravity.CENTER));
|
||||
|
||||
image = new ImageView(context);
|
||||
image.setScaleType(ImageView.ScaleType.CENTER);
|
||||
image.setScaleX(0.75f);
|
||||
@@ -53,13 +78,40 @@ public class MuteButton extends FrameLayout {
|
||||
setMuted(false, false);
|
||||
}
|
||||
|
||||
private boolean connected;
|
||||
private ValueAnimator loadingViewAnimator;
|
||||
public void setConnected(boolean connected, boolean animated) {
|
||||
if (this.connected == connected && animated) return;
|
||||
this.connected = connected;
|
||||
if (loadingViewAnimator != null) {
|
||||
loadingViewAnimator.cancel();
|
||||
loadingViewAnimator = null;
|
||||
}
|
||||
if (!animated) {
|
||||
loadingView.setAlpha(connected ? 0f : 1f);
|
||||
loadingView.setVisibility(connected ? View.GONE : View.VISIBLE);
|
||||
} else {
|
||||
loadingView.setVisibility(View.VISIBLE);
|
||||
loadingViewAnimator = ValueAnimator.ofFloat(loadingView.getAlpha(), connected ? 0f : 1f);
|
||||
loadingViewAnimator.addUpdateListener(a -> {
|
||||
loadingView.setAlpha((float) a.getAnimatedValue());
|
||||
});
|
||||
loadingViewAnimator.setDuration(320);
|
||||
loadingViewAnimator.setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT);
|
||||
loadingViewAnimator.start();
|
||||
}
|
||||
updateFill(muted || !connected, animated);
|
||||
}
|
||||
|
||||
private boolean muted;
|
||||
public void setMuted(boolean muted, boolean animated) {
|
||||
this.muted = muted;
|
||||
if (!animated) {
|
||||
AndroidUtilities.updateImageViewImageAnimated(image, muted ? R.drawable.msg_voice_muted : R.drawable.msg_voice_unmuted);
|
||||
} else {
|
||||
image.setImageResource(muted ? R.drawable.msg_voice_muted : R.drawable.msg_voice_unmuted);
|
||||
}
|
||||
updateFill(muted, animated);
|
||||
updateFill(muted || !connected, animated);
|
||||
}
|
||||
|
||||
private float mutedT;
|
||||
@@ -71,19 +123,25 @@ public class MuteButton extends FrameLayout {
|
||||
}
|
||||
if (!animated) {
|
||||
mutedT = muted ? 1.0f : 0.0f;
|
||||
background.setBackgroundColor(ColorUtils.blendARGB(0xFF31AA28, 0xFF20242A, mutedT));
|
||||
// background.setBackgroundColor(ColorUtils.blendARGB(0xFF31AA28, 0xFF20242A, mutedT));
|
||||
filledBackgroundView.setAlpha(1.0f - mutedT);
|
||||
filledBackgroundView.setScaleX(1.0f - mutedT);
|
||||
filledBackgroundView.setScaleY(1.0f - mutedT);
|
||||
image.setColorFilter(new PorterDuffColorFilter(ColorUtils.blendARGB(0xFFFFFFFF, 0xFFD2D3D4, mutedT), PorterDuff.Mode.SRC_IN));
|
||||
layout.invalidate();
|
||||
} else {
|
||||
animator = ValueAnimator.ofFloat(mutedT, muted ? 1.0f : 0.0f);
|
||||
animator.addUpdateListener(a -> {
|
||||
mutedT = (float) a.getAnimatedValue();
|
||||
background.setBackgroundColor(ColorUtils.blendARGB(0xFF31AA28, 0xFF20242A, mutedT));
|
||||
// background.setBackgroundColor(ColorUtils.blendARGB(0xFF31AA28, 0xFF20242A, mutedT));
|
||||
filledBackgroundView.setAlpha(1.0f - mutedT);
|
||||
filledBackgroundView.setScaleX(1.0f - mutedT);
|
||||
filledBackgroundView.setScaleY(1.0f - mutedT);
|
||||
image.setColorFilter(new PorterDuffColorFilter(ColorUtils.blendARGB(0xFFFFFFFF, 0xFFD2D3D4, mutedT), PorterDuff.Mode.SRC_IN));
|
||||
layout.invalidate();
|
||||
});
|
||||
animator.setInterpolator(CubicBezierInterpolator.EASE_OUT_QUINT);
|
||||
animator.setDuration(200);
|
||||
animator.setDuration(420);
|
||||
animator.start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,6 +223,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
public static final float SHARE_BUTTON_OFFSET = 46;
|
||||
private final static long IMAGE_LIVE_TIME = 10_000;
|
||||
private final ImageView optionsIconView;
|
||||
private final ImageView pipIconView;
|
||||
private final FrameLayout muteIconContainer;
|
||||
private final RLottieImageView muteIconView;
|
||||
private final ImageView noSoundIconView;
|
||||
@@ -1271,6 +1272,17 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
optionsIconView.setBackground(Theme.createSelectorDrawable(Color.WHITE));
|
||||
storyContainer.addView(optionsIconView, LayoutHelper.createFrame(40, 40, Gravity.RIGHT | Gravity.TOP, 2, 15, 2, 0));
|
||||
|
||||
pipIconView = new ImageView(context);
|
||||
pipIconView.setImageDrawable(sharedResources.pipDrawable);
|
||||
pipIconView.setPadding(dp(8), dp(8), dp(8), dp(8));
|
||||
pipIconView.setBackground(Theme.createSelectorDrawable(Color.WHITE));
|
||||
storyContainer.addView(pipIconView, LayoutHelper.createFrame(40, 40, Gravity.RIGHT | Gravity.TOP, 2, 15, 2 + 40, 0));
|
||||
pipIconView.setOnClickListener(v -> {
|
||||
if (storyViewer != null) {
|
||||
storyViewer.switchToPip();
|
||||
}
|
||||
});
|
||||
|
||||
optionsIconView.setOnClickListener(v -> {
|
||||
delegate.setPopupIsVisible(true);
|
||||
editStoryItem = null;
|
||||
@@ -2335,6 +2347,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
|
||||
muteIconContainer.setBackground(Theme.createSimpleSelectorRoundRectDrawable(dp(20), Color.TRANSPARENT, ColorUtils.setAlphaComponent(Color.WHITE, 100)));
|
||||
optionsIconView.setBackground(Theme.createSimpleSelectorRoundRectDrawable(dp(20), Color.TRANSPARENT, ColorUtils.setAlphaComponent(Color.WHITE, 100)));
|
||||
pipIconView.setBackground(Theme.createSimpleSelectorRoundRectDrawable(dp(20), Color.TRANSPARENT, ColorUtils.setAlphaComponent(Color.WHITE, 100)));
|
||||
shareButton.setBackground(Theme.createSimpleSelectorRoundRectDrawable(dp(20), Color.TRANSPARENT, ColorUtils.setAlphaComponent(Color.WHITE, 100)));
|
||||
likeButtonContainer.setBackground(Theme.createSimpleSelectorRoundRectDrawable(dp(20), Color.TRANSPARENT, ColorUtils.setAlphaComponent(Color.WHITE, 100)));
|
||||
if (repostButtonContainer != null) {
|
||||
@@ -2994,6 +3007,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
muteButton.setMuted(!muted, true);
|
||||
});
|
||||
muteButton.setMuted(LivePlayer.recording != null && LivePlayer.recording.isMuted(), false);
|
||||
muteButton.setConnected(LivePlayer.recording == null || LivePlayer.recording.isConnected(), false);
|
||||
addView(muteButton, LayoutHelper.createFrame(38 + 8, 38 + 4, Gravity.RIGHT | Gravity.BOTTOM, 7, 0, 7, 3));
|
||||
}
|
||||
|
||||
@@ -5389,6 +5403,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
if (muteButton != null) {
|
||||
muteButton.setVisibility(!unsupported && currentStory.isLive && LivePlayer.recording != null && currentStory.isThisCall(LivePlayer.recording.getCallId()) ? View.VISIBLE : View.GONE);
|
||||
muteButton.setMuted(LivePlayer.recording != null && LivePlayer.recording.isMuted(), true);
|
||||
muteButton.setConnected(LivePlayer.recording == null || LivePlayer.recording.isConnected(), true);
|
||||
}
|
||||
if (starsButton != null) {
|
||||
starsButtonEffectsView.setVisibility(!unsupported && currentStory.isLive ? View.VISIBLE : View.GONE);
|
||||
@@ -5571,6 +5586,9 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
if (optionsIconView != null) {
|
||||
optionsIconView.setVisibility(isBotsPreview() && !isEditBotsPreview() && (currentStory == null || !currentStory.isVideo) ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
if (pipIconView != null) {
|
||||
pipIconView.setVisibility(currentStory.isLive && !privacyButton.draw ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isEditBotsPreview() {
|
||||
@@ -7479,7 +7497,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
if (child == null || child == liveCommentsShadowView) {
|
||||
continue;
|
||||
}
|
||||
if (child == headerView || child == optionsIconView || child == muteIconContainer || child == selfView || child == storyCaptionView || child == privacyButton) {
|
||||
if (child == headerView || child == optionsIconView || child == pipIconView || child == muteIconContainer || child == selfView || child == storyCaptionView || child == privacyButton) {
|
||||
float alpha = 1f;
|
||||
if (child == muteIconContainer) {
|
||||
alpha = muteIconViewAlpha;
|
||||
@@ -8084,6 +8102,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
public Drawable likeDrawable;
|
||||
public Drawable likeDrawableFilled;
|
||||
public Drawable optionsDrawable;
|
||||
public Drawable pipDrawable;
|
||||
public Drawable deleteDrawable;
|
||||
public RLottieDrawable noSoundDrawable;
|
||||
// public ReplaceableIconDrawable muteDrawable;
|
||||
@@ -8096,6 +8115,7 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
likeDrawableFilled = ContextCompat.getDrawable(context, R.drawable.media_like_active);
|
||||
likeDrawableFilled.setColorFilter(new PorterDuffColorFilter(0xFFFF2E38, PorterDuff.Mode.MULTIPLY));
|
||||
optionsDrawable = ContextCompat.getDrawable(context, R.drawable.media_more);
|
||||
pipDrawable = ContextCompat.getDrawable(context, R.drawable.menu_stream_pip);
|
||||
deleteDrawable = ContextCompat.getDrawable(context, R.drawable.msg_delete);
|
||||
muteDrawable = new RLottieDrawable(R.raw.media_mute_unmute, "media_mute_unmute", AndroidUtilities.dp(28), AndroidUtilities.dp(28), true, null);
|
||||
// muteDrawable = new ReplaceableIconDrawable(context);
|
||||
@@ -8235,6 +8255,8 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
headerView.setAlpha(1f - outT);
|
||||
optionsIconView.setTranslationY(-AndroidUtilities.dp(8) * outT);
|
||||
optionsIconView.setAlpha(1f - outT);
|
||||
pipIconView.setTranslationY(-AndroidUtilities.dp(8) * outT);
|
||||
pipIconView.setAlpha(1f - outT);
|
||||
muteIconContainer.setTranslationY(-AndroidUtilities.dp(8) * outT);
|
||||
muteIconContainer.setAlpha(muteIconViewAlpha * (1f - outT));
|
||||
if (selfView != null) {
|
||||
@@ -8271,6 +8293,8 @@ public class PeerStoriesView extends SizeNotifierFrameLayout implements Notifica
|
||||
headerView.setAlpha(1f - outT);
|
||||
optionsIconView.setTranslationY(-AndroidUtilities.dp(8) * outT);
|
||||
optionsIconView.setAlpha(1f - outT);
|
||||
pipIconView.setTranslationY(-AndroidUtilities.dp(8) * outT);
|
||||
pipIconView.setAlpha(1f - outT);
|
||||
muteIconContainer.setTranslationY(-AndroidUtilities.dp(8) * outT);
|
||||
muteIconContainer.setAlpha(muteIconViewAlpha * (1f - outT));
|
||||
if (selfView != null) {
|
||||
|
||||
@@ -469,7 +469,7 @@ public class StoriesController {
|
||||
for (int j = 0; j < userStories.stories.size(); j++) {
|
||||
TL_stories.StoryItem story = userStories.stories.get(j);
|
||||
if (story instanceof TL_stories.TL_storyItemDeleted ||
|
||||
story instanceof TL_stories.TL_storyItem && now > story.expire_date) {
|
||||
story instanceof TL_stories.TL_storyItem && now > story.expire_date && !(story.media instanceof TLRPC.TL_messageMediaVideoStream)) {
|
||||
NotificationsController.getInstance(currentAccount).processDeleteStory(dialogId, story.id);
|
||||
userStories.stories.remove(j);
|
||||
j--;
|
||||
|
||||
@@ -1049,6 +1049,7 @@ public class StoriesUtilities {
|
||||
}
|
||||
|
||||
public static boolean isExpired(int currentAccount, TL_stories.StoryItem storyItem) {
|
||||
if (storyItem.media instanceof TLRPC.TL_messageMediaVideoStream) return false;
|
||||
return ConnectionsManager.getInstance(currentAccount).getCurrentTime() > storyItem.expire_date;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="72"
|
||||
android:viewportHeight="72">
|
||||
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M56 33.0698C56 34.4505 54.8807 35.5698 53.5 35.5698C52.1193 35.5698 51 34.4505 51 33.0698V17.5C51 15.0147 48.9853 13 46.5 13H23.5C21.0147 13 19 15.0147 19 17.5V51.5C19 53.9853 21.0147 56 23.5 56H33.7731C35.1538 56 36.2731 57.1193 36.2731 58.5C36.2731 59.8807 35.1538 61 33.7731 61H23.5C18.2533 61 14 56.7467 14 51.5V17.5C14 12.2533 18.2533 8 23.5 8H46.5C51.7467 8 56 12.2533 56 17.5V33.0698ZM40.5827 23.0321V34.5409L40.5815 34.5711C40.6 35.1187 40.4003 35.6724 39.9822 36.0904C39.6109 36.4618 39.1324 36.6609 38.6463 36.6877L38.4483 36.6907L27.9239 36.6909C26.7917 36.6909 25.8739 35.773 25.8739 34.6409C25.8739 33.5087 26.7917 32.5909 27.9239 32.5909L33.584 32.59L25.4744 24.4817C24.6738 23.6811 24.6738 22.3831 25.4744 21.5825C26.2749 20.782 27.5729 20.782 28.3735 21.5825L36.482 29.69L36.4827 23.0321C36.4827 21.9514 37.3189 21.066 38.3797 20.9877L38.5327 20.9821C39.6649 20.9821 40.5827 21.8999 40.5827 23.0321ZM60 61C60 63.2091 58.2091 65 56 65H46C43.7909 65 42 63.2091 42 61V45C42 42.7909 43.7909 41 46 41H56C58.2091 41 60 42.7909 60 45V61Z" />
|
||||
</vector>
|
||||
@@ -8630,6 +8630,9 @@
|
||||
<string name="Gift2SendYourBalance_one">Your balance is %d Star</string>
|
||||
<string name="Gift2SendYourBalance_other">Your balance is %d Stars</string>
|
||||
<string name="Gift2ActionTitle">Gift from </string>
|
||||
<string name="Gift2ActionTitleTo">Gift for </string>
|
||||
<string name="Gift2AveragePriceHint">**%d Stars** is the average sale price for **%s** gifts.</string>
|
||||
<string name="Gift2ActionWonActionText">You bought this gift at auction for %s Stars.</string>
|
||||
<string name="Gift2ActionUpgradeTitle">Upgrade from </string>
|
||||
<string name="Gift2ActionUpgradeUnknownTitle">Upgrade from unknown</string>
|
||||
<string name="Gift2ActionSelfTitle">Saved Gift</string>
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
#Sat Mar 12 05:53:50 MSK 2016
|
||||
APP_VERSION_CODE=6289
|
||||
APP_VERSION_NAME=12.2.0
|
||||
APP_VERSION_CODE=6292
|
||||
APP_VERSION_NAME=12.2.1
|
||||
APP_PACKAGE=org.telegram.messenger
|
||||
IS_PRIVATE=false
|
||||
RELEASE_KEY_PASSWORD=android
|
||||
|
||||
Reference in New Issue
Block a user