First commit

This commit is contained in:
Super12138 2023-12-30 18:43:22 +08:00
parent 84802e7a9c
commit ea4abdea06
114 changed files with 3066 additions and 1 deletions

42
.github/workflows/android_ci.yml vendored Normal file
View file

@ -0,0 +1,42 @@
name: Android CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: set up JDK 17
uses: actions/setup-java@v4.0.0
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleRelease
- uses: ilharp/sign-android-release@nightly
name: Sign APK
id: sign_app
with:
releaseDir: app/build/outputs/apk/release
signingKey: ${{ secrets.ANDROID_SIGNING_KEY }}
keyAlias: ${{ secrets.ANDROID_KEY_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
buildToolsVersion: 33.0.0
- name: Upload APK
uses: actions/upload-artifact@v4.0.0
with:
name: Release
path: ${{steps.sign_app.outputs.signedFile}}

2
.gitignore vendored
View file

@ -31,3 +31,5 @@ google-services.json
# Android Profiling
*.hprof
.DS_Store

View file

@ -1,2 +1,2 @@
# ToDo
# 待办 | ToDo
简单的待办应用遵循Material Design 3

1
app/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

72
app/build.gradle.kts Normal file
View file

@ -0,0 +1,72 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
}
val baseVersionName = "1.0.0"
val commitHash by lazy { "git rev-parse --short HEAD".exec() }
val verCode by lazy { "git rev-list --count HEAD".exec().toInt() }
android {
namespace = "cn.super12138.todo"
compileSdk = 34
defaultConfig {
applicationId = "cn.super12138.todo"
minSdk = 24
targetSdk = 34
versionCode = verCode
versionName = "${baseVersionName}-${commitHash}"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
viewBinding = true
}
}
dependencies {
// AndroidX
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.fragment:fragment:1.6.2")
implementation("androidx.fragment:fragment-ktx:1.6.2")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.lifecycle:lifecycle-viewmodel:2.6.2")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
implementation("androidx.preference:preference:1.2.1")
implementation("androidx.preference:preference-ktx:1.2.1")
// Material Design
implementation("com.google.android.material:material:1.12.0-alpha02")
// Test
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}
fun String.exec(): String = exec(this)
@Suppress("UnstableApiUsage")
fun Project.exec(command: String): String = providers.exec {
commandLine(command.split(" "))
}.standardOutput.asText.get().trim()

21
app/proguard-rules.pro vendored Normal file
View file

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View file

@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "cn.super12138.todo",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}

View file

@ -0,0 +1,22 @@
package cn.super12138.todo
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("cn.super12138.todo", appContext.packageName)
}
}

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:name=".ToDoApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ToDo"
tools:targetApi="34">
<activity
android:name=".views.main.MainActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".views.settings.SettingsActivity"
android:exported="false"
android:label="@string/settings_label"
android:launchMode="singleTask" />
<activity
android:name=".views.about.AboutActivity"
android:exported="false"
android:label="@string/about_label"
android:launchMode="singleTask" />
<activity
android:name=".views.crash.CrashActivity"
android:exported="false" />
</application>
</manifest>

View file

@ -0,0 +1,23 @@
package cn.super12138.todo
import android.annotation.SuppressLint
import android.app.Application
import android.content.Context
import cn.super12138.todo.views.crash.CrashHandler
import com.google.android.material.color.DynamicColors
class ToDoApplication : Application() {
companion object {
@SuppressLint("StaticFieldLeak")
lateinit var context: Context
}
override fun onCreate() {
super.onCreate()
DynamicColors.applyToActivitiesIfAvailable(this)
context = applicationContext
val crashHandler = CrashHandler(this)
Thread.setDefaultUncaughtExceptionHandler(crashHandler)
}
}

View file

@ -0,0 +1,11 @@
package cn.super12138.todo.constant
object Constants {
const val DB_NAME = "ToDo.db"
const val DB_VERSION = 1
const val TABLE_NAME = "ToDo"
const val AUTHOR_GITHUB_URL = "https://github.com/Super12138/"
const val REPO_GITHUB_URL = "https://github.com/Super12138/ToDo"
const val UPDATE_URL = "https://github.com/Super12138/ToDo/releases"
}

View file

@ -0,0 +1,20 @@
package cn.super12138.todo.logic
import android.content.ContentValues
import android.content.Context
import cn.super12138.todo.logic.database.DBHelper
import cn.super12138.todo.logic.database.SPHelper
object Repository {
fun getCompleteTotalCount() = DBHelper.getCompleteTotalCount()
fun insertData(data: ContentValues) = DBHelper.insertData(data)
fun deleteData(deleteAll: Boolean, uuid: String?) = DBHelper.deleteData(deleteAll, uuid)
fun updateData(uuid: String, newData: ContentValues) = DBHelper.updateData(uuid, newData)
fun getAllData() = DBHelper.getAllData()
fun getPreferenceString(context: Context, key: String, defaultValue: String) = SPHelper.getPreferenceString(context, key, defaultValue)
}

View file

@ -0,0 +1,109 @@
package cn.super12138.todo.logic.database
import android.annotation.SuppressLint
import android.content.ContentValues
import cn.super12138.todo.ToDoApplication
import cn.super12138.todo.constant.Constants
import cn.super12138.todo.logic.model.Progress
import cn.super12138.todo.logic.model.ToDo
import cn.super12138.todo.logic.model.ToDoDatabase
object DBHelper {
fun insertData(data: ContentValues) {
ToDoDatabase(
ToDoApplication.context,
Constants.DB_NAME,
Constants.DB_VERSION
).writableDatabase.use {db ->
db.insert(Constants.TABLE_NAME, null, data)
}
}
fun deleteData(delAll: Boolean, uuid: String?) {
ToDoDatabase(
ToDoApplication.context,
Constants.DB_NAME,
Constants.DB_VERSION
).writableDatabase.use { db ->
if (delAll) {
db.delete(Constants.TABLE_NAME, null, null)
} else {
if (uuid == null) {
throw RuntimeException("uuid cannot be null")
}
db.delete(Constants.TABLE_NAME, "uuid = ?", arrayOf(uuid))
}
}
}
fun updateData(uuid: String, newData: ContentValues) {
val dbHelper = ToDoDatabase(
ToDoApplication.context,
Constants.DB_NAME,
Constants.DB_VERSION
).writableDatabase
dbHelper.update(Constants.TABLE_NAME, newData, "uuid = ?", arrayOf(uuid))
}
@SuppressLint("Range")
fun getCompleteTotalCount(): Progress {
var total = 0
var complete = 0
ToDoDatabase(
ToDoApplication.context,
Constants.DB_NAME,
Constants.DB_VERSION
).writableDatabase.use { db ->
db.query(Constants.TABLE_NAME, null, null, null, null, null, null, null).use { cursor ->
if (cursor.moveToFirst()) {
do {
val state = cursor.getString(cursor.getColumnIndex("state"))
if (state.toInt() == 1) {
complete += 1
}
total += 1
} while (cursor.moveToNext())
cursor.close()
}
}
}
return Progress(complete, total)
}
@SuppressLint("Range")
fun getAllData() : MutableList<ToDo> {
val todoList = mutableListOf<ToDo>()
ToDoDatabase(
ToDoApplication.context,
Constants.DB_NAME,
Constants.DB_VERSION
).writableDatabase.query(
Constants.TABLE_NAME,
null,
null,
null,
null,
null,
null,
null
).use { cursor ->
if (cursor.moveToFirst()) {
do {
val uuid = cursor.getString(cursor.getColumnIndex("uuid"))
val subject = cursor.getString(cursor.getColumnIndex("subject"))
val state = cursor.getString(cursor.getColumnIndex("state"))
val todoContext = cursor.getString(cursor.getColumnIndex("context"))
if (state.toInt() != 1) {
todoList.add(ToDo(uuid, todoContext, subject))
}
} while (cursor.moveToNext())
cursor.close()
}
}
return todoList
}
}

View file

@ -0,0 +1,11 @@
package cn.super12138.todo.logic.database
import android.content.Context
import androidx.preference.PreferenceManager
object SPHelper {
fun getPreferenceString(context: Context, name: String, defaultValue: String): String? {
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context /* Activity context */)
return sharedPreferences.getString(name, defaultValue)
}
}

View file

@ -0,0 +1,3 @@
package cn.super12138.todo.logic.model
data class Progress(val complete: Int, val total: Int)

View file

@ -0,0 +1,19 @@
package cn.super12138.todo.logic.model
data class ToDo(val uuid: String, val context: String, val subject: String)
/*
package cn.super12138.todo.logic.model
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
@Entity(tableName = "todo")
data class ToDo (
@PrimaryKey @ColumnInfo(name = "uuid") val uuid: String,
@ColumnInfo(name = "state") val state: Int,
@ColumnInfo(name = "subject") val subject: String,
@ColumnInfo(name = "context") val context: String
)
*/

View file

@ -0,0 +1,28 @@
package cn.super12138.todo.logic.model
import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
class ToDoDatabase(val context: Context, name: String, version: Int) :
SQLiteOpenHelper(context, name, null, version) {
/*
* @param uuid: String 待办的uuid
* @param state: Int 待办的完成状态0表示未完成1表示完成
* @param subject: String 待办的学科
* @param context: String 待办的内容
*/
private val createToDo = "create table ToDo (" +
"uuid text primary key," +
"state integer," +
"subject text," +
"context text)"
override fun onCreate(db: SQLiteDatabase) {
db.execSQL(createToDo)
}
override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
}
}

View file

@ -0,0 +1,14 @@
import android.content.Context
import android.widget.Toast
import cn.super12138.todo.ToDoApplication
fun String.showToast(
context: Context = ToDoApplication.context,
duration: Int = Toast.LENGTH_SHORT
) {
Toast.makeText(context, this, duration).show()
}
fun Int.showToast(context: Context = ToDoApplication.context, duration: Int = Toast.LENGTH_SHORT) {
Toast.makeText(context, this, duration).show()
}

View file

@ -0,0 +1,77 @@
package cn.super12138.todo.views.about
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.view.WindowManager
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import cn.super12138.todo.constant.Constants
import cn.super12138.todo.databinding.ActivityAboutBinding
import showToast
class AboutActivity : AppCompatActivity() {
private lateinit var binding: ActivityAboutBinding
private var clickCount = 0
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
// 适配刘海屏
val lp = window.attributes
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
lp.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
window.attributes = lp
binding = ActivityAboutBinding.inflate(layoutInflater)
setContentView(binding.root)
val pkgInfo = packageManager.getPackageInfo(packageName, 0)
val verName = pkgInfo.versionName
val verCode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
pkgInfo.longVersionCode.toInt()
} else {
pkgInfo.versionCode
}
binding.appVersion.text = "$verName($verCode)"
binding.toolbar.setNavigationOnClickListener {
finish()
}
binding.checkUpdate.setOnClickListener {
val intent = Intent(Intent.ACTION_VIEW).apply {
data = Uri.parse(Constants.UPDATE_URL)
}
startActivity(intent)
}
binding.openSource.setOnClickListener {
val intent = Intent(Intent.ACTION_VIEW).apply {
data = Uri.parse(Constants.REPO_GITHUB_URL)
}
startActivity(intent)
}
binding.developerInfo.setOnClickListener {
val intent = Intent(Intent.ACTION_VIEW).apply {
data = Uri.parse(Constants.AUTHOR_GITHUB_URL)
}
startActivity(intent)
}
binding.appVersion.setOnClickListener {
clickCount++
if (clickCount == 5) {
clickCount = 0
"🧧".showToast()
}
}
}
}

View file

@ -0,0 +1,50 @@
package cn.super12138.todo.views.crash
import android.os.Build
import android.os.Bundle
import android.view.ViewGroup
import android.view.WindowManager
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updateLayoutParams
import cn.super12138.todo.databinding.ActivityCrashBinding
class CrashActivity : AppCompatActivity() {
private lateinit var binding: ActivityCrashBinding
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
// 适配刘海屏
val lp = window.attributes
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
lp.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
window.attributes = lp
binding = ActivityCrashBinding.inflate(layoutInflater)
setContentView(binding.root)
ViewCompat.setOnApplyWindowInsetsListener(binding.exitApp) { view, windowInsets ->
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
view.updateLayoutParams<ViewGroup.MarginLayoutParams> {
leftMargin = insets.left
bottomMargin = insets.bottom
rightMargin = insets.right
}
WindowInsetsCompat.CONSUMED
}
val crashLogs = intent.getStringExtra("crash_logs")
binding.crashLog.text = crashLogs
binding.exitApp.setOnClickListener {
this.finishAffinity()
}
}
}

View file

@ -0,0 +1,28 @@
package cn.super12138.todo.views.crash
import android.content.Context
import android.content.Intent
import android.os.Process
class CrashHandler(private val context: Context) : Thread.UncaughtExceptionHandler {
private val defaultUEH = Thread.getDefaultUncaughtExceptionHandler()
override fun uncaughtException(thread: Thread, ex: Throwable) {
val stackTrace = ex.stackTraceToString()
// 启动新的 Activity 来显示崩溃日志
val intent = Intent(context, CrashActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK
putExtra("crash_logs", stackTrace)
}
context.startActivity(intent)
// 杀掉崩溃的应用程序进程
Process.killProcess(Process.myPid())
System.exit(10)
// 传递异常给默认的异常处理器
defaultUEH?.uncaughtException(thread, ex)
}
}

View file

@ -0,0 +1,76 @@
package cn.super12138.todo.views.main
// 2023.11.18立项
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.view.WindowManager
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.preference.PreferenceManager
import cn.super12138.todo.R
import cn.super12138.todo.ToDoApplication
import cn.super12138.todo.databinding.ActivityMainBinding
import cn.super12138.todo.logic.Repository
import cn.super12138.todo.views.settings.SettingsActivity
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
// 适配刘海屏
val lp = window.attributes
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
lp.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
window.attributes = lp
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
setSupportActionBar(binding.toolbar)
/*val pref = getSharedPreferences("data",Context.MODE_PRIVATE)
val isFirstUse = pref.getBoolean("first_use", false)
if (!isFirstUse) {
MaterialAlertDialogBuilder(this)
.setTitle("欢迎使用待办")
.setMessage("")
.setPositiveButton("确定") { dialog, which ->
val editor = getSharedPreferences("data", Context.MODE_PRIVATE).edit()
editor.putBoolean("first_use", true)
editor.apply()
}
.show()
}
*/
val isDarkMode = Repository.getPreferenceString(this, "dark_mode", "0")
when (isDarkMode) {
"0" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
"1" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
"2" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
}
}
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.main, menu)
return true
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.item_settings -> {
val intent = Intent(ToDoApplication.context, SettingsActivity::class.java)
startActivity(intent)
}
}
return true
}
}

View file

@ -0,0 +1,45 @@
package cn.super12138.todo.views.progress
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import cn.super12138.todo.databinding.FragmentProgressBinding
class ProgressFragment : Fragment() {
private lateinit var viewModel: ProgressFragmentViewModel
private lateinit var binding: FragmentProgressBinding
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = FragmentProgressBinding.inflate(inflater, container, false)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
viewModel = ViewModelProvider(requireActivity()).get(ProgressFragmentViewModel::class.java)
viewModel.progress.observe(viewLifecycleOwner, Observer { value ->
binding.progressBar.setProgressCompat(value, true)
})
viewModel.totalCount.observe(viewLifecycleOwner, Observer { total ->
binding.totalTextView.text = total.toString()
})
viewModel.completeCount.observe(viewLifecycleOwner, Observer { complete ->
binding.completeTextView.text = complete.toString()
})
viewModel.updateProgress()
}
}

View file

@ -0,0 +1,22 @@
package cn.super12138.todo.views.progress
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import cn.super12138.todo.logic.Repository
class ProgressFragmentViewModel : ViewModel() {
val totalCount: MutableLiveData<Int> = MutableLiveData()
val completeCount: MutableLiveData<Int> = MutableLiveData()
val progress: MutableLiveData<Int> = MutableLiveData()
fun updateProgress() {
val progressData = Repository.getCompleteTotalCount()
val total = progressData.total
val complete = progressData.complete
val calcProgress = (complete.toDouble() / total.toDouble()) * 100
progress.value = calcProgress.toInt()
totalCount.value = total
completeCount.value = complete
}
}

View file

@ -0,0 +1,62 @@
package cn.super12138.todo.views.settings
import android.os.Build
import android.os.Bundle
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.preference.ListPreference
import androidx.preference.PreferenceFragmentCompat
import cn.super12138.todo.R
import cn.super12138.todo.databinding.ActivitySettingsBinding
class SettingsActivity : AppCompatActivity() {
private lateinit var binding: ActivitySettingsBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// 适配刘海屏
val lp = window.attributes
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
lp.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
window.attributes = lp
binding = ActivitySettingsBinding.inflate(layoutInflater)
setContentView(binding.root)
if (savedInstanceState == null) {
supportFragmentManager
.beginTransaction()
.replace(R.id.settings_frame, SettingsFragment())
.commit()
}
supportActionBar?.setDisplayHomeAsUpEnabled(true)
binding.toolbar.setNavigationOnClickListener {
finish()
}
}
class SettingsFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.preferences, rootKey)
findPreference<ListPreference>("dark_mode")?.apply {
setOnPreferenceChangeListener { preference, newValue ->
when (newValue) {
"0" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
"1" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
"2" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
}
activity?.recreate()
true
}
}
}
}
}

View file

@ -0,0 +1,118 @@
package cn.super12138.todo.views.todo
import android.content.ContentValues
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelStoreOwner
import androidx.recyclerview.widget.RecyclerView
import cn.super12138.todo.R
import cn.super12138.todo.logic.Repository
import cn.super12138.todo.logic.model.ToDo
import cn.super12138.todo.views.progress.ProgressFragmentViewModel
import com.google.android.material.snackbar.Snackbar
class ToDoAdapter(val todoList: MutableList<ToDo>, val viewModelStoreOwner: ViewModelStoreOwner) :
RecyclerView.Adapter<ToDoAdapter.ViewHolder>() {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val todoContext: TextView = view.findViewById(R.id.todo_context)
val todoSubject: TextView = view.findViewById(R.id.todo_subject)
val checkToDoBtn: Button = view.findViewById(R.id.check_item_btn)
val delToDoBtn: Button = view.findViewById(R.id.delete_item_btn)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val progressViewModel =
ViewModelProvider(viewModelStoreOwner).get(ProgressFragmentViewModel::class.java)
val todoViewModel =
ViewModelProvider(viewModelStoreOwner).get(ToDoFragmentViewModel::class.java)
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.todo_item, parent, false)
val holder = ViewHolder(view)
holder.checkToDoBtn.setOnClickListener {
val position = holder.absoluteAdapterPosition
if (position < 0 || position >= todoList.size) {
return@setOnClickListener
}
val todo = todoList[position]
todoList.removeAt(position)
notifyItemRemoved(position)
notifyItemRangeChanged(position, todoList.size)
val newState = ContentValues().apply {
put("state", true)
}
Repository.updateData(todo.uuid, newState)
progressViewModel.updateProgress()
// 设置空项目提示可见性
if (todoList.isEmpty()) {
todoViewModel.emptyTipVis.value = View.VISIBLE
} else {
todoViewModel.emptyTipVis.value = View.GONE
}
}
holder.delToDoBtn.setOnClickListener {
val position = holder.absoluteAdapterPosition
if (position < 0 || position >= todoList.size) {
return@setOnClickListener
}
val todo = todoList[position]
todoList.removeAt(position)
notifyItemRemoved(position)
notifyItemRangeChanged(position, todoList.size)
val tempTaskInfo = ContentValues().apply {
put("uuid", todo.uuid)
put("state", false)
put("subject", todo.subject)
put("context", todo.context)
}
Repository.deleteData(false, todo.uuid)
progressViewModel.updateProgress()
// 设置空项目提示可见性
if (todoList.isEmpty()) {
todoViewModel.emptyTipVis.value = View.VISIBLE
} else {
todoViewModel.emptyTipVis.value = View.GONE
}
Snackbar.make(it, R.string.task_deleted, Snackbar.LENGTH_LONG)
.setAction(R.string.delete_undo) {
if (todoList.size + 1 > 0) {
todoViewModel.emptyTipVis.value = View.GONE
}
todoList.add(ToDo(todo.uuid, todo.context, todo.subject))
todoViewModel.refreshData.value = 1
Repository.insertData(tempTaskInfo)
progressViewModel.updateProgress()
}
.show()
}
return holder
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val todo = todoList[position]
holder.todoContext.text = todo.context
holder.todoSubject.text = todo.subject
}
override fun getItemCount() = todoList.size
}

View file

@ -0,0 +1,168 @@
package cn.super12138.todo.views.todo
import android.content.ContentValues
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import cn.super12138.todo.R
import cn.super12138.todo.ToDoApplication
import cn.super12138.todo.databinding.DialogAddTodoBinding
import cn.super12138.todo.databinding.FragmentTodoBinding
import cn.super12138.todo.logic.Repository
import cn.super12138.todo.logic.model.ToDo
import cn.super12138.todo.views.progress.ProgressFragmentViewModel
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import java.util.UUID
class ToDoFragment : Fragment() {
private lateinit var binding: FragmentTodoBinding
private lateinit var ToDoDialogBinding: DialogAddTodoBinding
private val todoList = ArrayList<ToDo>()
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = FragmentTodoBinding.inflate(inflater, container, false)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val todos = Repository.getAllData()
for (todo in todos) {
todoList.add(ToDo(todo.uuid, todo.context, todo.subject))
}
/*ViewCompat.setOnApplyWindowInsetsListener(binding.todoList) { view, windowInsets ->
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
view.updateLayoutParams<ViewGroup.MarginLayoutParams> {
leftMargin = insets.left
bottomMargin = insets.bottom
rightMargin = insets.right
}
WindowInsetsCompat.CONSUMED
}*/
val layoutManager = LinearLayoutManager(ToDoApplication.context)
binding.todoList.layoutManager = layoutManager
val adapter = ToDoAdapter(todoList, requireActivity())
binding.todoList.adapter = adapter
val progressViewModel =
ViewModelProvider(requireActivity()).get(ProgressFragmentViewModel::class.java)
val todoViewModel =
ViewModelProvider(requireActivity()).get(ToDoFragmentViewModel::class.java)
if (todoList.size == 0) {
todoViewModel.emptyTipVis.value = View.VISIBLE
}
binding.addItem.setOnClickListener {
ToDoDialogBinding = DialogAddTodoBinding.inflate(layoutInflater)
activity?.let { it1 ->
MaterialAlertDialogBuilder(it1)
.setTitle(R.string.add_task)
.setView(ToDoDialogBinding.root)
.setPositiveButton(R.string.ok) { dialog, which ->
val randomUUID = UUID.randomUUID().toString()
val todoContext = ToDoDialogBinding.todoContext.editText?.text.toString()
val todoSubject = when (ToDoDialogBinding.todoSubject.checkedChipId) {
R.id.subject_chinese -> "语文"
R.id.subject_math -> "数学"
R.id.subject_english -> "英语"
R.id.subject_biology -> "生物"
R.id.subject_geography -> "地理"
R.id.subject_history -> "历史"
R.id.subject_physics -> "物理"
R.id.subject_law -> "道法"
else -> "未知"
}
// 显示RecyclerView
if (todoList.size + 1 > 0) {
todoViewModel.emptyTipVis.value = View.GONE
}
// 添加到RecyclerView
todoList.add(
ToDo(randomUUID, todoContext, todoSubject)
)
// 添加到数据库
val todoData = ContentValues().apply {
put("uuid", randomUUID)
put("state", 0)
put("subject", todoSubject)
put("context", todoContext)
}
Repository.insertData(todoData)
// dbHelper.writableDatabase.insert("ToDo", null, todoData)
binding.todoList.adapter?.notifyItemInserted(todoList.size + 1)
progressViewModel.updateProgress()
}
.setNegativeButton(R.string.cancel, null)
.show()
}
}
binding.addItem.setOnLongClickListener {
activity?.let { it1 ->
MaterialAlertDialogBuilder(it1)
.setTitle(R.string.warning)
.setMessage(R.string.delete_confirm)
.setPositiveButton(R.string.ok) { dialog, which ->
todoList.clear()
Repository.deleteData(true, null)
// dbHelper.writableDatabase.delete("ToDo", null, null)
binding.todoList.adapter?.notifyItemRangeRemoved(0, todoList.size + 1)
progressViewModel.updateProgress()
todoViewModel.emptyTipVis.value = View.VISIBLE
}
.setNegativeButton(R.string.cancel, null)
.show()
}
true
}
binding.todoList.addOnScrollListener(object : RecyclerView.OnScrollListener() {
val fab = binding.addItem
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
if (dy > 0 && fab.isShown) {
fab.hide()
}
if (dy < 0 && !fab.isShown) {
fab.show()
}
}
})
todoViewModel.emptyTipVis.observe(viewLifecycleOwner, Observer { visibility ->
if (visibility == View.VISIBLE) {
binding.todoList.visibility = View.GONE
binding.emptyTip.visibility = View.VISIBLE
} else {
binding.todoList.visibility = View.VISIBLE
binding.emptyTip.visibility = View.GONE
}
})
todoViewModel.refreshData.observe(viewLifecycleOwner, Observer {
binding.todoList.adapter?.notifyItemInserted(todoList.size + 1)
})
}
}

View file

@ -0,0 +1,10 @@
package cn.super12138.todo.views.todo
import android.view.View
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
class ToDoFragmentViewModel : ViewModel() {
val emptyTipVis = MutableLiveData<Int>(View.GONE)
val refreshData = MutableLiveData<Int>(0)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#000000"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
</vector>

View file

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#000000"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#000000"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#000000"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8.46,11.88l1.41,-1.41L12,12.59l2.12,-2.12 1.41,1.41L13.41,14l2.12,2.12 -1.41,1.41L12,15.41l-2.12,2.12 -1.41,-1.41L10.59,14l-2.13,-2.12zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z" />
</vector>

View file

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:tint="#000000"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M10.09,15.59L11.5,17l5,-5 -5,-5 -1.41,1.41L12.67,11H3v2h9.67l-2.58,2.59zM19,3H5c-1.11,0 -2,0.9 -2,2v4h2V5h14v14H5v-4H3v4c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/textColorPrimary"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:fillColor="#FF000000"
android:pathData="M8,0c4.42,0 8,3.58 8,8a8.013,8.013 0,0 1,-5.45 7.59c-0.4,0.08 -0.55,-0.17 -0.55,-0.38 0,-0.27 0.01,-1.13 0.01,-2.2 0,-0.75 -0.25,-1.23 -0.54,-1.48 1.78,-0.2 3.65,-0.88 3.65,-3.95 0,-0.88 -0.31,-1.59 -0.82,-2.15 0.08,-0.2 0.36,-1.02 -0.08,-2.12 0,0 -0.67,-0.22 -2.2,0.82 -0.64,-0.18 -1.32,-0.27 -2,-0.27 -0.68,0 -1.36,0.09 -2,0.27 -1.53,-1.03 -2.2,-0.82 -2.2,-0.82 -0.44,1.1 -0.16,1.92 -0.08,2.12 -0.51,0.56 -0.82,1.28 -0.82,2.15 0,3.06 1.86,3.75 3.64,3.95 -0.23,0.2 -0.44,0.55 -0.51,1.07 -0.46,0.21 -1.61,0.55 -2.33,-0.66 -0.15,-0.24 -0.6,-0.83 -1.23,-0.82 -0.67,0.01 -0.27,0.38 0.01,0.53 0.34,0.19 0.73,0.9 0.82,1.13 0.16,0.45 0.68,1.31 2.69,0.94 0,0.67 0.01,1.3 0.01,1.49 0,0.21 -0.15,0.45 -0.55,0.38A7.995,7.995 0,0 1,0 8c0,-4.42 3.58,-8 8,-8Z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="70dp"
android:height="70dp"
android:tint="?android:attr/textColorPrimary"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M21.29,5.89l-10,10c-0.39,0.39 -1.02,0.39 -1.41,0l-2.83,-2.83c-0.39,-0.39 -0.39,-1.02 0,-1.41l0,0c0.39,-0.39 1.02,-0.39 1.41,0l2.12,2.12l9.29,-9.29c0.39,-0.39 1.02,-0.39 1.41,0l0,0C21.68,4.87 21.68,5.5 21.29,5.89zM15.77,2.74c-1.69,-0.69 -3.61,-0.93 -5.61,-0.57C6.09,2.9 2.84,6.18 2.15,10.25C1.01,17 6.63,22.78 13.34,21.91c3.96,-0.51 7.28,-3.46 8.32,-7.31c0.4,-1.47 0.44,-2.89 0.21,-4.22c-0.13,-0.8 -1.12,-1.11 -1.7,-0.54v0c-0.23,0.23 -0.33,0.57 -0.27,0.89c0.22,1.33 0.12,2.75 -0.52,4.26c-1.16,2.71 -3.68,4.7 -6.61,4.97c-5.1,0.47 -9.33,-3.85 -8.7,-8.98c0.43,-3.54 3.28,-6.42 6.81,-6.91c1.73,-0.24 3.37,0.09 4.77,0.81c0.39,0.2 0.86,0.13 1.17,-0.18l0,0c0.48,-0.48 0.36,-1.29 -0.24,-1.6C16.31,2.98 16.04,2.85 15.77,2.74z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/textColorPrimary"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/textColorPrimary"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M21,10.12h-6.78l2.74,-2.82c-2.73,-2.7 -7.15,-2.8 -9.88,-0.1c-2.73,2.71 -2.73,7.08 0,9.79s7.15,2.71 9.88,0C18.32,15.65 19,14.08 19,12.1h2c0,1.98 -0.88,4.55 -2.64,6.29c-3.51,3.48 -9.21,3.48 -12.72,0c-3.5,-3.47 -3.53,-9.11 -0.02,-12.58s9.14,-3.47 12.65,0L21,3V10.12zM12.5,8v4.25l3.5,2.08l-0.72,1.21L11,13V8H12.5z" />
</vector>

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".views.main.MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:liftOnScroll="false">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:title="@string/app_name" />
</com.google.android.material.appbar.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/progress_frag"
android:name="cn.super12138.todo.views.progress.ProgressFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3"
android:minHeight="160dp" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/todo_frag"
android:name="cn.super12138.todo.views.todo.ToDoFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".views.about.AboutActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:navigationIcon="@drawable/arrow_back_24"
app:title="@string/about_label" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
style="?attr/materialCardViewElevatedStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="30dp"
android:layout_marginBottom="20dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/app_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/app_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:srcCompat="@drawable/ic_launcher" />
<TextView
android:id="@+id/app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/app_name"
android:textAlignment="center"
android:textColor="?android:attr/textColorPrimary"
android:textSize="20sp" />
<TextView
android:id="@+id/app_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:textAlignment="center"
android:textSize="11sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/check_update"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_horizontal|center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/check_update_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
app:srcCompat="@drawable/update_24" />
<TextView
android:id="@+id/check_update_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="@string/check_update"
android:textColor="?android:attr/textColorPrimary"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/open_source"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_horizontal|center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/github_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
app:srcCompat="@drawable/github_24" />
<TextView
android:id="@+id/open_source_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="@string/view_source"
android:textColor="?android:attr/textColorPrimary"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/developer_info"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_horizontal|center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/developer_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
app:srcCompat="@drawable/person_24" />
<TextView
android:id="@+id/developer_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="@string/author"
android:textColor="?android:attr/textColorPrimary"
android:textSize="15sp" />
</LinearLayout>
<!--<LinearLayout
android:id="@+id/wrp"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginTop="30dp"
android:layout_marginBottom="20dp"
android:gravity="center_horizontal|center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/wrp_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginStart="15dp"
app:srcCompat="@drawable/wrp_24" />
</LinearLayout>-->
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".views.crash.CrashActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="20dp"
android:text="@string/error_title"
android:textColor="?android:attr/textColorPrimary"
android:textSize="35sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="20dp"
android:text="@string/error_tips" />
<TextView
android:id="@+id/crash_log"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="20dp"
android:text="@string/no_crash_logs"
android:fontFamily="monospace"
android:textIsSelectable="true"
android:textSize="13sp" />
</LinearLayout>
</ScrollView>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/exit_app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:text="@string/exit_app"
app:icon="@drawable/exit_to_app_24" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".views.main.MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:liftOnScroll="false">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:title="@string/app_name" />
</com.google.android.material.appbar.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/progress_frag"
android:name="cn.super12138.todo.views.progress.ProgressFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:minHeight="160dp" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/todo_frag"
android:name="cn.super12138.todo.views.todo.ToDoFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".views.settings.SettingsActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:navigationIcon="@drawable/arrow_back_24"
app:title="@string/settings_label" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/settings_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/todo_context"
style="?attr/textInputFilledExposedDropdownMenuStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginRight="20dp"
android:gravity="center_horizontal"
android:hint="@string/tasks_textfield_hint"
app:errorEnabled="true"
app:helperTextEnabled="true">
<AutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:simpleItems="@array/todo_predicts" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.chip.ChipGroup
android:id="@+id/todo_subject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
app:chipSpacing="5dp"
app:selectionRequired="true"
app:singleSelection="true">
<com.google.android.material.chip.Chip
android:id="@+id/unknown_subject"
style="@style/Widget.Material3.Chip.Filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/subject_unknown" />
<com.google.android.material.chip.Chip
android:id="@+id/subject_chinese"
style="@style/Widget.Material3.Chip.Filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/subject_chinese" />
<com.google.android.material.chip.Chip
android:id="@+id/subject_math"
style="@style/Widget.Material3.Chip.Filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/subject_math" />
<com.google.android.material.chip.Chip
android:id="@+id/subject_english"
style="@style/Widget.Material3.Chip.Filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/subject_english" />
<com.google.android.material.chip.Chip
android:id="@+id/subject_biology"
style="@style/Widget.Material3.Chip.Filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/subject_biology" />
<com.google.android.material.chip.Chip
android:id="@+id/subject_physics"
style="@style/Widget.Material3.Chip.Filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/subject_physics" />
<com.google.android.material.chip.Chip
android:id="@+id/subject_history"
style="@style/Widget.Material3.Chip.Filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/subject_history" />
<com.google.android.material.chip.Chip
android:id="@+id/subject_geography"
style="@style/Widget.Material3.Chip.Filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/subject_geography" />
<com.google.android.material.chip.Chip
android:id="@+id/subject_law"
style="@style/Widget.Material3.Chip.Filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/subject_law" />
</com.google.android.material.chip.ChipGroup>
</LinearLayout>
</ScrollView>

View file

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:max="100"
app:indicatorSize="160dp"
app:trackColor="?attr/colorSurfaceContainerHighest"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:trackCornerRadius="5dp"
app:trackThickness="10dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/completeTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="/"
android:textAppearance="@style/TextAppearance.AppCompat.Display2"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
<TextView
android:id="@+id/totalTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textAppearance="@style/TextAppearance.AppCompat.Display2"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!--<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:orientation="horizontal"
android:animateLayoutChanges="true">
<Button
android:id="@+id/delete_all_item"
style="?attr/materialIconButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:tooltipText="@string/delete_all"
app:icon="@drawable/delete_forever_24" />
<Button
android:id="@+id/add_item"
style="?attr/materialIconButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:tooltipText="@string/add_task"
app:icon="@drawable/add_24" />
</LinearLayout>-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/todo_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
</androidx.recyclerview.widget.RecyclerView>
<TextView
android:id="@+id/empty_tip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="20dp"
android:text="@string/no_tasks"
android:visibility="visible" />
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/add_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_gravity="bottom|end"
android:contentDescription="@string/add_task"
android:text="@string/add_task"
app:icon="@drawable/add_24"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/todo_context"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="18dp"
android:ellipsize="marquee"
android:singleLine="true"
android:textColor="?android:attr/textColorPrimary"
android:textSize="20sp" />
<TextView
android:id="@+id/todo_subject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:ellipsize="marquee"
android:singleLine="true"
android:textColor="?android:attr/textColorPrimary"
android:textSize="11sp" />
</LinearLayout>
<Button
android:id="@+id/delete_item_btn"
style="?attr/materialIconButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:tooltipText="@string/delete_one"
app:icon="@drawable/delete_24" />
<Button
android:id="@+id/check_item_btn"
style="?attr/materialIconButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:tooltipText="@string/check_one"
app:icon="@drawable/check_24" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/item_settings"
android:icon="@drawable/settings_24"
android:title="@string/settings_label"
android:tooltipText="@string/settings_label"
app:showAsAction="always" />
<!--<item
android:id="@+id/item_about"
android:title="@string/about_label"
android:tooltipText="@string/about_label"/>
<item
android:id="@+id/item_make_crash"
android:title="制造崩溃"/>-->
</menu>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
</adaptive-icon>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_round_background"/>
<foreground android:drawable="@mipmap/ic_launcher_round_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_round_monochrome"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,143 @@
<resources>
<color name="md_theme_primary">#A0CAFD</color>
<color name="md_theme_onPrimary">#003258</color>
<color name="md_theme_primaryContainer">#1A4975</color>
<color name="md_theme_onPrimaryContainer">#D1E4FF</color>
<color name="md_theme_secondary">#BBC7DB</color>
<color name="md_theme_onSecondary">#253140</color>
<color name="md_theme_secondaryContainer">#3B4858</color>
<color name="md_theme_onSecondaryContainer">#D7E3F8</color>
<color name="md_theme_tertiary">#D7BEE4</color>
<color name="md_theme_onTertiary">#3B2948</color>
<color name="md_theme_tertiaryContainer">#523F5F</color>
<color name="md_theme_onTertiaryContainer">#F3DAFF</color>
<color name="md_theme_error">#FFB4AB</color>
<color name="md_theme_onError">#690005</color>
<color name="md_theme_errorContainer">#93000A</color>
<color name="md_theme_onErrorContainer">#FFDAD6</color>
<color name="md_theme_background">#111418</color>
<color name="md_theme_onBackground">#E1E2E8</color>
<color name="md_theme_surface">#111418</color>
<color name="md_theme_onSurface">#E1E2E8</color>
<color name="md_theme_surfaceVariant">#43474E</color>
<color name="md_theme_onSurfaceVariant">#C3C6CF</color>
<color name="md_theme_outline">#8D9199</color>
<color name="md_theme_outlineVariant">#43474E</color>
<color name="md_theme_scrim">#000000</color>
<color name="md_theme_inverseSurface">#E1E2E8</color>
<color name="md_theme_inverseOnSurface">#2E3135</color>
<color name="md_theme_inversePrimary">#36618E</color>
<color name="md_theme_primaryFixed">#D1E4FF</color>
<color name="md_theme_onPrimaryFixed">#001D36</color>
<color name="md_theme_primaryFixedDim">#A0CAFD</color>
<color name="md_theme_onPrimaryFixedVariant">#1A4975</color>
<color name="md_theme_secondaryFixed">#D7E3F8</color>
<color name="md_theme_onSecondaryFixed">#101C2B</color>
<color name="md_theme_secondaryFixedDim">#BBC7DB</color>
<color name="md_theme_onSecondaryFixedVariant">#3B4858</color>
<color name="md_theme_tertiaryFixed">#F3DAFF</color>
<color name="md_theme_onTertiaryFixed">#251431</color>
<color name="md_theme_tertiaryFixedDim">#D7BEE4</color>
<color name="md_theme_onTertiaryFixedVariant">#523F5F</color>
<color name="md_theme_surfaceDim">#111418</color>
<color name="md_theme_surfaceBright">#36393E</color>
<color name="md_theme_surfaceContainerLowest">#0B0E13</color>
<color name="md_theme_surfaceContainerLow">#191C20</color>
<color name="md_theme_surfaceContainer">#1D2024</color>
<color name="md_theme_surfaceContainerHigh">#272A2F</color>
<color name="md_theme_surfaceContainerHighest">#32353A</color>
<color name="md_theme_primary_mediumContrast">#A7CEFF</color>
<color name="md_theme_onPrimary_mediumContrast">#00172E</color>
<color name="md_theme_primaryContainer_mediumContrast">#6B94C4</color>
<color name="md_theme_onPrimaryContainer_mediumContrast">#000000</color>
<color name="md_theme_secondary_mediumContrast">#BFCCDF</color>
<color name="md_theme_onSecondary_mediumContrast">#0A1725</color>
<color name="md_theme_secondaryContainer_mediumContrast">#8592A4</color>
<color name="md_theme_onSecondaryContainer_mediumContrast">#000000</color>
<color name="md_theme_tertiary_mediumContrast">#DBC2E9</color>
<color name="md_theme_onTertiary_mediumContrast">#1F0F2C</color>
<color name="md_theme_tertiaryContainer_mediumContrast">#9F88AD</color>
<color name="md_theme_onTertiaryContainer_mediumContrast">#000000</color>
<color name="md_theme_error_mediumContrast">#FFBAB1</color>
<color name="md_theme_onError_mediumContrast">#370001</color>
<color name="md_theme_errorContainer_mediumContrast">#FF5449</color>
<color name="md_theme_onErrorContainer_mediumContrast">#000000</color>
<color name="md_theme_background_mediumContrast">#111418</color>
<color name="md_theme_onBackground_mediumContrast">#E1E2E8</color>
<color name="md_theme_surface_mediumContrast">#111418</color>
<color name="md_theme_onSurface_mediumContrast">#FAFAFF</color>
<color name="md_theme_surfaceVariant_mediumContrast">#43474E</color>
<color name="md_theme_onSurfaceVariant_mediumContrast">#C7CBD3</color>
<color name="md_theme_outline_mediumContrast">#9FA3AB</color>
<color name="md_theme_outlineVariant_mediumContrast">#7F838B</color>
<color name="md_theme_scrim_mediumContrast">#000000</color>
<color name="md_theme_inverseSurface_mediumContrast">#E1E2E8</color>
<color name="md_theme_inverseOnSurface_mediumContrast">#272A2F</color>
<color name="md_theme_inversePrimary_mediumContrast">#1B4A76</color>
<color name="md_theme_primaryFixed_mediumContrast">#D1E4FF</color>
<color name="md_theme_onPrimaryFixed_mediumContrast">#001225</color>
<color name="md_theme_primaryFixedDim_mediumContrast">#A0CAFD</color>
<color name="md_theme_onPrimaryFixedVariant_mediumContrast">#003862</color>
<color name="md_theme_secondaryFixed_mediumContrast">#D7E3F8</color>
<color name="md_theme_onSecondaryFixed_mediumContrast">#051220</color>
<color name="md_theme_secondaryFixedDim_mediumContrast">#BBC7DB</color>
<color name="md_theme_onSecondaryFixedVariant_mediumContrast">#2B3746</color>
<color name="md_theme_tertiaryFixed_mediumContrast">#F3DAFF</color>
<color name="md_theme_onTertiaryFixed_mediumContrast">#1A0926</color>
<color name="md_theme_tertiaryFixedDim_mediumContrast">#D7BEE4</color>
<color name="md_theme_onTertiaryFixedVariant_mediumContrast">#412F4E</color>
<color name="md_theme_surfaceDim_mediumContrast">#111418</color>
<color name="md_theme_surfaceBright_mediumContrast">#36393E</color>
<color name="md_theme_surfaceContainerLowest_mediumContrast">#0B0E13</color>
<color name="md_theme_surfaceContainerLow_mediumContrast">#191C20</color>
<color name="md_theme_surfaceContainer_mediumContrast">#1D2024</color>
<color name="md_theme_surfaceContainerHigh_mediumContrast">#272A2F</color>
<color name="md_theme_surfaceContainerHighest_mediumContrast">#32353A</color>
<color name="md_theme_primary_highContrast">#FAFAFF</color>
<color name="md_theme_onPrimary_highContrast">#000000</color>
<color name="md_theme_primaryContainer_highContrast">#A7CEFF</color>
<color name="md_theme_onPrimaryContainer_highContrast">#000000</color>
<color name="md_theme_secondary_highContrast">#FAFAFF</color>
<color name="md_theme_onSecondary_highContrast">#000000</color>
<color name="md_theme_secondaryContainer_highContrast">#BFCCDF</color>
<color name="md_theme_onSecondaryContainer_highContrast">#000000</color>
<color name="md_theme_tertiary_highContrast">#FFF9FB</color>
<color name="md_theme_onTertiary_highContrast">#000000</color>
<color name="md_theme_tertiaryContainer_highContrast">#DBC2E9</color>
<color name="md_theme_onTertiaryContainer_highContrast">#000000</color>
<color name="md_theme_error_highContrast">#FFF9F9</color>
<color name="md_theme_onError_highContrast">#000000</color>
<color name="md_theme_errorContainer_highContrast">#FFBAB1</color>
<color name="md_theme_onErrorContainer_highContrast">#000000</color>
<color name="md_theme_background_highContrast">#111418</color>
<color name="md_theme_onBackground_highContrast">#E1E2E8</color>
<color name="md_theme_surface_highContrast">#111418</color>
<color name="md_theme_onSurface_highContrast">#FFFFFF</color>
<color name="md_theme_surfaceVariant_highContrast">#43474E</color>
<color name="md_theme_onSurfaceVariant_highContrast">#FAFAFF</color>
<color name="md_theme_outline_highContrast">#C7CBD3</color>
<color name="md_theme_outlineVariant_highContrast">#C7CBD3</color>
<color name="md_theme_scrim_highContrast">#000000</color>
<color name="md_theme_inverseSurface_highContrast">#E1E2E8</color>
<color name="md_theme_inverseOnSurface_highContrast">#000000</color>
<color name="md_theme_inversePrimary_highContrast">#002B4E</color>
<color name="md_theme_primaryFixed_highContrast">#D9E8FF</color>
<color name="md_theme_onPrimaryFixed_highContrast">#000000</color>
<color name="md_theme_primaryFixedDim_highContrast">#A7CEFF</color>
<color name="md_theme_onPrimaryFixedVariant_highContrast">#00172E</color>
<color name="md_theme_secondaryFixed_highContrast">#DBE8FC</color>
<color name="md_theme_onSecondaryFixed_highContrast">#000000</color>
<color name="md_theme_secondaryFixedDim_highContrast">#BFCCDF</color>
<color name="md_theme_onSecondaryFixedVariant_highContrast">#0A1725</color>
<color name="md_theme_tertiaryFixed_highContrast">#F5DFFF</color>
<color name="md_theme_onTertiaryFixed_highContrast">#000000</color>
<color name="md_theme_tertiaryFixedDim_highContrast">#DBC2E9</color>
<color name="md_theme_onTertiaryFixedVariant_highContrast">#1F0F2C</color>
<color name="md_theme_surfaceDim_highContrast">#111418</color>
<color name="md_theme_surfaceBright_highContrast">#36393E</color>
<color name="md_theme_surfaceContainerLowest_highContrast">#0B0E13</color>
<color name="md_theme_surfaceContainerLow_highContrast">#191C20</color>
<color name="md_theme_surfaceContainer_highContrast">#1D2024</color>
<color name="md_theme_surfaceContainerHigh_highContrast">#272A2F</color>
<color name="md_theme_surfaceContainerHighest_highContrast">#32353A</color>
</resources>

View file

@ -0,0 +1,99 @@
<resources>
<style name="ThemeOverlay.ToDo.MediumContrast" parent="Theme.Material3.Dark.NoActionBar">
<item name="colorPrimary">@color/md_theme_primary_mediumContrast</item>
<item name="colorOnPrimary">@color/md_theme_onPrimary_mediumContrast</item>
<item name="colorPrimaryContainer">@color/md_theme_primaryContainer_mediumContrast</item>
<item name="colorOnPrimaryContainer">@color/md_theme_onPrimaryContainer_mediumContrast</item>
<item name="colorSecondary">@color/md_theme_secondary_mediumContrast</item>
<item name="colorOnSecondary">@color/md_theme_onSecondary_mediumContrast</item>
<item name="colorSecondaryContainer">@color/md_theme_secondaryContainer_mediumContrast</item>
<item name="colorOnSecondaryContainer">@color/md_theme_onSecondaryContainer_mediumContrast</item>
<item name="colorTertiary">@color/md_theme_tertiary_mediumContrast</item>
<item name="colorOnTertiary">@color/md_theme_onTertiary_mediumContrast</item>
<item name="colorTertiaryContainer">@color/md_theme_tertiaryContainer_mediumContrast</item>
<item name="colorOnTertiaryContainer">@color/md_theme_onTertiaryContainer_mediumContrast</item>
<item name="colorError">@color/md_theme_error_mediumContrast</item>
<item name="colorOnError">@color/md_theme_onError_mediumContrast</item>
<item name="colorErrorContainer">@color/md_theme_errorContainer_mediumContrast</item>
<item name="colorOnErrorContainer">@color/md_theme_onErrorContainer_mediumContrast</item>
<item name="android:colorBackground">@color/md_theme_background_mediumContrast</item>
<item name="colorOnBackground">@color/md_theme_onBackground_mediumContrast</item>
<item name="colorSurface">@color/md_theme_surface_mediumContrast</item>
<item name="colorOnSurface">@color/md_theme_onSurface_mediumContrast</item>
<item name="colorSurfaceVariant">@color/md_theme_surfaceVariant_mediumContrast</item>
<item name="colorOnSurfaceVariant">@color/md_theme_onSurfaceVariant_mediumContrast</item>
<item name="colorOutline">@color/md_theme_outline_mediumContrast</item>
<item name="colorOutlineVariant">@color/md_theme_outlineVariant_mediumContrast</item>
<item name="colorSurfaceInverse">@color/md_theme_inverseSurface_mediumContrast</item>
<item name="colorOnSurfaceInverse">@color/md_theme_inverseOnSurface_mediumContrast</item>
<item name="colorPrimaryInverse">@color/md_theme_inversePrimary_mediumContrast</item>
<item name="colorPrimaryFixed">@color/md_theme_primaryFixed_mediumContrast</item>
<item name="colorOnPrimaryFixed">@color/md_theme_onPrimaryFixed_mediumContrast</item>
<item name="colorPrimaryFixedDim">@color/md_theme_primaryFixedDim_mediumContrast</item>
<item name="colorOnPrimaryFixedVariant">@color/md_theme_onPrimaryFixedVariant_mediumContrast</item>
<item name="colorSecondaryFixed">@color/md_theme_secondaryFixed_mediumContrast</item>
<item name="colorOnSecondaryFixed">@color/md_theme_onSecondaryFixed_mediumContrast</item>
<item name="colorSecondaryFixedDim">@color/md_theme_secondaryFixedDim_mediumContrast</item>
<item name="colorOnSecondaryFixedVariant">@color/md_theme_onSecondaryFixedVariant_mediumContrast</item>
<item name="colorTertiaryFixed">@color/md_theme_tertiaryFixed_mediumContrast</item>
<item name="colorOnTertiaryFixed">@color/md_theme_onTertiaryFixed_mediumContrast</item>
<item name="colorTertiaryFixedDim">@color/md_theme_tertiaryFixedDim_mediumContrast</item>
<item name="colorOnTertiaryFixedVariant">@color/md_theme_onTertiaryFixedVariant_mediumContrast</item>
<item name="colorSurfaceDim">@color/md_theme_surfaceDim_mediumContrast</item>
<item name="colorSurfaceBright">@color/md_theme_surfaceBright_mediumContrast</item>
<item name="colorSurfaceContainerLowest">@color/md_theme_surfaceContainerLowest_mediumContrast</item>
<item name="colorSurfaceContainerLow">@color/md_theme_surfaceContainerLow_mediumContrast</item>
<item name="colorSurfaceContainer">@color/md_theme_surfaceContainer_mediumContrast</item>
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh_mediumContrast</item>
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest_mediumContrast</item>
</style>
<style name="ThemeOverlay.ToDo.HighContrast" parent="Theme.Material3.Dark.NoActionBar">
<item name="colorPrimary">@color/md_theme_primary_highContrast</item>
<item name="colorOnPrimary">@color/md_theme_onPrimary_highContrast</item>
<item name="colorPrimaryContainer">@color/md_theme_primaryContainer_highContrast</item>
<item name="colorOnPrimaryContainer">@color/md_theme_onPrimaryContainer_highContrast</item>
<item name="colorSecondary">@color/md_theme_secondary_highContrast</item>
<item name="colorOnSecondary">@color/md_theme_onSecondary_highContrast</item>
<item name="colorSecondaryContainer">@color/md_theme_secondaryContainer_highContrast</item>
<item name="colorOnSecondaryContainer">@color/md_theme_onSecondaryContainer_highContrast</item>
<item name="colorTertiary">@color/md_theme_tertiary_highContrast</item>
<item name="colorOnTertiary">@color/md_theme_onTertiary_highContrast</item>
<item name="colorTertiaryContainer">@color/md_theme_tertiaryContainer_highContrast</item>
<item name="colorOnTertiaryContainer">@color/md_theme_onTertiaryContainer_highContrast</item>
<item name="colorError">@color/md_theme_error_highContrast</item>
<item name="colorOnError">@color/md_theme_onError_highContrast</item>
<item name="colorErrorContainer">@color/md_theme_errorContainer_highContrast</item>
<item name="colorOnErrorContainer">@color/md_theme_onErrorContainer_highContrast</item>
<item name="android:colorBackground">@color/md_theme_background_highContrast</item>
<item name="colorOnBackground">@color/md_theme_onBackground_highContrast</item>
<item name="colorSurface">@color/md_theme_surface_highContrast</item>
<item name="colorOnSurface">@color/md_theme_onSurface_highContrast</item>
<item name="colorSurfaceVariant">@color/md_theme_surfaceVariant_highContrast</item>
<item name="colorOnSurfaceVariant">@color/md_theme_onSurfaceVariant_highContrast</item>
<item name="colorOutline">@color/md_theme_outline_highContrast</item>
<item name="colorOutlineVariant">@color/md_theme_outlineVariant_highContrast</item>
<item name="colorSurfaceInverse">@color/md_theme_inverseSurface_highContrast</item>
<item name="colorOnSurfaceInverse">@color/md_theme_inverseOnSurface_highContrast</item>
<item name="colorPrimaryInverse">@color/md_theme_inversePrimary_highContrast</item>
<item name="colorPrimaryFixed">@color/md_theme_primaryFixed_highContrast</item>
<item name="colorOnPrimaryFixed">@color/md_theme_onPrimaryFixed_highContrast</item>
<item name="colorPrimaryFixedDim">@color/md_theme_primaryFixedDim_highContrast</item>
<item name="colorOnPrimaryFixedVariant">@color/md_theme_onPrimaryFixedVariant_highContrast</item>
<item name="colorSecondaryFixed">@color/md_theme_secondaryFixed_highContrast</item>
<item name="colorOnSecondaryFixed">@color/md_theme_onSecondaryFixed_highContrast</item>
<item name="colorSecondaryFixedDim">@color/md_theme_secondaryFixedDim_highContrast</item>
<item name="colorOnSecondaryFixedVariant">@color/md_theme_onSecondaryFixedVariant_highContrast</item>
<item name="colorTertiaryFixed">@color/md_theme_tertiaryFixed_highContrast</item>
<item name="colorOnTertiaryFixed">@color/md_theme_onTertiaryFixed_highContrast</item>
<item name="colorTertiaryFixedDim">@color/md_theme_tertiaryFixedDim_highContrast</item>
<item name="colorOnTertiaryFixedVariant">@color/md_theme_onTertiaryFixedVariant_highContrast</item>
<item name="colorSurfaceDim">@color/md_theme_surfaceDim_highContrast</item>
<item name="colorSurfaceBright">@color/md_theme_surfaceBright_highContrast</item>
<item name="colorSurfaceContainerLowest">@color/md_theme_surfaceContainerLowest_highContrast</item>
<item name="colorSurfaceContainerLow">@color/md_theme_surfaceContainerLow_highContrast</item>
<item name="colorSurfaceContainer">@color/md_theme_surfaceContainer_highContrast</item>
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh_highContrast</item>
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest_highContrast</item>
</style>
</resources>

View file

@ -0,0 +1,50 @@
<resources>
<style name="Base.Theme.ToDo" parent="Theme.Material3.Dark.NoActionBar">
<item name="colorPrimary">@color/md_theme_primary</item>
<item name="colorOnPrimary">@color/md_theme_onPrimary</item>
<item name="colorPrimaryContainer">@color/md_theme_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/md_theme_onPrimaryContainer</item>
<item name="colorSecondary">@color/md_theme_secondary</item>
<item name="colorOnSecondary">@color/md_theme_onSecondary</item>
<item name="colorSecondaryContainer">@color/md_theme_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/md_theme_onSecondaryContainer</item>
<item name="colorTertiary">@color/md_theme_tertiary</item>
<item name="colorOnTertiary">@color/md_theme_onTertiary</item>
<item name="colorTertiaryContainer">@color/md_theme_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/md_theme_onTertiaryContainer</item>
<item name="colorError">@color/md_theme_error</item>
<item name="colorOnError">@color/md_theme_onError</item>
<item name="colorErrorContainer">@color/md_theme_errorContainer</item>
<item name="colorOnErrorContainer">@color/md_theme_onErrorContainer</item>
<item name="android:colorBackground">@color/md_theme_background</item>
<item name="colorOnBackground">@color/md_theme_onBackground</item>
<item name="colorSurface">@color/md_theme_surface</item>
<item name="colorOnSurface">@color/md_theme_onSurface</item>
<item name="colorSurfaceVariant">@color/md_theme_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/md_theme_onSurfaceVariant</item>
<item name="colorOutline">@color/md_theme_outline</item>
<item name="colorOutlineVariant">@color/md_theme_outlineVariant</item>
<item name="colorSurfaceInverse">@color/md_theme_inverseSurface</item>
<item name="colorOnSurfaceInverse">@color/md_theme_inverseOnSurface</item>
<item name="colorPrimaryInverse">@color/md_theme_inversePrimary</item>
<item name="colorPrimaryFixed">@color/md_theme_primaryFixed</item>
<item name="colorOnPrimaryFixed">@color/md_theme_onPrimaryFixed</item>
<item name="colorPrimaryFixedDim">@color/md_theme_primaryFixedDim</item>
<item name="colorOnPrimaryFixedVariant">@color/md_theme_onPrimaryFixedVariant</item>
<item name="colorSecondaryFixed">@color/md_theme_secondaryFixed</item>
<item name="colorOnSecondaryFixed">@color/md_theme_onSecondaryFixed</item>
<item name="colorSecondaryFixedDim">@color/md_theme_secondaryFixedDim</item>
<item name="colorOnSecondaryFixedVariant">@color/md_theme_onSecondaryFixedVariant</item>
<item name="colorTertiaryFixed">@color/md_theme_tertiaryFixed</item>
<item name="colorOnTertiaryFixed">@color/md_theme_onTertiaryFixed</item>
<item name="colorTertiaryFixedDim">@color/md_theme_tertiaryFixedDim</item>
<item name="colorOnTertiaryFixedVariant">@color/md_theme_onTertiaryFixedVariant</item>
<item name="colorSurfaceDim">@color/md_theme_surfaceDim</item>
<item name="colorSurfaceBright">@color/md_theme_surfaceBright</item>
<item name="colorSurfaceContainerLowest">@color/md_theme_surfaceContainerLowest</item>
<item name="colorSurfaceContainerLow">@color/md_theme_surfaceContainerLow</item>
<item name="colorSurfaceContainer">@color/md_theme_surfaceContainer</item>
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
</style>
</resources>

View file

@ -0,0 +1,9 @@
<resources>
<style name="Theme.ToDo" parent="Base.Theme.ToDo">
<!-- Transparent system bars for edge-to-edge. -->
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
</style>
</resources>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="todo_predicts">
<item>字词小故事</item>
<item>诊断</item>
<item>E 听说</item>
<item>卷子</item>
<item>试卷整理</item>
<item>改错</item>
<item>每周一练</item>
<item>作文</item>
</string-array>
<string-array name="appearance">
<item>跟随系统设置</item>
<item>开启</item>
<item>关闭</item>
</string-array>
<!--0: 自动, 1: 深色, 2: 浅色-->
<string-array name="appearance_value">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
</resources>

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">待办</string>
<!--About Activity-->
<string name="about_label">关于</string>
<string name="author">Super12138</string>
<string name="check_update">检查更新</string>
<!--Crash Activity-->
<string name="error_title">应用程序出现错误</string>
<string name="error_tips">别担心,下方是错误日志,请全选复制然后把它发送给我,我会尽快解决问题</string>
<string name="no_crash_logs">没有日志传入</string>
<string name="exit_app">退出应用</string>
<!--Subjects-->
<string name="subject_unknown">未知</string>
<string name="subject_chinese">语文</string>
<string name="subject_math">数学</string>
<string name="subject_english">英语</string>
<string name="subject_biology">生物</string>
<string name="subject_physics">物理</string>
<string name="subject_history">历史</string>
<string name="subject_geography">地理</string>
<string name="subject_law">道法</string>
<!--UI-->
<string name="cancel">取消</string>
<string name="ok">确定</string>
<string name="add_task">添加待办</string>
<string name="warning">警告</string>
<string name="delete_confirm">即将删除全部待办,是否继续?</string>
<string name="tasks_textfield_hint">待办内容</string>
<string name="delete_one">删除</string>
<string name="delete_all">删除全部代办</string>
<string name="check_one">标记为已完成</string>
<string name="no_tasks">无待办事项</string>
<string name="delete_undo">撤销</string>
<string name="task_deleted">该待办已删除</string>
<string name="settings_label">设置</string>
<string name="appearance">外观</string>
<string name="dark_mode">深色模式</string>
<string name="dark_mode_summary">开启或关闭应用深色模式</string>
<string name="view_source">在 GitHub 上查看源代码</string>
<string name="config">配置</string>
</resources>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="todo_predicts">
<item>字词小故事</item>
<item>诊断</item>
<item>E 听说</item>
<item>卷子</item>
<item>试卷整理</item>
<item>改错</item>
<item>每周一练</item>
<item>作文</item>
</string-array>
<string-array name="appearance">
<item>Follow system</item>
<item>On</item>
<item>Off</item>
</string-array>
<!--0: 自动, 1: 深色, 2: 浅色-->
<string-array name="appearance_value">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
</resources>

View file

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="seed">#0061A4</color>
<color name="md_theme_primary">#36618E</color>
<color name="md_theme_onPrimary">#FFFFFF</color>
<color name="md_theme_primaryContainer">#D1E4FF</color>
<color name="md_theme_onPrimaryContainer">#001D36</color>
<color name="md_theme_secondary">#535F70</color>
<color name="md_theme_onSecondary">#FFFFFF</color>
<color name="md_theme_secondaryContainer">#D7E3F8</color>
<color name="md_theme_onSecondaryContainer">#101C2B</color>
<color name="md_theme_tertiary">#6B5778</color>
<color name="md_theme_onTertiary">#FFFFFF</color>
<color name="md_theme_tertiaryContainer">#F3DAFF</color>
<color name="md_theme_onTertiaryContainer">#251431</color>
<color name="md_theme_error">#BA1A1A</color>
<color name="md_theme_onError">#FFFFFF</color>
<color name="md_theme_errorContainer">#FFDAD6</color>
<color name="md_theme_onErrorContainer">#410002</color>
<color name="md_theme_background">#F8F9FF</color>
<color name="md_theme_onBackground">#191C20</color>
<color name="md_theme_surface">#F8F9FF</color>
<color name="md_theme_onSurface">#191C20</color>
<color name="md_theme_surfaceVariant">#DFE2EB</color>
<color name="md_theme_onSurfaceVariant">#43474E</color>
<color name="md_theme_outline">#73777F</color>
<color name="md_theme_outlineVariant">#C3C6CF</color>
<color name="md_theme_scrim">#000000</color>
<color name="md_theme_inverseSurface">#2E3135</color>
<color name="md_theme_inverseOnSurface">#EFF0F7</color>
<color name="md_theme_inversePrimary">#A0CAFD</color>
<color name="md_theme_primaryFixed">#D1E4FF</color>
<color name="md_theme_onPrimaryFixed">#001D36</color>
<color name="md_theme_primaryFixedDim">#A0CAFD</color>
<color name="md_theme_onPrimaryFixedVariant">#1A4975</color>
<color name="md_theme_secondaryFixed">#D7E3F8</color>
<color name="md_theme_onSecondaryFixed">#101C2B</color>
<color name="md_theme_secondaryFixedDim">#BBC7DB</color>
<color name="md_theme_onSecondaryFixedVariant">#3B4858</color>
<color name="md_theme_tertiaryFixed">#F3DAFF</color>
<color name="md_theme_onTertiaryFixed">#251431</color>
<color name="md_theme_tertiaryFixedDim">#D7BEE4</color>
<color name="md_theme_onTertiaryFixedVariant">#523F5F</color>
<color name="md_theme_surfaceDim">#D8DAE0</color>
<color name="md_theme_surfaceBright">#F8F9FF</color>
<color name="md_theme_surfaceContainerLowest">#FFFFFF</color>
<color name="md_theme_surfaceContainerLow">#F2F3FA</color>
<color name="md_theme_surfaceContainer">#ECEEF4</color>
<color name="md_theme_surfaceContainerHigh">#E6E8EE</color>
<color name="md_theme_surfaceContainerHighest">#E1E2E8</color>
<color name="md_theme_primary_mediumContrast">#144571</color>
<color name="md_theme_onPrimary_mediumContrast">#FFFFFF</color>
<color name="md_theme_primaryContainer_mediumContrast">#4E77A6</color>
<color name="md_theme_onPrimaryContainer_mediumContrast">#FFFFFF</color>
<color name="md_theme_secondary_mediumContrast">#374454</color>
<color name="md_theme_onSecondary_mediumContrast">#FFFFFF</color>
<color name="md_theme_secondaryContainer_mediumContrast">#697687</color>
<color name="md_theme_onSecondaryContainer_mediumContrast">#FFFFFF</color>
<color name="md_theme_tertiary_mediumContrast">#4E3B5B</color>
<color name="md_theme_onTertiary_mediumContrast">#FFFFFF</color>
<color name="md_theme_tertiaryContainer_mediumContrast">#826D8F</color>
<color name="md_theme_onTertiaryContainer_mediumContrast">#FFFFFF</color>
<color name="md_theme_error_mediumContrast">#8C0009</color>
<color name="md_theme_onError_mediumContrast">#FFFFFF</color>
<color name="md_theme_errorContainer_mediumContrast">#DA342E</color>
<color name="md_theme_onErrorContainer_mediumContrast">#FFFFFF</color>
<color name="md_theme_background_mediumContrast">#F8F9FF</color>
<color name="md_theme_onBackground_mediumContrast">#191C20</color>
<color name="md_theme_surface_mediumContrast">#F8F9FF</color>
<color name="md_theme_onSurface_mediumContrast">#191C20</color>
<color name="md_theme_surfaceVariant_mediumContrast">#DFE2EB</color>
<color name="md_theme_onSurfaceVariant_mediumContrast">#3F434A</color>
<color name="md_theme_outline_mediumContrast">#5B5F67</color>
<color name="md_theme_outlineVariant_mediumContrast">#777B83</color>
<color name="md_theme_scrim_mediumContrast">#000000</color>
<color name="md_theme_inverseSurface_mediumContrast">#2E3135</color>
<color name="md_theme_inverseOnSurface_mediumContrast">#EFF0F7</color>
<color name="md_theme_inversePrimary_mediumContrast">#A0CAFD</color>
<color name="md_theme_primaryFixed_mediumContrast">#4E77A6</color>
<color name="md_theme_onPrimaryFixed_mediumContrast">#FFFFFF</color>
<color name="md_theme_primaryFixedDim_mediumContrast">#335E8C</color>
<color name="md_theme_onPrimaryFixedVariant_mediumContrast">#FFFFFF</color>
<color name="md_theme_secondaryFixed_mediumContrast">#697687</color>
<color name="md_theme_onSecondaryFixed_mediumContrast">#FFFFFF</color>
<color name="md_theme_secondaryFixedDim_mediumContrast">#515D6E</color>
<color name="md_theme_onSecondaryFixedVariant_mediumContrast">#FFFFFF</color>
<color name="md_theme_tertiaryFixed_mediumContrast">#826D8F</color>
<color name="md_theme_onTertiaryFixed_mediumContrast">#FFFFFF</color>
<color name="md_theme_tertiaryFixedDim_mediumContrast">#685475</color>
<color name="md_theme_onTertiaryFixedVariant_mediumContrast">#FFFFFF</color>
<color name="md_theme_surfaceDim_mediumContrast">#D8DAE0</color>
<color name="md_theme_surfaceBright_mediumContrast">#F8F9FF</color>
<color name="md_theme_surfaceContainerLowest_mediumContrast">#FFFFFF</color>
<color name="md_theme_surfaceContainerLow_mediumContrast">#F2F3FA</color>
<color name="md_theme_surfaceContainer_mediumContrast">#ECEEF4</color>
<color name="md_theme_surfaceContainerHigh_mediumContrast">#E6E8EE</color>
<color name="md_theme_surfaceContainerHighest_mediumContrast">#E1E2E8</color>
<color name="md_theme_primary_highContrast">#002341</color>
<color name="md_theme_onPrimary_highContrast">#FFFFFF</color>
<color name="md_theme_primaryContainer_highContrast">#144571</color>
<color name="md_theme_onPrimaryContainer_highContrast">#FFFFFF</color>
<color name="md_theme_secondary_highContrast">#172332</color>
<color name="md_theme_onSecondary_highContrast">#FFFFFF</color>
<color name="md_theme_secondaryContainer_highContrast">#374454</color>
<color name="md_theme_onSecondaryContainer_highContrast">#FFFFFF</color>
<color name="md_theme_tertiary_highContrast">#2C1B38</color>
<color name="md_theme_onTertiary_highContrast">#FFFFFF</color>
<color name="md_theme_tertiaryContainer_highContrast">#4E3B5B</color>
<color name="md_theme_onTertiaryContainer_highContrast">#FFFFFF</color>
<color name="md_theme_error_highContrast">#4E0002</color>
<color name="md_theme_onError_highContrast">#FFFFFF</color>
<color name="md_theme_errorContainer_highContrast">#8C0009</color>
<color name="md_theme_onErrorContainer_highContrast">#FFFFFF</color>
<color name="md_theme_background_highContrast">#F8F9FF</color>
<color name="md_theme_onBackground_highContrast">#191C20</color>
<color name="md_theme_surface_highContrast">#F8F9FF</color>
<color name="md_theme_onSurface_highContrast">#000000</color>
<color name="md_theme_surfaceVariant_highContrast">#DFE2EB</color>
<color name="md_theme_onSurfaceVariant_highContrast">#20242B</color>
<color name="md_theme_outline_highContrast">#3F434A</color>
<color name="md_theme_outlineVariant_highContrast">#3F434A</color>
<color name="md_theme_scrim_highContrast">#000000</color>
<color name="md_theme_inverseSurface_highContrast">#2E3135</color>
<color name="md_theme_inverseOnSurface_highContrast">#FFFFFF</color>
<color name="md_theme_inversePrimary_highContrast">#E2EDFF</color>
<color name="md_theme_primaryFixed_highContrast">#144571</color>
<color name="md_theme_onPrimaryFixed_highContrast">#FFFFFF</color>
<color name="md_theme_primaryFixedDim_highContrast">#002E52</color>
<color name="md_theme_onPrimaryFixedVariant_highContrast">#FFFFFF</color>
<color name="md_theme_secondaryFixed_highContrast">#374454</color>
<color name="md_theme_onSecondaryFixed_highContrast">#FFFFFF</color>
<color name="md_theme_secondaryFixedDim_highContrast">#212E3D</color>
<color name="md_theme_onSecondaryFixedVariant_highContrast">#FFFFFF</color>
<color name="md_theme_tertiaryFixed_highContrast">#4E3B5B</color>
<color name="md_theme_onTertiaryFixed_highContrast">#FFFFFF</color>
<color name="md_theme_tertiaryFixedDim_highContrast">#372644</color>
<color name="md_theme_onTertiaryFixedVariant_highContrast">#FFFFFF</color>
<color name="md_theme_surfaceDim_highContrast">#D8DAE0</color>
<color name="md_theme_surfaceBright_highContrast">#F8F9FF</color>
<color name="md_theme_surfaceContainerLowest_highContrast">#FFFFFF</color>
<color name="md_theme_surfaceContainerLow_highContrast">#F2F3FA</color>
<color name="md_theme_surfaceContainer_highContrast">#ECEEF4</color>
<color name="md_theme_surfaceContainerHigh_highContrast">#E6E8EE</color>
<color name="md_theme_surfaceContainerHighest_highContrast">#E1E2E8</color>
</resources>

Some files were not shown because too many files have changed in this diff Show more