MESSENGER-4807 new add room menu

This commit is contained in:
Arnfried Griesert
2023-09-08 06:41:40 +00:00
parent 927c71d5fa
commit 031cd87084
7 changed files with 120 additions and 7 deletions
+3
View File
@@ -669,4 +669,7 @@ class BWIBuildSettings: NSObject {
// MARK: OIDC
var isOIDCEnabled = true
// MARK: Create Room Menu
var enableAllChatsToolbar = true
}
@@ -39,7 +39,8 @@ extension BWIBuildSettings {
enableLabFeatureWYSIWYG = true
showMaintenanceInfoMessageType = true
ignoreBlockingMaintenance = true
enableAllChatsToolbar = false
itunesAppLink = "itms://itunes.apple.com/app/bundesmessenger-beta/id1617068656?mt=8"
}
@@ -0,0 +1,17 @@
<svg width="58" height="58" viewBox="0 0 58 58" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_101_5652)">
<circle cx="29" cy="25" r="25" fill="white"/>
</g>
<path d="M21.8077 34.4C21.3026 34.4 20.875 34.225 20.525 33.875C20.175 33.5249 20 33.0974 20 32.5922V19.2077C20 18.7025 20.175 18.275 20.525 17.925C20.875 17.575 21.3026 17.4 21.8077 17.4H30.3481L28.8481 18.9H21.8077C21.7308 18.9 21.6602 18.932 21.5961 18.9961C21.532 19.0602 21.5 19.1307 21.5 19.2077V32.5922C21.5 32.6692 21.532 32.7397 21.5961 32.8038C21.6602 32.8679 21.7308 32.9 21.8077 32.9H35.1923C35.2692 32.9 35.3397 32.8679 35.4038 32.8038C35.4679 32.7397 35.5 32.6692 35.5 32.5922V25.5365L37 24.0365V32.5922C37 33.0974 36.825 33.5249 36.475 33.875C36.125 34.225 35.6974 34.4 35.1923 34.4H21.8077ZM33.0308 17.8211L34.1096 18.875L27.5 25.4749V26.9H28.9L35.5442 20.275L36.6038 21.3192L29.548 28.3999H26V24.8519L33.0308 17.8211ZM36.6038 21.3192L33.0308 17.8211L35.3192 15.5327C35.6743 15.1776 36.1054 15 36.6125 15C37.1195 15 37.5455 15.1808 37.8904 15.5423L38.8673 16.525C39.2121 16.8762 39.3846 17.2996 39.3846 17.7952C39.3846 18.2907 39.2089 18.714 38.8576 19.0653L36.6038 21.3192Z" fill="#13293D"/>
<defs>
<filter id="filter0_d_101_5652" x="0" y="0" width="58" height="58" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="2"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_101_5652"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_101_5652" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Button-new-dark.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,17 @@
<svg width="58" height="58" viewBox="0 0 58 58" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_101_2886)">
<circle cx="29" cy="25" r="25" fill="#13293D"/>
</g>
<path d="M21.8077 34.4C21.3026 34.4 20.875 34.225 20.525 33.875C20.175 33.5249 20 33.0974 20 32.5922V19.2077C20 18.7025 20.175 18.275 20.525 17.925C20.875 17.575 21.3026 17.4 21.8077 17.4H30.3481L28.8481 18.9H21.8077C21.7308 18.9 21.6602 18.932 21.5961 18.9961C21.532 19.0602 21.5 19.1307 21.5 19.2077V32.5922C21.5 32.6692 21.532 32.7397 21.5961 32.8038C21.6602 32.8679 21.7308 32.9 21.8077 32.9H35.1923C35.2692 32.9 35.3397 32.8679 35.4038 32.8038C35.4679 32.7397 35.5 32.6692 35.5 32.5922V25.5365L37 24.0365V32.5922C37 33.0974 36.825 33.5249 36.475 33.875C36.125 34.225 35.6974 34.4 35.1923 34.4H21.8077ZM33.0308 17.8211L34.1096 18.875L27.5 25.4749V26.9H28.9L35.5442 20.275L36.6038 21.3192L29.548 28.3999H26V24.8519L33.0308 17.8211ZM36.6038 21.3192L33.0308 17.8211L35.3192 15.5327C35.6743 15.1776 36.1054 15 36.6125 15C37.1195 15 37.5455 15.1808 37.8904 15.5423L38.8673 16.525C39.2121 16.8762 39.3846 17.2996 39.3846 17.7952C39.3846 18.2907 39.2089 18.714 38.8576 19.0653L36.6038 21.3192Z" fill="white"/>
<defs>
<filter id="filter0_d_101_2886" x="0" y="0" width="58" height="58" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="2"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_101_2886"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_101_2886" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Button-new-light.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -77,6 +77,9 @@ class AllChatsViewController: HomeViewController {
private var isOnboardingCoordinatorPreparing: Bool = false
// bwi: 4807
private var floatingButton: UIButton?
private var theme: Theme {
ThemeService.shared().theme
}
@@ -92,10 +95,11 @@ class AllChatsViewController: HomeViewController {
}
private func setToolbarHidden(_ isHidden: Bool, animated: Bool) {
UIView.animate(withDuration: animated ? 0.3 : 0) {
self.isToolbarHidden = isHidden
if BWIBuildSettings.shared.enableAllChatsToolbar {
UIView.animate(withDuration: animated ? 0.3 : 0) {
self.isToolbarHidden = isHidden
}
}
}
// MARK: - SplitViewMasterViewControllerProtocol
@@ -144,6 +148,23 @@ class AllChatsViewController: HomeViewController {
} else {
toolbar.tintColor = theme.colors.accent
}
// bwi: 4807 - hide the toolbar and show a floating button for room create instead
if !BWIBuildSettings.shared.enableAllChatsToolbar {
// no toolbar then use a floating button instead
floatingButton = UIButton(frame: CGRect(x: 50, y: 50, width: 50, height: 50))
updateFloatingButton()
if let floatingButton = floatingButton {
view.addSubview(floatingButton)
}
// set constraint to make the floating button stay in the lower right corner
floatingButton?.translatesAutoresizingMaskIntoConstraints = false
floatingButton?.widthAnchor.constraint(equalToConstant: 50).isActive = true
floatingButton?.heightAnchor.constraint(equalToConstant: 50).isActive = true
floatingButton?.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -10).isActive = true
floatingButton?.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: -40).isActive = true
}
if BWIBuildSettings.shared.roomFiltersToggle {
updateNewFilterSearchAndToggleButton()
@@ -248,6 +269,12 @@ class AllChatsViewController: HomeViewController {
self.toolbar.tintColor = theme.colors.accent
}
// bwi: 4807 - hide the toolbar and show a floating button for room create instead
if !BWIBuildSettings.shared.enableAllChatsToolbar {
toolbar.transform = CGAffineTransform(translationX: 0, y: 2 * toolbarHeight)
self.view.layoutIfNeeded()
}
if BWIBuildSettings.shared.roomFiltersToggle {
if ThemeService.shared().isCurrentThemeDark() {
roomFilterButton?.setImage(Asset.Images.roomFilterToggleDarkOff.image, for: .normal)
@@ -668,6 +695,17 @@ class AllChatsViewController: HomeViewController {
} else {
self.navigationController?.toolbar?.tintColor = theme.colors.accent
}
// bwi: 4807
updateFloatingButton()
}
private func updateFloatingButton() {
if ThemeService.shared().isCurrentThemeDark() {
floatingButton?.setImage(Asset.Images.buttonNewDark.image, for: .normal)
} else {
floatingButton?.setImage(Asset.Images.buttonNewLight.image, for: .normal)
}
}
// MARK: - Private
@@ -699,9 +737,22 @@ class AllChatsViewController: HomeViewController {
self.title = currentSpace?.summary?.displayName ?? VectorL10n.allChatsTitle
setupEditOptions()
updateToolbar(with: editActionProvider.updateMenu(with: mainSession, parentSpace: currentSpace, completion: { [weak self] menu in
self?.updateToolbar(with: menu)
}))
let menu = editActionProvider.updateMenu(with: mainSession, parentSpace: currentSpace, completion: { [weak self] menu in
if BWIBuildSettings.shared.enableAllChatsToolbar {
self?.updateToolbar(with: menu)
} else {
}
})
if BWIBuildSettings.shared.enableAllChatsToolbar {
updateToolbar(with: menu)
} else {
updateFloatingButton()
self.floatingButton?.menu = menu
self.floatingButton?.showsMenuAsPrimaryAction = true
}
updateEmptyView()
updateBadgeButton()
}