mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-28 02:45:58 +00:00
Various improvements
This commit is contained in:
parent
9527b2d8be
commit
3886b847ae
@ -15354,3 +15354,16 @@ Error: %8$@";
|
||||
"ScheduleMessage.PremiumRequired.Title" = "Premium Required";
|
||||
"ScheduleMessage.PremiumRequired.Text" = "Subscribe to **Telegram Premium** to schedule repeating messages.";
|
||||
"ScheduleMessage.PremiumRequired.Add" = "Add";
|
||||
|
||||
"Stars.Transaction.GiftAuctionBid" = "Gift Auction Bid";
|
||||
"Stars.Intro.Transaction.GiftAuctionBid" = "Gift Auction Bid";
|
||||
|
||||
"Stars.Intro.Transaction.LiveStreamReaction" = "Live Stream Reaction";
|
||||
"Stars.Transaction.LiveStreamReaction" = "Live Stream Reaction";
|
||||
"Stars.Transaction.LiveStreamReaction.Text" = "You receive **%@%** of the amount of each reaction.";
|
||||
|
||||
"Stars.Intro.Transaction.LiveStreamPaidMessage_1" = "Fee for %@ Live Stream Message";
|
||||
"Stars.Intro.Transaction.LiveStreamPaidMessage_any" = "Fee for %@ Live Stream Messages";
|
||||
"Stars.Transaction.LiveStreamPaidMessage_1" = "Fee for %@ Live Stream Message";
|
||||
"Stars.Transaction.LiveStreamPaidMessage_any" = "Fee for %@ Live Stream Messages";
|
||||
"Stars.Transaction.LiveStreamPaidMessage.Text" = "You receive **%@%** of the price that you charge for each incoming message.";
|
||||
|
||||
@ -890,7 +890,7 @@ private class ChatQrCodeScreenNode: ViewControllerTracingNode, ASScrollViewDeleg
|
||||
self.animationNode = AnimationNode(animation: self.isDarkAppearance ? "anim_sun_reverse" : "anim_sun", colors: iconColors(theme: self.presentationData.theme), scale: 1.0)
|
||||
self.animationNode.isUserInteractionEnabled = false
|
||||
|
||||
self.doneButton = SolidRoundedButtonNode(theme: SolidRoundedButtonTheme(theme: self.presentationData.theme), height: 52.0, cornerRadius: 11.0)
|
||||
self.doneButton = SolidRoundedButtonNode(theme: SolidRoundedButtonTheme(theme: self.presentationData.theme), glass: true, height: 52.0, cornerRadius: 26.0)
|
||||
switch controller.subject {
|
||||
case .peer:
|
||||
self.doneButton.title = self.presentationData.strings.InviteLink_QRCode_Share
|
||||
|
||||
@ -57,9 +57,9 @@ public final class ListSwitchItemComponent: Component {
|
||||
self.state = state
|
||||
|
||||
self.backgroundColor = component.theme.list.itemBlocksBackgroundColor
|
||||
self.layer.cornerRadius = 12.0
|
||||
self.layer.cornerRadius = 26.0
|
||||
|
||||
let size = CGSize(width: availableSize.width, height: 44.0)
|
||||
let size = CGSize(width: availableSize.width, height: 52.0)
|
||||
let rightInset: CGFloat = 16.0
|
||||
let leftInset: CGFloat = 16.0
|
||||
let spacing: CGFloat = 8.0
|
||||
|
||||
@ -174,7 +174,7 @@ final class EmojiListInputComponent: Component {
|
||||
let minSideInset: CGFloat = 12.0
|
||||
|
||||
self.backgroundColor = component.theme.list.itemBlocksBackgroundColor
|
||||
self.layer.cornerRadius = 12.0
|
||||
self.layer.cornerRadius = 26.0
|
||||
|
||||
let maxItemsWidth = availableSize.width - minSideInset * 2.0
|
||||
let itemsPerRow = Int(floor((maxItemsWidth + minItemSize * itemSpacingFactor) / (minItemSize + minItemSize * itemSpacingFactor)))
|
||||
|
||||
@ -1259,6 +1259,7 @@ final class PeerAllowedReactionsScreenComponent: Component {
|
||||
transition: transition,
|
||||
component: AnyComponent(ListSectionComponent(
|
||||
theme: environment.theme,
|
||||
style: .glass,
|
||||
header: AnyComponent(MultilineTextComponent(
|
||||
text: .plain(NSAttributedString(
|
||||
string: environment.strings.PeerInfo_AllowedReactions_MaxCountSectionTitle,
|
||||
@ -1350,6 +1351,7 @@ final class PeerAllowedReactionsScreenComponent: Component {
|
||||
transition: transition,
|
||||
component: AnyComponent(ListSectionComponent(
|
||||
theme: environment.theme,
|
||||
style: .glass,
|
||||
header: nil,
|
||||
footer: AnyComponent(MultilineTextComponent(
|
||||
text: .plain(paidReactionsFooterText),
|
||||
@ -1534,10 +1536,12 @@ final class PeerAllowedReactionsScreenComponent: Component {
|
||||
))))
|
||||
}
|
||||
|
||||
let buttonInsets = ContainerViewLayout.concentricInsets(bottomInset: environment.safeInsets.bottom, innerDiameter: 52.0, sideInset: 30.0)
|
||||
let buttonSize = self.actionButton.update(
|
||||
transition: transition,
|
||||
component: AnyComponent(ButtonComponent(
|
||||
background: ButtonComponent.Background(
|
||||
style: .glass,
|
||||
color: environment.theme.list.itemCheckColors.fillColor,
|
||||
foreground: environment.theme.list.itemCheckColors.foregroundColor,
|
||||
pressedColor: environment.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.8)
|
||||
@ -1556,7 +1560,7 @@ final class PeerAllowedReactionsScreenComponent: Component {
|
||||
}
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: availableSize.width - sideInset * 2.0, height: 50.0)
|
||||
containerSize: CGSize(width: availableSize.width - buttonInsets.left - buttonInsets.right, height: 52.0)
|
||||
)
|
||||
contentHeight += buttonSize.height
|
||||
|
||||
@ -1650,7 +1654,7 @@ final class PeerAllowedReactionsScreenComponent: Component {
|
||||
buttonY = availableSize.height - bottomInset - environment.safeInsets.bottom - buttonSize.height
|
||||
}
|
||||
|
||||
let buttonFrame = CGRect(origin: CGPoint(x: sideInset, y: buttonY), size: buttonSize)
|
||||
let buttonFrame = CGRect(origin: CGPoint(x: buttonInsets.left, y: buttonY), size: buttonSize)
|
||||
if let buttonView = self.actionButton.view {
|
||||
if buttonView.superview == nil {
|
||||
self.addSubview(buttonView)
|
||||
|
||||
@ -17,7 +17,6 @@ import ListSectionComponent
|
||||
import BundleIconComponent
|
||||
import LottieComponent
|
||||
import ListSwitchItemComponent
|
||||
import ListSwitchItemComponent
|
||||
import ListActionItemComponent
|
||||
import Markdown
|
||||
import TelegramStringFormatting
|
||||
|
||||
@ -425,6 +425,7 @@ private final class CollectibleItemInfoScreenContentComponent: Component {
|
||||
transition: transition,
|
||||
component: AnyComponent(ButtonComponent(
|
||||
background: ButtonComponent.Background(
|
||||
style: .glass,
|
||||
color: environment.theme.list.itemCheckColors.fillColor,
|
||||
foreground: environment.theme.list.itemCheckColors.foregroundColor,
|
||||
pressedColor: environment.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.8)
|
||||
@ -450,9 +451,9 @@ private final class CollectibleItemInfoScreenContentComponent: Component {
|
||||
}
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: availableSize.width - sideInset * 2.0, height: 50.0)
|
||||
containerSize: CGSize(width: availableSize.width - 30.0 * 2.0, height: 52.0)
|
||||
)
|
||||
let buttonFrame = CGRect(origin: CGPoint(x: sideInset, y: contentHeight), size: buttonSize)
|
||||
let buttonFrame = CGRect(origin: CGPoint(x: 30.0, y: contentHeight), size: buttonSize)
|
||||
if let buttonView = self.button.view {
|
||||
if buttonView.superview == nil {
|
||||
self.addSubview(buttonView)
|
||||
@ -618,6 +619,7 @@ private final class CollectibleItemInfoScreenComponent: Component {
|
||||
})
|
||||
}
|
||||
)),
|
||||
style: .glass,
|
||||
backgroundColor: .color(environment.theme.list.plainBackgroundColor),
|
||||
animateOut: self.sheetAnimateOut
|
||||
)),
|
||||
|
||||
@ -354,7 +354,11 @@ private final class StarsTransactionSheetContent: CombinedComponent {
|
||||
if let starGift = transaction.starGift {
|
||||
switch starGift {
|
||||
case .generic:
|
||||
if transaction.flags.contains(.isStarGiftAuctionBid) {
|
||||
titleText = strings.Stars_Transaction_GiftAuctionBid
|
||||
} else {
|
||||
titleText = strings.Stars_Transaction_Gift_Title
|
||||
}
|
||||
descriptionText = ""
|
||||
case let .unique(gift):
|
||||
titleText = gift.title
|
||||
@ -418,7 +422,24 @@ private final class StarsTransactionSheetContent: CombinedComponent {
|
||||
isGift = true
|
||||
} else if let starrefCommissionPermille = transaction.starrefCommissionPermille {
|
||||
isRefProgram = true
|
||||
if transaction.flags.contains(.isPaidMessage) {
|
||||
if transaction.flags.contains(.isLiveStreamPaidMessage) {
|
||||
isPaidMessage = true
|
||||
if transaction.flags.contains(.isReaction) {
|
||||
titleText = strings.Stars_Transaction_LiveStreamReaction
|
||||
} else {
|
||||
titleText = strings.Stars_Transaction_LiveStreamPaidMessage(transaction.paidMessageCount ?? 1)
|
||||
}
|
||||
if !transaction.flags.contains(.isRefund) {
|
||||
countOnTop = true
|
||||
if transaction.flags.contains(.isReaction) {
|
||||
descriptionText = strings.Stars_Transaction_LiveStreamReaction_Text(formatPermille(1000 - starrefCommissionPermille)).string
|
||||
} else {
|
||||
descriptionText = strings.Stars_Transaction_LiveStreamPaidMessage_Text(formatPermille(1000 - starrefCommissionPermille)).string
|
||||
}
|
||||
} else {
|
||||
descriptionText = ""
|
||||
}
|
||||
} else if transaction.flags.contains(.isPaidMessage) {
|
||||
isPaidMessage = true
|
||||
titleText = strings.Stars_Transaction_PaidMessage(transaction.paidMessageCount ?? 1)
|
||||
if !transaction.flags.contains(.isRefund) {
|
||||
@ -468,6 +489,13 @@ private final class StarsTransactionSheetContent: CombinedComponent {
|
||||
if let months = transaction.premiumGiftMonths {
|
||||
premiumGiftMonths = months
|
||||
titleText = strings.Stars_Transaction_TelegramPremium(months)
|
||||
} else if transaction.flags.contains(.isLiveStreamPaidMessage) {
|
||||
isPaidMessage = true
|
||||
if transaction.flags.contains(.isReaction) {
|
||||
titleText = strings.Stars_Transaction_LiveStreamReaction
|
||||
} else {
|
||||
titleText = strings.Stars_Transaction_LiveStreamPaidMessage(transaction.paidMessageCount ?? 1)
|
||||
}
|
||||
} else if transaction.flags.contains(.isPaidMessage) {
|
||||
isPaidMessage = true
|
||||
titleText = strings.Stars_Transaction_PaidMessage(transaction.paidMessageCount ?? 1)
|
||||
|
||||
@ -311,11 +311,21 @@ final class StarsTransactionsListPanelComponent: Component {
|
||||
itemTitle = environment.strings.Stars_Intro_Transaction_SearchFee
|
||||
itemSubtitle = ""
|
||||
itemPeer = .search
|
||||
} else if item.flags.contains(.isLiveStreamPaidMessage) {
|
||||
itemTitle = peer.displayTitle(strings: environment.strings, displayOrder: .firstLast)
|
||||
if item.flags.contains(.isReaction) {
|
||||
itemSubtitle = environment.strings.Stars_Intro_Transaction_LiveStreamReaction
|
||||
} else {
|
||||
itemSubtitle = environment.strings.Stars_Intro_Transaction_LiveStreamPaidMessage(item.paidMessageCount ?? 1)
|
||||
}
|
||||
} else if item.flags.contains(.isPaidMessage) {
|
||||
itemTitle = peer.displayTitle(strings: environment.strings, displayOrder: .firstLast)
|
||||
itemSubtitle = environment.strings.Stars_Intro_Transaction_PaidMessage(item.paidMessageCount ?? 1)
|
||||
} else if let starGift = item.starGift {
|
||||
if item.flags.contains(.isStarGiftPrepaidUpgrade) {
|
||||
if item.flags.contains(.isStarGiftAuctionBid), case let .generic(gift) = starGift {
|
||||
itemTitle = gift.title ?? "Gift"
|
||||
itemSubtitle = environment.strings.Stars_Intro_Transaction_GiftAuctionBid
|
||||
} else if item.flags.contains(.isStarGiftPrepaidUpgrade) {
|
||||
itemTitle = peer.displayTitle(strings: environment.strings, displayOrder: .firstLast)
|
||||
itemSubtitle = environment.strings.Stars_Intro_Transaction_PrepaidGiftUpgrade
|
||||
} else if item.flags.contains(.isStarGiftDropOriginalDetails), case let .unique(gift) = starGift {
|
||||
|
||||
@ -1126,10 +1126,10 @@ final class OverlayPlayerControlsNode: ASDisplayNode {
|
||||
} else {
|
||||
profileAudioComponent = AnyComponent(ButtonComponent(
|
||||
background: ButtonComponent.Background(
|
||||
style: .glass,
|
||||
color: self.presentationData.theme.list.itemCheckColors.fillColor,
|
||||
foreground: self.presentationData.theme.list.itemCheckColors.foregroundColor,
|
||||
pressedColor: self.presentationData.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.9),
|
||||
cornerRadius: 10.0
|
||||
),
|
||||
content: AnyComponentWithIdentity(id: AnyHashable(0 as Int), component: AnyComponent(
|
||||
HStack([
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user