Skip to content

Commit

Permalink
Update lifecycle-viewmodel to 2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Super12138 committed Jan 12, 2024
1 parent 8f88809 commit 67a7eb8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ dependencies {
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.lifecycle:lifecycle-viewmodel:2.7.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
implementation("androidx.preference:preference:1.2.1")
implementation("androidx.preference:preference-ktx:1.2.1")
// Material Design
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/kotlin/cn/super12138/todo/ToDoApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import android.content.Context
import cn.super12138.todo.logic.dao.ToDoRoomDB
import cn.super12138.todo.views.crash.CrashHandler
import com.google.android.material.color.DynamicColors
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

class ToDoApplication : Application() {
private val database by lazy { ToDoRoomDB.getDatabase(this) }

companion object {
@SuppressLint("StaticFieldLeak")
lateinit var context: Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ object SPHelper {
PreferenceManager.getDefaultSharedPreferences(context /* Activity context */)
return sharedPreferences.getString(name, defaultValue)
}
fun getPreferenceBoolean(context: Context, name: String, defaultValue: Boolean): Boolean? {

fun getPreferenceBoolean(context: Context, name: String, defaultValue: Boolean): Boolean {
val sharedPreferences =
PreferenceManager.getDefaultSharedPreferences(context /* Activity context */)
return sharedPreferences.getBoolean(name, defaultValue)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/cn/super12138/todo/logic/model/ToDo.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package cn.super12138.todo.logic.model

data class ToDo(val uuid: String, val content: String, val subject: String){
data class ToDo(val uuid: String, val content: String, val subject: String) {
var isAnimated = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class MainActivity : BaseActivity() {
)

false -> window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
else -> window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
}
}
}

0 comments on commit 67a7eb8

Please sign in to comment.