Skip to content

Commit

Permalink
/issues/5114 - Poll creation screen
Browse files Browse the repository at this point in the history
- added input toolbar poll creation action.
- reordered input toolbar actions as per designs.
- added multiline text field and extracted common components.
  • Loading branch information
stefanceriu committed Nov 11, 2021
1 parent b7d25cb commit 30ff8a6
Show file tree
Hide file tree
Showing 50 changed files with 1,231 additions and 42 deletions.
7 changes: 7 additions & 0 deletions Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ final class BuildSettings: NSObject {
static let roomScreenAllowMediaLibraryAction: Bool = true
static let roomScreenAllowStickerAction: Bool = true
static let roomScreenAllowFilesAction: Bool = true
static var roomScreenAllowPollsAction: Bool {
guard #available(iOS 14, *) else {
return false
}

return false
}

/// Allow split view detail view stacking
static let allowSplitViewDetailsScreenStacking: Bool = true
Expand Down
6 changes: 5 additions & 1 deletion DesignKit/Source/FontsSwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import SwiftUI
*/
@available(iOS 14.0, *)
public struct FontSwiftUI: Fonts {

public let uiFonts: ElementFonts

public var largeTitle: Font

public var largeTitleB: Font
Expand Down Expand Up @@ -63,6 +66,8 @@ public struct FontSwiftUI: Fonts {
public var caption2SB: Font

public init(values: ElementFonts) {
self.uiFonts = values

self.largeTitle = Font(values.largeTitle)
self.largeTitleB = Font(values.largeTitleB)
self.title1 = Font(values.title1)
Expand All @@ -85,4 +90,3 @@ public struct FontSwiftUI: Fonts {
self.caption2SB = Font(values.caption2SB)
}
}

17 changes: 16 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ end

########################################

def import_SwiftUI_pods
pod 'Introspect', '~> 0.1'
end

abstract_target 'RiotPods' do

pod 'GBDeviceInfo', '~> 6.6.0'
Expand All @@ -63,6 +67,9 @@ abstract_target 'RiotPods' do

target "Riot" do
import_MatrixKit

import_SwiftUI_pods

pod 'DGCollectionViewLeftAlignFlowLayout', '~> 1.0.4'
pod 'KTCenterFlowLayout', '~> 1.3.1'
pod 'ZXingObjC', '~> 3.6.5'
Expand All @@ -73,7 +80,7 @@ abstract_target 'RiotPods' do
pod 'SideMenu', '~> 6.5'
pod 'DSWaveformImage', '~> 6.1.1'
pod 'ffmpeg-kit-ios-audio', '~> 4.5'

pod 'FLEX', '~> 4.5.0', :configurations => ['Debug']

target 'RiotTests' do
Expand All @@ -85,6 +92,14 @@ abstract_target 'RiotPods' do
import_MatrixKit
end

target "RiotSwiftUI" do
import_SwiftUI_pods
end

target "RiotSwiftUITests" do
import_SwiftUI_pods
end

target "SiriIntents" do
import_MatrixKit
end
Expand Down
22 changes: 11 additions & 11 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PODS:
- AFNetworking/NSURLSession
- BlueCryptor (1.0.32)
- BlueECC (1.2.5)
- BlueRSA (1.0.34)
- BlueRSA (1.0.200)
- DGCollectionViewLeftAlignFlowLayout (1.0.4)
- Down (0.11.0)
- DSWaveformImage (6.1.1)
Expand All @@ -39,13 +39,13 @@ PODS:
- DTFoundation/Core
- ffmpeg-kit-ios-audio (4.5)
- FLEX (4.5.0)
- FlowCommoniOS (1.12.0)
- FlowCommoniOS (1.12.2)
- GBDeviceInfo (6.6.0):
- GBDeviceInfo/Core (= 6.6.0)
- GBDeviceInfo/Core (6.6.0)
- GrowingTextView (0.7.2)
- GZIP (1.3.0)
- HPGrowingTextView (1.1)
- Introspect (0.1.3)
- JitsiMeetSDK (3.10.2)
- KeychainAccess (4.2.2)
- KituraContracts (1.2.1):
Expand Down Expand Up @@ -100,7 +100,7 @@ PODS:
- Reusable/View (4.1.2)
- SideMenu (6.5.0)
- SwiftBase32 (0.9.0)
- SwiftGen (6.4.0)
- SwiftGen (6.5.1)
- SwiftJWT (3.6.200):
- BlueCryptor (~> 1.0)
- BlueECC (~> 1.1)
Expand All @@ -122,7 +122,7 @@ DEPENDENCIES:
- FLEX (~> 4.5.0)
- FlowCommoniOS (~> 1.12.0)
- GBDeviceInfo (~> 6.6.0)
- GrowingTextView (~> 0.7.2)
- Introspect (~> 0.1)
- KeychainAccess (~> 4.2.2)
- KTCenterFlowLayout (~> 1.3.1)
- MatomoTracker (~> 7.4.1)
Expand Down Expand Up @@ -156,9 +156,9 @@ SPEC REPOS:
- FLEX
- FlowCommoniOS
- GBDeviceInfo
- GrowingTextView
- GZIP
- HPGrowingTextView
- Introspect
- JitsiMeetSDK
- KeychainAccess
- KituraContracts
Expand Down Expand Up @@ -188,19 +188,19 @@ SPEC CHECKSUMS:
AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce
BlueCryptor: b0aee3d9b8f367b49b30de11cda90e1735571c24
BlueECC: 0d18e93347d3ec6d41416de21c1ffa4d4cd3c2cc
BlueRSA: 6f9776d62d9773502415a7db3bcbb2bbb3f71fc3
BlueRSA: dfeef51db96bcc4edec654956c1581adbda4e6a3
DGCollectionViewLeftAlignFlowLayout: a0fa58797373ded039cafba8133e79373d048399
Down: b6ba1bc985c9d2f4e15e3b293d2207766fa12612
DSWaveformImage: 3c718a0cf99291887ee70d1d0c18d80101d3d9ce
DTCoreText: ec749e013f2e1f76de5e7c7634642e600a7467ce
DTFoundation: a53f8cda2489208cbc71c648be177f902ee17536
ffmpeg-kit-ios-audio: 8c44d93054e1a9743a7014ec3dd26cd1ad8f2a59
FLEX: e51461dd6f0bfb00643c262acdfea5d5d12c596b
FlowCommoniOS: e9ecbc97fb9ce5c593fb3da0e1073b65a3902026
FlowCommoniOS: ca92071ab526dc89905495a37844fd7e78d1a7f2
GBDeviceInfo: ed0db16230d2fa280e1cbb39a5a7f60f6946aaec
GrowingTextView: 876bf42005b5e4a4fd740597db12caaf41f0fe6c
GZIP: 416858efbe66b41b206895ac6dfd5493200d95b3
HPGrowingTextView: 88a716d97fb853bcb08a4a08e4727da17efc9b19
Introspect: 2be020f30f084ada52bb4387fff83fa52c5c400e
JitsiMeetSDK: 2f118fa770f23e518f3560fc224fae3ac7062223
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
KituraContracts: e845e60dc8627ad0a76fa55ef20a45451d8f830b
Expand All @@ -218,14 +218,14 @@ SPEC CHECKSUMS:
Reusable: 6bae6a5e8aa793c9c441db0213c863a64bce9136
SideMenu: f583187d21c5b1dd04c72002be544b555a2627a2
SwiftBase32: 9399c25a80666dc66b51e10076bf591e3bbb8f17
SwiftGen: 67860cc7c3cfc2ed25b9b74cfd55495fc89f9108
SwiftGen: a6d22010845f08fe18fbdf3a07a8e380fd22e0ea
SwiftJWT: 88c412708f58c169d431d344c87bc79a87c830ae
SwiftLint: e96c0a8c770c7ebbc4d36c55baf9096bb65c4584
SwiftyBeaver: 84069991dd5dca07d7069100985badaca7f0ce82
WeakDictionary: 8cd038acd77e5d54ca4ebaec3d20853d732b45e0
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: 2740772a9b2d32e17876526875dfc58f67240ba0
PODFILE CHECKSUM: 56547a5087a419eb4461b0fb59380381194392dc

COCOAPODS: 1.11.2
3 changes: 2 additions & 1 deletion Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
buildImplicitDependencies = "YES"
runPostActionsOnFailure = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "action_poll.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "action_poll@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "action_poll@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Riot/Assets/Images.xcassets/Room/Polls/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "poll_delete_icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "poll_delete_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "poll_delete_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "poll_delete_option_icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "poll_delete_option_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "poll_delete_option_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "poll_edit_icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "poll_edit_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "poll_edit_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "poll_end_icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "poll_end_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "poll_end_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1780,3 +1780,19 @@ Tap the + to start adding people.";
"version_check_modal_title_deprecated" = "We’re no longer supporting iOS %@";
"version_check_modal_subtitle_deprecated" = "We've been working on enhancing %@ for a faster and more polished experience. Unfortunately your current version of iOS is not compatible with some of those fixes and is no longer supported.\nWe're advising you to upgrade your operating system to use %@ to its full potential.";
"version_check_modal_action_title_deprecated" = "Find out how";

// Mark: - Polls

"poll_edit_form_create_poll" = "Create poll";

"poll_edit_form_poll_question_or_topic" = "Poll question or topic";

"poll_edit_form_question_or_topic" = "Question or topic";

"poll_edit_form_input_placeholder" = "Write something";

"poll_edit_form_create_options" = "Create options";

"poll_edit_form_option_number" = "Option %d";

"poll_edit_form_add_option" = "Add option";
5 changes: 5 additions & 0 deletions Riot/Generated/Images.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ internal enum Asset {
internal static let actionCamera = ImageAsset(name: "action_camera")
internal static let actionFile = ImageAsset(name: "action_file")
internal static let actionMediaLibrary = ImageAsset(name: "action_media_library")
internal static let actionPoll = ImageAsset(name: "action_poll")
internal static let actionSticker = ImageAsset(name: "action_sticker")
internal static let error = ImageAsset(name: "error")
internal static let errorMessageTick = ImageAsset(name: "error_message_tick")
Expand Down Expand Up @@ -142,6 +143,10 @@ internal enum Asset {
internal static let videoCall = ImageAsset(name: "video_call")
internal static let voiceCallHangonIcon = ImageAsset(name: "voice_call_hangon_icon")
internal static let voiceCallHangupIcon = ImageAsset(name: "voice_call_hangup_icon")
internal static let pollDeleteIcon = ImageAsset(name: "poll_delete_icon")
internal static let pollDeleteOptionIcon = ImageAsset(name: "poll_delete_option_icon")
internal static let pollEditIcon = ImageAsset(name: "poll_edit_icon")
internal static let pollEndIcon = ImageAsset(name: "poll_end_icon")
internal static let urlPreviewClose = ImageAsset(name: "url_preview_close")
internal static let urlPreviewCloseDark = ImageAsset(name: "url_preview_close_dark")
internal static let voiceMessageCancelGradient = ImageAsset(name: "voice_message_cancel_gradient")
Expand Down
28 changes: 28 additions & 0 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2363,6 +2363,34 @@ public class VectorL10n: NSObject {
public static func pinProtectionSettingsSectionHeaderWithBiometrics(_ p1: String) -> String {
return VectorL10n.tr("Vector", "pin_protection_settings_section_header_with_biometrics", p1)
}
/// Add option
public static var pollEditFormAddOption: String {
return VectorL10n.tr("Vector", "poll_edit_form_add_option")
}
/// Create options
public static var pollEditFormCreateOptions: String {
return VectorL10n.tr("Vector", "poll_edit_form_create_options")
}
/// Create poll
public static var pollEditFormCreatePoll: String {
return VectorL10n.tr("Vector", "poll_edit_form_create_poll")
}
/// Write something
public static var pollEditFormInputPlaceholder: String {
return VectorL10n.tr("Vector", "poll_edit_form_input_placeholder")
}
/// Option %d
public static func pollEditFormOptionNumber(_ p1: Int) -> String {
return VectorL10n.tr("Vector", "poll_edit_form_option_number", p1)
}
/// Poll question or topic
public static var pollEditFormPollQuestionOrTopic: String {
return VectorL10n.tr("Vector", "poll_edit_form_poll_question_or_topic")
}
/// Question or topic
public static var pollEditFormQuestionOrTopic: String {
return VectorL10n.tr("Vector", "poll_edit_form_question_or_topic")
}
/// Preview
public static var preview: String {
return VectorL10n.tr("Vector", "preview")
Expand Down
2 changes: 1 addition & 1 deletion Riot/Managers/Settings/RiotSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ final class RiotSettings: NSObject {

@UserDefault(key: "roomScreenAllowFilesAction", defaultValue: BuildSettings.roomScreenAllowFilesAction, storage: defaults)
var roomScreenAllowFilesAction

@UserDefault(key: "roomScreenShowsURLPreviews", defaultValue: true, storage: defaults)
var roomScreenShowsURLPreviews

Expand Down
Loading

0 comments on commit 30ff8a6

Please sign in to comment.