mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Various fixes
This commit is contained in:
parent
e990abd718
commit
c5f4cf179e
@ -242,6 +242,7 @@ private final class CameraScreenComponent: CombinedComponent {
|
||||
var isTransitioning = false
|
||||
|
||||
var displayingFlashTint = false
|
||||
var previousFlashMode: Camera.FlashMode?
|
||||
|
||||
private let hapticFeedback = HapticFeedback()
|
||||
|
||||
@ -553,7 +554,7 @@ private final class CameraScreenComponent: CombinedComponent {
|
||||
self.completion.invoke(takePhoto)
|
||||
}
|
||||
|
||||
let isFrontCamera = controller.cameraState.position == .front
|
||||
let isFrontCamera = controller.cameraState.position == .front || controller.cameraState.isDualCameraEnabled
|
||||
let isFlashOn = controller.cameraState.flashMode == .on
|
||||
|
||||
if isFrontCamera && isFlashOn {
|
||||
@ -980,7 +981,11 @@ private final class CameraScreenComponent: CombinedComponent {
|
||||
let flashIconName: String
|
||||
switch component.cameraState.flashMode {
|
||||
case .off:
|
||||
flashIconName = "flash_off"
|
||||
if let previousFlashMode = state.previousFlashMode, previousFlashMode == .on {
|
||||
flashIconName = "flash_onToOff"
|
||||
} else {
|
||||
flashIconName = "flash_off"
|
||||
}
|
||||
case .on:
|
||||
flashIconName = "flash_on"
|
||||
case .auto:
|
||||
@ -988,6 +993,7 @@ private final class CameraScreenComponent: CombinedComponent {
|
||||
@unknown default:
|
||||
flashIconName = "flash_off"
|
||||
}
|
||||
state.previousFlashMode = component.cameraState.flashMode
|
||||
|
||||
flashContentComponent = AnyComponentWithIdentity(
|
||||
id: "animatedIcon",
|
||||
@ -2440,6 +2446,13 @@ public class CameraScreen: ViewController {
|
||||
let componentFrame = CGRect(origin: .zero, size: componentSize)
|
||||
transition.setFrame(view: componentView, frame: componentFrame)
|
||||
}
|
||||
|
||||
if let view = self.componentHost.findTaggedView(tag: cancelButtonTag), view.layer.shadowOpacity.isZero {
|
||||
view.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
|
||||
view.layer.shadowRadius = 3.0
|
||||
view.layer.shadowColor = UIColor.black.cgColor
|
||||
view.layer.shadowOpacity = 0.25
|
||||
}
|
||||
|
||||
if let view = self.componentHost.findTaggedView(tag: flashButtonTag), view.layer.shadowOpacity.isZero {
|
||||
view.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
|
||||
|
@ -70,7 +70,7 @@ final class ApplyColorFooterItemNode: ItemListControllerFooterItemNode {
|
||||
super.init()
|
||||
|
||||
self.addSubnode(self.backgroundNode)
|
||||
// self.addSubnode(self.separatorNode)
|
||||
self.addSubnode(self.separatorNode)
|
||||
self.addSubnode(self.buttonNode)
|
||||
|
||||
self.updateItem()
|
||||
|
@ -109,10 +109,10 @@ final class EmojiPickerItemNode: ListViewItemNode {
|
||||
let insets: UIEdgeInsets
|
||||
let separatorHeight = UIScreenPixel
|
||||
|
||||
let contentSize = CGSize(width: params.width, height: 190.0)
|
||||
let contentSize = CGSize(width: params.width, height: 200.0)
|
||||
insets = itemListNeighborsGroupedInsets(neighbors, params)
|
||||
|
||||
let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets)
|
||||
let layout = ListViewItemNodeLayout(contentSize: CGSize(width: params.width, height: contentSize.height - 20.0), insets: insets)
|
||||
let layoutSize = layout.size
|
||||
|
||||
return (layout, { [weak self] in
|
||||
|
@ -450,6 +450,9 @@ private final class StoryContainerScreenComponent: Component {
|
||||
guard let self, let stateValue = self.stateValue, let slice = stateValue.slice, let itemSetView = self.visibleItemSetViews[slice.peer.id], let itemSetComponentView = itemSetView.view.view as? StoryItemSetContainerComponent.View else {
|
||||
return []
|
||||
}
|
||||
if self.isDisplayingInteractionGuide {
|
||||
return []
|
||||
}
|
||||
if let environment = self.environment, case .regular = environment.metrics.widthClass {
|
||||
} else {
|
||||
if !itemSetComponentView.isPointInsideContentArea(point: self.convert(point, to: itemSetComponentView)) {
|
||||
@ -568,6 +571,9 @@ private final class StoryContainerScreenComponent: Component {
|
||||
guard let self else {
|
||||
return false
|
||||
}
|
||||
if self.isDisplayingInteractionGuide {
|
||||
return false
|
||||
}
|
||||
if let stateValue = self.stateValue, let slice = stateValue.slice, let itemSetView = self.visibleItemSetViews[slice.peer.id] {
|
||||
if let itemSetComponentView = itemSetView.view.view as? StoryItemSetContainerComponent.View {
|
||||
let itemLocation = self.convert(pinchLocation, to: itemSetComponentView)
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user