项目名称更改为VerveDo

This commit is contained in:
Super12138 2026-02-09 17:33:15 +08:00
parent 0f27ee5b6f
commit 8059fd15a0
25 changed files with 108 additions and 111 deletions

View file

@ -38,12 +38,12 @@ android {
applicationId = "cn.super12138.todo" applicationId = "cn.super12138.todo"
minSdk = 24 minSdk = 24
targetSdk = 36 targetSdk = 36
versionCode = 996 versionCode = 997
versionName = "2.3.3" versionName = "2.3.3"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
base.archivesName.set("todo-${versionName}") base.archivesName.set("vervedo-${versionName}")
} }
buildTypes { buildTypes {

View file

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<application <application
android:name=".TodoApp" android:name=".VerveDoApp"
android:allowBackup="true" android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules" android:fullBackupContent="@xml/backup_rules"
@ -11,7 +11,7 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.ToDo.Starting" android:theme="@style/Theme.VerveDo.Starting"
tools:targetApi="35"> tools:targetApi="35">
<activity <activity
android:name=".ui.activities.MainActivity" android:name=".ui.activities.MainActivity"
@ -27,7 +27,7 @@
android:name=".ui.activities.CrashActivity" android:name=".ui.activities.CrashActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTask" android:launchMode="singleTask"
android:theme="@style/Theme.ToDo" /> android:theme="@style/Theme.VerveDo" />
</application> </application>
</manifest> </manifest>

View file

@ -6,7 +6,7 @@ import android.content.Context
import cn.super12138.todo.logic.database.TodoDatabase import cn.super12138.todo.logic.database.TodoDatabase
import cn.super12138.todo.ui.pages.crash.CrashHandler import cn.super12138.todo.ui.pages.crash.CrashHandler
class TodoApp : Application() { class VerveDoApp : Application() {
private val database by lazy { TodoDatabase.getDatabase(this) } private val database by lazy { TodoDatabase.getDatabase(this) }
companion object { companion object {

View file

@ -2,7 +2,7 @@ package cn.super12138.todo.constants
object Constants { object Constants {
const val DEVELOPER_GITHUB = "https://github.com/Super12138/" 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_FAB_TRANSITION = "todo_fab"
const val KEY_TODO_ITEM_TRANSITION = "todo_item_id" const val KEY_TODO_ITEM_TRANSITION = "todo_item_id"

View file

@ -1,11 +1,11 @@
package cn.super12138.todo.logic package cn.super12138.todo.logic
import cn.super12138.todo.TodoApp import cn.super12138.todo.VerveDoApp
import cn.super12138.todo.logic.database.TodoEntity import cn.super12138.todo.logic.database.TodoEntity
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
object Repository : IRepository { object Repository : IRepository {
private val db get() = TodoApp.db private val db get() = VerveDoApp.db
private val toDoDao = db.toDoDao() private val toDoDao = db.toDoDao()
override suspend fun insertTodo(toDo: TodoEntity) { override suspend fun insertTodo(toDo: TodoEntity) {

View file

@ -8,7 +8,7 @@ import androidx.datastore.preferences.core.floatPreferencesKey
import androidx.datastore.preferences.core.intPreferencesKey import androidx.datastore.preferences.core.intPreferencesKey
import androidx.datastore.preferences.core.stringPreferencesKey import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.datastore.preferences.preferencesDataStore import androidx.datastore.preferences.preferencesDataStore
import cn.super12138.todo.TodoApp import cn.super12138.todo.VerveDoApp
import cn.super12138.todo.constants.Constants import cn.super12138.todo.constants.Constants
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.map
@ -27,7 +27,7 @@ object DataStoreManager {
} }
) )
val dataStore = TodoApp.context.dataStore val dataStore = VerveDoApp.context.dataStore
// Keys // Keys
// 外观与个性化 // 外观与个性化

View file

@ -17,7 +17,7 @@ import cn.super12138.todo.logic.datastore.DataStoreManager
import cn.super12138.todo.logic.model.DarkMode import cn.super12138.todo.logic.model.DarkMode
import cn.super12138.todo.logic.model.PaletteStyle import cn.super12138.todo.logic.model.PaletteStyle
import cn.super12138.todo.ui.pages.crash.CrashPage 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.VibrationUtils
import cn.super12138.todo.utils.configureEdgeToEdge import cn.super12138.todo.utils.configureEdgeToEdge
@ -61,7 +61,7 @@ class CrashActivity : ComponentActivity() {
VibrationUtils.setEnabled(hapticFeedback) VibrationUtils.setEnabled(hapticFeedback)
} }
ToDoTheme( VerveDoTheme(
darkTheme = darkTheme, darkTheme = darkTheme,
style = PaletteStyle.fromId(paletteStyle), style = PaletteStyle.fromId(paletteStyle),
contrastLevel = contrastLevel.toDouble(), contrastLevel = contrastLevel.toDouble(),

View file

@ -29,9 +29,9 @@ import cn.super12138.todo.logic.model.DarkMode
import cn.super12138.todo.logic.model.PaletteStyle import cn.super12138.todo.logic.model.PaletteStyle
import cn.super12138.todo.ui.TodoDefaults import cn.super12138.todo.ui.TodoDefaults
import cn.super12138.todo.ui.components.Konfetti 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.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.ui.viewmodels.MainViewModel
import cn.super12138.todo.utils.VibrationUtils import cn.super12138.todo.utils.VibrationUtils
import cn.super12138.todo.utils.configureEdgeToEdge import cn.super12138.todo.utils.configureEdgeToEdge
@ -91,7 +91,7 @@ class MainActivity : ComponentActivity() {
// 当BackStack出现非顶层路由时隐藏底部导航栏 // 当BackStack出现非顶层路由时隐藏底部导航栏
LaunchedEffect(mainBackStack.backStack.lastOrNull()) { LaunchedEffect(mainBackStack.backStack.lastOrNull()) {
val isTopLevel = val isTopLevel =
mainBackStack.backStack.lastOrNull() in TodoDestinations.entries.map { it.route } mainBackStack.backStack.lastOrNull() in VerveDoDestinations.entries.map { it.route }
if (isTopLevel) { if (isTopLevel) {
if (navigationScaffoldState.currentValue != NavigationSuiteScaffoldValue.Visible) navigationScaffoldState.show() if (navigationScaffoldState.currentValue != NavigationSuiteScaffoldValue.Visible) navigationScaffoldState.show()
} else { } else {
@ -99,7 +99,7 @@ class MainActivity : ComponentActivity() {
} }
} }
ToDoTheme( VerveDoTheme(
darkTheme = darkTheme, darkTheme = darkTheme,
style = PaletteStyle.fromId(paletteStyle), style = PaletteStyle.fromId(paletteStyle),
contrastLevel = contrastLevel.toDouble(), contrastLevel = contrastLevel.toDouble(),
@ -113,7 +113,7 @@ class MainActivity : ComponentActivity() {
NavigationSuiteScaffold( NavigationSuiteScaffold(
state = navigationScaffoldState, state = navigationScaffoldState,
navigationSuiteItems = { navigationSuiteItems = {
TodoDestinations.entries.forEach { destination -> VerveDoDestinations.entries.forEach { destination ->
val selected = destination.route == mainBackStack.topLevelKey val selected = destination.route == mainBackStack.topLevelKey
item( item(
icon = { icon = {

View file

@ -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
)
}

View file

@ -9,8 +9,8 @@ import androidx.compose.ui.Modifier
import androidx.navigation3.runtime.NavKey import androidx.navigation3.runtime.NavKey
import androidx.navigation3.runtime.entryProvider import androidx.navigation3.runtime.entryProvider
import androidx.navigation3.ui.NavDisplay import androidx.navigation3.ui.NavDisplay
import cn.super12138.todo.ui.pages.editor.TodoAddPage import cn.super12138.todo.ui.pages.editor.TaskAddPage
import cn.super12138.todo.ui.pages.editor.TodoEditPage import cn.super12138.todo.ui.pages.editor.TaskEditPage
import cn.super12138.todo.ui.pages.overview.OverviewPage import cn.super12138.todo.ui.pages.overview.OverviewPage
import cn.super12138.todo.ui.pages.settings.SettingsAbout import cn.super12138.todo.ui.pages.settings.SettingsAbout
import cn.super12138.todo.ui.pages.settings.SettingsAboutLicence import cn.super12138.todo.ui.pages.settings.SettingsAboutLicence
@ -78,20 +78,20 @@ fun TopNavigation(
popTransitionSpec = { defaultTransition }, popTransitionSpec = { defaultTransition },
predictivePopTransitionSpec = { defaultTransition }, predictivePopTransitionSpec = { defaultTransition },
entryProvider = entryProvider { entryProvider = entryProvider {
entry<TodoScreen.Overview> { entry<VerveDoScreen.Overview> {
OverviewPage(viewModel = viewModel) OverviewPage(viewModel = viewModel)
} }
entry<TodoScreen.Tasks> { entry<VerveDoScreen.Tasks> {
TasksPage( TasksPage(
viewModel = viewModel, viewModel = viewModel,
toTodoAddPage = { backStack.add(TodoScreen.Editor.Add) }, toTodoAddPage = { backStack.add(VerveDoScreen.Editor.Add) },
toTodoEditPage = { backStack.add(TodoScreen.Editor.Edit(it)) } toTodoEditPage = { backStack.add(VerveDoScreen.Editor.Edit(it)) }
) )
} }
entry<TodoScreen.Editor.Add>(metadata = editorTransition()) { entry<VerveDoScreen.Editor.Add>(metadata = editorTransition()) {
TodoAddPage( TaskAddPage(
onSave = { onSave = {
viewModel.addTodo(it) viewModel.addTodo(it)
onBack() onBack()
@ -100,8 +100,8 @@ fun TopNavigation(
) )
} }
entry<TodoScreen.Editor.Edit>(metadata = editorTransition()) { editorArgs -> entry<VerveDoScreen.Editor.Edit>(metadata = editorTransition()) { editorArgs ->
TodoEditPage( TaskEditPage(
toDo = editorArgs.toDo, toDo = editorArgs.toDo,
onSave = { onSave = {
viewModel.addTodo(it) viewModel.addTodo(it)
@ -119,40 +119,40 @@ fun TopNavigation(
) )
} }
entry<TodoScreen.Settings.Main> { entry<VerveDoScreen.Settings.Main> {
SettingsMain( SettingsMain(
toAppearancePage = { backStack.add(TodoScreen.Settings.Appearance) }, toAppearancePage = { backStack.add(VerveDoScreen.Settings.Appearance) },
toAboutPage = { backStack.add(TodoScreen.Settings.About) }, toAboutPage = { backStack.add(VerveDoScreen.Settings.About) },
toInterfacePage = { backStack.add(TodoScreen.Settings.Interface) }, toInterfacePage = { backStack.add(VerveDoScreen.Settings.Interface) },
toDataPage = { backStack.add(TodoScreen.Settings.Data) }, toDataPage = { backStack.add(VerveDoScreen.Settings.Data) },
) )
} }
entry<TodoScreen.Settings.Appearance>(metadata = settingsTransition()) { entry<VerveDoScreen.Settings.Appearance>(metadata = settingsTransition()) {
SettingsAppearance(onNavigateUp = ::onBack) SettingsAppearance(onNavigateUp = ::onBack)
} }
entry<TodoScreen.Settings.Interface>(metadata = settingsTransition()) { entry<VerveDoScreen.Settings.Interface>(metadata = settingsTransition()) {
SettingsInterface(onNavigateUp = ::onBack) SettingsInterface(onNavigateUp = ::onBack)
} }
entry<TodoScreen.Settings.Data>(metadata = settingsTransition()) { entry<VerveDoScreen.Settings.Data>(metadata = settingsTransition()) {
SettingsData( SettingsData(
viewModel = viewModel, viewModel = viewModel,
toCategoryManager = { backStack.add(TodoScreen.Settings.DataCategory) }, toCategoryManager = { backStack.add(VerveDoScreen.Settings.DataCategory) },
onNavigateUp = ::onBack onNavigateUp = ::onBack
) )
} }
entry<TodoScreen.Settings.DataCategory>(metadata = settingsTransition()) { entry<VerveDoScreen.Settings.DataCategory>(metadata = settingsTransition()) {
SettingsDataCategory(onNavigateUp = ::onBack) SettingsDataCategory(onNavigateUp = ::onBack)
} }
entry<TodoScreen.Settings.About>(metadata = settingsTransition()) { entry<VerveDoScreen.Settings.About>(metadata = settingsTransition()) {
SettingsAbout( SettingsAbout(
//toSpecialPage = { backStack.add(TodoScreen.Settings.AboutSpecial) }, //toSpecialPage = { backStack.add(TodoScreen.Settings.AboutSpecial) },
toLicencePage = { backStack.add(TodoScreen.Settings.AboutLicence) }, toLicencePage = { backStack.add(VerveDoScreen.Settings.AboutLicence) },
toDevPage = { backStack.add(TodoScreen.Settings.DeveloperOptions) }, toDevPage = { backStack.add(VerveDoScreen.Settings.DeveloperOptions) },
onNavigateUp = ::onBack, onNavigateUp = ::onBack,
) )
} }
@ -161,17 +161,17 @@ fun TopNavigation(
SettingsAboutSpecial(viewModel = viewModel) SettingsAboutSpecial(viewModel = viewModel)
}*/ }*/
entry<TodoScreen.Settings.AboutLicence>(metadata = settingsTransition()) { entry<VerveDoScreen.Settings.AboutLicence>(metadata = settingsTransition()) {
SettingsAboutLicence(onNavigateUp = ::onBack) SettingsAboutLicence(onNavigateUp = ::onBack)
} }
entry<TodoScreen.Settings.DeveloperOptions>(metadata = settingsTransition()) { entry<VerveDoScreen.Settings.DeveloperOptions>(metadata = settingsTransition()) {
SettingsDeveloperOptions( SettingsDeveloperOptions(
toPaddingPage = { backStack.add(TodoScreen.Settings.DeveloperOptionsPadding) }, toPaddingPage = { backStack.add(VerveDoScreen.Settings.DeveloperOptionsPadding) },
onNavigateUp = ::onBack onNavigateUp = ::onBack
) )
} }
entry<TodoScreen.Settings.DeveloperOptionsPadding>(metadata = settingsTransition()) { entry<VerveDoScreen.Settings.DeveloperOptionsPadding>(metadata = settingsTransition()) {
SettingsDeveloperOptionsPadding(onNavigateUp = ::onBack) SettingsDeveloperOptionsPadding(onNavigateUp = ::onBack)
} }
}, },

View file

@ -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
)
}

View file

@ -5,15 +5,15 @@ import cn.super12138.todo.logic.database.TodoEntity
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
@Serializable @Serializable
sealed class TodoScreen : NavKey { sealed class VerveDoScreen : NavKey {
@Serializable @Serializable
data object Overview : TodoScreen() data object Overview : VerveDoScreen()
@Serializable @Serializable
data object Tasks : TodoScreen() data object Tasks : VerveDoScreen()
@Serializable @Serializable
sealed class Settings : TodoScreen() { sealed class Settings : VerveDoScreen() {
@Serializable @Serializable
data object Main : Settings() data object Main : Settings()
@ -46,7 +46,7 @@ sealed class TodoScreen : NavKey {
} }
@Serializable @Serializable
sealed class Editor : TodoScreen() { sealed class Editor : VerveDoScreen() {
@Serializable @Serializable
data object Add : Editor() data object Add : Editor()

View file

@ -48,11 +48,11 @@ import cn.super12138.todo.ui.pages.editor.components.TodoPrioritySlider
import cn.super12138.todo.ui.pages.editor.state.rememberEditorState import cn.super12138.todo.ui.pages.editor.state.rememberEditorState
@Composable @Composable
fun SharedTransitionScope.TodoAddPage( fun SharedTransitionScope.TaskAddPage(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
onSave: (TodoEntity) -> Unit, onSave: (TodoEntity) -> Unit,
onNavigateUp: () -> Unit onNavigateUp: () -> Unit
) = TodoEditorPage( ) = TaskEditorPage(
toDo = null, toDo = null,
modifier = modifier modifier = modifier
.sharedBounds( .sharedBounds(
@ -67,13 +67,13 @@ fun SharedTransitionScope.TodoAddPage(
) )
@Composable @Composable
fun SharedTransitionScope.TodoEditPage( fun SharedTransitionScope.TaskEditPage(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
toDo: TodoEntity, toDo: TodoEntity,
onSave: (TodoEntity) -> Unit, onSave: (TodoEntity) -> Unit,
onDelete: () -> Unit, onDelete: () -> Unit,
onNavigateUp: () -> Unit onNavigateUp: () -> Unit
) = TodoEditorPage( ) = TaskEditorPage(
toDo = toDo, toDo = toDo,
modifier = modifier.sharedBounds( modifier = modifier.sharedBounds(
sharedContentState = rememberSharedContentState(key = "${Constants.KEY_TODO_ITEM_TRANSITION}_${toDo.id}"), sharedContentState = rememberSharedContentState(key = "${Constants.KEY_TODO_ITEM_TRANSITION}_${toDo.id}"),
@ -88,7 +88,7 @@ fun SharedTransitionScope.TodoEditPage(
@OptIn(ExperimentalMaterial3ExpressiveApi::class) @OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable @Composable
fun SharedTransitionScope.TodoEditorPage( fun SharedTransitionScope.TaskEditorPage(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
toDo: TodoEntity? = null, toDo: TodoEntity? = null,
onSave: (TodoEntity) -> Unit, onSave: (TodoEntity) -> Unit,

View file

@ -11,7 +11,7 @@ import cn.super12138.todo.logic.model.PaletteStyle
@OptIn(ExperimentalMaterial3ExpressiveApi::class) @OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable @Composable
fun ToDoTheme( fun VerveDoTheme(
color: Color? = null, color: Color? = null,
darkTheme: Boolean = isSystemInDarkTheme(), darkTheme: Boolean = isSystemInDarkTheme(),
style: PaletteStyle = PaletteStyle.TonalSpot, style: PaletteStyle = PaletteStyle.TonalSpot,

View file

@ -8,13 +8,13 @@ import androidx.compose.runtime.mutableStateOf
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import androidx.navigation3.runtime.NavKey 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.constants.Constants
import cn.super12138.todo.logic.Repository import cn.super12138.todo.logic.Repository
import cn.super12138.todo.logic.database.TodoEntity import cn.super12138.todo.logic.database.TodoEntity
import cn.super12138.todo.logic.datastore.DataStoreManager import cn.super12138.todo.logic.datastore.DataStoreManager
import cn.super12138.todo.logic.model.SortingMethod 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.ui.navigation.TopLevelBackStack
import cn.super12138.todo.utils.FileUtils import cn.super12138.todo.utils.FileUtils
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@ -40,7 +40,7 @@ import java.util.zip.ZipOutputStream
@OptIn(ExperimentalCoroutinesApi::class) @OptIn(ExperimentalCoroutinesApi::class)
class MainViewModel : ViewModel() { class MainViewModel : ViewModel() {
val mainBackStack = TopLevelBackStack<NavKey>(TodoScreen.Overview) val mainBackStack = TopLevelBackStack<NavKey>(VerveDoScreen.Overview)
// 待办 // 待办
private val toDos: Flow<List<TodoEntity>> = Repository.getAllTodos() private val toDos: Flow<List<TodoEntity>> = Repository.getAllTodos()
@ -232,7 +232,7 @@ class MainViewModel : ViewModel() {
* * DataStore Preferences 文件 * * DataStore Preferences 文件
*/ */
private fun getBackupFiles(context: Context): List<File> { 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" val prefPath = "${context.filesDir}/datastore"
return listOf( return listOf(
context.getDatabasePath(Constants.DB_NAME), // 数据库 context.getDatabasePath(Constants.DB_NAME), // 数据库

View file

@ -2,12 +2,12 @@ package cn.super12138.todo.utils
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import cn.super12138.todo.TodoApp import cn.super12138.todo.VerveDoApp
import cn.super12138.todo.constants.Constants import cn.super12138.todo.constants.Constants
object SPUtils { object SPUtils {
private val sp: SharedPreferences by lazy { 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) { fun <T> getValue(name: String, default: T): T = with(sp) {

View file

@ -1,5 +1,4 @@
<resources> <resources>
<string name="app_name">قائمة المهام</string>
<string name="page_settings">الإعدادات</string> <string name="page_settings">الإعدادات</string>
<string name="action_add_task">إضافة مهمة</string> <string name="action_add_task">إضافة مهمة</string>
<string name="tip_no_task">لا توجد مهام لإكمالها في الوقت الحالي.\nخذ قسطًا من الراحة!</string> <string name="tip_no_task">لا توجد مهام لإكمالها في الوقت الحالي.\nخذ قسطًا من الراحة!</string>
@ -87,9 +86,7 @@
<string name="pref_data">البيانات</string> <string name="pref_data">البيانات</string>
<string name="pref_data_desc">نسخ احتياطي واستعادة، إدارة البيانات</string> <string name="pref_data_desc">نسخ احتياطي واستعادة، إدارة البيانات</string>
<string name="pref_backup">نسخ احتياطي</string> <string name="pref_backup">نسخ احتياطي</string>
<string name="pref_backup_desc">حفظ بيانات تطبيق المهام على جهازك</string>
<string name="pref_restore">استعادة</string> <string name="pref_restore">استعادة</string>
<string name="pref_restore_desc">استعادة بيانات التطبيق من جهازك</string>
<string name="tip_backup_success">تم النسخ الاحتياطي بنجاح</string> <string name="tip_backup_success">تم النسخ الاحتياطي بنجاح</string>
<string name="tip_backup_failed">فشل النسخ الاحتياطي</string> <string name="tip_backup_failed">فشل النسخ الاحتياطي</string>
<string name="tip_restore_success">تمت الاستعادة بنجاح، أعد تشغيل التطبيق لتحميل البيانات</string> <string name="tip_restore_success">تمت الاستعادة بنجاح، أعد تشغيل التطبيق لتحميل البيانات</string>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <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:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">false</item> <item name="android:windowLightStatusBar">false</item>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <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:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">false</item> <item name="android:windowLightStatusBar">false</item>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <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:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">false</item> <item name="android:windowLightStatusBar">false</item>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <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:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">true</item> <item name="android:windowLightStatusBar">true</item>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <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:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">true</item> <item name="android:windowLightStatusBar">true</item>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">待办</string>
<string name="page_settings">设置</string> <string name="page_settings">设置</string>
<string name="action_add_task">添加待办</string> <string name="action_add_task">添加待办</string>
<string name="tip_no_task">目前没有要完成的任务,好好休息一下吧~</string> <string name="tip_no_task">目前没有要完成的任务,好好休息一下吧~</string>
@ -86,9 +85,9 @@
<string name="pref_data">数据</string> <string name="pref_data">数据</string>
<string name="pref_data_desc">备份与恢复、管理数据</string> <string name="pref_data_desc">备份与恢复、管理数据</string>
<string name="pref_backup">备份数据</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">恢复数据</string>
<string name="pref_restore_desc">从你的设备上恢复待办的应用数据</string> <string name="pref_restore_desc">从你的设备上恢复 VerveDo 的应用数据</string>
<string name="tip_backup_success">备份成功</string> <string name="tip_backup_success">备份成功</string>
<string name="tip_backup_failed">备份失败</string> <string name="tip_backup_failed">备份失败</string>
<string name="tip_restore_success">数据恢复成功,需要重启应用以加载数据</string> <string name="tip_restore_success">数据恢复成功,需要重启应用以加载数据</string>

View file

@ -1,5 +1,5 @@
<resources> <resources>
<string name="app_name">To Do</string> <string name="app_name" translatable="false">VerveDo</string>
<string name="page_settings">Settings</string> <string name="page_settings">Settings</string>
<string name="action_add_task">Add Task</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> <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">Data</string>
<string name="pref_data_desc">Backup and Restore, Manage Data</string> <string name="pref_data_desc">Backup and Restore, Manage Data</string>
<string name="pref_backup">Backup</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">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_success">Backup successful</string>
<string name="tip_backup_failed">Backup failed</string> <string name="tip_backup_failed">Backup failed</string>
<string name="tip_restore_success">Restore successful, restart the app to load data</string> <string name="tip_restore_success">Restore successful, restart the app to load data</string>

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <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="windowSplashScreenBackground">@color/background</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</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>
<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:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">true</item> <item name="android:windowLightStatusBar">true</item>