Skip to content

Commit

Permalink
Implement new space selector bottom sheet (#6518)
Browse files Browse the repository at this point in the history
* Delight: Edit layout experiment #6079
  • Loading branch information
gileluard authored Aug 5, 2022
1 parent 6cb076b commit a809185
Show file tree
Hide file tree
Showing 47 changed files with 1,704 additions and 294 deletions.
2 changes: 1 addition & 1 deletion Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ final class BuildSettings: NSObject {
static let allowInviteExernalUsers: Bool = true

// MARK: - Side Menu
static let enableSideMenu: Bool = true
static let enableSideMenu: Bool = true && !newAppLayoutEnabled
static let sideMenuShowInviteFriends: Bool = true

/// Whether to read the `io.element.functional_members` state event and exclude any service members when computing a room's name and avatar.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"images" : [
{
"filename" : "home_fab_join_room.png",
"filename" : "home_my_spaces_action.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
Expand All @@ -21,6 +19,7 @@
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1998,6 +1998,7 @@ Tap the + to start adding people.";
"spaces_add_space_title" = "Create space";
"spaces_add_subspace_title" = "Create space within %@";
"spaces_create_space_title" = "Create a space";
"spaces_create_subspace_title" = "Create a subspace";
"spaces_left_panel_title" = "Spaces";
"leave_space_title" = "Leave %@";
"leave_space_message" = "Are you sure you want to leave %@? Do you also want to leave all rooms and spaces of this space?";
Expand Down Expand Up @@ -2043,6 +2044,8 @@ Tap the + to start adding people.";
"spaces_creation_hint" = "Spaces are a new way to group rooms and people.";
"spaces_creation_visibility_title" = "What type of space do you want to create?";
"spaces_creation_visibility_message" = "To join an existing space, you need an invite.";
"spaces_subspace_creation_visibility_title" = "What type of subspace do you want to create?";
"spaces_subspace_creation_visibility_message" = "The created space will be added to %@.";
"spaces_creation_footer" = "You can change this later";
"spaces_creation_settings_message" = "Add some details to help it stand out. You can change these at any point.";
"spaces_creation_address" = "Address";
Expand Down Expand Up @@ -2158,7 +2161,7 @@ Tap the + to start adding people.";

"all_chats_title" = "All chats";
"all_chats_section_title" = "Chats";
"all_chats_edit_layout" = "Edit layout";
"all_chats_edit_layout" = "Layout preferences";
"all_chats_edit_layout_recents" = "Recents";
"all_chats_edit_layout_unreads" = "Unreads";
"all_chats_edit_layout_add_section_title" = "Add section to home";
Expand All @@ -2176,9 +2179,14 @@ Tap the + to start adding people.";

"room_recents_recently_viewed_section" = "Recently viewed";

"all_chats_user_menu_settings" = "User settings";

"all_chats_edit_menu_leave_space" = "Leave %@";
"all_chats_edit_menu_space_settings" = "Space settings";

// Mark: - Space Selector

"space_selector_title" = "Choose space";
"space_selector_title" = "My spaces";

// Mark: - Polls

Expand Down
3 changes: 1 addition & 2 deletions Riot/Generated/Images.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ internal class Asset: NSObject {
internal static let roomActionPriorityLow = ImageAsset(name: "room_action_priority_low")
internal static let homeEmptyScreenArtwork = ImageAsset(name: "home_empty_screen_artwork")
internal static let homeEmptyScreenArtworkDark = ImageAsset(name: "home_empty_screen_artwork_dark")
internal static let homeFabCreateRoom = ImageAsset(name: "home_fab_create_room")
internal static let homeFabJoinRoom = ImageAsset(name: "home_fab_join_room")
internal static let homeMySpacesAction = ImageAsset(name: "home_my_spaces_action")
internal static let plusFloatingAction = ImageAsset(name: "plus_floating_action")
internal static let versionCheckCloseIcon = ImageAsset(name: "version_check_close_icon")
internal static let versionCheckInfoIcon = ImageAsset(name: "version_check_info_icon")
Expand Down
28 changes: 26 additions & 2 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class VectorL10n: NSObject {
public static var allChatsAllFilter: String {
return VectorL10n.tr("Vector", "all_chats_all_filter")
}
/// Edit layout
/// Layout preferences
public static var allChatsEditLayout: String {
return VectorL10n.tr("Vector", "all_chats_edit_layout")
}
Expand Down Expand Up @@ -171,6 +171,14 @@ public class VectorL10n: NSObject {
public static var allChatsEditLayoutUnreads: String {
return VectorL10n.tr("Vector", "all_chats_edit_layout_unreads")
}
/// Leave %@
public static func allChatsEditMenuLeaveSpace(_ p1: String) -> String {
return VectorL10n.tr("Vector", "all_chats_edit_menu_leave_space", p1)
}
/// Space settings
public static var allChatsEditMenuSpaceSettings: String {
return VectorL10n.tr("Vector", "all_chats_edit_menu_space_settings")
}
/// Chats
public static var allChatsSectionTitle: String {
return VectorL10n.tr("Vector", "all_chats_section_title")
Expand All @@ -179,6 +187,10 @@ public class VectorL10n: NSObject {
public static var allChatsTitle: String {
return VectorL10n.tr("Vector", "all_chats_title")
}
/// User settings
public static var allChatsUserMenuSettings: String {
return VectorL10n.tr("Vector", "all_chats_user_menu_settings")
}
/// Help us identify issues and improve %@ by sharing anonymous usage data. To understand how people use multiple devices, we’ll generate a random identifier, shared by your devices.
public static func analyticsPromptMessageNewUser(_ p1: String) -> String {
return VectorL10n.tr("Vector", "analytics_prompt_message_new_user", p1)
Expand Down Expand Up @@ -7779,7 +7791,7 @@ public class VectorL10n: NSObject {
public static var spacePublicJoinRuleDetail: String {
return VectorL10n.tr("Vector", "space_public_join_rule_detail")
}
/// Choose space
/// My spaces
public static var spaceSelectorTitle: String {
return VectorL10n.tr("Vector", "space_selector_title")
}
Expand Down Expand Up @@ -7839,6 +7851,10 @@ public class VectorL10n: NSObject {
public static var spacesCreateSpaceTitle: String {
return VectorL10n.tr("Vector", "spaces_create_space_title")
}
/// Create a subspace
public static var spacesCreateSubspaceTitle: String {
return VectorL10n.tr("Vector", "spaces_create_subspace_title")
}
/// As this space is just for you, no one will be informed. You can add more later.
public static var spacesCreationAddRoomsMessage: String {
return VectorL10n.tr("Vector", "spaces_creation_add_rooms_message")
Expand Down Expand Up @@ -8071,6 +8087,14 @@ public class VectorL10n: NSObject {
public static var spacesNoRoomFoundDetail: String {
return VectorL10n.tr("Vector", "spaces_no_room_found_detail")
}
/// The created space will be added to %@.
public static func spacesSubspaceCreationVisibilityMessage(_ p1: String) -> String {
return VectorL10n.tr("Vector", "spaces_subspace_creation_visibility_message", p1)
}
/// What type of subspace do you want to create?
public static var spacesSubspaceCreationVisibilityTitle: String {
return VectorL10n.tr("Vector", "spaces_subspace_creation_visibility_title")
}
/// Suggested
public static var spacesSuggestedRoom: String {
return VectorL10n.tr("Vector", "spaces_suggested_room")
Expand Down
12 changes: 10 additions & 2 deletions Riot/Managers/Theme/Themes/DarkTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,16 @@ class DarkTheme: NSObject, Theme {

navigationBar.standardAppearance = appearance

navigationBar.scrollEdgeAppearance = modernScrollEdgeAppearance || BuildSettings.newAppLayoutEnabled ? nil : appearance
} else {
if BuildSettings.newAppLayoutEnabled {
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = baseColor
appearance.shadowColor = nil
appearance.titleTextAttributes = [
NSAttributedString.Key.foregroundColor: textPrimaryColor
]
}
navigationBar.scrollEdgeAppearance = modernScrollEdgeAppearance ? nil : appearance
} else {
navigationBar.titleTextAttributes = [
NSAttributedString.Key.foregroundColor: textPrimaryColor
]
Expand Down
10 changes: 9 additions & 1 deletion Riot/Managers/Theme/Themes/DefaultTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,15 @@ class DefaultTheme: NSObject, Theme {
]

navigationBar.standardAppearance = appearance
navigationBar.scrollEdgeAppearance = modernScrollEdgeAppearance || BuildSettings.newAppLayoutEnabled ? nil : appearance
if BuildSettings.newAppLayoutEnabled {
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = baseColor
appearance.shadowColor = nil
appearance.titleTextAttributes = [
NSAttributedString.Key.foregroundColor: textPrimaryColor
]
}
navigationBar.scrollEdgeAppearance = modernScrollEdgeAppearance ? nil : appearance
} else {
navigationBar.titleTextAttributes = [
NSAttributedString.Key.foregroundColor: textPrimaryColor
Expand Down
9 changes: 7 additions & 2 deletions Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ - (RecentsDataSourceSections *)makeDataSourceSections
[types addObject:@(RecentsDataSourceSectionTypeSecureBackupBanner)];
}

if (self.invitesCellDataArray.count > 0)
if (!BuildSettings.newAppLayoutEnabled && self.invitesCellDataArray.count > 0)
{
[types addObject:@(RecentsDataSourceSectionTypeInvites)];
}
Expand Down Expand Up @@ -229,7 +229,12 @@ - (RecentsDataSourceSections *)makeDataSourceSections
[types addObject:@(RecentsDataSourceSectionTypeAllChats)];
}

if (self.suggestedRoomCellDataArray.count > 0)
if (self.currentSpace == nil && BuildSettings.newAppLayoutEnabled && self.invitesCellDataArray.count > 0)
{
[types addObject:@(RecentsDataSourceSectionTypeInvites)];
}

if (self.currentSpace != nil && self.suggestedRoomCellDataArray.count > 0)
{
[types addObject:@(RecentsDataSourceSectionTypeSuggestedRooms)];
}
Expand Down
Loading

0 comments on commit a809185

Please sign in to comment.