Add app icon shortcut

This commit is contained in:
Ilya Laktyushin
2024-04-20 22:20:01 +04:00
parent e32b2d3d09
commit 4956d1a79a
12 changed files with 58 additions and 25 deletions

View File

@@ -273,6 +273,23 @@ public final class TelegramRootController: NavigationController, TelegramRootCon
presentedLegacyShortcutCamera(context: self.context, saveCapturedMedia: false, saveEditedPhotos: false, mediaGrouping: true, parentController: controller)
}
public func openAppIcon() {
guard let rootTabController = self.rootTabController else {
return
}
self.popToRoot(animated: false)
if let index = rootTabController.controllers.firstIndex(where: { $0 is PeerInfoScreenImpl }) {
rootTabController.selectedIndex = index
}
let themeController = themeSettingsController(context: self.context, focusOnItemTag: .icon)
var controllers: [UIViewController] = Array(self.viewControllers.prefix(1))
controllers.append(themeController)
self.setViewControllers(controllers, animated: true)
}
@discardableResult
public func openStoryCamera(customTarget: EnginePeer.Id?, transitionIn: StoryCameraTransitionIn?, transitionedIn: @escaping () -> Void, transitionOut: @escaping (Stories.PendingTarget?, Bool) -> StoryCameraTransitionOut?) -> StoryCameraTransitionInCoordinator? {
guard let controller = self.viewControllers.last as? ViewController else {