diff --git a/changelog.d/3754.feature b/changelog.d/3754.feature new file mode 100644 index 0000000000..e997ac370d --- /dev/null +++ b/changelog.d/3754.feature @@ -0,0 +1 @@ +M11.12 Spaces | Default to 'Home' in settings \ No newline at end of file diff --git a/vector/src/main/java/im/vector/app/features/home/UnreadMessagesSharedViewModel.kt b/vector/src/main/java/im/vector/app/features/home/UnreadMessagesSharedViewModel.kt index e9e2447b39..f02711690a 100644 --- a/vector/src/main/java/im/vector/app/features/home/UnreadMessagesSharedViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/UnreadMessagesSharedViewModel.kt @@ -147,7 +147,7 @@ class UnreadMessagesSharedViewModel @AssistedInject constructor(@Assisted initia roomSummaryQueryParams { this.memberships = listOf(Membership.JOIN) this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null).takeIf { - vectorPreferences.labsSpacesOnlyOrphansInHome() + !vectorPreferences.prefSpacesShowAllRoomInHome() } ?: ActiveSpaceFilter.None } ) diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt index 845be0b18b..11f92284a6 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt @@ -131,7 +131,7 @@ class RoomListViewModel @Inject constructor( updatableQuery = it }, suggestedRoomJoiningState, - vectorPreferences.labsSpacesOnlyOrphansInHome() + !vectorPreferences.prefSpacesShowAllRoomInHome() ) } else { RoomListSectionBuilderGroup( diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt index e3949983fc..77aa624e0e 100755 --- a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt @@ -153,6 +153,7 @@ class VectorPreferences @Inject constructor(private val context: Context) { const val SETTINGS_LABS_ALLOW_EXTENDED_LOGS = "SETTINGS_LABS_ALLOW_EXTENDED_LOGS" const val SETTINGS_LABS_USE_RESTRICTED_JOIN_RULE = "SETTINGS_LABS_USE_RESTRICTED_JOIN_RULE" const val SETTINGS_LABS_SPACES_HOME_AS_ORPHAN = "SETTINGS_LABS_SPACES_HOME_AS_ORPHAN" + const val SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME = "SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME" private const val SETTINGS_DEVELOPER_MODE_PREFERENCE_KEY = "SETTINGS_DEVELOPER_MODE_PREFERENCE_KEY" private const val SETTINGS_LABS_SHOW_HIDDEN_EVENTS_PREFERENCE_KEY = "SETTINGS_LABS_SHOW_HIDDEN_EVENTS_PREFERENCE_KEY" @@ -971,10 +972,16 @@ class VectorPreferences @Inject constructor(private val context: Context) { return defaultPrefs.getBoolean(SETTINGS_LABS_USE_RESTRICTED_JOIN_RULE, false) } - fun labsSpacesOnlyOrphansInHome(): Boolean { + private fun labsSpacesOnlyOrphansInHome(): Boolean { return defaultPrefs.getBoolean(SETTINGS_LABS_SPACES_HOME_AS_ORPHAN, false) } + fun prefSpacesShowAllRoomInHome(): Boolean { + return defaultPrefs.getBoolean(SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME, + // migration of old property + !labsSpacesOnlyOrphansInHome()) + } + /* * Photo / video picker */ diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt index ae6b24e4e4..f457980403 100644 --- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt @@ -17,24 +17,12 @@ package im.vector.app.features.settings import im.vector.app.R -import im.vector.app.core.preference.VectorSwitchPreference -import im.vector.app.features.MainActivity -import im.vector.app.features.MainActivityArgs import javax.inject.Inject -class VectorSettingsLabsFragment @Inject constructor( - private val vectorPreferences: VectorPreferences -) : VectorSettingsBaseFragment() { +class VectorSettingsLabsFragment @Inject constructor() : VectorSettingsBaseFragment() { override var titleRes = R.string.room_settings_labs_pref_title override val preferenceXmlRes = R.xml.vector_settings_labs - override fun bindPref() { - findPreference(VectorPreferences.SETTINGS_LABS_SPACES_HOME_AS_ORPHAN)!!.let { pref -> - pref.setOnPreferenceChangeListener { _, _ -> - MainActivity.restartApp(requireActivity(), MainActivityArgs(clearCache = false)) - true - } - } - } + override fun bindPref() {} } diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt index 83780f362c..212147e628 100644 --- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt @@ -27,7 +27,10 @@ import im.vector.app.core.dialogs.PhotoOrVideoDialog import im.vector.app.core.extensions.restart import im.vector.app.core.preference.VectorListPreference import im.vector.app.core.preference.VectorPreference +import im.vector.app.core.preference.VectorSwitchPreference import im.vector.app.databinding.DialogSelectTextSizeBinding +import im.vector.app.features.MainActivity +import im.vector.app.features.MainActivityArgs import im.vector.app.features.configuration.VectorConfiguration import im.vector.app.features.themes.ThemeUtils import javax.inject.Inject @@ -67,6 +70,14 @@ class VectorSettingsPreferencesFragment @Inject constructor( } } + findPreference(VectorPreferences.SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME)!!.let { pref -> + pref.isChecked = vectorPreferences.prefSpacesShowAllRoomInHome() + pref.setOnPreferenceChangeListener { _, _ -> + MainActivity.restartApp(requireActivity(), MainActivityArgs(clearCache = false)) + true + } + } + // Url preview /* TODO Note: we keep the setting client side for now diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpacesListViewModel.kt b/vector/src/main/java/im/vector/app/features/spaces/SpacesListViewModel.kt index 400a658d1b..12c4ddbfc4 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpacesListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpacesListViewModel.kt @@ -121,7 +121,7 @@ class SpacesListViewModel @AssistedInject constructor(@Assisted initialState: Sp roomSummaryQueryParams { this.memberships = listOf(Membership.JOIN) this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null).takeIf { - vectorPreferences.labsSpacesOnlyOrphansInHome() + !vectorPreferences.prefSpacesShowAllRoomInHome() } ?: ActiveSpaceFilter.None }, sortOrder = RoomSortOrder.NONE ).asObservable() @@ -139,7 +139,7 @@ class SpacesListViewModel @AssistedInject constructor(@Assisted initialState: Sp roomSummaryQueryParams { this.memberships = listOf(Membership.JOIN) this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null).takeIf { - vectorPreferences.labsSpacesOnlyOrphansInHome() + !vectorPreferences.prefSpacesShowAllRoomInHome() } ?: ActiveSpaceFilter.None } ) diff --git a/vector/src/main/res/values-ar/strings.xml b/vector/src/main/res/values-ar/strings.xml index 9249228546..39dc53140e 100644 --- a/vector/src/main/res/values-ar/strings.xml +++ b/vector/src/main/res/values-ar/strings.xml @@ -1178,7 +1178,6 @@ علم كمقترحة علم كغير مقترحة إدارة الغُرف والمساحات - مساحة تجريبية - فقط أعرض المُيتِّمة في الصفحة الرئيسية تشعر بالتجربة؟ \nيمكنك إضافة مساحات موجودة إلى مساحة. يرجى الاتصال بمسؤول الخادم الخاص بك للحصول على مزيد من المعلومات diff --git a/vector/src/main/res/values-cs/strings.xml b/vector/src/main/res/values-cs/strings.xml index 5e8a852562..c37ebbe20b 100644 --- a/vector/src/main/res/values-cs/strings.xml +++ b/vector/src/main/res/values-cs/strings.xml @@ -2832,7 +2832,6 @@ Vypadá to, že váš domovský server zatím Prostory nepodporuje Chcete experimentovat\? \nDo prostoru můžete přidat existující prostory. - Experimentální prostor - Zobrazit pouze sirotky v Domově Přidat místnosti Jste administrátorem tohoto prostoru, ujistěte se, že jste před odchodem převedli administrátorská práva na jiného člena. Tento prostor není veřejný. Bez pozvánky se do něj nebudete moci znovu připojit. diff --git a/vector/src/main/res/values-de/strings.xml b/vector/src/main/res/values-de/strings.xml index 65e27a7f9f..bdbc25241d 100644 --- a/vector/src/main/res/values-de/strings.xml +++ b/vector/src/main/res/values-de/strings.xml @@ -2842,7 +2842,6 @@ Möglicherweise musst du extra eingeladen werden, damit du die Räume siehst. \nDie fehlt die Berechtigung, Räume hinzuzufügen. Du kannst Unterspaces zu einem Space hinzufügen. - Experimentelle Spaces - Nur verweiste Räume auf Startseite Leider ist ein Fehler beim Betreten der Konferenz aufgetreten Unbenannter Raum Dieser Space hat noch keine Räume diff --git a/vector/src/main/res/values-eo/strings.xml b/vector/src/main/res/values-eo/strings.xml index 36ba941734..f4c34a1b27 100644 --- a/vector/src/main/res/values-eo/strings.xml +++ b/vector/src/main/res/values-eo/strings.xml @@ -2656,7 +2656,6 @@ Ŝajnas, ke via hejmservilo ankoraŭ ne subtenas arojn Ĉu vi eksperimentemas\? \nVi povas arigi jamajn arojn. - Eksperimenta aro – montri nur orfojn en la Hejmo Administri ĉambrojn kaj arojn Marki nerekomendita Marki rekomendita diff --git a/vector/src/main/res/values-et/strings.xml b/vector/src/main/res/values-et/strings.xml index f1fe015df8..29a539e354 100644 --- a/vector/src/main/res/values-et/strings.xml +++ b/vector/src/main/res/values-et/strings.xml @@ -2779,7 +2779,6 @@ Tundub, et sinu koduserver veel ei võimalda kogukonnakeskuste kasutamist Kas sa tahad katsetada\? \nSa võid kogukonnakeskusele lisada ka teisi kogukonnakeskuseid. - Katseline kogukonnakeskus, mis näitab avalehel vaid hüljatud jututube Lisa jututube Sa oled selle kogukonnakeskuse haldaja. Enne oma lahkumist palun lisa siia veel vähemalt üks uus haldaja. See ei ole avalik kogukonnakeskus. Ilma kutseta sa ei saa uuesti liituda. diff --git a/vector/src/main/res/values-fa/strings.xml b/vector/src/main/res/values-fa/strings.xml index a085d4c08e..80f29b54b2 100644 --- a/vector/src/main/res/values-fa/strings.xml +++ b/vector/src/main/res/values-fa/strings.xml @@ -2838,7 +2838,6 @@ این فضا عمومی است حس آزمایش دارید؟ \nمی‌توانید فضاهای موجود را به فضایی بیفزایید. - فضای آزمایشی - فقط نمایش یتسم‌ها در خانه مشاوره با %1$s پیام صوتی (%1$s) نمی‌توان هنگام فعّال بودن پیام صوتی، پاسخ داد یا ویراست diff --git a/vector/src/main/res/values-fr-rCA/strings.xml b/vector/src/main/res/values-fr-rCA/strings.xml index fe2e08780e..ab6e988870 100644 --- a/vector/src/main/res/values-fr-rCA/strings.xml +++ b/vector/src/main/res/values-fr-rCA/strings.xml @@ -2730,7 +2730,6 @@ Il semble que votre serveur d’accueil ne prend pas encore en charge les espaces Envie d’expérimenter\? \nVous pouvez ajouter des espaces existants à un espace. - Espace expérimental – afficher seulement les orphelins dans Accueil Gérer les salons et les espaces Marquer comme non recommandé Marquer comme recommandé diff --git a/vector/src/main/res/values-fr/strings.xml b/vector/src/main/res/values-fr/strings.xml index ff4d325bda..7a73099456 100644 --- a/vector/src/main/res/values-fr/strings.xml +++ b/vector/src/main/res/values-fr/strings.xml @@ -2778,7 +2778,6 @@ Envoyer la vidéo en taille originale Envoyer les vidéos en taille originale - Espace expérimental – afficher seulement les orphelins dans Accueil Vous êtes administrateur de cet espace, assurez-vous d’avoir transféré les droits d’administration à un autre membre avant de partir. Vous utilisez une version bêta des espaces. Vos remarques aideront à concevoir les prochaines versions. Votre plateforme et votre nom d’utilisateur seront marqués pour nous aider à utiliser vos remarques autant que possible. Il se peut que certains salons soient masqués parce qu’ils sont privés et vous avez besoin d’une invitation. diff --git a/vector/src/main/res/values-hu/strings.xml b/vector/src/main/res/values-hu/strings.xml index 58eebfe0f4..b2ee733f12 100644 --- a/vector/src/main/res/values-hu/strings.xml +++ b/vector/src/main/res/values-hu/strings.xml @@ -2472,7 +2472,6 @@ Ha nem te állítottad be a visszaállítási metódust, akkor egy támadó pró Úgy látszik a matrix szervered nem támogatja egyelőre a Tereket Szeretsz kísérletezni\? \nTereket adhatsz terekhez. - Kísérleti tér - Csak árvák mutatása a Kezdőlapon Szobák és terek kezelése Nem javasoltnak jelölés Javasoltnak jelölés diff --git a/vector/src/main/res/values-it/strings.xml b/vector/src/main/res/values-it/strings.xml index 00bb8d4b32..3c0a839684 100644 --- a/vector/src/main/res/values-it/strings.xml +++ b/vector/src/main/res/values-it/strings.xml @@ -2838,7 +2838,6 @@ Sei l\'Amministratore di questo Spazio. Assicurati di aver nominato un altro amministratore prima di uscire. Sei l\'unico utente di questo Spazio. Se esci nessuno potrà più entrarci. Nemmeno tu. Aggiungi stanze - Spazio sperimentale - Mostra solo stanze orfane nella Home Alcune stanze potrebbero essere nascoste perché sono private e ti serve il loro invito. Alcune stanze potrebbero essere nascoste perché sono private e ti serve il loro invito. \nNon hai il permesso di aggiungere stanze. diff --git a/vector/src/main/res/values-pt-rBR/strings.xml b/vector/src/main/res/values-pt-rBR/strings.xml index 55f1acfc40..0805b82533 100644 --- a/vector/src/main/res/values-pt-rBR/strings.xml +++ b/vector/src/main/res/values-pt-rBR/strings.xml @@ -2803,7 +2803,6 @@ Parece que seu servidorcasa não suporta Espaços ainda Se sentindo experimental\? \nVocê pode adicionar espaços existentes a um espaço. - Espaço Experimental - Somente mostrar órfãos em Home Gerenciar salas e espaços Fazer este espaço público Gerenciar salas diff --git a/vector/src/main/res/values-ru/strings.xml b/vector/src/main/res/values-ru/strings.xml index 20c151a9d6..f86d9238c9 100644 --- a/vector/src/main/res/values-ru/strings.xml +++ b/vector/src/main/res/values-ru/strings.xml @@ -2850,7 +2850,6 @@ Похоже, что ваш домашний сервер пока не поддерживает пространства Чувствуете себя экспериментатором\? \nВы можете добавить существующие пространства в пространство. - Экспериментальное пространство - показывать в Главной только сирот Управление комнатами и пространствами Отметить как не рекомендуется Отметить как рекомендуется diff --git a/vector/src/main/res/values-sq/strings.xml b/vector/src/main/res/values-sq/strings.xml index 91d853cadb..45dd488d61 100644 --- a/vector/src/main/res/values-sq/strings.xml +++ b/vector/src/main/res/values-sq/strings.xml @@ -2769,7 +2769,6 @@ Duket sikur shërbyesi juaj Home nuk mbulon ende Hapësira Ndiheni eksperimentues\? \nMund të shtoni te një hapësirë hapësira ekzistuese. - Hapësirë Eksperimentale - Shfaq jetimë te Kreu Shtoni dhoma Jeni përgjegjës i kësaj hapësirë, sigurohuni se keni shpërngulur të drejt përgjegjësi te një anëtar tjetër, përpara braktisjes. Kjo hapësirë s’është publike. S’do të jeni në gjendje të rihyni pa një ftesë. diff --git a/vector/src/main/res/values-sv/strings.xml b/vector/src/main/res/values-sv/strings.xml index 900e439b07..cc51a51ff8 100644 --- a/vector/src/main/res/values-sv/strings.xml +++ b/vector/src/main/res/values-sv/strings.xml @@ -2779,7 +2779,6 @@ Det verkar som att din hemserver inte stöder utrymmen än Känner du dig äventyrlig\? \nDu kan lägga till existerande utrymmen till ett utrymme. - Experimentellt utrymme - Visa bara övergivna i Hem Lägg till rum Du är administratör för det här utrymmet, se till att du har överfört administratörsrättigheter till en annan medlem innan du lämnar. Det här utrymmet är inte offentligt. Du kommer inte att kunna gå med igen utan en inbjudan. diff --git a/vector/src/main/res/values-zh-rCN/strings.xml b/vector/src/main/res/values-zh-rCN/strings.xml index 1a417db842..5d89f15788 100644 --- a/vector/src/main/res/values-zh-rCN/strings.xml +++ b/vector/src/main/res/values-zh-rCN/strings.xml @@ -2583,7 +2583,6 @@ 看来你的主服务器尚未支持空间 想要做点实验? \n你可以将现有的空间添加到其他空间中。 - 实验性空间 - 仅在首页显示无人看管的聊天室 管理聊天室和空间 标记为不建议 标记为建议 diff --git a/vector/src/main/res/values-zh-rTW/strings.xml b/vector/src/main/res/values-zh-rTW/strings.xml index db87236cfc..d5a82bfd25 100644 --- a/vector/src/main/res/values-zh-rTW/strings.xml +++ b/vector/src/main/res/values-zh-rTW/strings.xml @@ -2726,7 +2726,6 @@ 看來您的家伺服器尚未支援空間 想要做點實驗嗎? \n您可以將既有的空間新增至其他空間中。 - 實驗性空間,僅在首頁顯示無人看管的聊天室 新增聊天室 您是此空間的管理員,請確保在您離開前已將管理權轉交給另一個成員。 此空間並非公開。您將無法在無邀請的狀況下重新加入。 diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index f2981c1253..3906df8c20 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -385,6 +385,7 @@ Dismiss Reset Start Chatting + Spaces Some permissions are missing to perform this action, please grant the permissions from the system settings. @@ -3451,7 +3452,10 @@ Manage rooms and spaces - Experimental Space - Only show orphans in Home + + Show all rooms in Home + All rooms you’re in will be shown in Home. + Feeling experimental?\nYou can add existing spaces to a space. It looks like your homeserver does not support Spaces yet Please contact your homeserver admin for further information diff --git a/vector/src/main/res/xml/vector_settings_labs.xml b/vector/src/main/res/xml/vector_settings_labs.xml index 1e0f736db2..6260f65fd9 100644 --- a/vector/src/main/res/xml/vector_settings_labs.xml +++ b/vector/src/main/res/xml/vector_settings_labs.xml @@ -52,9 +52,5 @@ android:summary="@string/labs_use_restricted_join_rule_desc"/> - \ No newline at end of file diff --git a/vector/src/main/res/xml/vector_settings_preferences.xml b/vector/src/main/res/xml/vector_settings_preferences.xml index 1be192e0f5..1f7c347ddd 100644 --- a/vector/src/main/res/xml/vector_settings_preferences.xml +++ b/vector/src/main/res/xml/vector_settings_preferences.xml @@ -30,6 +30,16 @@ + + + + + +