Skip to content

Commit

Permalink
Merge branch 'feat/bump-compose' into 'master'
Browse files Browse the repository at this point in the history
Bump Jetpack Compose to 1.0.0-beta09 and temporarily disable Firebase plugin

See merge request fmasa/wfrp-master!206
  • Loading branch information
fmasa committed Jul 1, 2021
2 parents c2c2d36 + f12ffda commit 1f149cf
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 33 deletions.
7 changes: 4 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id("com.google.gms.google-services")
id("kotlin-kapt")
id("com.google.firebase.crashlytics")
id("com.google.firebase.firebase-perf")
//id("com.google.firebase.firebase-perf")
}

android {
Expand Down Expand Up @@ -78,6 +78,7 @@ android {
"-Xopt-in=androidx.compose.foundation.layout.ExperimentalLayout" +
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi" +
"-Xopt-in=androidx.compose.material.ExperimentalMaterialApi" +
"-Xopt-in=androidx.compose.animation.ExperimentalAnimationApi" +
"-P" +
"plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"
}
Expand Down Expand Up @@ -114,12 +115,12 @@ dependencies {
testImplementation("org.mockito:mockito-core:2.7.22")

// Time picker
implementation("io.github.vanpra.compose-material-dialogs:datetime:0.4.0")
implementation("io.github.vanpra.compose-material-dialogs:datetime:0.4.3")

// Checking network access
implementation("com.github.pwittchen:reactivenetwork-rx2:3.0.8")
api("org.jetbrains.kotlinx:kotlinx-coroutines-rx2:1.4.2")

// Firebase Performance
implementation("com.google.firebase:firebase-perf-ktx:19.1.1")
// implementation("com.google.firebase:firebase-perf-ktx:20.0.1")
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cz.frantisekmasa.wfrp_master.compendium.ui
import android.content.Intent
import android.net.Uri
import android.widget.Toast
import androidx.activity.compose.registerForActivityResult
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -74,7 +74,8 @@ private fun MainContainer(routing: Routing<Route.CompendiumImport>) {
)
}

val fileChooser = registerForActivityResult(ActivityResultContracts.GetContent(),
val fileChooser = rememberLauncherForActivityResult(
ActivityResultContracts.GetContent(),
onResult = {
coroutineScope.launch(Dispatchers.IO) {
context.contentResolver.openInputStream(it)?.use { inputStream ->
Expand Down
30 changes: 15 additions & 15 deletions app/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,38 @@ dependencies {
api("org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}")

// Basic Android stuff
api("androidx.core:core-ktx:1.3.2")
api("androidx.fragment:fragment-ktx:1.3.0")
api("androidx.core:core-ktx:1.5.0")
api("androidx.fragment:fragment-ktx:1.3.5")

// Jetpack Compose
api("androidx.compose.ui:ui:${Versions.compose}")
api("androidx.compose.material:material:${Versions.compose}")
api("androidx.compose.ui:ui-tooling:${Versions.compose}")
api("androidx.compose.runtime:runtime-livedata:${Versions.compose}")
api("androidx.activity:activity-compose:1.3.0-alpha07")
api("androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha04")
api("androidx.activity:activity-compose:1.3.0-beta02")
api("androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha07")


// Koin
api("org.koin:koin-android:2.2.0")
api("org.koin:koin-androidx-viewmodel:2.2.0")

// Firebase-related dependencies
api("com.google.firebase:firebase-analytics:18.0.2")
api("com.google.firebase:firebase-analytics:19.0.0")
api("com.firebaseui:firebase-ui-auth:6.2.0")
api("com.google.firebase:firebase-firestore-ktx:22.1.0")
api("com.google.firebase:firebase-analytics-ktx:18.0.2")
api("com.google.firebase:firebase-crashlytics:17.3.1")
api("com.google.firebase:firebase-dynamic-links-ktx:19.1.1")
api("com.google.firebase:firebase-firestore-ktx:23.0.1")
api("com.google.firebase:firebase-analytics-ktx:19.0.0")
api("com.google.firebase:firebase-crashlytics:18.1.0")
api("com.google.firebase:firebase-dynamic-links-ktx:20.1.0")

// Logging
api("com.jakewharton.timber:timber:4.7.1")

// Coroutines
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2")
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0")
api("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.3.5")
api("androidx.lifecycle:lifecycle-livedata-ktx:2.3.0")
api("androidx.lifecycle:lifecycle-livedata-ktx:2.3.1")

api("io.arrow-kt:arrow-core:0.10.4")

Expand All @@ -73,20 +73,20 @@ dependencies {

// JSON encoding
// TODO: Make is implementation only
api("com.fasterxml.jackson.module:jackson-module-kotlin:2.11.0")
api("com.fasterxml.jackson.module:jackson-module-kotlin:2.12.3")

// Premium
// TODO: Make implementation only
api("com.revenuecat.purchases:purchases:4.0.2")

// Ads
api("com.google.android.gms:play-services-ads:19.7.0")
api("com.google.android.gms:play-services-ads:20.2.0")

// Shared Preferences DataStore
implementation("androidx.datastore:datastore-preferences:1.0.0-alpha05")

// HTTP Client
val ktorVersion = "1.5.0"
val ktorVersion = "1.6.0"
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-jackson:$ktorVersion")
Expand Down
2 changes: 1 addition & 1 deletion app/navigation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ dependencies {
implementation(project(":app:core"))

// Navigation
api("androidx.navigation:navigation-compose:1.0.0-alpha10")
api("androidx.navigation:navigation-compose:2.4.0-alpha03")
}
4 changes: 2 additions & 2 deletions app/src/main/java/cz/muni/fi/rpg/ui/settings/SignInCard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cz.muni.fi.rpg.ui.settings

import android.os.Parcelable
import android.widget.Toast
import androidx.activity.compose.registerForActivityResult
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
Expand Down Expand Up @@ -62,7 +62,7 @@ fun SignInCard(viewModel: SettingsViewModel, routing: Routing<Route.Settings>) {
)
}

val launcher = registerForActivityResult(contract) { result ->
val launcher = rememberLauncherForActivityResult(contract) { result ->
coroutineScope.launch(Dispatchers.IO) {
try {
GoogleSignIn.getSignedInAccountFromIntent(result.intent)
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/cz/muni/fi/rpg/ui/shell/NavController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.core.os.bundleOf
import androidx.navigation.NavController
import androidx.navigation.NavDestination
import androidx.navigation.NavHostController
import androidx.navigation.compose.KEY_ROUTE
import androidx.navigation.compose.rememberNavController
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.analytics.ktx.analytics
Expand All @@ -33,7 +32,7 @@ private class DestinationAnalyticsLogger : NavController.OnDestinationChangedLis
destination: NavDestination,
arguments: Bundle?
) {
val route = arguments?.getString(KEY_ROUTE) ?: return
val route = destination.route ?: return

Timber.d("Showing screen $route")

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/cz/muni/fi/rpg/ui/startup/StartupScreen.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cz.muni.fi.rpg.ui.startup

import androidx.activity.compose.registerForActivityResult
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -59,11 +59,11 @@ fun StartupScreen(viewModel: AuthenticationViewModel) {
val context = LocalContext.current
val contract = remember(viewModel) { viewModel.googleSignInContract() }
val googleSignInLauncher = key(contract, coroutineScope) {
registerForActivityResult(contract) { result ->
rememberLauncherForActivityResult(contract) { result ->
if (result.resultCode == 0) {
Timber.d("Google Sign-In dialog was dismissed")
showAnonymousAuthenticationDialog = true
return@registerForActivityResult
return@rememberLauncherForActivityResult
}

coroutineScope.launch(Dispatchers.IO) {
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ buildscript {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}")

// Firebase-related dependencies
classpath("com.google.gms:google-services:4.3.5")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.7.0")
classpath("com.google.firebase:perf-plugin:1.3.4")
classpath("com.google.gms:google-services:4.3.8")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.7.1")
//classpath("com.google.firebase:perf-plugin:1.4.0")
}
}

Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/resources/versions.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
androidGradlePluginVersion=7.0.0-alpha15
kotlinVersion=1.4.30
composeVersion=1.0.0-beta06
kotlinVersion=1.5.10
composeVersion=1.0.0-beta09

0 comments on commit 1f149cf

Please sign in to comment.