Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation | New Home tab to priorize all unread - BLOCKED #4010

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class VectorPreferences @Inject constructor(private val context: Context) {

// SETTINGS_LABS_HIDE_TECHNICAL_E2E_ERRORS
private const val SETTINGS_LABS_SHOW_COMPLETE_HISTORY_IN_ENCRYPTED_ROOM = "SETTINGS_LABS_SHOW_COMPLETE_HISTORY_IN_ENCRYPTED_ROOM"
const val SETTINGS_LABS_UNREAD_NOTIFICATIONS_AS_TAB = "SETTINGS_LABS_UNREAD_NOTIFICATIONS_AS_TAB"

// analytics
const val SETTINGS_USE_ANALYTICS_KEY = "SETTINGS_USE_ANALYTICS_KEY"
Expand Down Expand Up @@ -335,6 +336,11 @@ class VectorPreferences @Inject constructor(private val context: Context) {
return developerMode() && defaultPrefs.getBoolean(SETTINGS_LABS_ALLOW_EXTENDED_LOGS, false)
}

// Legacy lab option kept for migration to layout mode settings
fun labAddNotificationTab(): Boolean {
return defaultPrefs.getBoolean(SETTINGS_LABS_UNREAD_NOTIFICATIONS_AS_TAB, false)
}

fun failFast(): Boolean {
return BuildConfig.DEBUG || (developerMode() && defaultPrefs.getBoolean(SETTINGS_DEVELOPER_MODE_FAIL_FAST_PREFERENCE_KEY, false))
}
Expand Down Expand Up @@ -1012,7 +1018,12 @@ class VectorPreferences @Inject constructor(private val context: Context) {
// Layout

fun getLayoutMode(): LayoutMode {
return defaultPrefs.getString(SETTINGS_LAYOUT_MODE, LayoutMode.PRODUCTIVITY.name).let {
val defaultLayoutMode = if (labAddNotificationTab()) {
LayoutMode.PRODUCTIVITY.name
} else {
LayoutMode.SIMPLE.name
}
return defaultPrefs.getString(SETTINGS_LAYOUT_MODE, defaultLayoutMode).let {
when (it) {
LayoutMode.SIMPLE.name -> LayoutMode.SIMPLE
else -> LayoutMode.PRODUCTIVITY
Expand Down