Skip to content

Commit

Permalink
[build] Update dependencies; Happy 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyD666 committed Feb 9, 2024
1 parent ab548ac commit d33f45a
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ android {
applicationId "com.skyd.rays"
minSdk 24
targetSdk 34
versionCode 59
versionName "2.1-rc06"
versionCode 60
versionName "2.1-Happy 2024"
flavorDimensions = ["versionName"]

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/skyd/rays/model/db/AppDatabase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import com.skyd.rays.model.bean.TagBean
import com.skyd.rays.model.bean.UriStringSharePackageBean
import com.skyd.rays.model.db.dao.ApiGrantPackageDao
import com.skyd.rays.model.db.dao.SearchDomainDao
import com.skyd.rays.model.db.dao.sticker.StickerDao
import com.skyd.rays.model.db.dao.TagDao
import com.skyd.rays.model.db.dao.UriStringSharePackageDao
import com.skyd.rays.model.db.dao.sticker.StickerDao
import com.skyd.rays.model.db.migration.Migration1To2
import com.skyd.rays.model.db.migration.Migration2To3
import com.skyd.rays.model.db.migration.Migration3To4
Expand Down Expand Up @@ -45,6 +45,7 @@ abstract class AppDatabase : RoomDatabase() {
abstract fun apiGrantPackageDao(): ApiGrantPackageDao

companion object {
@Volatile
private var instance: AppDatabase? = null

private val migrations = arrayOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface StickerDao {
val tagDao: TagDao
}

// @Transaction 加上后会导致Flow更新不正常(搜索页面不能及时删除没有tag的表情包)
@Transaction
@RawQuery
fun getStickerWithTagsList(sql: SupportSQLiteQuery): Flow<List<StickerWithTags>>

Expand Down Expand Up @@ -165,7 +165,7 @@ interface StickerDao {
innerDeleteAllStickers()
}

@Transaction
@Transaction //加上后会导致Flow更新不正常(搜索页面不能及时删除没有tag的表情包)
@Query("DELETE FROM $STICKER_TABLE_NAME WHERE $UUID_COLUMN IN (:stickerUuids)")
fun innerDeleteStickers(stickerUuids: List<String>): Int

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material3.Icon
import androidx.compose.material3.SwipeToDismissBox
import androidx.compose.material3.SwipeToDismissState
import androidx.compose.material3.SwipeToDismissBoxState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -20,7 +20,7 @@ import com.skyd.rays.R

@Composable
fun RaysSwipeToDismiss(
state: SwipeToDismissState,
state: SwipeToDismissBoxState,
modifier: Modifier = Modifier,
background: @Composable RowScope.() -> Unit = {
Box(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun MiniToolScreen() {
imageVector = Icons.Default.Extension,
onClick = {
snackbarHostState.showSnackbar(
message = "\uD83D\uDC31 Meow~",
message = "\ud83c\udfee Happy New Year 2024~",
scope = scope,
withDismissAction = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fun MoreScreen() {
imageVector = Icons.Default.Widgets,
onClick = {
snackbarHostState.showSnackbar(
message = "\uD83D\uDC31 Nya~",
message = "\uD83C\uDFEE Happy New Year 2024~",
scope = scope,
withDismissAction = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import androidx.compose.material.icons.filled.VisibilityOff
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.SwipeToDismissValue
import androidx.compose.material3.SwipeToDismissBoxValue
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberSwipeToDismissState
import androidx.compose.material3.rememberSwipeToDismissBoxState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -119,9 +119,9 @@ fun ApiGrantScreen(viewModel: ApiGrantViewModel = hiltViewModel()) {
itemsIndexed(uriStringShareResultState.data) { _, item ->
CompositionLocalProvider(LocalUseColorfulIcon provides true) {
RaysSwipeToDismiss(
state = rememberSwipeToDismissState(
state = rememberSwipeToDismissBoxState(
confirmValueChange = { dismissValue ->
if (dismissValue == SwipeToDismissValue.EndToStart) {
if (dismissValue == SwipeToDismissBoxValue.EndToStart) {
openDeleteDialog = item.apiGrantPackageBean.packageName
}
false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.SwipeToDismissValue
import androidx.compose.material3.SwipeToDismissBoxValue
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberSwipeToDismissState
import androidx.compose.material3.rememberSwipeToDismissBoxState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand Down Expand Up @@ -183,9 +183,9 @@ private fun ModelList(
}
itemsIndexed(models) { _, item ->
RaysSwipeToDismiss(
state = rememberSwipeToDismissState(
state = rememberSwipeToDismissBoxState(
confirmValueChange = { dismissValue ->
if (dismissValue == SwipeToDismissValue.EndToStart) {
if (dismissValue == SwipeToDismissBoxValue.EndToStart) {
onDelete(item)
}
false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.SwipeToDismissValue
import androidx.compose.material3.SwipeToDismissBoxValue
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberSwipeToDismissState
import androidx.compose.material3.rememberSwipeToDismissBoxState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -120,9 +120,9 @@ fun UriStringShareScreen(viewModel: UriStringShareViewModel = hiltViewModel()) {
itemsIndexed(uriStringShareResultUiState.data) { _, item ->
CompositionLocalProvider(LocalUseColorfulIcon provides true) {
RaysSwipeToDismiss(
state = rememberSwipeToDismissState(
state = rememberSwipeToDismissBoxState(
confirmValueChange = { dismissValue ->
if (dismissValue == SwipeToDismissValue.EndToStart) {
if (dismissValue == SwipeToDismissBoxValue.EndToStart) {
openDeleteDialog =
item.uriStringSharePackageBean.packageName
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ buildscript {
ext {
secret = "${rootDir}/secret.gradle"
compose_version = '1.6.0'
md3_version = '1.2.0-beta01'
md3_version = '1.2.0'
accompanist_version = '0.34.0'
mlkit_recognition_version = '16.0.0'
}
Expand Down

0 comments on commit d33f45a

Please sign in to comment.