Skip to content
Snippets Groups Projects
Verified Commit 5a3bd500 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixes #83

parent 28115962
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,8 @@ data class AppearanceSettings(
val inputEnter: InputEnterMode = InputEnterMode.EMOJI,
val showLag: Boolean = true,
val theme: Theme = Theme.MATERIAL_LIGHT,
val language: String = ""
val language: String = "",
val keepScreenOn: Boolean = false
) {
enum class InputEnterMode {
EMOJI,
......
......@@ -44,6 +44,10 @@ object Settings {
context.getString(R.string.preference_show_lag_key),
AppearanceSettings.DEFAULT.showLag
),
keepScreenOn = getBoolean(
context.getString(R.string.preference_keep_screen_on_key),
AppearanceSettings.DEFAULT.keepScreenOn
),
language = getString(
context.getString(R.string.preference_language_key),
AppearanceSettings.DEFAULT.language
......
......@@ -24,6 +24,7 @@ import android.content.SharedPreferences
import android.os.Bundle
import android.support.annotation.ColorRes
import android.support.annotation.DrawableRes
import android.view.WindowManager
import de.kuschku.libquassel.session.Backend
import de.kuschku.libquassel.util.Optional
import de.kuschku.quasseldroid.Keys
......@@ -75,6 +76,10 @@ abstract class ServiceBoundActivity :
connection.context = this
lifecycle.addObserver(connection)
checkConnection()
if (appearanceSettings.keepScreenOn) {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
}
fun updateRecentsHeader() =
......
......@@ -31,12 +31,17 @@
<string name="preference_theme_entry_gruvbox_light">Gruvbox (Hell)</string>
<string name="preference_theme_entry_gruvbox_dark">Gruvbox (Dunkel)</string>
<string name="preference_theme_entry_dracula">Dracula</string>
<string name="preference_input_enter_title">Eingabetaste auf Tastatur</string>
<string name="preference_input_enter_entry_emoji">Emoji-Auswahl</string>
<string name="preference_input_enter_entry_send">Senden</string>
<string name="preference_show_lag_title">Latenz anzeigen</string>
<string name="preference_show_lag_summary">Zeigt die Gerät-Core-Latenz in der Statusleiste</string>
<string name="preference_keep_screen_on_title">Bildschirm aktiv halten</string>
<string name="preference_keep_screen_on_summary">Verhindert, dass das Gerät in den Schlafmodus wechselt während die App im Vordergrund ist</string>
<string name="preference_language_title">Sprache</string>
<string name="preference_language_entry_auto">System-Standardsprache</string>
<string name="preference_notifications_title">Benachrichtigungen</string>
......
......@@ -74,6 +74,10 @@
<string name="preference_show_lag_title">Show lag</string>
<string name="preference_show_lag_summary">Displays the lag between client and core in the action bar</string>
<string name="preference_keep_screen_on_key" translatable="false">keep_screen_on</string>
<string name="preference_keep_screen_on_title">Keep Screen Active</string>
<string name="preference_keep_screen_on_summary">Prevents the device from going to sleep while the app is in foreground</string>
<string name="preference_language_key" translatable="false">language</string>
<string name="preference_language_title">Language</string>
<string name="preference_language_entry_auto">System Default</string>
......
......@@ -41,6 +41,12 @@
android:summary="@string/preference_show_lag_summary"
android:title="@string/preference_show_lag_title" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/preference_keep_screen_on_key"
android:summary="@string/preference_keep_screen_on_summary"
android:title="@string/preference_keep_screen_on_title" />
<DropDownPreference
android:defaultValue=""
android:entries="@array/preference_language_entries"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment