spotlessApply

pull/1323/head
lihenggui 2 years ago
parent 42c3501d54
commit 94b14e7279

@ -30,7 +30,7 @@ import kotlinx.datetime.Instant
/**
* DAO for [NewsResource] and [NewsResourceEntity] access
*/
class NewsResourceDao(db: NiaDatabase, private val dispatcher: CoroutineDispatcher): NewsResourceDaoInterface {
class NewsResourceDao(db: NiaDatabase, private val dispatcher: CoroutineDispatcher) : NewsResourceDaoInterface {
private val query = db.newsResourceQueries
/**

@ -26,14 +26,14 @@ interface NewsResourceDaoInterface {
useFilterTopicIds: Boolean = false,
filterTopicIds: Set<String> = emptySet(),
useFilterNewsIds: Boolean = false,
filterNewsIds: Set<String> = emptySet()
filterNewsIds: Set<String> = emptySet(),
): Flow<List<PopulatedNewsResource>>
fun getNewsResourceIds(
useFilterTopicIds: Boolean = false,
filterTopicIds: Set<String> = emptySet(),
useFilterNewsIds: Boolean = false,
filterNewsIds: Set<String> = emptySet()
filterNewsIds: Set<String> = emptySet(),
): Flow<List<String>>
suspend fun insertOrIgnoreNewsResources(entities: List<NewsResourceEntity>): List<Long>

@ -28,7 +28,7 @@ import kotlinx.coroutines.flow.map
/**
* DAO for [NewsResourceFtsEntity] access.
*/
class NewsResourceFtsDao(db: NiaDatabase, private val dispatcher: CoroutineDispatcher): NewsResourceFtsDaoInterface {
class NewsResourceFtsDao(db: NiaDatabase, private val dispatcher: CoroutineDispatcher) : NewsResourceFtsDaoInterface {
private val dbQuery = db.newsResourceFtsQueries
override suspend fun insertAll(newsResources: List<NewsResourceFtsEntity>) {
newsResources.forEach {

@ -28,7 +28,7 @@ import kotlinx.datetime.Instant
/**
* DAO for [RecentSearchQueryEntity] access
*/
class RecentSearchQueryDao(db: NiaDatabase, private val dispatcher: CoroutineDispatcher): RecentSearchQueryDaoInterface {
class RecentSearchQueryDao(db: NiaDatabase, private val dispatcher: CoroutineDispatcher) : RecentSearchQueryDaoInterface {
private val query = db.recentSearchQueryQueries

@ -29,7 +29,7 @@ import kotlinx.coroutines.flow.map
* DAO for [TopicEntity] access
*/
class TopicDao(db: NiaDatabase, private val dispatcher: CoroutineDispatcher): TopicDaoInterface {
class TopicDao(db: NiaDatabase, private val dispatcher: CoroutineDispatcher) : TopicDaoInterface {
private val query = db.topicsQueries

@ -28,7 +28,7 @@ import kotlinx.coroutines.flow.map
/**
* DAO for [TopicFtsEntity] access.
*/
class TopicFtsDao(db: NiaDatabase, private val dispatcher: CoroutineDispatcher): TopicFtsDaoInterface {
class TopicFtsDao(db: NiaDatabase, private val dispatcher: CoroutineDispatcher) : TopicFtsDaoInterface {
private val dbQuery = db.topicFtsQueries

@ -16,7 +16,6 @@
package com.google.samples.apps.nowinandroid.core.designsystem
import android.R.string
import androidx.activity.ComponentActivity
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.runtime.Composable

@ -143,8 +143,8 @@ fun NiaGradientBackground(
* Multipreview annotation that represents light and dark themes. Add this annotation to a
* composable to render the both themes.
*/
//@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, name = "Light theme")
//@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, name = "Dark theme")
// @Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, name = "Light theme")
// @Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, name = "Dark theme")
@Preview
annotation class ThemePreviews

@ -18,7 +18,6 @@ package com.google.samples.apps.nowinandroid.core.designsystem.component
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilterChip
import androidx.compose.material3.FilterChipDefaults
import androidx.compose.material3.Icon
@ -31,7 +30,6 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.google.samples.apps.nowinandroid.core.designsystem.icon.NiaIcons
import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
/**
* Now in Android filter chip with included leading checked icon as well as text content slot.

@ -49,7 +49,7 @@ fun DynamicAsyncImage(
imageLoader: ImageLoader,
contentDescription: String?,
modifier: Modifier = Modifier,
//TODO Use Compose resources to present a placeholder
// TODO Use Compose resources to present a placeholder
// placeholder: Painter = painterResource(R.drawable.core_designsystem_ic_placeholder_default),
) {
val iconTint = LocalTintTheme.current.iconTint

@ -236,7 +236,7 @@ fun NiaTheme(
}
}
//@ChecksSdkIntAtLeast(api = Build.VERSION_CODES.S)
//fun supportsDynamicTheming() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
// @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.S)
// fun supportsDynamicTheming() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
// A workaround for the dynamic theming support in Compose Multiplatform
fun supportsDynamicTheming() = false

@ -16,7 +16,6 @@
package com.google.samples.apps.nowinandroid.core.testing.di
import com.google.samples.apps.nowinandroid.core.di.DispatchersComponent
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.test.TestDispatcher
import me.tatarka.inject.annotations.Component

Loading…
Cancel
Save