mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-06-08 02:53:56 +02:00
chore: migrate to new version + fixed several critical bugs
- Migrated project to latest Telegram iOS base (v12.3.2+) - Fixed circular dependency between GhostModeManager and MiscSettingsManager - Fixed multiple Bazel build configuration errors (select() default conditions) - Fixed duplicate type definitions in PeerInfoScreen - Fixed swiftmodule directory resolution in build scripts - Added Ghostgram Settings tab in main Settings menu with all 5 features - Cleared sensitive credentials from config.json (template-only now) - Excluded bazel-cache from version control
This commit is contained in:
@@ -42,7 +42,6 @@ swift_library(
|
||||
"//submodules/ChatPresentationInterfaceState",
|
||||
"//submodules/TelegramUI/Components/EmojiSuggestionsComponent",
|
||||
"//submodules/TelegramUI/Components/ListComposePollOptionComponent",
|
||||
"//submodules/TelegramUI/Components/EdgeEffect",
|
||||
"//submodules/TelegramUI/Components/GlassBarButtonComponent",
|
||||
],
|
||||
visibility = [
|
||||
|
||||
@@ -27,7 +27,6 @@ import EmojiSuggestionsComponent
|
||||
import TextFormat
|
||||
import TextFieldComponent
|
||||
import ListComposePollOptionComponent
|
||||
import EdgeEffect
|
||||
import GlassBarButtonComponent
|
||||
|
||||
public final class ComposedPoll {
|
||||
@@ -76,6 +75,7 @@ final class ComposePollScreenComponent: Component {
|
||||
typealias EnvironmentType = ViewControllerComponentContainer.Environment
|
||||
|
||||
let context: AccountContext
|
||||
let overNavigationContainer: UIView
|
||||
let peer: EnginePeer
|
||||
let isQuiz: Bool?
|
||||
let initialData: ComposePollScreen.InitialData
|
||||
@@ -83,12 +83,14 @@ final class ComposePollScreenComponent: Component {
|
||||
|
||||
init(
|
||||
context: AccountContext,
|
||||
overNavigationContainer: UIView,
|
||||
peer: EnginePeer,
|
||||
isQuiz: Bool?,
|
||||
initialData: ComposePollScreen.InitialData,
|
||||
completion: @escaping (ComposedPoll) -> Void
|
||||
) {
|
||||
self.context = context
|
||||
self.overNavigationContainer = overNavigationContainer
|
||||
self.peer = peer
|
||||
self.isQuiz = isQuiz
|
||||
self.initialData = initialData
|
||||
@@ -112,7 +114,6 @@ final class ComposePollScreenComponent: Component {
|
||||
|
||||
final class View: UIView, UIScrollViewDelegate {
|
||||
private let scrollView: UIScrollView
|
||||
private let edgeEffectView: EdgeEffectView
|
||||
|
||||
private var reactionInput: ComponentView<Empty>?
|
||||
private let pollTextSection = ComponentView<Empty>()
|
||||
@@ -184,8 +185,6 @@ final class ComposePollScreenComponent: Component {
|
||||
self.scrollView.contentInsetAdjustmentBehavior = .never
|
||||
self.scrollView.alwaysBounceVertical = true
|
||||
|
||||
self.edgeEffectView = EdgeEffectView()
|
||||
|
||||
self.pollOptionsSectionContainer = ListSectionContentView(frame: CGRect())
|
||||
|
||||
super.init(frame: frame)
|
||||
@@ -193,8 +192,6 @@ final class ComposePollScreenComponent: Component {
|
||||
self.scrollView.delegate = self
|
||||
self.addSubview(self.scrollView)
|
||||
|
||||
self.addSubview(self.edgeEffectView)
|
||||
|
||||
let reorderRecognizer = ReorderGestureRecognizer(
|
||||
shouldBegin: { [weak self] point in
|
||||
guard let self, let (id, item) = self.item(at: point) else {
|
||||
@@ -550,7 +547,6 @@ final class ComposePollScreenComponent: Component {
|
||||
pendingUnpinnedAllMessages: false,
|
||||
activeGroupCallInfo: nil,
|
||||
hasActiveGroupCall: false,
|
||||
importState: nil,
|
||||
threadData: nil,
|
||||
isGeneralThreadClosed: nil,
|
||||
replyMessage: nil,
|
||||
@@ -1624,11 +1620,6 @@ final class ComposePollScreenComponent: Component {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
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.edgeEffectView, frame: edgeEffectFrame)
|
||||
self.edgeEffectView.update(content: theme.list.blocksBackgroundColor, blur: true, alpha: 1.0, rect: edgeEffectFrame, edge: .top, edgeSize: edgeEffectFrame.height, transition: transition)
|
||||
|
||||
let title = self.isQuiz ? environment.strings.CreatePoll_QuizTitle : environment.strings.CreatePoll_Title
|
||||
let titleSize = self.title.update(
|
||||
transition: .immediate,
|
||||
@@ -1649,23 +1640,23 @@ final class ComposePollScreenComponent: Component {
|
||||
let titleFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((availableSize.width - titleSize.width) / 2.0), y: floorToScreenPixels((environment.navigationHeight - titleSize.height) / 2.0) + 3.0), size: titleSize)
|
||||
if let titleView = self.title.view {
|
||||
if titleView.superview == nil {
|
||||
self.addSubview(titleView)
|
||||
component.overNavigationContainer.addSubview(titleView)
|
||||
}
|
||||
transition.setFrame(view: titleView, frame: titleFrame)
|
||||
}
|
||||
|
||||
let barButtonSize = CGSize(width: 40.0, height: 40.0)
|
||||
let barButtonSize = CGSize(width: 44.0, height: 44.0)
|
||||
let cancelButtonSize = self.cancelButton.update(
|
||||
transition: transition,
|
||||
component: AnyComponent(GlassBarButtonComponent(
|
||||
size: barButtonSize,
|
||||
backgroundColor: environment.theme.rootController.navigationBar.glassBarButtonBackgroundColor,
|
||||
backgroundColor: nil,
|
||||
isDark: environment.theme.overallDarkAppearance,
|
||||
state: .generic,
|
||||
state: .glass,
|
||||
component: AnyComponentWithIdentity(id: "close", component: AnyComponent(
|
||||
BundleIconComponent(
|
||||
name: "Navigation/Close",
|
||||
tintColor: environment.theme.rootController.navigationBar.glassBarButtonForegroundColor
|
||||
tintColor: environment.theme.chat.inputPanel.panelControlColor
|
||||
)
|
||||
)),
|
||||
action: { [weak self] _ in
|
||||
@@ -1681,7 +1672,7 @@ final class ComposePollScreenComponent: Component {
|
||||
let cancelButtonFrame = CGRect(origin: CGPoint(x: environment.safeInsets.left + 16.0, y: 16.0), size: cancelButtonSize)
|
||||
if let cancelButtonView = self.cancelButton.view {
|
||||
if cancelButtonView.superview == nil {
|
||||
self.addSubview(cancelButtonView)
|
||||
component.overNavigationContainer.addSubview(cancelButtonView)
|
||||
}
|
||||
transition.setFrame(view: cancelButtonView, frame: cancelButtonFrame)
|
||||
}
|
||||
@@ -1717,7 +1708,7 @@ final class ComposePollScreenComponent: Component {
|
||||
let doneButtonFrame = CGRect(origin: CGPoint(x: availableSize.width - environment.safeInsets.right - 16.0 - doneButtonSize.width, y: 16.0), size: doneButtonSize)
|
||||
if let doneButtonView = self.doneButton.view {
|
||||
if doneButtonView.superview == nil {
|
||||
self.addSubview(doneButtonView)
|
||||
component.overNavigationContainer.addSubview(doneButtonView)
|
||||
}
|
||||
transition.setFrame(view: doneButtonView, frame: doneButtonFrame)
|
||||
}
|
||||
@@ -1798,6 +1789,8 @@ public class ComposePollScreen: ViewControllerComponentContainer, AttachmentCont
|
||||
fileprivate let completion: (ComposedPoll) -> Void
|
||||
private var isDismissed: Bool = false
|
||||
|
||||
private let overNavigationContainer: UIView
|
||||
|
||||
fileprivate private(set) var sendButtonItem: UIBarButtonItem?
|
||||
|
||||
public var isMinimized: Bool = false
|
||||
@@ -1842,13 +1835,16 @@ public class ComposePollScreen: ViewControllerComponentContainer, AttachmentCont
|
||||
self.context = context
|
||||
self.completion = completion
|
||||
|
||||
self.overNavigationContainer = SparseContainerView()
|
||||
|
||||
super.init(context: context, component: ComposePollScreenComponent(
|
||||
context: context,
|
||||
overNavigationContainer: self.overNavigationContainer,
|
||||
peer: peer,
|
||||
isQuiz: isQuiz,
|
||||
initialData: initialData,
|
||||
completion: completion
|
||||
), navigationBarAppearance: .transparent, theme: .default)
|
||||
), navigationBarAppearance: .default, theme: .default)
|
||||
|
||||
self._hasGlassStyle = true
|
||||
|
||||
@@ -1883,6 +1879,10 @@ public class ComposePollScreen: ViewControllerComponentContainer, AttachmentCont
|
||||
|
||||
return componentView.attemptNavigation(complete: complete)
|
||||
}
|
||||
|
||||
if let navigationBar = self.navigationBar {
|
||||
navigationBar.customOverBackgroundContentView.insertSubview(self.overNavigationContainer, at: 0)
|
||||
}
|
||||
}
|
||||
|
||||
required public init(coder aDecoder: NSCoder) {
|
||||
|
||||
Reference in New Issue
Block a user