diff --git a/Riot.xcodeproj/project.pbxproj b/Riot.xcodeproj/project.pbxproj index c6cb33c76..b5b738cfc 100644 --- a/Riot.xcodeproj/project.pbxproj +++ b/Riot.xcodeproj/project.pbxproj @@ -203,6 +203,8 @@ B110872621F098F0003554A5 /* ActivityIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B110872221F098F0003554A5 /* ActivityIndicatorView.swift */; }; B11291EA238D35590077B478 /* SlidingModalPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B11291E9238D35590077B478 /* SlidingModalPresentable.swift */; }; B11291EC238D704C0077B478 /* FloatingPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = B11291EB238D704C0077B478 /* FloatingPoint.swift */; }; + B11F4D1C25680010009F1586 /* HomeEmptyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B11F4D1A25680010009F1586 /* HomeEmptyView.xib */; }; + B11F4D1D25680010009F1586 /* HomeEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B11F4D1B25680010009F1586 /* HomeEmptyView.swift */; }; B120863722EF375F001F89E0 /* ReactionHistoryBridgeCoordinatorPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B120863622EF375F001F89E0 /* ReactionHistoryBridgeCoordinatorPresenter.swift */; }; B125FE1B231D5BF200B72806 /* SettingsDiscoveryTableViewSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = B125FE1A231D5BF200B72806 /* SettingsDiscoveryTableViewSection.swift */; }; B125FE1D231D5DE400B72806 /* SettingsDiscoveryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B125FE1C231D5DE400B72806 /* SettingsDiscoveryViewModel.swift */; }; @@ -1240,6 +1242,8 @@ B110872221F098F0003554A5 /* ActivityIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivityIndicatorView.swift; sourceTree = ""; }; B11291E9238D35590077B478 /* SlidingModalPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SlidingModalPresentable.swift; sourceTree = ""; }; B11291EB238D704C0077B478 /* FloatingPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloatingPoint.swift; sourceTree = ""; }; + B11F4D1A25680010009F1586 /* HomeEmptyView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeEmptyView.xib; sourceTree = ""; }; + B11F4D1B25680010009F1586 /* HomeEmptyView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeEmptyView.swift; sourceTree = ""; }; B120863622EF375F001F89E0 /* ReactionHistoryBridgeCoordinatorPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionHistoryBridgeCoordinatorPresenter.swift; sourceTree = ""; }; B125FE1A231D5BF200B72806 /* SettingsDiscoveryTableViewSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsDiscoveryTableViewSection.swift; sourceTree = ""; }; B125FE1C231D5DE400B72806 /* SettingsDiscoveryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsDiscoveryViewModel.swift; sourceTree = ""; }; @@ -4456,6 +4460,8 @@ B1B5594320EF7BD000210D55 /* TableViewCellWithCollectionView.h */, B1B5594020EF7BD000210D55 /* TableViewCellWithCollectionView.m */, B1B5593F20EF7BD000210D55 /* TableViewCellWithCollectionView.xib */, + B11F4D1B25680010009F1586 /* HomeEmptyView.swift */, + B11F4D1A25680010009F1586 /* HomeEmptyView.xib */, ); path = Views; sourceTree = ""; @@ -5934,6 +5940,7 @@ B1B5582B20EF666100210D55 /* DirectoryRecentTableViewCell.xib in Resources */, B105778F2213052A00334B1E /* KeyBackupSetupSuccessFromRecoveryKeyViewController.storyboard in Resources */, EC1CA89924C9C9A200DE9EBF /* SetupBiometricsViewController.storyboard in Resources */, + B11F4D1C25680010009F1586 /* HomeEmptyView.xib in Resources */, B1B5590F20EF782800210D55 /* TableViewCellWithPhoneNumberTextField.xib in Resources */, B1B5578520EF564900210D55 /* GroupTableViewCellWithSwitch.xib in Resources */, B1B557B320EF5AEF00210D55 /* EventDetailsView.xib in Resources */, @@ -6918,6 +6925,7 @@ B10A3E9C24FE88CB007C380F /* RootRouter.swift in Sources */, B1C562E8228C7CF20037F12A /* ContextualMenuItemView.swift in Sources */, B14F143022144F6500FA0595 /* KeyBackupRecoverFromRecoveryKeyCoordinatorType.swift in Sources */, + B11F4D1D25680010009F1586 /* HomeEmptyView.swift in Sources */, B1E5368921FB1E20001F3AFF /* UIButton.swift in Sources */, B1DCC63422E72C1B00625807 /* UISearchBar.swift in Sources */, 32A6001622C661100042C1D9 /* EditHistoryViewState.swift in Sources */, diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index f6a017fea..1a85fe047 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -1516,3 +1516,8 @@ "room_info_list_one_member" = "1 member"; "room_info_list_several_members" = "%@ members"; "room_info_list_section_other" = "Other"; + +// MARK: - Home + +"home_empty_view_title" = "Welcome to Element,\n%@"; +"home_empty_view_information" = "The all-in-one secure chat app for teams, friends and organisations. Tap the + to add people and rooms."; diff --git a/Riot/Generated/Images.swift b/Riot/Generated/Images.swift index eb3d1fe8a..d8a8f46f1 100644 --- a/Riot/Generated/Images.swift +++ b/Riot/Generated/Images.swift @@ -65,6 +65,7 @@ internal enum Asset { internal static let roomActionNotification = ImageAsset(name: "room_action_notification") internal static let roomActionPriorityHigh = ImageAsset(name: "room_action_priority_high") internal static let roomActionPriorityLow = ImageAsset(name: "room_action_priority_low") + internal static let homePlaceholderArtwork = ImageAsset(name: "home_placeholder_artwork") internal static let plusFloatingAction = ImageAsset(name: "plus_floating_action") internal static let closeBanner = ImageAsset(name: "close_banner") internal static let importFilesButton = ImageAsset(name: "import_files_button") diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 7abd43de8..5dd6edd9f 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -1346,6 +1346,14 @@ internal enum VectorL10n { internal static var groupSection: String { return VectorL10n.tr("Vector", "group_section") } + /// The all-in-one secure chat app for teams, friends and organisations. Tap the + to add people and rooms. + internal static var homeEmptyViewInformation: String { + return VectorL10n.tr("Vector", "home_empty_view_information") + } + /// Welcome to Element,\n%@ + internal static func homeEmptyViewTitle(_ p1: String) -> String { + return VectorL10n.tr("Vector", "home_empty_view_title", p1) + } /// Could not connect to the homeserver. internal static var homeserverConnectionLost: String { return VectorL10n.tr("Vector", "homeserver_connection_lost") diff --git a/Riot/Modules/Home/Views/HomeEmptyView.swift b/Riot/Modules/Home/Views/HomeEmptyView.swift new file mode 100644 index 000000000..7a37058a0 --- /dev/null +++ b/Riot/Modules/Home/Views/HomeEmptyView.swift @@ -0,0 +1,70 @@ +// +// Copyright 2020 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation +import Reusable + +@objcMembers +final class HomeEmptyView: UIView, NibLoadable { + + // MARK: - Properties + + // MARK: Outlets + + @IBOutlet private weak var titleLabel: UILabel! + @IBOutlet private weak var informationLabel: UILabel! + + // MARK: Private + + private var theme: Theme! + + // MARK: Public + + // MARK: - Setup + + class func instantiate() -> HomeEmptyView { + let view = HomeEmptyView.loadFromNib() + view.theme = ThemeService.shared().theme + return view + } + + // MARK: - Life cycle + + override func awakeFromNib() { + super.awakeFromNib() + + self.informationLabel.text = VectorL10n.homeEmptyViewInformation + } + + // MARK: - Public + + func fill(with displayName: String) { + self.titleLabel.text = VectorL10n.homeEmptyViewTitle(displayName) + } +} + +// MARK: - Themable +extension HomeEmptyView: Themable { + + func update(theme: Theme) { + self.theme = theme + + self.backgroundColor = theme.backgroundColor + + self.titleLabel.textColor = theme.textPrimaryColor + self.informationLabel.textColor = theme.textSecondaryColor + } +} diff --git a/Riot/Modules/Home/Views/HomeEmptyView.xib b/Riot/Modules/Home/Views/HomeEmptyView.xib new file mode 100644 index 000000000..cd6740b1c --- /dev/null +++ b/Riot/Modules/Home/Views/HomeEmptyView.xib @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +