Various Fixes

This commit is contained in:
Ilya Laktyushin 2021-03-30 10:10:12 +03:00
parent 7ab9412313
commit 6d4b43a745
10 changed files with 4752 additions and 4724 deletions

View File

@ -6321,3 +6321,12 @@ Sorry for the inconvenience.";
"VoiceChat.SendPublicLinkText" = "%1$@ isn't a member of \"%2$@\" yet. Send them a public invite link instead?";
"VoiceChat.SendPublicLinkSend" = "Send";
"VoiceChat.TapToAddPhotoOrBio" = "tap to add photo or bio";
"VoiceChat.TapToAddPhoto" = "tap to add photo";
"VoiceChat.TapToAddBio" = "tap to add bio";
"VoiceChat.ImproveYourProfileText" = "You can improve your profile by adding missing information.";
"VoiceChat.AddPhoto" = "Add Photo";
"VoiceChat.AddBio" = "Add Bio";
"VoiceChat.ChangeName" = "Change Name";

View File

@ -801,7 +801,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
let titleFont = Font.medium(floor(item.presentationData.fontSize.itemListBaseFontSize * 16.0 / 17.0))
let textFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 15.0 / 17.0))
let dateFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 14.0 / 17.0))
let badgeFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 14.0 / 17.0))
let badgeFont = Font.with(size: floor(item.presentationData.fontSize.itemListBaseFontSize * 14.0 / 17.0), design: .regular, weight: .regular, traits: [.monospacedNumbers])
let account = item.context.account
var messages: [Message]

View File

@ -9,7 +9,7 @@ import Display
import UniversalMediaPlayer
import TelegramPresentationData
private let textFont = Font.regular(13.0)
private let textFont = Font.with(size: 13.0, design: .regular, weight: .regular, traits: [.monospacedNumbers])
private let scrubberBackgroundColor = UIColor(white: 1.0, alpha: 0.42)
private let scrubberForegroundColor = UIColor.white

View File

@ -444,7 +444,7 @@
bool onlyGroupableMedia = true;
for (TGMediaAsset *item in strongSelf->_selectionContext.selectedItems)
{
TGMediaAsset *asset = asset;
TGMediaAsset *asset = item;
if ([asset isKindOfClass:[TGCameraCapturedVideo class]]) {
asset = [(TGCameraCapturedVideo *)item originalAsset];
}

View File

@ -1258,12 +1258,6 @@ public final class VoiceChatController: ViewController {
}
if peer.id == strongSelf.callState?.myPeerId {
let maxLength: Int
if peer.id.namespace == Namespaces.Peer.CloudUser {
maxLength = 70
} else {
maxLength = 100
}
if entry.raisedHand {
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.VoiceChat_CancelSpeakRequest, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Call/Context Menu/RevokeSpeak"), color: theme.actionSheet.primaryTextColor)
@ -1276,7 +1270,7 @@ public final class VoiceChatController: ViewController {
f(.default)
})))
}
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.VoiceChat_ChangePhoto, icon: { theme in
items.append(.action(ContextMenuActionItem(text: peer.smallProfileImage == nil ? strongSelf.presentationData.strings.VoiceChat_AddPhoto : strongSelf.presentationData.strings.VoiceChat_ChangePhoto, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Camera"), color: theme.actionSheet.primaryTextColor)
}, action: { _, f in
guard let strongSelf = self else {
@ -1289,8 +1283,9 @@ public final class VoiceChatController: ViewController {
strongSelf.openAvatarForEditing(fromGallery: false, completion: {})
}
})))
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.VoiceChat_EditBio, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Pencil"), color: theme.actionSheet.primaryTextColor)
items.append(.action(ContextMenuActionItem(text: (entry.about?.isEmpty ?? true) ? strongSelf.presentationData.strings.VoiceChat_AddBio : strongSelf.presentationData.strings.VoiceChat_EditBio, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Info"), color: theme.actionSheet.primaryTextColor)
}, action: { _, f in
guard let strongSelf = self else {
return
@ -1298,7 +1293,13 @@ public final class VoiceChatController: ViewController {
f(.default)
Queue.mainQueue().after(0.1) {
let controller = voiceChatTitleEditController(sharedContext: strongSelf.context.sharedContext, account: strongSelf.context.account, forceTheme: strongSelf.darkTheme, title: presentationData.strings.VoiceChat_EditBioTitle, text: presentationData.strings.VoiceChat_EditBioText, placeholder: presentationData.strings.VoiceChat_EditBioPlaceholder, doneButtonTitle: presentationData.strings.VoiceChat_EditBioSave, value: entry.about, maxLength: maxLength, apply: { bio in
let maxBioLength: Int
if peer.id.namespace == Namespaces.Peer.CloudUser {
maxBioLength = 70
} else {
maxBioLength = 100
}
let controller = voiceChatTitleEditController(sharedContext: strongSelf.context.sharedContext, account: strongSelf.context.account, forceTheme: strongSelf.darkTheme, title: presentationData.strings.VoiceChat_EditBioTitle, text: presentationData.strings.VoiceChat_EditBioText, placeholder: presentationData.strings.VoiceChat_EditBioPlaceholder, doneButtonTitle: presentationData.strings.VoiceChat_EditBioSave, value: entry.about, maxLength: maxBioLength, apply: { bio in
if let strongSelf = self {
let _ = (updateAbout(account: strongSelf.context.account, about: bio)
|> `catch` { _ -> Signal<Void, NoError> in

View File

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "ic_changename.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -59,21 +59,6 @@ private class ChatHistoryListSelectionRecognizer: UIPanGestureRecognizer {
} else {
let touch = touches.first!
self.initialLocation = touch.location(in: self.view)
let touchesArray = Array(touches)
if touchesArray.count == 2, let firstTouch = touchesArray.first, let secondTouch = touchesArray.last {
let firstLocation = firstTouch.location(in: self.view)
let secondLocation = secondTouch.location(in: self.view)
func distance(_ v1: CGPoint, _ v2: CGPoint) -> CGFloat {
let dx = v1.x - v2.x
let dy = v1.y - v2.y
return sqrt(dx * dx + dy * dy)
}
if distance(firstLocation, secondLocation) > 70 {
self.state = .failed
}
}
}
}
@ -82,8 +67,22 @@ private class ChatHistoryListSelectionRecognizer: UIPanGestureRecognizer {
let location = touches.first!.location(in: self.view)
let translation = location.offsetBy(dx: -self.initialLocation.x, dy: -self.initialLocation.y)
if self.recognized == nil {
if (abs(translation.y) >= selectionGestureActivationThreshold) {
let touchesArray = Array(touches)
if self.recognized == nil, touchesArray.count == 2 {
if let firstTouch = touchesArray.first, let secondTouch = touchesArray.last {
let firstLocation = firstTouch.location(in: self.view)
let secondLocation = secondTouch.location(in: self.view)
func distance(_ v1: CGPoint, _ v2: CGPoint) -> CGFloat {
let dx = v1.x - v2.x
let dy = v1.y - v2.y
return sqrt(dx * dx + dy * dy)
}
if distance(firstLocation, secondLocation) > 200.0 {
self.state = .failed
}
}
if self.state != .failed && (abs(translation.y) >= selectionGestureActivationThreshold) {
self.recognized = true
}
}