mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-14 23:09:38 +00:00
Glass
This commit is contained in:
@@ -34,6 +34,9 @@ swift_library(
|
||||
"//submodules/InviteLinksUI",
|
||||
"//submodules/UndoUI",
|
||||
"//submodules/TelegramCallsUI",
|
||||
"//submodules/TelegramUI/Components/EdgeEffect",
|
||||
"//submodules/ComponentFlow",
|
||||
"//submodules/Components/ComponentDisplayAdapters",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
|
||||
@@ -361,10 +361,10 @@ public final class CallListController: TelegramBaseController {
|
||||
if empty {
|
||||
switch strongSelf.mode {
|
||||
case .tab:
|
||||
strongSelf.navigationItem.setLeftBarButton(nil, animated: true)
|
||||
strongSelf.navigationItem.setRightBarButton(nil, animated: true)
|
||||
strongSelf.navigationItem.setLeftBarButton(nil, animated: strongSelf.controllerNode.didSetReady)
|
||||
strongSelf.navigationItem.setRightBarButton(nil, animated: strongSelf.controllerNode.didSetReady)
|
||||
case .navigation:
|
||||
strongSelf.navigationItem.setRightBarButton(nil, animated: true)
|
||||
strongSelf.navigationItem.setRightBarButton(nil, animated: strongSelf.controllerNode.didSetReady)
|
||||
}
|
||||
} else {
|
||||
var pressedImpl: (() -> Void)?
|
||||
@@ -381,25 +381,24 @@ public final class CallListController: TelegramBaseController {
|
||||
switch strongSelf.mode {
|
||||
case .tab:
|
||||
if strongSelf.editingMode {
|
||||
strongSelf.navigationItem.setLeftBarButton(UIBarButtonItem(title: strongSelf.presentationData.strings.Common_Done, style: .done, target: strongSelf, action: #selector(strongSelf.donePressed)), animated: true)
|
||||
strongSelf.navigationItem.setRightBarButton(UIBarButtonItem(customDisplayNode: buttonNode), animated: true)
|
||||
strongSelf.navigationItem.setLeftBarButton(UIBarButtonItem(title: strongSelf.presentationData.strings.Common_Done, style: .done, target: strongSelf, action: #selector(strongSelf.donePressed)), animated: strongSelf.controllerNode.didSetReady)
|
||||
strongSelf.navigationItem.setRightBarButton(UIBarButtonItem(customDisplayNode: buttonNode), animated: strongSelf.controllerNode.didSetReady)
|
||||
strongSelf.navigationItem.rightBarButtonItem?.setCustomAction({
|
||||
pressedImpl?()
|
||||
})
|
||||
} else {
|
||||
strongSelf.navigationItem.setLeftBarButton(UIBarButtonItem(title: strongSelf.presentationData.strings.Common_Edit, style: .plain, target: strongSelf, action: #selector(strongSelf.editPressed)), animated: true)
|
||||
//strongSelf.navigationItem.setRightBarButton(UIBarButtonItem(image: PresentationResourcesRootController.navigationCallIcon(strongSelf.presentationData.theme), style: .plain, target: self, action: #selector(strongSelf.callPressed)), animated: true)
|
||||
strongSelf.navigationItem.setRightBarButton(nil, animated: true)
|
||||
strongSelf.navigationItem.setLeftBarButton(UIBarButtonItem(title: strongSelf.presentationData.strings.Common_Edit, style: .plain, target: strongSelf, action: #selector(strongSelf.editPressed)), animated: strongSelf.controllerNode.didSetReady)
|
||||
strongSelf.navigationItem.setRightBarButton(nil, animated: strongSelf.controllerNode.didSetReady)
|
||||
}
|
||||
case .navigation:
|
||||
if strongSelf.editingMode {
|
||||
strongSelf.navigationItem.setLeftBarButton(UIBarButtonItem(customDisplayNode: buttonNode), animated: true)
|
||||
strongSelf.navigationItem.setLeftBarButton(UIBarButtonItem(customDisplayNode: buttonNode), animated: strongSelf.controllerNode.didSetReady)
|
||||
strongSelf.navigationItem.leftBarButtonItem?.setCustomAction({
|
||||
pressedImpl?()
|
||||
})
|
||||
strongSelf.navigationItem.setRightBarButton(UIBarButtonItem(title: strongSelf.presentationData.strings.Common_Done, style: .done, target: strongSelf, action: #selector(strongSelf.donePressed)), animated: true)
|
||||
strongSelf.navigationItem.setRightBarButton(UIBarButtonItem(title: strongSelf.presentationData.strings.Common_Done, style: .done, target: strongSelf, action: #selector(strongSelf.donePressed)), animated: strongSelf.controllerNode.didSetReady)
|
||||
} else {
|
||||
strongSelf.navigationItem.setRightBarButton(UIBarButtonItem(title: strongSelf.presentationData.strings.Common_Edit, style: .plain, target: strongSelf, action: #selector(strongSelf.editPressed)), animated: true)
|
||||
strongSelf.navigationItem.setRightBarButton(UIBarButtonItem(title: strongSelf.presentationData.strings.Common_Edit, style: .plain, target: strongSelf, action: #selector(strongSelf.editPressed)), animated: strongSelf.controllerNode.didSetReady)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ import AnimatedStickerNode
|
||||
import TelegramAnimatedStickerNode
|
||||
import AppBundle
|
||||
import ItemListPeerActionItem
|
||||
import EdgeEffect
|
||||
import ComponentFlow
|
||||
import ComponentDisplayAdapters
|
||||
|
||||
private struct CallListNodeListViewTransition {
|
||||
let callListView: CallListNodeView
|
||||
@@ -185,7 +188,7 @@ final class CallListControllerNode: ASDisplayNode {
|
||||
private var containerLayout: (ContainerViewLayout, CGFloat)?
|
||||
|
||||
private let _ready = ValuePromise<Bool>()
|
||||
private var didSetReady = false
|
||||
private(set) var didSetReady = false
|
||||
var ready: Signal<Bool, NoError> {
|
||||
return _ready.get()
|
||||
}
|
||||
@@ -220,6 +223,8 @@ final class CallListControllerNode: ASDisplayNode {
|
||||
private let emptyButtonIconNode: ASImageNode
|
||||
private let emptyButtonTextNode: ImmediateTextNode
|
||||
|
||||
private let edgeEffectView: EdgeEffectView
|
||||
|
||||
private let call: (EngineMessage) -> Void
|
||||
private let joinGroupCall: (EnginePeer.Id, EngineGroupCallDescription) -> Void
|
||||
private let openNewCall: () -> Void
|
||||
@@ -277,6 +282,8 @@ final class CallListControllerNode: ASDisplayNode {
|
||||
self.emptyButtonIconNode.displaysAsynchronously = false
|
||||
self.emptyButtonIconNode.isUserInteractionEnabled = false
|
||||
|
||||
self.edgeEffectView = EdgeEffectView()
|
||||
|
||||
super.init()
|
||||
|
||||
self.setViewBlock({
|
||||
@@ -289,6 +296,8 @@ final class CallListControllerNode: ASDisplayNode {
|
||||
self.addSubnode(self.emptyButtonTextNode)
|
||||
self.addSubnode(self.emptyButtonIconNode)
|
||||
self.addSubnode(self.emptyButtonNode)
|
||||
|
||||
self.view.addSubview(self.edgeEffectView)
|
||||
|
||||
switch self.mode {
|
||||
case .tab:
|
||||
@@ -945,5 +954,10 @@ final class CallListControllerNode: ASDisplayNode {
|
||||
self.dequeuedInitialTransitionOnLayout = true
|
||||
self.dequeueTransition()
|
||||
}
|
||||
|
||||
let edgeEffectHeight: CGFloat = layout.intrinsicInsets.bottom
|
||||
let edgeEffectFrame = CGRect(origin: CGPoint(x: 0.0, y: layout.size.height - edgeEffectHeight), size: CGSize(width: layout.size.width, height: edgeEffectHeight))
|
||||
transition.updateFrame(view: self.edgeEffectView, frame: edgeEffectFrame)
|
||||
self.edgeEffectView.update(content: self.presentationData.theme.list.plainBackgroundColor, rect: edgeEffectFrame, edge: .bottom, edgeSize: edgeEffectFrame.height, transition: ComponentTransition(transition))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user