mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-27 20:09:27 +03:00
Bubbles: add quick settings (temporary)
This commit is contained in:
parent
f7df0b891e
commit
32e72f54b3
3 changed files with 22 additions and 2 deletions
|
@ -16,11 +16,16 @@
|
||||||
|
|
||||||
package im.vector.app.features.home.room.detail.timeline.style
|
package im.vector.app.features.home.room.detail.timeline.style
|
||||||
|
|
||||||
|
import im.vector.app.features.settings.VectorPreferences
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class TimelineLayoutSettingsProvider @Inject constructor() {
|
class TimelineLayoutSettingsProvider @Inject constructor(private val vectorPreferences: VectorPreferences) {
|
||||||
|
|
||||||
fun getLayoutSettings(): TimelineLayoutSettings {
|
fun getLayoutSettings(): TimelineLayoutSettings {
|
||||||
return TimelineLayoutSettings.BUBBLE
|
return if (vectorPreferences.useMessageBubblesLayout()) {
|
||||||
|
TimelineLayoutSettings.BUBBLE
|
||||||
|
} else {
|
||||||
|
TimelineLayoutSettings.MODERN
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,7 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
||||||
// interface
|
// interface
|
||||||
const val SETTINGS_INTERFACE_LANGUAGE_PREFERENCE_KEY = "SETTINGS_INTERFACE_LANGUAGE_PREFERENCE_KEY"
|
const val SETTINGS_INTERFACE_LANGUAGE_PREFERENCE_KEY = "SETTINGS_INTERFACE_LANGUAGE_PREFERENCE_KEY"
|
||||||
const val SETTINGS_INTERFACE_TEXT_SIZE_KEY = "SETTINGS_INTERFACE_TEXT_SIZE_KEY"
|
const val SETTINGS_INTERFACE_TEXT_SIZE_KEY = "SETTINGS_INTERFACE_TEXT_SIZE_KEY"
|
||||||
|
const val SETTINGS_INTERFACE_BUBBLE_KEY = "SETTINGS_INTERFACE_BUBBLE_KEY"
|
||||||
const val SETTINGS_SHOW_URL_PREVIEW_KEY = "SETTINGS_SHOW_URL_PREVIEW_KEY"
|
const val SETTINGS_SHOW_URL_PREVIEW_KEY = "SETTINGS_SHOW_URL_PREVIEW_KEY"
|
||||||
private const val SETTINGS_SEND_TYPING_NOTIF_KEY = "SETTINGS_SEND_TYPING_NOTIF_KEY"
|
private const val SETTINGS_SEND_TYPING_NOTIF_KEY = "SETTINGS_SEND_TYPING_NOTIF_KEY"
|
||||||
private const val SETTINGS_ENABLE_MARKDOWN_KEY = "SETTINGS_ENABLE_MARKDOWN_KEY"
|
private const val SETTINGS_ENABLE_MARKDOWN_KEY = "SETTINGS_ENABLE_MARKDOWN_KEY"
|
||||||
|
@ -852,6 +853,15 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
||||||
return defaultPrefs.getBoolean(SETTINGS_SHOW_EMOJI_KEYBOARD, true)
|
return defaultPrefs.getBoolean(SETTINGS_SHOW_EMOJI_KEYBOARD, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tells if the emoji keyboard button should be visible or not.
|
||||||
|
*
|
||||||
|
* @return true to show emoji keyboard button.
|
||||||
|
*/
|
||||||
|
fun useMessageBubblesLayout(): Boolean {
|
||||||
|
return defaultPrefs.getBoolean(SETTINGS_INTERFACE_BUBBLE_KEY, false)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tells if the rage shake is used.
|
* Tells if the rage shake is used.
|
||||||
*
|
*
|
||||||
|
|
|
@ -22,6 +22,11 @@
|
||||||
android:title="@string/settings_theme"
|
android:title="@string/settings_theme"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
|
<im.vector.app.core.preference.VectorSwitchPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="SETTINGS_INTERFACE_BUBBLE_KEY"
|
||||||
|
android:title="Message bubbles" />
|
||||||
|
|
||||||
<im.vector.app.core.preference.VectorPreference
|
<im.vector.app.core.preference.VectorPreference
|
||||||
android:dialogTitle="@string/font_size"
|
android:dialogTitle="@string/font_size"
|
||||||
android:key="SETTINGS_INTERFACE_TEXT_SIZE_KEY"
|
android:key="SETTINGS_INTERFACE_TEXT_SIZE_KEY"
|
||||||
|
|
Loading…
Reference in a new issue