Compare commits
3 Commits
4adca319be
...
7e0e7e4c29
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e0e7e4c29 | |||
| 28d96bd3c1 | |||
| adc7fb54d9 |
@@ -2,6 +2,7 @@ package me.hgsky.synq.data
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.provider.Settings
|
||||
import androidx.datastore.preferences.core.edit
|
||||
import androidx.datastore.preferences.core.intPreferencesKey
|
||||
import androidx.datastore.preferences.core.stringPreferencesKey
|
||||
@@ -29,7 +30,10 @@ class SettingsRepository(private val context: Context) {
|
||||
SynqSettings(
|
||||
serverUrl = prefs[KEY_URL] ?: "http://jeeves.mother:8765",
|
||||
token = prefs[KEY_TOKEN] ?: "",
|
||||
deviceLabel = prefs[KEY_DEVICE] ?: Build.MODEL,
|
||||
deviceLabel = prefs[KEY_DEVICE] ?: (
|
||||
Settings.Global.getString(context.contentResolver, Settings.Global.DEVICE_NAME)
|
||||
?.takeIf { it.isNotBlank() } ?: Build.MODEL
|
||||
),
|
||||
syncIntervalMinutes = prefs[KEY_INTERVAL] ?: 15,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ fun CaptureScreen(
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
snackbarHost = { SnackbarHost(snackbarState) },
|
||||
snackbarHost = { SnackbarHost(snackbarState, modifier = Modifier.imePadding()) },
|
||||
topBar = {
|
||||
TopAppBar(
|
||||
title = { Text("synq") },
|
||||
|
||||
Reference in New Issue
Block a user