mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Quote improvements
This commit is contained in:
@@ -147,6 +147,7 @@ private func processPollText(_ text: String) -> String {
|
||||
}
|
||||
|
||||
private final class CreatePollControllerArguments {
|
||||
let context: AccountContext
|
||||
let updatePollText: (String) -> Void
|
||||
let updateOptionText: (Int, String, Bool) -> Void
|
||||
let moveToNextOption: (Int) -> Void
|
||||
@@ -163,7 +164,8 @@ private final class CreatePollControllerArguments {
|
||||
let solutionTextFocused: (Bool) -> Void
|
||||
let questionTextFocused: (Bool) -> Void
|
||||
|
||||
init(updatePollText: @escaping (String) -> Void, updateOptionText: @escaping (Int, String, Bool) -> Void, moveToNextOption: @escaping (Int) -> Void, moveToPreviousOption: @escaping (Int) -> Void, removeOption: @escaping (Int, Bool) -> Void, optionFocused: @escaping (Int, Bool) -> Void, setItemIdWithRevealedOptions: @escaping (Int?, Int?) -> Void, toggleOptionSelected: @escaping (Int) -> Void, updateAnonymous: @escaping (Bool) -> Void, updateMultipleChoice: @escaping (Bool) -> Void, displayMultipleChoiceDisabled: @escaping () -> Void, updateQuiz: @escaping (Bool) -> Void, updateSolutionText: @escaping (NSAttributedString) -> Void, solutionTextFocused: @escaping (Bool) -> Void, questionTextFocused: @escaping (Bool) -> Void) {
|
||||
init(context: AccountContext, updatePollText: @escaping (String) -> Void, updateOptionText: @escaping (Int, String, Bool) -> Void, moveToNextOption: @escaping (Int) -> Void, moveToPreviousOption: @escaping (Int) -> Void, removeOption: @escaping (Int, Bool) -> Void, optionFocused: @escaping (Int, Bool) -> Void, setItemIdWithRevealedOptions: @escaping (Int?, Int?) -> Void, toggleOptionSelected: @escaping (Int) -> Void, updateAnonymous: @escaping (Bool) -> Void, updateMultipleChoice: @escaping (Bool) -> Void, displayMultipleChoiceDisabled: @escaping () -> Void, updateQuiz: @escaping (Bool) -> Void, updateSolutionText: @escaping (NSAttributedString) -> Void, solutionTextFocused: @escaping (Bool) -> Void, questionTextFocused: @escaping (Bool) -> Void) {
|
||||
self.context = context
|
||||
self.updatePollText = updatePollText
|
||||
self.updateOptionText = updateOptionText
|
||||
self.moveToNextOption = moveToNextOption
|
||||
@@ -397,7 +399,7 @@ private enum CreatePollEntry: ItemListNodeEntry {
|
||||
case let .quizSolutionHeader(text):
|
||||
return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section)
|
||||
case let .quizSolutionText(placeholder, text):
|
||||
return CreatePollTextInputItem(presentationData: presentationData, text: text.value, placeholder: placeholder, maxLength: CreatePollTextInputItemTextLimit(value: 200, display: true), sectionId: self.section, style: .blocks, textUpdated: { text in
|
||||
return CreatePollTextInputItem(context: arguments.context, presentationData: presentationData, text: text.value, placeholder: placeholder, maxLength: CreatePollTextInputItemTextLimit(value: 200, display: true), sectionId: self.section, style: .blocks, textUpdated: { text in
|
||||
arguments.updateSolutionText(text)
|
||||
}, updatedFocus: { value in
|
||||
arguments.solutionTextFocused(value)
|
||||
@@ -664,7 +666,7 @@ private func legacyCreatePollController(context: AccountContext, updatedPresenta
|
||||
let updateAddressNameDisposable = MetaDisposable()
|
||||
actionsDisposable.add(updateAddressNameDisposable)
|
||||
|
||||
let arguments = CreatePollControllerArguments(updatePollText: { value in
|
||||
let arguments = CreatePollControllerArguments(context: context, updatePollText: { value in
|
||||
updateState { state in
|
||||
var state = state
|
||||
state.focusOptionId = nil
|
||||
|
||||
Reference in New Issue
Block a user