Skip to content

Commit

Permalink
Update SDK version to 2023.11.01
Browse files Browse the repository at this point in the history
Signed-off-by: Mohsen Mirhoseini <[email protected]>
  • Loading branch information
Mohsen Mirhoseini committed Dec 21, 2023
1 parent 256713c commit a6e50a0
Show file tree
Hide file tree
Showing 95 changed files with 700 additions and 543 deletions.
28 changes: 28 additions & 0 deletions compose/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SOURCE: https://github.com/JetBrains/kotlin-playground/blob/master/.editorconfig
root = true


[*]
indent_style = space
indent_size = 4

max_line_length = 150

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

ij_continuation_indent_size = 4
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_spaces_around_equality_operators = true

[*.{kt,kts}]
ktlint_function_naming_ignore_when_annotated_with=Composable

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
23 changes: 10 additions & 13 deletions compose/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ android {
buildConfigField(
"String",
"FW_CLIENT_ID",
"\"f6d6ec1275217f178cdff91363825cb390e038c1168f64f6efa23cb95ec6b325\""
"\"f6d6ec1275217f178cdff91363825cb390e038c1168f64f6efa23cb95ec6b325\"",
)
}

release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
}
}
Expand All @@ -62,7 +62,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
kotlinCompilerExtensionVersion = "1.5.7"
}
}

Expand All @@ -76,8 +76,8 @@ detekt {
dependencies {
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.activity:activity-compose:1.7.2")
implementation("androidx.compose.material:material:1.5.2")
implementation("androidx.activity:activity-compose:1.8.2")
implementation("androidx.compose.material:material:1.5.4")

// compose
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
Expand All @@ -88,12 +88,9 @@ dependencies {
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

val fireworkSdkVersion = "6.7.0"
implementation("com.firework:sdk:$fireworkSdkVersion")

// Glide Impl (Optional)
implementation("com.firework.external.imageloading:glide:$fireworkSdkVersion")

// Picasso (optional image loader)
// implementation("com.firework.external.imageloading:picasso:$fireworkSdkVersion")
val fireworkBomVersion = "2023.11.01"
implementation(platform("com.firework:firework-bom:$fireworkBomVersion"))
implementation("com.firework:sdk")
implementation("com.firework.external.imageloading:glide") // Glide (optional image loader)
// implementation("com.firework.external.imageloading:picasso") // Picasso (optional image loader)
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ class ExampleApplication : Application() {
super.onCreate()

// build Firework Android SDK v6 configuration
val config = FireworkSdkConfig.Builder(this)
.checksumRequired(false)
.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
.muteOnLaunch(true)
.build()
val config =
FireworkSdkConfig.Builder(this)
.checksumRequired(false)
.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
.muteOnLaunch(true)
.build()

// initialize Firework Android SDK v6
FireworkSdk.init(
Expand All @@ -28,7 +29,7 @@ class ExampleApplication : Application() {
},
onError = { initError ->
Log.e("FireworkSDK", "Error initializing Firework - $initError")
}
},
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MainActivity : ComponentActivity() {
FireworkComposeTheme {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.background
color = MaterialTheme.colors.background,
) {
VideoFeed()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Shapes
import androidx.compose.ui.unit.dp

val Shapes = Shapes(
small = RoundedCornerShape(4.dp),
medium = RoundedCornerShape(4.dp),
large = RoundedCornerShape(0.dp)
)
val Shapes =
Shapes(
small = RoundedCornerShape(4.dp),
medium = RoundedCornerShape(4.dp),
large = RoundedCornerShape(0.dp),
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,37 @@ import androidx.compose.material.darkColors
import androidx.compose.material.lightColors
import androidx.compose.runtime.Composable

private val DarkColorPalette = darkColors(
primary = Purple200,
primaryVariant = Purple700,
secondary = Teal200
)
private val DarkColorPalette =
darkColors(
primary = Purple200,
primaryVariant = Purple700,
secondary = Teal200,
)

private val LightColorPalette = lightColors(
primary = Purple500,
primaryVariant = Purple700,
secondary = Teal200,
background = White
)
private val LightColorPalette =
lightColors(
primary = Purple500,
primaryVariant = Purple700,
secondary = Teal200,
background = White,
)

@Composable
fun FireworkComposeTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
val colors = if (darkTheme) {
DarkColorPalette
} else {
LightColorPalette
}
fun FireworkComposeTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit,
) {
val colors =
if (darkTheme) {
DarkColorPalette
} else {
LightColorPalette
}

MaterialTheme(
colors = colors,
typography = Typography,
shapes = Shapes,
content = content
content = content,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp

// Set of Material typography styles to start with
val Typography = Typography(
body1 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp
)
val Typography =
Typography(
body1 =
TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
),
/* Other default text styles to override
button = TextStyle(
fontFamily = FontFamily.Default,
Expand All @@ -24,5 +26,5 @@ val Typography = Typography(
fontWeight = FontWeight.Normal,
fontSize = 12.sp
)
*/
)
*/
)
10 changes: 5 additions & 5 deletions compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.1.1" apply false
id("com.android.library") version "8.1.1" apply false
id("org.jetbrains.kotlin.android") version "1.8.10" apply false
id("org.jlleitschuh.gradle.ktlint") version "11.3.1" apply false
id("io.gitlab.arturbosch.detekt") version "1.22.0" apply false
id("com.android.application") version "8.2.0" apply false
id("com.android.library") version "8.2.0" 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") {
Expand Down
Binary file modified compose/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions compose/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Mon Nov 14 07:46:26 CST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions compose/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
26 changes: 15 additions & 11 deletions feed_integration/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,20 @@ android {

buildTypes {
defaultConfig {
buildConfigField("String", "FW_CLIENT_ID", "\"f6d6ec1275217f178cdff91363825cb390e038c1168f64f6efa23cb95ec6b325\"")
buildConfigField(
"String",
"FW_CLIENT_ID",
"\"f6d6ec1275217f178cdff91363825cb390e038c1168f64f6efa23cb95ec6b325\"",
)
buildConfigField("String", "FW_CHANNEL_ID", "\"7RXwK8k\"")
buildConfigField("String", "FW_PLAYLIST_ID", "\"g4lA0g\"")
}
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}

Expand Down Expand Up @@ -64,7 +71,7 @@ dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")

implementation("com.google.android.material:material:1.9.0")
implementation("com.google.android.material:material:1.11.0")

implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.6.10"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
Expand All @@ -73,12 +80,9 @@ dependencies {
implementation("com.github.bumptech.glide:glide:4.13.2")

// Firework SDK
val fireworkSdkVersion = "6.7.0"
implementation("com.firework:sdk:$fireworkSdkVersion")

// Glide (optional image loader)
implementation("com.firework.external.imageloading:glide:$fireworkSdkVersion")

// Picasso (optional image loader)
// implementation("com.firework.external.imageloading:picasso:$fireworkSdkVersion")
val fireworkBomVersion = "2023.11.01"
implementation(platform("com.firework:firework-bom:$fireworkBomVersion"))
implementation("com.firework:sdk")
implementation("com.firework.external.imageloading:glide") // Glide (optional image loader)
// implementation("com.firework.external.imageloading:picasso") // Picasso (optional image loader)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import com.firework.sdk.FireworkSdk
import com.firework.sdk.FireworkSdkConfig

class ExampleApplication : Application() {

override fun onCreate() {
super.onCreate()

// build Firework Android SDK v6 configuration
val config = FireworkSdkConfig.Builder(this)
.checksumRequired(false)
.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 implementation
.build()
val config =
FireworkSdkConfig.Builder(this)
.checksumRequired(false)
.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 implementation
.build()

// initialize Firework Android SDK v6
FireworkSdk.init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.firework.example.feedintegration.fragment.FragmentIntegrationActivity
import com.firework.example.feedintegration.recyclerview.RecyclerViewIntegrationActivity

class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import com.firework.viewoptions.baseOptions
import com.firework.viewoptions.viewOptions

class ActivityIntegrationActivity : AppCompatActivity() {

private lateinit var binding: ActivityActivityIntegrationBinding

override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -30,11 +29,12 @@ class ActivityIntegrationActivity : AppCompatActivity() {
private fun initVideoFeedView() {
val videoFeedView = binding.fwVideoFeedView

val viewOptions = viewOptions {
baseOptions {
feedResource(FeedResource.Discovery)
val viewOptions =
viewOptions {
baseOptions {
feedResource(FeedResource.Discovery)
}
}
}

videoFeedView.init(viewOptions)
}
Expand Down
Loading

0 comments on commit a6e50a0

Please sign in to comment.