Skip to content

Commit

Permalink
Add room theme color and apply colors
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Jul 26, 2024
1 parent 6d020fc commit ed6da17
Show file tree
Hide file tree
Showing 28 changed files with 286 additions and 621 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package io.github.droidkaigi.confsched.shared

import io.github.droidkaigi.confsched.data.Repositories
import io.github.droidkaigi.confsched.data.achievements.AchievementsDataStore
import io.github.droidkaigi.confsched.data.auth.AuthApi
import io.github.droidkaigi.confsched.data.auth.Authenticator
import io.github.droidkaigi.confsched.data.auth.User
import io.github.droidkaigi.confsched.model.AchievementRepository
import io.github.droidkaigi.confsched.data.remoteconfig.RemoteConfigApi
import io.github.droidkaigi.confsched.data.sessions.SessionCacheDataStore
import io.github.droidkaigi.confsched.data.sessions.SessionsApiClient
Expand Down Expand Up @@ -50,10 +48,8 @@ class EntryPointTest {
assertNotNull(kmpEntryPoint.get<AuthApi>())
assertNotNull(kmpEntryPoint.get<SessionsApiClient>())
assertNotNull(kmpEntryPoint.get<SessionCacheDataStore>())
assertNotNull(kmpEntryPoint.get<AchievementsDataStore>())

assertNotNull(kmpEntryPoint.get<SessionsRepository>())
assertNotNull(kmpEntryPoint.get<AchievementRepository>())
assertNotNull(kmpEntryPoint.get<ContributorsRepository>())
assertNotNull(kmpEntryPoint.get<SponsorsRepository>())
assertNotNull(kmpEntryPoint.get<StaffRepository>())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
import org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
import org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED
import org.gradle.api.tasks.testing.logging.TestLogEvent.STARTED
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType

Expand All @@ -22,14 +23,16 @@ class AndroidRoborazziPlugin : Plugin<Project> {
testOptions {
unitTests {
all { test ->
test.systemProperties["robolectric.logging.enabled"] = "true"
test.jvmArgs("-noverify")
test.systemProperties["robolectric.graphicsMode"] = "NATIVE"
test.systemProperties["robolectric.pixelCopyRenderMode"] = "hardware"
test.maxParallelForks = Runtime.getRuntime().availableProcessors()
test.testLogging {
events.addAll(listOf(PASSED, SKIPPED, FAILED))
events.addAll(listOf(STARTED, PASSED, SKIPPED, FAILED))
showCauses = true
showExceptions = true
showStandardStreams = true
exceptionFormat = FULL
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
import org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
import org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED
import org.gradle.api.tasks.testing.logging.TestLogEvent.STARTED
import org.gradle.kotlin.dsl.getByType
import kotlin.collections.listOf
import kotlin.collections.set
Expand All @@ -31,7 +32,7 @@ class KmpRoborazziPlugin : Plugin<Project> {

test.maxParallelForks = Runtime.getRuntime().availableProcessors()
test.testLogging {
events.addAll(listOf(PASSED, SKIPPED, FAILED))
events.addAll(listOf(STARTED, PASSED, SKIPPED, FAILED))
showCauses = true
showExceptions = true
exceptionFormat = FULL
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ public annotation class UserDataStoreQualifier
@Qualifier
public annotation class SessionCacheDataStoreQualifier

@Qualifier
public annotation class AchievementsDataStoreQualifier

@InstallIn(SingletonComponent::class)
@Module
public class DataStoreModule {
Expand All @@ -48,21 +45,9 @@ public class DataStoreModule {
producePath = { context.cacheDir.resolve(DATA_STORE_CACHE_PREFERENCE_FILE_NAME).path },
)

@AchievementsDataStoreQualifier
@Provides
@Singleton
public fun provideAchievementsDataStore(
@ApplicationContext context: Context,
): DataStore<Preferences> = createDataStore(
coroutineScope = CoroutineScope(Dispatchers.IO + SupervisorJob()),
producePath = { context.filesDir.resolve(DATA_STORE_ACHIEVEMENTS_FILE_NAME).path },
)

public companion object {
private const val DATA_STORE_PREFERENCE_FILE_NAME = "confsched2024.preferences_pb"
private const val DATA_STORE_CACHE_PREFERENCE_FILE_NAME =
"confsched2024.cache.preferences_pb"
private const val DATA_STORE_ACHIEVEMENTS_FILE_NAME =
"confsched2024.achievements.preferences_pb"
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.github.droidkaigi.confsched.data

import de.jensklingenberg.ktorfit.Ktorfit
import io.github.droidkaigi.confsched.data.achievements.AchievementsDataStore
import io.github.droidkaigi.confsched.data.achievements.DefaultAchievementRepository
import io.github.droidkaigi.confsched.data.auth.AuthApi
import io.github.droidkaigi.confsched.data.auth.DefaultAuthApi
import io.github.droidkaigi.confsched.data.contributors.ContributorsApiClient
Expand All @@ -21,7 +19,6 @@ import io.github.droidkaigi.confsched.data.staff.DefaultStaffApiClient
import io.github.droidkaigi.confsched.data.staff.DefaultStaffRepository
import io.github.droidkaigi.confsched.data.staff.StaffApiClient
import io.github.droidkaigi.confsched.data.user.UserDataStore
import io.github.droidkaigi.confsched.model.AchievementRepository
import io.github.droidkaigi.confsched.model.ContributorsRepository
import io.github.droidkaigi.confsched.model.SessionsRepository
import io.github.droidkaigi.confsched.model.SponsorsRepository
Expand Down Expand Up @@ -114,22 +111,6 @@ public val dataModule: Module = module {
)
SessionCacheDataStore(dataStore, get())
}
single {
val dataStore = createDataStore(
coroutineScope = CoroutineScope(Dispatchers.Default + SupervisorJob()),
producePath = {
val documentDirectory: NSURL? = NSFileManager.defaultManager.URLForDirectory(
directory = NSDocumentDirectory,
inDomain = NSUserDomainMask,
appropriateForURL = null,
create = false,
error = null,
)
requireNotNull(documentDirectory).path + "/confsched2024.achievements.preferences_pb"
},
)
AchievementsDataStore(dataStore)
}

singleOf(::DefaultAuthApi) bind AuthApi::class
singleOf(::DefaultSessionsApiClient) bind SessionsApiClient::class
Expand All @@ -138,15 +119,13 @@ public val dataModule: Module = module {
singleOf(::DefaultStaffApiClient) bind StaffApiClient::class

singleOf(::NetworkService)
singleOf(::DefaultAchievementRepository) bind AchievementRepository::class
singleOf(::DefaultSessionsRepository) bind SessionsRepository::class
singleOf(::DefaultContributorsRepository) bind ContributorsRepository::class
singleOf(::DefaultStaffRepository) bind StaffRepository::class
singleOf(::DefaultSponsorsRepository) bind SponsorsRepository::class
single<Repositories> {
DefaultRepositories(
mapOf(
AchievementRepository::class to get<AchievementRepository>(),
SessionsRepository::class to get<SessionsRepository>(),
ContributorsRepository::class to get<ContributorsRepository>(),
StaffRepository::class to get<StaffRepository>(),
Expand Down
Loading

0 comments on commit ed6da17

Please sign in to comment.