Various improvements

This commit is contained in:
Ilya Laktyushin 2025-11-12 18:41:57 +04:00
parent bdcc80e649
commit b0f4ca9ad9
7 changed files with 40 additions and 14 deletions

View file

@ -15293,3 +15293,8 @@ Error: %8$@";
"Gift.Auction.Info.Missed.Text" = "If your bid doesn't win after the final drop, your Stars will be fully refunded.";
"Gift.Auction.Info.Understood" = "Understood";
"Location.SendLocation" = "Send Location";
"Camera.LiveStream.Change" = "change";
"Camera.LiveStream.StartLiveStream" = "Start Live Stream";

View file

@ -341,8 +341,7 @@ public final class AuthorizationSequenceCountrySelectionController: ViewControll
self.statusBar.statusBarStyle = theme.rootController.statusBarStyle.style
if glass {
//TODO:localize
self.title = "Select Country"
self.title = strings.Login_SelectCountry
} else {
let navigationContentNode = AuthorizationSequenceCountrySelectionNavigationContentNode(theme: theme, strings: strings, cancel: { [weak self] in
self?.dismissed?()

View file

@ -446,9 +446,7 @@ public func storyLocationPickerController(
) -> ViewController {
let presentationData = context.sharedContext.currentPresentationData.with({ $0 }).withUpdated(theme: defaultDarkColorPresentationTheme)
let updatedPresentationData: (PresentationData, Signal<PresentationData, NoError>) = (presentationData, .single(presentationData))
let controller = AttachmentController(context: context, updatedPresentationData: updatedPresentationData, chatLocation: nil, buttons: [.standalone], initialButton: .standalone, fromMenu: false, hasTextInput: false, makeEntityInputView: {
return nil
})
let controller = AttachmentController(context: context, updatedPresentationData: updatedPresentationData, chatLocation: nil, buttons: [.standalone], initialButton: .standalone, fromMenu: false, hasTextInput: false)
controller.requestController = { _, present in
let locationPickerController = LocationPickerController(context: context, updatedPresentationData: updatedPresentationData, mode: .share(peer: nil, selfPeer: nil, hasLiveLocation: false), source: .story, initialLocation: location, completion: { location, queryId, resultId, address, countryCode in
completion(location, queryId, resultId, address, countryCode)

View file

@ -1533,11 +1533,10 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM
foreground: self.presentationData.theme.list.itemCheckColors.foregroundColor,
pressedColor: self.presentationData.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.9),
)
//TODO:localize
var buttonContents: [AnyComponentWithIdentity<Empty>] = [
AnyComponentWithIdentity(
id: AnyHashable("label"),
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: "Send Location", font: Font.semibold(17.0), textColor: self.presentationData.theme.list.itemCheckColors.foregroundColor, paragraphAlignment: .center))))
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: self.presentationData.strings.Location_SendLocation, font: Font.semibold(17.0), textColor: self.presentationData.theme.list.itemCheckColors.foregroundColor, paragraphAlignment: .center))))
)
]

View file

@ -413,12 +413,13 @@ public final class StreamAsComponent: Component {
})
}
let presentationData = component.context.sharedContext.currentPresentationData.with({ $0 })
let avatarSize = CGSize(width: 32.0, height: 32.0)
self.avatarNode.frame = CGRect(origin: .zero, size: avatarSize)
if let peer = self.peer {
self.avatarNode.setPeer(
context: component.context,
theme: component.context.sharedContext.currentPresentationData.with({ $0 }).theme,
theme: presentationData.theme,
peer: peer,
synchronousLoad: true
)
@ -444,12 +445,11 @@ public final class StreamAsComponent: Component {
var maxWidth = titleFrame.maxX
if !component.isCustomTarget {
//TODO:localize
let subtitleSize = self.subtitle.update(
transition: .immediate,
component: AnyComponent(
MultilineTextComponent(
text: .plain(NSAttributedString(string: "change", font: Font.regular(11.0), textColor: UIColor(white: 1.0, alpha: 0.8), paragraphAlignment: .left))
text: .plain(NSAttributedString(string: presentationData.strings.Camera_LiveStream_Change, font: Font.regular(11.0), textColor: UIColor(white: 1.0, alpha: 0.8), paragraphAlignment: .left))
)
),
environment: {},

View file

@ -252,11 +252,10 @@ private final class ShutterButtonContentComponent: Component {
}
}
//TODO:localize
let labelSize = self.label.update(
transition: .immediate,
component: AnyComponent(
Text(text: "Start Live Stream", font: Font.semibold(17.0), color: .white)
Text(text: component.strings.Camera_LiveStream_StartLiveStream, font: Font.semibold(17.0), color: .white)
),
environment: {},
containerSize: availableSize

View file

@ -29,6 +29,7 @@ import BotPaymentsUI
import UndoUI
import GiftItemComponent
import LottieComponent
import EdgeEffect
private final class BadgeComponent: Component {
let theme: PresentationTheme
@ -1039,6 +1040,9 @@ private final class GiftAuctionBidScreenComponent: Component {
private let scrollContentView: UIView
private let hierarchyTrackingNode: HierarchyTrackingNode
private let topEdgeEffectView: EdgeEffectView
private let bottomEdgeEffectView: EdgeEffectView
private var balanceOverlay = ComponentView<Empty>()
private let backgroundHandleView: UIImageView
@ -1115,6 +1119,13 @@ private final class GiftAuctionBidScreenComponent: Component {
self.hierarchyTrackingNode = HierarchyTrackingNode()
self.topEdgeEffectView = EdgeEffectView()
self.topEdgeEffectView.clipsToBounds = true
self.topEdgeEffectView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
self.topEdgeEffectView.layer.cornerRadius = 40.0
self.bottomEdgeEffectView = EdgeEffectView()
super.init(frame: frame)
self.addSubview(self.dimView)
@ -2518,9 +2529,24 @@ private final class GiftAuctionBidScreenComponent: Component {
containerSize: CGSize(width: availableSize.width - buttonInsets.left - buttonInsets.right, height: 54.0)
)
let edgeEffectHeight: CGFloat = 80.0
let edgeEffectFrame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: availableSize.width, height: edgeEffectHeight))
transition.setFrame(view: self.topEdgeEffectView, frame: edgeEffectFrame)
self.topEdgeEffectView.update(content: environment.theme.actionSheet.opaqueItemBackgroundColor, blur: true, alpha: 1.0, rect: edgeEffectFrame, edge: .top, edgeSize: edgeEffectFrame.height, transition: transition)
if self.topEdgeEffectView.superview == nil {
self.navigationBarContainer.insertSubview(self.topEdgeEffectView, at: 0)
}
var bottomPanelHeight = 13.0 + buttonInsets.bottom + actionButtonSize.height
let bottomEdgeEffectHeight: CGFloat = bottomPanelHeight
let bottomEdgeEffectFrame = CGRect(origin: CGPoint(x: 0.0, y: availableSize.height - bottomEdgeEffectHeight), size: CGSize(width: availableSize.width, height: bottomEdgeEffectHeight))
transition.setFrame(view: self.bottomEdgeEffectView, frame: bottomEdgeEffectFrame)
self.bottomEdgeEffectView.update(content: environment.theme.actionSheet.opaqueItemBackgroundColor, blur: true, alpha: 1.0, rect: bottomEdgeEffectFrame, edge: .bottom, edgeSize: bottomEdgeEffectFrame.height, transition: transition)
if self.bottomEdgeEffectView.superview == nil {
self.containerView.addSubview(self.bottomEdgeEffectView)
}
let actionButtonFrame = CGRect(origin: CGPoint(x: buttonInsets.left, y: availableSize.height - buttonInsets.bottom - actionButtonSize.height), size: actionButtonSize)
bottomPanelHeight -= 1.0
if let actionButtonView = actionButton.view {
@ -2539,7 +2565,7 @@ private final class GiftAuctionBidScreenComponent: Component {
let scrollContentHeight = max(topInset + contentHeight + containerInset, availableSize.height - containerInset)
self.scrollContentClippingView.layer.cornerRadius = 10.0
self.scrollContentClippingView.layer.cornerRadius = 38.0
self.itemLayout = ItemLayout(containerSize: availableSize, containerInset: containerInset, containerCornerRadius: environment.deviceMetrics.screenCornerRadius, bottomInset: environment.safeInsets.bottom, topInset: topInset)