mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
Various Fixes
This commit is contained in:
parent
7ab9412313
commit
6d4b43a745
@ -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.SendPublicLinkText" = "%1$@ isn't a member of \"%2$@\" yet. Send them a public invite link instead?";
|
||||||
"VoiceChat.SendPublicLinkSend" = "Send";
|
"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";
|
||||||
|
@ -801,7 +801,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
let titleFont = Font.medium(floor(item.presentationData.fontSize.itemListBaseFontSize * 16.0 / 17.0))
|
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 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 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
|
let account = item.context.account
|
||||||
var messages: [Message]
|
var messages: [Message]
|
||||||
|
@ -9,7 +9,7 @@ import Display
|
|||||||
import UniversalMediaPlayer
|
import UniversalMediaPlayer
|
||||||
import TelegramPresentationData
|
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 scrubberBackgroundColor = UIColor(white: 1.0, alpha: 0.42)
|
||||||
private let scrubberForegroundColor = UIColor.white
|
private let scrubberForegroundColor = UIColor.white
|
||||||
|
@ -444,7 +444,7 @@
|
|||||||
bool onlyGroupableMedia = true;
|
bool onlyGroupableMedia = true;
|
||||||
for (TGMediaAsset *item in strongSelf->_selectionContext.selectedItems)
|
for (TGMediaAsset *item in strongSelf->_selectionContext.selectedItems)
|
||||||
{
|
{
|
||||||
TGMediaAsset *asset = asset;
|
TGMediaAsset *asset = item;
|
||||||
if ([asset isKindOfClass:[TGCameraCapturedVideo class]]) {
|
if ([asset isKindOfClass:[TGCameraCapturedVideo class]]) {
|
||||||
asset = [(TGCameraCapturedVideo *)item originalAsset];
|
asset = [(TGCameraCapturedVideo *)item originalAsset];
|
||||||
}
|
}
|
||||||
|
@ -1258,12 +1258,6 @@ public final class VoiceChatController: ViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if peer.id == strongSelf.callState?.myPeerId {
|
if peer.id == strongSelf.callState?.myPeerId {
|
||||||
let maxLength: Int
|
|
||||||
if peer.id.namespace == Namespaces.Peer.CloudUser {
|
|
||||||
maxLength = 70
|
|
||||||
} else {
|
|
||||||
maxLength = 100
|
|
||||||
}
|
|
||||||
if entry.raisedHand {
|
if entry.raisedHand {
|
||||||
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.VoiceChat_CancelSpeakRequest, icon: { theme in
|
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)
|
return generateTintedImage(image: UIImage(bundleImageName: "Call/Context Menu/RevokeSpeak"), color: theme.actionSheet.primaryTextColor)
|
||||||
@ -1276,7 +1270,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
f(.default)
|
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)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Camera"), color: theme.actionSheet.primaryTextColor)
|
||||||
}, action: { _, f in
|
}, action: { _, f in
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
@ -1289,8 +1283,9 @@ public final class VoiceChatController: ViewController {
|
|||||||
strongSelf.openAvatarForEditing(fromGallery: false, completion: {})
|
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
|
}, action: { _, f in
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
@ -1298,7 +1293,13 @@ public final class VoiceChatController: ViewController {
|
|||||||
f(.default)
|
f(.default)
|
||||||
|
|
||||||
Queue.mainQueue().after(0.1) {
|
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 {
|
if let strongSelf = self {
|
||||||
let _ = (updateAbout(account: strongSelf.context.account, about: bio)
|
let _ = (updateAbout(account: strongSelf.context.account, about: bio)
|
||||||
|> `catch` { _ -> Signal<Void, NoError> in
|
|> `catch` { _ -> Signal<Void, NoError> in
|
||||||
|
File diff suppressed because it is too large
Load Diff
12
submodules/TelegramUI/Images.xcassets/Call/Context Menu/ChangeName.imageset/Contents.json
vendored
Normal file
12
submodules/TelegramUI/Images.xcassets/Call/Context Menu/ChangeName.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "ic_changename.pdf",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
submodules/TelegramUI/Images.xcassets/Call/Context Menu/ChangeName.imageset/ic_changename.pdf
vendored
Normal file
BIN
submodules/TelegramUI/Images.xcassets/Call/Context Menu/ChangeName.imageset/ic_changename.pdf
vendored
Normal file
Binary file not shown.
Binary file not shown.
@ -59,21 +59,6 @@ private class ChatHistoryListSelectionRecognizer: UIPanGestureRecognizer {
|
|||||||
} else {
|
} else {
|
||||||
let touch = touches.first!
|
let touch = touches.first!
|
||||||
self.initialLocation = touch.location(in: self.view)
|
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 location = touches.first!.location(in: self.view)
|
||||||
let translation = location.offsetBy(dx: -self.initialLocation.x, dy: -self.initialLocation.y)
|
let translation = location.offsetBy(dx: -self.initialLocation.x, dy: -self.initialLocation.y)
|
||||||
|
|
||||||
if self.recognized == nil {
|
let touchesArray = Array(touches)
|
||||||
if (abs(translation.y) >= selectionGestureActivationThreshold) {
|
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
|
self.recognized = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user