-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update to ASDK v6.10.0 #86
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ class ExampleApplication : Application() { | |
// build Firework Android SDK v6 configuration | ||
val config = | ||
FireworkSdkConfig.Builder(this) | ||
.checksumRequired(false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deprecated |
||
.clientId(FW_CLIENT_ID) // Client OAUTH Id | ||
.userId("example app user ID") // User Id in your eco-system | ||
.imageLoader(GlideImageLoaderFactory.createInstance(context = this)) // glide, picasso, or your ImageLoader implementation | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,72 @@ | ||
package com.firework.example.compose.ui.theme | ||
|
||
import android.app.Activity | ||
import android.os.Build | ||
import androidx.compose.foundation.isSystemInDarkTheme | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.darkColors | ||
import androidx.compose.material.lightColors | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.darkColorScheme | ||
import androidx.compose.material3.dynamicDarkColorScheme | ||
import androidx.compose.material3.dynamicLightColorScheme | ||
import androidx.compose.material3.lightColorScheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.SideEffect | ||
import androidx.compose.ui.graphics.toArgb | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.platform.LocalView | ||
import androidx.core.view.WindowCompat | ||
|
||
private val DarkColorPalette = | ||
darkColors( | ||
primary = Purple200, | ||
primaryVariant = Purple700, | ||
secondary = Teal200, | ||
private val DarkColorScheme = | ||
darkColorScheme( | ||
primary = Purple80, | ||
secondary = PurpleGrey80, | ||
tertiary = Pink80, | ||
) | ||
|
||
private val LightColorPalette = | ||
lightColors( | ||
primary = Purple500, | ||
primaryVariant = Purple700, | ||
secondary = Teal200, | ||
background = White, | ||
private val LightColorScheme = | ||
lightColorScheme( | ||
primary = Purple40, | ||
secondary = PurpleGrey40, | ||
tertiary = Pink40, | ||
/* Other default colors to override | ||
background = Color(0xFFFFFBFE), | ||
surface = Color(0xFFFFFBFE), | ||
onPrimary = Color.White, | ||
onSecondary = Color.White, | ||
onTertiary = Color.White, | ||
onBackground = Color(0xFF1C1B1F), | ||
onSurface = Color(0xFF1C1B1F), | ||
*/ | ||
) | ||
|
||
@Composable | ||
fun FireworkComposeTheme( | ||
fun MyApplicationTheme( | ||
darkTheme: Boolean = isSystemInDarkTheme(), | ||
// Dynamic color is available on Android 12+ | ||
dynamicColor: Boolean = true, | ||
content: @Composable () -> Unit, | ||
) { | ||
val colors = | ||
if (darkTheme) { | ||
DarkColorPalette | ||
} else { | ||
LightColorPalette | ||
val colorScheme = | ||
when { | ||
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { | ||
val context = LocalContext.current | ||
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) | ||
} | ||
|
||
darkTheme -> DarkColorScheme | ||
else -> LightColorScheme | ||
} | ||
val view = LocalView.current | ||
if (!view.isInEditMode) { | ||
SideEffect { | ||
val window = (view.context as Activity).window | ||
window.statusBarColor = colorScheme.primary.toArgb() | ||
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme | ||
} | ||
} | ||
|
||
MaterialTheme( | ||
colors = colors, | ||
colorScheme = colorScheme, | ||
typography = Typography, | ||
shapes = Shapes, | ||
content = content, | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
plugins { | ||
id("com.android.application") version "8.2.2" apply false | ||
id("com.android.library") version "8.2.2" apply false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed |
||
id("com.android.application") version "8.3.1" apply false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to the latest |
||
id("org.jetbrains.kotlin.android") version "1.9.22" apply false | ||
id("org.jlleitschuh.gradle.ktlint") version "12.0.3" apply false | ||
id("io.gitlab.arturbosch.detekt") version "1.23.4" apply false | ||
} | ||
|
||
task<Delete>("clean") { | ||
delete = setOf(rootProject.buildDir) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deprecated |
||
delete = setOf(rootProject.layout.buildDirectory) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,4 @@ kotlin.code.style=official | |
# resources declared in the library itself and none from the library's dependencies, | ||
# thereby reducing the size of the R class for that library | ||
android.nonTransitiveRClass=true | ||
android.defaults.buildfeatures.buildconfig=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deprecated and causes a warning |
||
android.nonFinalResIds=false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated by AGP |
||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ dependencyResolutionManagement { | |
repositories { | ||
google() | ||
mavenCentral() | ||
mavenLocal() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice to have for testing before release |
||
// SNAPSHOTS repo is for the test purpose, and should not be used in production | ||
maven { | ||
setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
plugins { | ||
id("com.android.application") version "8.2.2" apply false | ||
id("com.android.library") version "8.2.2" apply false | ||
id("com.android.application") version "8.3.1" apply false | ||
id("org.jetbrains.kotlin.android") version "1.9.21" apply false | ||
id("org.jlleitschuh.gradle.ktlint") version "12.0.3" apply false | ||
id("io.gitlab.arturbosch.detekt") version "1.23.4" apply false | ||
} | ||
|
||
task<Delete>("clean") { | ||
delete = setOf(rootProject.buildDir) | ||
delete = setOf(rootProject.layout.buildDirectory) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solves a Gradle warning