Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Implement License Screen #883

Merged
merged 15 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ dependencies {
implementation(libs.accompanistSystemUiController)
implementation(libs.androidxBrowser)
implementation(libs.androidxWindow)
implementation(libs.ossLicenses)
implementation(libs.kermit)
testImplementation(projects.core.testing)
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.core.content.ContextCompat.startActivity
import androidx.core.net.toUri
import androidx.core.os.bundleOf
import androidx.hilt.navigation.compose.hiltViewModel
Expand All @@ -31,6 +32,7 @@ import androidx.navigation.compose.rememberNavController
import androidx.window.layout.DisplayFeature
import co.touchlab.kermit.Logger
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
import io.github.droidkaigi.confsched2023.about.aboutScreenRoute
import io.github.droidkaigi.confsched2023.about.navigateAboutScreen
import io.github.droidkaigi.confsched2023.about.nestedAboutScreen
Expand Down Expand Up @@ -159,7 +161,7 @@ private fun NavGraphBuilder.mainScreen(
Sponsors -> navController.navigateSponsorsScreen()
CodeOfConduct -> externalNavController.navigate(url = "https://portal.droidkaigi.jp/about/code-of-conduct")
Contributors -> mainNestedNavController.navigate(contributorsScreenRoute)
License -> TODO()
License -> externalNavController.navigateToLicenseScreen()
Medium -> externalNavController.navigate(url = "https://medium.com/droidkaigi")
PrivacyPolicy -> externalNavController.navigate(url = "https://portal.droidkaigi.jp/about/privacy")
Staff -> navController.navigateStaffScreen()
Expand Down Expand Up @@ -269,6 +271,10 @@ private class ExternalNavController(
}
}

fun navigateToLicenseScreen(){
context.startActivity(Intent(context,OssLicensesMenuActivity::class.java))
}

@Suppress("SwallowedException")
@RequiresApi(Build.VERSION_CODES.R)
private fun navigateToNativeAppApi30(context: Context, uri: Uri): Boolean {
Expand Down
2 changes: 1 addition & 1 deletion app-android/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.KaigiApp" parent="android:Theme.Material.Light.NoActionBar">
<style name="Theme.KaigiApp" parent="Theme.AppCompat.Light.NoActionBar">
Copy link
Member

@takahirom takahirom Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏
(I thought it is ok to have this theme 👀 )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check with revert ver 🙇

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have to change the theme for entire the app.

I can just update the theme for the Activities which generate by the plugin.

<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ tasks.register("clean", Delete::class) {
}

buildscript {
dependencies {
classpath(libs.ossLicensesPlugin)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer here to add this plugin.
https://github.com/DroidKaigi/conference-app-2023/blob/main/build-logic/build.gradle.kts
Or there is a blog reading this. You can refer to it 👍
https://sys1yagi.hatenablog.com/entry/2023/08/17/151450

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for recommendations!
I'm not family with this, so much helpful 🙇

Copy link
Contributor Author

@fumiya-kume fumiya-kume Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created the Plugin for OSS license plugin.

also It applied.

configurations.all {
resolutionStrategy.eachDependency {
when {
Expand Down
9 changes: 9 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ multiplatformFirebase = "1.8.1"
kermit = "1.2.2"
okHttp = "4.11.0"
ktorfit = "1.5.0"
ossLicensesPlugin = "0.10.6"
ossLicenses = "17.0.1"
detekt = "1.23.1"
twitterComposeRule = "0.0.26"

Expand Down Expand Up @@ -124,6 +126,11 @@ ktorfitKsp = { module = "de.jensklingenberg.ktorfit:ktorfit-ksp", version.ref =

# Test

# etc

ossLicenses = { module = "com.google.android.gms:play-services-oss-licenses", version.ref = "ossLicenses" }
ossLicensesPlugin = { module = "com.google.android.gms:oss-licenses-plugin", version.ref = "ossLicensesPlugin" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about placing these dependencies below the dependencies for tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's make sense. thank you for suggestion!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved to below of tests


junit = { module = "junit:junit", version.ref = "junit" }
androidxTestExtJunit = { module = "androidx.test.ext:junit", version.ref = "androidxTestExt" }
androidxTestEspressoEspressoCore = { module = "androidx.test.espresso:espresso-core", version.ref = "androidxTestEspresso" }
Expand All @@ -143,6 +150,7 @@ roborazziGradlePlugin = { id = "io.github.takahirom.roborazzi", version.ref = "r
kspGradlePlugin = { id = "com.google.devtools.ksp", version.ref = "ksp" }
kotlinxKover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.3" }
detektGradlePlugin = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
ossLicensesPlugin = { id = "com.google.android.gms.oss-licenses-plugin", version.ref = "ossLicensesPlugin" }

[bundles]
plugins = [
Expand All @@ -157,4 +165,5 @@ plugins = [
"kotlinxSerializationGradlePlugin",
"completeKotlinPlugin",
"detektGradlePlugin",
"ossLicensesPlugin"
]