项目名称更改为VerveDo
This commit is contained in:
parent
0f27ee5b6f
commit
8059fd15a0
25 changed files with 108 additions and 111 deletions
|
|
@ -38,12 +38,12 @@ android {
|
|||
applicationId = "cn.super12138.todo"
|
||||
minSdk = 24
|
||||
targetSdk = 36
|
||||
versionCode = 996
|
||||
versionCode = 997
|
||||
versionName = "2.3.3"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
base.archivesName.set("todo-${versionName}")
|
||||
base.archivesName.set("vervedo-${versionName}")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:name=".TodoApp"
|
||||
android:name=".VerveDoApp"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.ToDo.Starting"
|
||||
android:theme="@style/Theme.VerveDo.Starting"
|
||||
tools:targetApi="35">
|
||||
<activity
|
||||
android:name=".ui.activities.MainActivity"
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
android:name=".ui.activities.CrashActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/Theme.ToDo" />
|
||||
android:theme="@style/Theme.VerveDo" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -6,7 +6,7 @@ import android.content.Context
|
|||
import cn.super12138.todo.logic.database.TodoDatabase
|
||||
import cn.super12138.todo.ui.pages.crash.CrashHandler
|
||||
|
||||
class TodoApp : Application() {
|
||||
class VerveDoApp : Application() {
|
||||
private val database by lazy { TodoDatabase.getDatabase(this) }
|
||||
|
||||
companion object {
|
||||
|
|
@ -2,7 +2,7 @@ package cn.super12138.todo.constants
|
|||
|
||||
object Constants {
|
||||
const val DEVELOPER_GITHUB = "https://github.com/Super12138/"
|
||||
const val GITHUB_REPO = "https://github.com/Super12138/ToDo/"
|
||||
const val GITHUB_REPO = "https://github.com/Super12138/VerveDo/"
|
||||
|
||||
const val KEY_TODO_FAB_TRANSITION = "todo_fab"
|
||||
const val KEY_TODO_ITEM_TRANSITION = "todo_item_id"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package cn.super12138.todo.logic
|
||||
|
||||
import cn.super12138.todo.TodoApp
|
||||
import cn.super12138.todo.VerveDoApp
|
||||
import cn.super12138.todo.logic.database.TodoEntity
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
object Repository : IRepository {
|
||||
private val db get() = TodoApp.db
|
||||
private val db get() = VerveDoApp.db
|
||||
private val toDoDao = db.toDoDao()
|
||||
|
||||
override suspend fun insertTodo(toDo: TodoEntity) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import androidx.datastore.preferences.core.floatPreferencesKey
|
|||
import androidx.datastore.preferences.core.intPreferencesKey
|
||||
import androidx.datastore.preferences.core.stringPreferencesKey
|
||||
import androidx.datastore.preferences.preferencesDataStore
|
||||
import cn.super12138.todo.TodoApp
|
||||
import cn.super12138.todo.VerveDoApp
|
||||
import cn.super12138.todo.constants.Constants
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.map
|
||||
|
|
@ -27,7 +27,7 @@ object DataStoreManager {
|
|||
}
|
||||
)
|
||||
|
||||
val dataStore = TodoApp.context.dataStore
|
||||
val dataStore = VerveDoApp.context.dataStore
|
||||
|
||||
// Keys
|
||||
// 外观与个性化
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import cn.super12138.todo.logic.datastore.DataStoreManager
|
|||
import cn.super12138.todo.logic.model.DarkMode
|
||||
import cn.super12138.todo.logic.model.PaletteStyle
|
||||
import cn.super12138.todo.ui.pages.crash.CrashPage
|
||||
import cn.super12138.todo.ui.theme.ToDoTheme
|
||||
import cn.super12138.todo.ui.theme.VerveDoTheme
|
||||
import cn.super12138.todo.utils.VibrationUtils
|
||||
import cn.super12138.todo.utils.configureEdgeToEdge
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ class CrashActivity : ComponentActivity() {
|
|||
VibrationUtils.setEnabled(hapticFeedback)
|
||||
}
|
||||
|
||||
ToDoTheme(
|
||||
VerveDoTheme(
|
||||
darkTheme = darkTheme,
|
||||
style = PaletteStyle.fromId(paletteStyle),
|
||||
contrastLevel = contrastLevel.toDouble(),
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ import cn.super12138.todo.logic.model.DarkMode
|
|||
import cn.super12138.todo.logic.model.PaletteStyle
|
||||
import cn.super12138.todo.ui.TodoDefaults
|
||||
import cn.super12138.todo.ui.components.Konfetti
|
||||
import cn.super12138.todo.ui.navigation.TodoDestinations
|
||||
import cn.super12138.todo.ui.navigation.VerveDoDestinations
|
||||
import cn.super12138.todo.ui.navigation.TopNavigation
|
||||
import cn.super12138.todo.ui.theme.ToDoTheme
|
||||
import cn.super12138.todo.ui.theme.VerveDoTheme
|
||||
import cn.super12138.todo.ui.viewmodels.MainViewModel
|
||||
import cn.super12138.todo.utils.VibrationUtils
|
||||
import cn.super12138.todo.utils.configureEdgeToEdge
|
||||
|
|
@ -91,7 +91,7 @@ class MainActivity : ComponentActivity() {
|
|||
// 当BackStack出现非顶层路由时,隐藏底部导航栏
|
||||
LaunchedEffect(mainBackStack.backStack.lastOrNull()) {
|
||||
val isTopLevel =
|
||||
mainBackStack.backStack.lastOrNull() in TodoDestinations.entries.map { it.route }
|
||||
mainBackStack.backStack.lastOrNull() in VerveDoDestinations.entries.map { it.route }
|
||||
if (isTopLevel) {
|
||||
if (navigationScaffoldState.currentValue != NavigationSuiteScaffoldValue.Visible) navigationScaffoldState.show()
|
||||
} else {
|
||||
|
|
@ -99,7 +99,7 @@ class MainActivity : ComponentActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
ToDoTheme(
|
||||
VerveDoTheme(
|
||||
darkTheme = darkTheme,
|
||||
style = PaletteStyle.fromId(paletteStyle),
|
||||
contrastLevel = contrastLevel.toDouble(),
|
||||
|
|
@ -113,7 +113,7 @@ class MainActivity : ComponentActivity() {
|
|||
NavigationSuiteScaffold(
|
||||
state = navigationScaffoldState,
|
||||
navigationSuiteItems = {
|
||||
TodoDestinations.entries.forEach { destination ->
|
||||
VerveDoDestinations.entries.forEach { destination ->
|
||||
val selected = destination.route == mainBackStack.topLevelKey
|
||||
item(
|
||||
icon = {
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
package cn.super12138.todo.ui.navigation
|
||||
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.navigation3.runtime.NavKey
|
||||
|
||||
enum class TodoDestinations(
|
||||
val route: NavKey,
|
||||
@param:StringRes val label: Int,
|
||||
@param:DrawableRes val icon: Int,
|
||||
@param:DrawableRes val selectedIcon: Int
|
||||
) {
|
||||
Overview(
|
||||
route = TodoScreen.Overview,
|
||||
label = cn.super12138.todo.R.string.page_overview,
|
||||
icon = cn.super12138.todo.R.drawable.ic_dashboard,
|
||||
selectedIcon = cn.super12138.todo.R.drawable.ic_dashboard_filled
|
||||
),
|
||||
Tasks(
|
||||
route = TodoScreen.Tasks,
|
||||
label = cn.super12138.todo.R.string.page_tasks,
|
||||
icon = cn.super12138.todo.R.drawable.ic_ballot,
|
||||
selectedIcon = cn.super12138.todo.R.drawable.ic_ballot_filled
|
||||
),
|
||||
Settings(
|
||||
route = TodoScreen.Settings.Main,
|
||||
label = cn.super12138.todo.R.string.page_settings,
|
||||
icon = cn.super12138.todo.R.drawable.ic_settings,
|
||||
selectedIcon = cn.super12138.todo.R.drawable.ic_settings_filled
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -9,8 +9,8 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.navigation3.runtime.NavKey
|
||||
import androidx.navigation3.runtime.entryProvider
|
||||
import androidx.navigation3.ui.NavDisplay
|
||||
import cn.super12138.todo.ui.pages.editor.TodoAddPage
|
||||
import cn.super12138.todo.ui.pages.editor.TodoEditPage
|
||||
import cn.super12138.todo.ui.pages.editor.TaskAddPage
|
||||
import cn.super12138.todo.ui.pages.editor.TaskEditPage
|
||||
import cn.super12138.todo.ui.pages.overview.OverviewPage
|
||||
import cn.super12138.todo.ui.pages.settings.SettingsAbout
|
||||
import cn.super12138.todo.ui.pages.settings.SettingsAboutLicence
|
||||
|
|
@ -78,20 +78,20 @@ fun TopNavigation(
|
|||
popTransitionSpec = { defaultTransition },
|
||||
predictivePopTransitionSpec = { defaultTransition },
|
||||
entryProvider = entryProvider {
|
||||
entry<TodoScreen.Overview> {
|
||||
entry<VerveDoScreen.Overview> {
|
||||
OverviewPage(viewModel = viewModel)
|
||||
}
|
||||
|
||||
entry<TodoScreen.Tasks> {
|
||||
entry<VerveDoScreen.Tasks> {
|
||||
TasksPage(
|
||||
viewModel = viewModel,
|
||||
toTodoAddPage = { backStack.add(TodoScreen.Editor.Add) },
|
||||
toTodoEditPage = { backStack.add(TodoScreen.Editor.Edit(it)) }
|
||||
toTodoAddPage = { backStack.add(VerveDoScreen.Editor.Add) },
|
||||
toTodoEditPage = { backStack.add(VerveDoScreen.Editor.Edit(it)) }
|
||||
)
|
||||
}
|
||||
|
||||
entry<TodoScreen.Editor.Add>(metadata = editorTransition()) {
|
||||
TodoAddPage(
|
||||
entry<VerveDoScreen.Editor.Add>(metadata = editorTransition()) {
|
||||
TaskAddPage(
|
||||
onSave = {
|
||||
viewModel.addTodo(it)
|
||||
onBack()
|
||||
|
|
@ -100,8 +100,8 @@ fun TopNavigation(
|
|||
)
|
||||
}
|
||||
|
||||
entry<TodoScreen.Editor.Edit>(metadata = editorTransition()) { editorArgs ->
|
||||
TodoEditPage(
|
||||
entry<VerveDoScreen.Editor.Edit>(metadata = editorTransition()) { editorArgs ->
|
||||
TaskEditPage(
|
||||
toDo = editorArgs.toDo,
|
||||
onSave = {
|
||||
viewModel.addTodo(it)
|
||||
|
|
@ -119,40 +119,40 @@ fun TopNavigation(
|
|||
)
|
||||
}
|
||||
|
||||
entry<TodoScreen.Settings.Main> {
|
||||
entry<VerveDoScreen.Settings.Main> {
|
||||
SettingsMain(
|
||||
toAppearancePage = { backStack.add(TodoScreen.Settings.Appearance) },
|
||||
toAboutPage = { backStack.add(TodoScreen.Settings.About) },
|
||||
toInterfacePage = { backStack.add(TodoScreen.Settings.Interface) },
|
||||
toDataPage = { backStack.add(TodoScreen.Settings.Data) },
|
||||
toAppearancePage = { backStack.add(VerveDoScreen.Settings.Appearance) },
|
||||
toAboutPage = { backStack.add(VerveDoScreen.Settings.About) },
|
||||
toInterfacePage = { backStack.add(VerveDoScreen.Settings.Interface) },
|
||||
toDataPage = { backStack.add(VerveDoScreen.Settings.Data) },
|
||||
)
|
||||
}
|
||||
|
||||
entry<TodoScreen.Settings.Appearance>(metadata = settingsTransition()) {
|
||||
entry<VerveDoScreen.Settings.Appearance>(metadata = settingsTransition()) {
|
||||
SettingsAppearance(onNavigateUp = ::onBack)
|
||||
}
|
||||
|
||||
entry<TodoScreen.Settings.Interface>(metadata = settingsTransition()) {
|
||||
entry<VerveDoScreen.Settings.Interface>(metadata = settingsTransition()) {
|
||||
SettingsInterface(onNavigateUp = ::onBack)
|
||||
}
|
||||
|
||||
entry<TodoScreen.Settings.Data>(metadata = settingsTransition()) {
|
||||
entry<VerveDoScreen.Settings.Data>(metadata = settingsTransition()) {
|
||||
SettingsData(
|
||||
viewModel = viewModel,
|
||||
toCategoryManager = { backStack.add(TodoScreen.Settings.DataCategory) },
|
||||
toCategoryManager = { backStack.add(VerveDoScreen.Settings.DataCategory) },
|
||||
onNavigateUp = ::onBack
|
||||
)
|
||||
}
|
||||
|
||||
entry<TodoScreen.Settings.DataCategory>(metadata = settingsTransition()) {
|
||||
entry<VerveDoScreen.Settings.DataCategory>(metadata = settingsTransition()) {
|
||||
SettingsDataCategory(onNavigateUp = ::onBack)
|
||||
}
|
||||
|
||||
entry<TodoScreen.Settings.About>(metadata = settingsTransition()) {
|
||||
entry<VerveDoScreen.Settings.About>(metadata = settingsTransition()) {
|
||||
SettingsAbout(
|
||||
//toSpecialPage = { backStack.add(TodoScreen.Settings.AboutSpecial) },
|
||||
toLicencePage = { backStack.add(TodoScreen.Settings.AboutLicence) },
|
||||
toDevPage = { backStack.add(TodoScreen.Settings.DeveloperOptions) },
|
||||
toLicencePage = { backStack.add(VerveDoScreen.Settings.AboutLicence) },
|
||||
toDevPage = { backStack.add(VerveDoScreen.Settings.DeveloperOptions) },
|
||||
onNavigateUp = ::onBack,
|
||||
)
|
||||
}
|
||||
|
|
@ -161,17 +161,17 @@ fun TopNavigation(
|
|||
SettingsAboutSpecial(viewModel = viewModel)
|
||||
}*/
|
||||
|
||||
entry<TodoScreen.Settings.AboutLicence>(metadata = settingsTransition()) {
|
||||
entry<VerveDoScreen.Settings.AboutLicence>(metadata = settingsTransition()) {
|
||||
SettingsAboutLicence(onNavigateUp = ::onBack)
|
||||
}
|
||||
|
||||
entry<TodoScreen.Settings.DeveloperOptions>(metadata = settingsTransition()) {
|
||||
entry<VerveDoScreen.Settings.DeveloperOptions>(metadata = settingsTransition()) {
|
||||
SettingsDeveloperOptions(
|
||||
toPaddingPage = { backStack.add(TodoScreen.Settings.DeveloperOptionsPadding) },
|
||||
toPaddingPage = { backStack.add(VerveDoScreen.Settings.DeveloperOptionsPadding) },
|
||||
onNavigateUp = ::onBack
|
||||
)
|
||||
}
|
||||
entry<TodoScreen.Settings.DeveloperOptionsPadding>(metadata = settingsTransition()) {
|
||||
entry<VerveDoScreen.Settings.DeveloperOptionsPadding>(metadata = settingsTransition()) {
|
||||
SettingsDeveloperOptionsPadding(onNavigateUp = ::onBack)
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package cn.super12138.todo.ui.navigation
|
||||
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.navigation3.runtime.NavKey
|
||||
import cn.super12138.todo.R
|
||||
|
||||
enum class VerveDoDestinations(
|
||||
val route: NavKey,
|
||||
@param:StringRes val label: Int,
|
||||
@param:DrawableRes val icon: Int,
|
||||
@param:DrawableRes val selectedIcon: Int
|
||||
) {
|
||||
Overview(
|
||||
route = VerveDoScreen.Overview,
|
||||
label = R.string.page_overview,
|
||||
icon = R.drawable.ic_dashboard,
|
||||
selectedIcon = R.drawable.ic_dashboard_filled
|
||||
),
|
||||
Tasks(
|
||||
route = VerveDoScreen.Tasks,
|
||||
label = R.string.page_tasks,
|
||||
icon = R.drawable.ic_ballot,
|
||||
selectedIcon = R.drawable.ic_ballot_filled
|
||||
),
|
||||
Settings(
|
||||
route = VerveDoScreen.Settings.Main,
|
||||
label = R.string.page_settings,
|
||||
icon = R.drawable.ic_settings,
|
||||
selectedIcon = R.drawable.ic_settings_filled
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -5,15 +5,15 @@ import cn.super12138.todo.logic.database.TodoEntity
|
|||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
sealed class TodoScreen : NavKey {
|
||||
sealed class VerveDoScreen : NavKey {
|
||||
@Serializable
|
||||
data object Overview : TodoScreen()
|
||||
data object Overview : VerveDoScreen()
|
||||
|
||||
@Serializable
|
||||
data object Tasks : TodoScreen()
|
||||
data object Tasks : VerveDoScreen()
|
||||
|
||||
@Serializable
|
||||
sealed class Settings : TodoScreen() {
|
||||
sealed class Settings : VerveDoScreen() {
|
||||
@Serializable
|
||||
data object Main : Settings()
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ sealed class TodoScreen : NavKey {
|
|||
}
|
||||
|
||||
@Serializable
|
||||
sealed class Editor : TodoScreen() {
|
||||
sealed class Editor : VerveDoScreen() {
|
||||
@Serializable
|
||||
data object Add : Editor()
|
||||
|
||||
|
|
@ -48,11 +48,11 @@ import cn.super12138.todo.ui.pages.editor.components.TodoPrioritySlider
|
|||
import cn.super12138.todo.ui.pages.editor.state.rememberEditorState
|
||||
|
||||
@Composable
|
||||
fun SharedTransitionScope.TodoAddPage(
|
||||
fun SharedTransitionScope.TaskAddPage(
|
||||
modifier: Modifier = Modifier,
|
||||
onSave: (TodoEntity) -> Unit,
|
||||
onNavigateUp: () -> Unit
|
||||
) = TodoEditorPage(
|
||||
) = TaskEditorPage(
|
||||
toDo = null,
|
||||
modifier = modifier
|
||||
.sharedBounds(
|
||||
|
|
@ -67,13 +67,13 @@ fun SharedTransitionScope.TodoAddPage(
|
|||
)
|
||||
|
||||
@Composable
|
||||
fun SharedTransitionScope.TodoEditPage(
|
||||
fun SharedTransitionScope.TaskEditPage(
|
||||
modifier: Modifier = Modifier,
|
||||
toDo: TodoEntity,
|
||||
onSave: (TodoEntity) -> Unit,
|
||||
onDelete: () -> Unit,
|
||||
onNavigateUp: () -> Unit
|
||||
) = TodoEditorPage(
|
||||
) = TaskEditorPage(
|
||||
toDo = toDo,
|
||||
modifier = modifier.sharedBounds(
|
||||
sharedContentState = rememberSharedContentState(key = "${Constants.KEY_TODO_ITEM_TRANSITION}_${toDo.id}"),
|
||||
|
|
@ -88,7 +88,7 @@ fun SharedTransitionScope.TodoEditPage(
|
|||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
@Composable
|
||||
fun SharedTransitionScope.TodoEditorPage(
|
||||
fun SharedTransitionScope.TaskEditorPage(
|
||||
modifier: Modifier = Modifier,
|
||||
toDo: TodoEntity? = null,
|
||||
onSave: (TodoEntity) -> Unit,
|
||||
|
|
@ -11,7 +11,7 @@ import cn.super12138.todo.logic.model.PaletteStyle
|
|||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
@Composable
|
||||
fun ToDoTheme(
|
||||
fun VerveDoTheme(
|
||||
color: Color? = null,
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
style: PaletteStyle = PaletteStyle.TonalSpot,
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ import androidx.compose.runtime.mutableStateOf
|
|||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import androidx.navigation3.runtime.NavKey
|
||||
import cn.super12138.todo.TodoApp
|
||||
import cn.super12138.todo.VerveDoApp
|
||||
import cn.super12138.todo.constants.Constants
|
||||
import cn.super12138.todo.logic.Repository
|
||||
import cn.super12138.todo.logic.database.TodoEntity
|
||||
import cn.super12138.todo.logic.datastore.DataStoreManager
|
||||
import cn.super12138.todo.logic.model.SortingMethod
|
||||
import cn.super12138.todo.ui.navigation.TodoScreen
|
||||
import cn.super12138.todo.ui.navigation.VerveDoScreen
|
||||
import cn.super12138.todo.ui.navigation.TopLevelBackStack
|
||||
import cn.super12138.todo.utils.FileUtils
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
|
@ -40,7 +40,7 @@ import java.util.zip.ZipOutputStream
|
|||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class MainViewModel : ViewModel() {
|
||||
val mainBackStack = TopLevelBackStack<NavKey>(TodoScreen.Overview)
|
||||
val mainBackStack = TopLevelBackStack<NavKey>(VerveDoScreen.Overview)
|
||||
|
||||
// 待办
|
||||
private val toDos: Flow<List<TodoEntity>> = Repository.getAllTodos()
|
||||
|
|
@ -232,7 +232,7 @@ class MainViewModel : ViewModel() {
|
|||
* * DataStore Preferences 文件
|
||||
*/
|
||||
private fun getBackupFiles(context: Context): List<File> {
|
||||
val dbPath = TodoApp.db.openHelper.writableDatabase.path
|
||||
val dbPath = VerveDoApp.db.openHelper.writableDatabase.path
|
||||
val prefPath = "${context.filesDir}/datastore"
|
||||
return listOf(
|
||||
context.getDatabasePath(Constants.DB_NAME), // 数据库
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ package cn.super12138.todo.utils
|
|||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import cn.super12138.todo.TodoApp
|
||||
import cn.super12138.todo.VerveDoApp
|
||||
import cn.super12138.todo.constants.Constants
|
||||
|
||||
object SPUtils {
|
||||
private val sp: SharedPreferences by lazy {
|
||||
TodoApp.context.getSharedPreferences(Constants.SP_NAME, Context.MODE_PRIVATE)
|
||||
VerveDoApp.context.getSharedPreferences(Constants.SP_NAME, Context.MODE_PRIVATE)
|
||||
}
|
||||
|
||||
fun <T> getValue(name: String, default: T): T = with(sp) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<resources>
|
||||
<string name="app_name">قائمة المهام</string>
|
||||
<string name="page_settings">الإعدادات</string>
|
||||
<string name="action_add_task">إضافة مهمة</string>
|
||||
<string name="tip_no_task">لا توجد مهام لإكمالها في الوقت الحالي.\nخذ قسطًا من الراحة!</string>
|
||||
|
|
@ -87,9 +86,7 @@
|
|||
<string name="pref_data">البيانات</string>
|
||||
<string name="pref_data_desc">نسخ احتياطي واستعادة، إدارة البيانات</string>
|
||||
<string name="pref_backup">نسخ احتياطي</string>
|
||||
<string name="pref_backup_desc">حفظ بيانات تطبيق المهام على جهازك</string>
|
||||
<string name="pref_restore">استعادة</string>
|
||||
<string name="pref_restore_desc">استعادة بيانات التطبيق من جهازك</string>
|
||||
<string name="tip_backup_success">تم النسخ الاحتياطي بنجاح</string>
|
||||
<string name="tip_backup_failed">فشل النسخ الاحتياطي</string>
|
||||
<string name="tip_restore_success">تمت الاستعادة بنجاح، أعد تشغيل التطبيق لتحميل البيانات</string>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.ToDo" parent="android:Theme.Material.NoActionBar">
|
||||
<style name="Theme.VerveDo" parent="android:Theme.Material.NoActionBar">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.ToDo" parent="android:Theme.Material.NoActionBar">
|
||||
<style name="Theme.VerveDo" parent="android:Theme.Material.NoActionBar">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.ToDo" parent="android:Theme.Material.NoActionBar">
|
||||
<style name="Theme.VerveDo" parent="android:Theme.Material.NoActionBar">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.ToDo" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<style name="Theme.VerveDo" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.ToDo" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<style name="Theme.VerveDo" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">待办</string>
|
||||
<string name="page_settings">设置</string>
|
||||
<string name="action_add_task">添加待办</string>
|
||||
<string name="tip_no_task">目前没有要完成的任务,好好休息一下吧~</string>
|
||||
|
|
@ -86,9 +85,9 @@
|
|||
<string name="pref_data">数据</string>
|
||||
<string name="pref_data_desc">备份与恢复、管理数据</string>
|
||||
<string name="pref_backup">备份数据</string>
|
||||
<string name="pref_backup_desc">将待办的应用数据保存在你的设备上</string>
|
||||
<string name="pref_backup_desc">将 VerveDo 的应用数据保存在你的设备上</string>
|
||||
<string name="pref_restore">恢复数据</string>
|
||||
<string name="pref_restore_desc">从你的设备上恢复待办的应用数据</string>
|
||||
<string name="pref_restore_desc">从你的设备上恢复 VerveDo 的应用数据</string>
|
||||
<string name="tip_backup_success">备份成功</string>
|
||||
<string name="tip_backup_failed">备份失败</string>
|
||||
<string name="tip_restore_success">数据恢复成功,需要重启应用以加载数据</string>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<resources>
|
||||
<string name="app_name">To Do</string>
|
||||
<string name="app_name" translatable="false">VerveDo</string>
|
||||
<string name="page_settings">Settings</string>
|
||||
<string name="action_add_task">Add Task</string>
|
||||
<string name="tip_no_task">There are no tasks to complete at the moment.\nTake a good rest!</string>
|
||||
|
|
@ -87,9 +87,9 @@
|
|||
<string name="pref_data">Data</string>
|
||||
<string name="pref_data_desc">Backup and Restore, Manage Data</string>
|
||||
<string name="pref_backup">Backup</string>
|
||||
<string name="pref_backup_desc">Save the To Do app data on your device</string>
|
||||
<string name="pref_backup_desc">Save VerveDo app data on your device</string>
|
||||
<string name="pref_restore">Restore</string>
|
||||
<string name="pref_restore_desc">Restore the To Do app data from your device</string>
|
||||
<string name="pref_restore_desc">Restore VerveDo app data from your device</string>
|
||||
<string name="tip_backup_success">Backup successful</string>
|
||||
<string name="tip_backup_failed">Backup failed</string>
|
||||
<string name="tip_restore_success">Restore successful, restart the app to load data</string>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.ToDo.Starting" parent="Theme.SplashScreen">
|
||||
<style name="Theme.VerveDo.Starting" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">@color/background</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.ToDo</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.VerveDo</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.ToDo" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<style name="Theme.VerveDo" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
|
|
|
|||
Loading…
Reference in a new issue