diff --git a/compose/app/build.gradle.kts b/compose/app/build.gradle.kts index da4531c..10b85a4 100644 --- a/compose/app/build.gradle.kts +++ b/compose/app/build.gradle.kts @@ -29,7 +29,7 @@ android { buildConfigField( "String", "FW_CLIENT_ID", - "\"f6d6ec1275217f178cdff91363825cb390e038c1168f64f6efa23cb95ec6b325\"" + "\"f6d6ec1275217f178cdff91363825cb390e038c1168f64f6efa23cb95ec6b325\"", ) } @@ -37,7 +37,7 @@ android { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + "proguard-rules.pro", ) } } @@ -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")) @@ -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) } diff --git a/compose/app/src/main/java/com/firework/example/compose/ExampleApplication.kt b/compose/app/src/main/java/com/firework/example/compose/ExampleApplication.kt index b2cddb3..c27a65b 100644 --- a/compose/app/src/main/java/com/firework/example/compose/ExampleApplication.kt +++ b/compose/app/src/main/java/com/firework/example/compose/ExampleApplication.kt @@ -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( @@ -28,7 +29,7 @@ class ExampleApplication : Application() { }, onError = { initError -> Log.e("FireworkSDK", "Error initializing Firework - $initError") - } + }, ) } } diff --git a/compose/app/src/main/java/com/firework/example/compose/MainActivity.kt b/compose/app/src/main/java/com/firework/example/compose/MainActivity.kt index b674991..afe4b45 100644 --- a/compose/app/src/main/java/com/firework/example/compose/MainActivity.kt +++ b/compose/app/src/main/java/com/firework/example/compose/MainActivity.kt @@ -30,7 +30,7 @@ class MainActivity : ComponentActivity() { FireworkComposeTheme { Surface( modifier = Modifier.fillMaxSize(), - color = MaterialTheme.colors.background + color = MaterialTheme.colors.background, ) { VideoFeed() } diff --git a/compose/app/src/main/java/com/firework/example/compose/ui/theme/Shape.kt b/compose/app/src/main/java/com/firework/example/compose/ui/theme/Shape.kt index 378d348..2d58b55 100644 --- a/compose/app/src/main/java/com/firework/example/compose/ui/theme/Shape.kt +++ b/compose/app/src/main/java/com/firework/example/compose/ui/theme/Shape.kt @@ -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), + ) diff --git a/compose/app/src/main/java/com/firework/example/compose/ui/theme/Theme.kt b/compose/app/src/main/java/com/firework/example/compose/ui/theme/Theme.kt index 77d5811..072d629 100644 --- a/compose/app/src/main/java/com/firework/example/compose/ui/theme/Theme.kt +++ b/compose/app/src/main/java/com/firework/example/compose/ui/theme/Theme.kt @@ -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, ) } diff --git a/compose/app/src/main/java/com/firework/example/compose/ui/theme/Type.kt b/compose/app/src/main/java/com/firework/example/compose/ui/theme/Type.kt index e34a6a6..6913c74 100644 --- a/compose/app/src/main/java/com/firework/example/compose/ui/theme/Type.kt +++ b/compose/app/src/main/java/com/firework/example/compose/ui/theme/Type.kt @@ -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, @@ -24,5 +26,5 @@ val Typography = Typography( fontWeight = FontWeight.Normal, fontSize = 12.sp ) - */ -) + */ + ) diff --git a/compose/build.gradle.kts b/compose/build.gradle.kts index b943169..622be7e 100644 --- a/compose/build.gradle.kts +++ b/compose/build.gradle.kts @@ -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("clean") { diff --git a/compose/gradle/wrapper/gradle-wrapper.jar b/compose/gradle/wrapper/gradle-wrapper.jar index ccebba7..033e24c 100644 Binary files a/compose/gradle/wrapper/gradle-wrapper.jar and b/compose/gradle/wrapper/gradle-wrapper.jar differ diff --git a/compose/gradle/wrapper/gradle-wrapper.properties b/compose/gradle/wrapper/gradle-wrapper.properties index addba2d..62f495d 100644 --- a/compose/gradle/wrapper/gradle-wrapper.properties +++ b/compose/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/compose/gradlew b/compose/gradlew index 79a61d4..fcb6fca 100755 --- a/compose/gradlew +++ b/compose/gradlew @@ -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 @@ -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. @@ -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 diff --git a/feed_integration/app/build.gradle.kts b/feed_integration/app/build.gradle.kts index f0b5202..940a4fe 100644 --- a/feed_integration/app/build.gradle.kts +++ b/feed_integration/app/build.gradle.kts @@ -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", + ) } } @@ -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") @@ -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) } diff --git a/feed_integration/app/src/main/java/com/firework/example/feedintegration/ExampleApplication.kt b/feed_integration/app/src/main/java/com/firework/example/feedintegration/ExampleApplication.kt index d086d89..2bb0470 100644 --- a/feed_integration/app/src/main/java/com/firework/example/feedintegration/ExampleApplication.kt +++ b/feed_integration/app/src/main/java/com/firework/example/feedintegration/ExampleApplication.kt @@ -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( diff --git a/feed_integration/app/src/main/java/com/firework/example/feedintegration/MainActivity.kt b/feed_integration/app/src/main/java/com/firework/example/feedintegration/MainActivity.kt index df50575..beb3b44 100644 --- a/feed_integration/app/src/main/java/com/firework/example/feedintegration/MainActivity.kt +++ b/feed_integration/app/src/main/java/com/firework/example/feedintegration/MainActivity.kt @@ -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?) { diff --git a/feed_integration/app/src/main/java/com/firework/example/feedintegration/activity/ActivityIntegrationActivity.kt b/feed_integration/app/src/main/java/com/firework/example/feedintegration/activity/ActivityIntegrationActivity.kt index c09661b..d0a7174 100644 --- a/feed_integration/app/src/main/java/com/firework/example/feedintegration/activity/ActivityIntegrationActivity.kt +++ b/feed_integration/app/src/main/java/com/firework/example/feedintegration/activity/ActivityIntegrationActivity.kt @@ -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?) { @@ -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) } diff --git a/feed_integration/app/src/main/java/com/firework/example/feedintegration/addremove/AddRemoveIntegrationActivity.kt b/feed_integration/app/src/main/java/com/firework/example/feedintegration/addremove/AddRemoveIntegrationActivity.kt index e4902b2..edb57ad 100644 --- a/feed_integration/app/src/main/java/com/firework/example/feedintegration/addremove/AddRemoveIntegrationActivity.kt +++ b/feed_integration/app/src/main/java/com/firework/example/feedintegration/addremove/AddRemoveIntegrationActivity.kt @@ -15,7 +15,6 @@ import com.firework.viewoptions.baseOptions import com.firework.viewoptions.viewOptions class AddRemoveIntegrationActivity : AppCompatActivity() { - private lateinit var binding: ActivityAddRemoveIntegrationBinding private var videoFeedView: FwVideoFeedView? = null @@ -48,11 +47,12 @@ class AddRemoveIntegrationActivity : AppCompatActivity() { private fun addFeed() { val videoFeedView = FwVideoFeedView(this) - val viewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.Discovery) + val viewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.Discovery) + } } - } videoFeedView.init(viewOptions) diff --git a/feed_integration/app/src/main/java/com/firework/example/feedintegration/fragment/FeedViewFragment.kt b/feed_integration/app/src/main/java/com/firework/example/feedintegration/fragment/FeedViewFragment.kt index 19990a6..03c317c 100644 --- a/feed_integration/app/src/main/java/com/firework/example/feedintegration/fragment/FeedViewFragment.kt +++ b/feed_integration/app/src/main/java/com/firework/example/feedintegration/fragment/FeedViewFragment.kt @@ -22,14 +22,18 @@ class FeedViewFragment : Fragment() { return inflater.inflate(R.layout.fragment_feed_view, container, false) } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + override fun onViewCreated( + view: View, + savedInstanceState: Bundle?, + ) { super.onViewCreated(view, savedInstanceState) videoFeedView = view.findViewById(R.id.videoFeedView) - val viewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.Discovery) + val viewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.Discovery) + } } - } videoFeedView.init(viewOptions) } diff --git a/feed_integration/app/src/main/java/com/firework/example/feedintegration/fragment/FragmentIntegrationActivity.kt b/feed_integration/app/src/main/java/com/firework/example/feedintegration/fragment/FragmentIntegrationActivity.kt index 4c3fc7b..2a3f5c6 100644 --- a/feed_integration/app/src/main/java/com/firework/example/feedintegration/fragment/FragmentIntegrationActivity.kt +++ b/feed_integration/app/src/main/java/com/firework/example/feedintegration/fragment/FragmentIntegrationActivity.kt @@ -10,7 +10,6 @@ import com.firework.example.feedintegration.R import com.firework.example.feedintegration.databinding.ActivityFragmentIntegrationBinding class FragmentIntegrationActivity : AppCompatActivity() { - private lateinit var binding: ActivityFragmentIntegrationBinding override fun onCreate(savedInstanceState: Bundle?) { diff --git a/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/FeedListAdapter.kt b/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/FeedListAdapter.kt index c553356..0e1f2d3 100644 --- a/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/FeedListAdapter.kt +++ b/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/FeedListAdapter.kt @@ -19,8 +19,10 @@ class FeedListAdapter( private val onFeedViewStateListener: FeedViewStateListener, private val onFeedErrorListener: FwErrorListener, ) : RecyclerView.Adapter() { - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder { + override fun onCreateViewHolder( + parent: ViewGroup, + viewType: Int, + ): BaseViewHolder { val layoutInflater = LayoutInflater.from(parent.context) return when (viewType) { R.layout.feed_list_item -> { @@ -33,7 +35,10 @@ class FeedListAdapter( } } - override fun onBindViewHolder(holder: BaseViewHolder, position: Int) { + override fun onBindViewHolder( + holder: BaseViewHolder, + position: Int, + ) { val item = values[position] holder.bind(item) } @@ -54,15 +59,17 @@ class FeedListAdapter( inner class FeedItemViewHolder(view: View) : BaseViewHolder(view) { private var feedView: FwLifecycleAwareVideoFeedView? = null + override fun bind(item: ListItem) { // This check is needed to avoid calling init() every time view goes in and out of the view port if (feedView == null) { - val feedView: FwLifecycleAwareVideoFeedView = view.findViewById(R.id.feedView).apply { - init((item as FeedViewItem).viewOptions, lifecycle) - setOnErrorListener(onFeedErrorListener) - setOnFeedItemClickListener(onFeedItemClickListener) - setOnFeedViewStateListener(onFeedViewStateListener) - } + val feedView: FwLifecycleAwareVideoFeedView = + view.findViewById(R.id.feedView).apply { + init((item as FeedViewItem).viewOptions, lifecycle) + setOnErrorListener(onFeedErrorListener) + setOnFeedItemClickListener(onFeedItemClickListener) + setOnFeedViewStateListener(onFeedViewStateListener) + } this.feedView = feedView } } @@ -70,6 +77,7 @@ class FeedListAdapter( inner class TextItemViewHolder(view: View) : BaseViewHolder(view) { private val textView = view.findViewById(R.id.text) + override fun bind(item: ListItem) { textView.text = (item as TextItem).text } diff --git a/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/FeedListFragment.kt b/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/FeedListFragment.kt index 13d77cf..a3d8026 100644 --- a/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/FeedListFragment.kt +++ b/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/FeedListFragment.kt @@ -22,7 +22,6 @@ import com.firework.viewoptions.viewOptions import java.util.UUID class FeedListFragment : Fragment(), FeedItemClickListener, FwErrorListener, FeedViewStateListener { - override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -31,7 +30,10 @@ class FeedListFragment : Fragment(), FeedItemClickListener, FwErrorListener, Fee return inflater.inflate(R.layout.fragment_feed_list, container, false) } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + override fun onViewCreated( + view: View, + savedInstanceState: Bundle?, + ) { super.onViewCreated(view, savedInstanceState) val recyclerView = view.findViewById(R.id.rvList) recyclerView.layoutManager = LinearLayoutManager(context) @@ -39,11 +41,12 @@ class FeedListFragment : Fragment(), FeedItemClickListener, FwErrorListener, Fee } private fun getListItems(): List { - val playlistFeedViewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.Playlist(FW_CHANNEL_ID, FW_PLAYLIST_ID)) + val playlistFeedViewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.Playlist(FW_CHANNEL_ID, FW_PLAYLIST_ID)) + } } - } return listOf( TextItem(LOREN_IPSUM), TextItem(LOREN_IPSUM), @@ -68,6 +71,7 @@ class FeedListFragment : Fragment(), FeedItemClickListener, FwErrorListener, Fee companion object { fun newInstance() = FeedListFragment() + private val TAG = FeedListFragment::class.simpleName private const val LOREN_IPSUM = """ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, diff --git a/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/RecyclerViewIntegrationActivity.kt b/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/RecyclerViewIntegrationActivity.kt index 158fcc0..7893278 100644 --- a/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/RecyclerViewIntegrationActivity.kt +++ b/feed_integration/app/src/main/java/com/firework/example/feedintegration/recyclerview/RecyclerViewIntegrationActivity.kt @@ -10,7 +10,6 @@ import com.firework.example.feedintegration.R import com.firework.example.feedintegration.databinding.ActivityRecyclerViewIntegrationBinding class RecyclerViewIntegrationActivity : AppCompatActivity() { - private lateinit var binding: ActivityRecyclerViewIntegrationBinding override fun onCreate(savedInstanceState: Bundle?) { diff --git a/feed_integration/build.gradle.kts b/feed_integration/build.gradle.kts index 5f669bf..622be7e 100644 --- a/feed_integration/build.gradle.kts +++ b/feed_integration/build.gradle.kts @@ -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.0.2" apply false - id("com.android.library") version "8.0.2" 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("clean") { diff --git a/feed_integration/gradle/wrapper/gradle-wrapper.jar b/feed_integration/gradle/wrapper/gradle-wrapper.jar index ccebba7..033e24c 100644 Binary files a/feed_integration/gradle/wrapper/gradle-wrapper.jar and b/feed_integration/gradle/wrapper/gradle-wrapper.jar differ diff --git a/feed_integration/gradle/wrapper/gradle-wrapper.properties b/feed_integration/gradle/wrapper/gradle-wrapper.properties index 42defcc..62f495d 100644 --- a/feed_integration/gradle/wrapper/gradle-wrapper.properties +++ b/feed_integration/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/feed_integration/gradlew b/feed_integration/gradlew index 79a61d4..fcb6fca 100755 --- a/feed_integration/gradlew +++ b/feed_integration/gradlew @@ -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 @@ -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. @@ -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 diff --git a/feed_resources/app/build.gradle.kts b/feed_resources/app/build.gradle.kts index eb20908..6cda946 100644 --- a/feed_resources/app/build.gradle.kts +++ b/feed_resources/app/build.gradle.kts @@ -22,14 +22,21 @@ 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\"") buildConfigField("String", "FW_CONTENT_ID", "\"gle8W8\"") } release { isMinifyEnabled = false - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) } } @@ -65,7 +72,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") @@ -74,12 +81,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) } diff --git a/feed_resources/app/src/main/java/com/firework/example/feedresources/ExampleApplication.kt b/feed_resources/app/src/main/java/com/firework/example/feedresources/ExampleApplication.kt index 5a601a6..5d7796a 100644 --- a/feed_resources/app/src/main/java/com/firework/example/feedresources/ExampleApplication.kt +++ b/feed_resources/app/src/main/java/com/firework/example/feedresources/ExampleApplication.kt @@ -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(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(this)) // glide, picasso, or your implementation + .build() // initialize Firework Android SDK v6 FireworkSdk.init( diff --git a/feed_resources/app/src/main/java/com/firework/example/feedresources/MainActivity.kt b/feed_resources/app/src/main/java/com/firework/example/feedresources/MainActivity.kt index 750317b..2ec63cb 100644 --- a/feed_resources/app/src/main/java/com/firework/example/feedresources/MainActivity.kt +++ b/feed_resources/app/src/main/java/com/firework/example/feedresources/MainActivity.kt @@ -13,6 +13,7 @@ import com.firework.example.feedresources.sku.SkuActivity class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) diff --git a/feed_resources/app/src/main/java/com/firework/example/feedresources/channel/ChannelActivity.kt b/feed_resources/app/src/main/java/com/firework/example/feedresources/channel/ChannelActivity.kt index 17917f0..7ddba1b 100644 --- a/feed_resources/app/src/main/java/com/firework/example/feedresources/channel/ChannelActivity.kt +++ b/feed_resources/app/src/main/java/com/firework/example/feedresources/channel/ChannelActivity.kt @@ -14,7 +14,6 @@ import com.firework.viewoptions.baseOptions import com.firework.viewoptions.viewOptions class ChannelActivity : AppCompatActivity() { - private lateinit var binding: ActivityChannelBinding override fun onCreate(savedInstanceState: Bundle?) { @@ -38,11 +37,12 @@ class ChannelActivity : AppCompatActivity() { private fun initVideoFeedView() { val videoFeedView = binding.fwVideoFeedView - val viewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.Channel(channelId = FW_CHANNEL_ID)) + val viewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.Channel(channelId = FW_CHANNEL_ID)) + } } - } videoFeedView.init(viewOptions) } diff --git a/feed_resources/app/src/main/java/com/firework/example/feedresources/channelhashtags/ChannelHashtagsActivity.kt b/feed_resources/app/src/main/java/com/firework/example/feedresources/channelhashtags/ChannelHashtagsActivity.kt index 5658e7c..160e48e 100644 --- a/feed_resources/app/src/main/java/com/firework/example/feedresources/channelhashtags/ChannelHashtagsActivity.kt +++ b/feed_resources/app/src/main/java/com/firework/example/feedresources/channelhashtags/ChannelHashtagsActivity.kt @@ -43,11 +43,12 @@ class ChannelHashtagsActivity : AppCompatActivity() { private fun initVideoFeedView() { val videoFeedView = binding.fwVideoFeedView - val viewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.ChannelHashtag(channelId = FW_CHANNEL_ID, HASHTAG_FILTER_EXPRESSION)) + val viewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.ChannelHashtag(channelId = FW_CHANNEL_ID, HASHTAG_FILTER_EXPRESSION)) + } } - } videoFeedView.init(viewOptions) } @@ -56,11 +57,12 @@ class ChannelHashtagsActivity : AppCompatActivity() { binding.fwVideoFeedView.destroy() binding.feedContainer.removeAllViews() val videoFeedView = FwVideoFeedView(this) - val viewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.ChannelHashtag(channelId = FW_CHANNEL_ID, hashTagFilter)) + val viewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.ChannelHashtag(channelId = FW_CHANNEL_ID, hashTagFilter)) + } } - } binding.feedContainer.addView(videoFeedView) videoFeedView.init(viewOptions) } diff --git a/feed_resources/app/src/main/java/com/firework/example/feedresources/discovery/DiscoveryActivity.kt b/feed_resources/app/src/main/java/com/firework/example/feedresources/discovery/DiscoveryActivity.kt index 7cdacdd..0fa5bc2 100644 --- a/feed_resources/app/src/main/java/com/firework/example/feedresources/discovery/DiscoveryActivity.kt +++ b/feed_resources/app/src/main/java/com/firework/example/feedresources/discovery/DiscoveryActivity.kt @@ -13,7 +13,6 @@ import com.firework.viewoptions.baseOptions import com.firework.viewoptions.viewOptions class DiscoveryActivity : AppCompatActivity() { - private lateinit var binding: ActivityDiscoveryBinding override fun onCreate(savedInstanceState: Bundle?) { @@ -37,12 +36,13 @@ class DiscoveryActivity : AppCompatActivity() { private fun initVideoFeedView() { val videoFeedView = binding.fwVideoFeedView - val viewOptions = viewOptions { - baseOptions { - // Check Channel, Playlist, or Dynamic screens for other feed sources - feedResource(FeedResource.Discovery) + val viewOptions = + viewOptions { + baseOptions { + // Check Channel, Playlist, or Dynamic screens for other feed sources + feedResource(FeedResource.Discovery) + } } - } videoFeedView.init(viewOptions) } diff --git a/feed_resources/app/src/main/java/com/firework/example/feedresources/dynamiccontent/DynamicContentActivity.kt b/feed_resources/app/src/main/java/com/firework/example/feedresources/dynamiccontent/DynamicContentActivity.kt index 5ea06fb..fe87f19 100644 --- a/feed_resources/app/src/main/java/com/firework/example/feedresources/dynamiccontent/DynamicContentActivity.kt +++ b/feed_resources/app/src/main/java/com/firework/example/feedresources/dynamiccontent/DynamicContentActivity.kt @@ -14,7 +14,6 @@ import com.firework.viewoptions.baseOptions import com.firework.viewoptions.viewOptions class DynamicContentActivity : AppCompatActivity() { - private lateinit var binding: ActivityDynamicContentBinding override fun onCreate(savedInstanceState: Bundle?) { @@ -42,11 +41,12 @@ class DynamicContentActivity : AppCompatActivity() { val categories = listOf("Test category") val parameters = mapOf("category" to categories) val feedResource = FeedResource.DynamicContent(channelId = FW_CHANNEL_ID, parameters = parameters) - val viewOptions = viewOptions { - baseOptions { - feedResource(feedResource) + val viewOptions = + viewOptions { + baseOptions { + feedResource(feedResource) + } } - } videoFeedView.init(viewOptions) } diff --git a/feed_resources/app/src/main/java/com/firework/example/feedresources/playlist/PlaylistActivity.kt b/feed_resources/app/src/main/java/com/firework/example/feedresources/playlist/PlaylistActivity.kt index 2b7a178..416c44e 100644 --- a/feed_resources/app/src/main/java/com/firework/example/feedresources/playlist/PlaylistActivity.kt +++ b/feed_resources/app/src/main/java/com/firework/example/feedresources/playlist/PlaylistActivity.kt @@ -15,7 +15,6 @@ import com.firework.viewoptions.baseOptions import com.firework.viewoptions.viewOptions class PlaylistActivity : AppCompatActivity() { - private lateinit var binding: ActivityPlaylistBinding override fun onCreate(savedInstanceState: Bundle?) { @@ -39,11 +38,12 @@ class PlaylistActivity : AppCompatActivity() { private fun initVideoFeedView() { val videoFeedView = binding.fwVideoFeedView - val viewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.Playlist(channelId = FW_CHANNEL_ID, playlistId = FW_PLAYLIST_ID)) + val viewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.Playlist(channelId = FW_CHANNEL_ID, playlistId = FW_PLAYLIST_ID)) + } } - } videoFeedView.init(viewOptions) } diff --git a/feed_resources/app/src/main/java/com/firework/example/feedresources/singlecontent/SingleContentActivity.kt b/feed_resources/app/src/main/java/com/firework/example/feedresources/singlecontent/SingleContentActivity.kt index 2ccca69..af27b1b 100644 --- a/feed_resources/app/src/main/java/com/firework/example/feedresources/singlecontent/SingleContentActivity.kt +++ b/feed_resources/app/src/main/java/com/firework/example/feedresources/singlecontent/SingleContentActivity.kt @@ -14,7 +14,6 @@ import com.firework.viewoptions.baseOptions import com.firework.viewoptions.viewOptions class SingleContentActivity : AppCompatActivity() { - private lateinit var binding: ActivitySingleContentBinding override fun onCreate(savedInstanceState: Bundle?) { @@ -37,12 +36,13 @@ class SingleContentActivity : AppCompatActivity() { private fun initVideoFeedView() { val videoFeedView = binding.fwVideoFeedView - val viewOptions = viewOptions { - baseOptions { - // Check Channel, Playlist, or Dynamic screens for other feed sources - feedResource(FeedResource.SingleContent(FW_CONTENT_ID)) + val viewOptions = + viewOptions { + baseOptions { + // Check Channel, Playlist, or Dynamic screens for other feed sources + feedResource(FeedResource.SingleContent(FW_CONTENT_ID)) + } } - } videoFeedView.init(viewOptions) } diff --git a/feed_resources/app/src/main/java/com/firework/example/feedresources/sku/SkuActivity.kt b/feed_resources/app/src/main/java/com/firework/example/feedresources/sku/SkuActivity.kt index c41e6f8..0fee2cc 100644 --- a/feed_resources/app/src/main/java/com/firework/example/feedresources/sku/SkuActivity.kt +++ b/feed_resources/app/src/main/java/com/firework/example/feedresources/sku/SkuActivity.kt @@ -44,11 +44,12 @@ class SkuActivity : AppCompatActivity() { private fun initVideoFeedView() { val videoFeedView = binding.fwVideoFeedView - val viewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.Sku(channelId = FW_CHANNEL_ID, DEFAULT_IDS)) + val viewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.Sku(channelId = FW_CHANNEL_ID, DEFAULT_IDS)) + } } - } videoFeedView.init(viewOptions) } @@ -57,11 +58,12 @@ class SkuActivity : AppCompatActivity() { binding.fwVideoFeedView.destroy() binding.feedContainer.removeAllViews() val videoFeedView = FwVideoFeedView(this) - val viewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.Sku(channelId = FW_CHANNEL_ID, productIds = skuIds)) + val viewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.Sku(channelId = FW_CHANNEL_ID, productIds = skuIds)) + } } - } binding.feedContainer.addView(videoFeedView) videoFeedView.init(viewOptions) } diff --git a/feed_resources/build.gradle.kts b/feed_resources/build.gradle.kts index 5f669bf..622be7e 100644 --- a/feed_resources/build.gradle.kts +++ b/feed_resources/build.gradle.kts @@ -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.0.2" apply false - id("com.android.library") version "8.0.2" 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("clean") { diff --git a/feed_resources/gradle/wrapper/gradle-wrapper.jar b/feed_resources/gradle/wrapper/gradle-wrapper.jar index ccebba7..033e24c 100644 Binary files a/feed_resources/gradle/wrapper/gradle-wrapper.jar and b/feed_resources/gradle/wrapper/gradle-wrapper.jar differ diff --git a/feed_resources/gradle/wrapper/gradle-wrapper.properties b/feed_resources/gradle/wrapper/gradle-wrapper.properties index 42defcc..62f495d 100644 --- a/feed_resources/gradle/wrapper/gradle-wrapper.properties +++ b/feed_resources/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/feed_resources/gradlew b/feed_resources/gradlew index 79a61d4..fcb6fca 100755 --- a/feed_resources/gradlew +++ b/feed_resources/gradlew @@ -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 @@ -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. @@ -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 diff --git a/multi_host_livestream/app/build.gradle.kts b/multi_host_livestream/app/build.gradle.kts index 80bdd2a..181263f 100644 --- a/multi_host_livestream/app/build.gradle.kts +++ b/multi_host_livestream/app/build.gradle.kts @@ -71,15 +71,10 @@ 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") - - // Livestream player - implementation("com.firework.external.livestream:multiHostPlayer:$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) + implementation("com.firework.external.livestream:multiHostPlayer") // Livestream player } diff --git a/multi_host_livestream/app/src/main/java/com/firework/example/multihostlivestream/ExampleApplication.kt b/multi_host_livestream/app/src/main/java/com/firework/example/multihostlivestream/ExampleApplication.kt index b0e2e90..a5e568c 100644 --- a/multi_host_livestream/app/src/main/java/com/firework/example/multihostlivestream/ExampleApplication.kt +++ b/multi_host_livestream/app/src/main/java/com/firework/example/multihostlivestream/ExampleApplication.kt @@ -9,19 +9,19 @@ 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 - // Single-Host and Multi-Host Livestreams can be used together, and single-host will be used as a fallback if multi-host is missing - .addLivestreamPlayerInitializer(MultiHostLivestreamPlayerInitializer()) - .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 + // Single-Host and Multi-Host Livestreams can be used together, and single-host will be used as a fallback if multi-host is missing + .addLivestreamPlayerInitializer(MultiHostLivestreamPlayerInitializer()) + .build() // initialize Firework Android SDK v6 FireworkSdk.init( diff --git a/multi_host_livestream/app/src/main/java/com/firework/example/multihostlivestream/MainActivity.kt b/multi_host_livestream/app/src/main/java/com/firework/example/multihostlivestream/MainActivity.kt index 1ab6fec..49138f2 100644 --- a/multi_host_livestream/app/src/main/java/com/firework/example/multihostlivestream/MainActivity.kt +++ b/multi_host_livestream/app/src/main/java/com/firework/example/multihostlivestream/MainActivity.kt @@ -12,7 +12,6 @@ import com.firework.viewoptions.baseOptions import com.firework.viewoptions.viewOptions class MainActivity : AppCompatActivity() { - private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { @@ -38,11 +37,12 @@ class MainActivity : AppCompatActivity() { // Replace this playlist with one including MultiHost Livestream val playlistFeedResource = FeedResource.Playlist(FW_CHANNEL_ID, FW_PLAYLIST_ID) - val viewOptions = viewOptions { - baseOptions { - feedResource(playlistFeedResource) + val viewOptions = + viewOptions { + baseOptions { + feedResource(playlistFeedResource) + } } - } videoFeedView.init(viewOptions) } diff --git a/multi_host_livestream/build.gradle.kts b/multi_host_livestream/build.gradle.kts index 5f669bf..622be7e 100644 --- a/multi_host_livestream/build.gradle.kts +++ b/multi_host_livestream/build.gradle.kts @@ -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.0.2" apply false - id("com.android.library") version "8.0.2" 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("clean") { diff --git a/multi_host_livestream/gradle/wrapper/gradle-wrapper.jar b/multi_host_livestream/gradle/wrapper/gradle-wrapper.jar index ccebba7..033e24c 100644 Binary files a/multi_host_livestream/gradle/wrapper/gradle-wrapper.jar and b/multi_host_livestream/gradle/wrapper/gradle-wrapper.jar differ diff --git a/multi_host_livestream/gradle/wrapper/gradle-wrapper.properties b/multi_host_livestream/gradle/wrapper/gradle-wrapper.properties index 42defcc..62f495d 100644 --- a/multi_host_livestream/gradle/wrapper/gradle-wrapper.properties +++ b/multi_host_livestream/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/multi_host_livestream/gradlew b/multi_host_livestream/gradlew index 79a61d4..fcb6fca 100755 --- a/multi_host_livestream/gradlew +++ b/multi_host_livestream/gradlew @@ -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 @@ -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. @@ -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 diff --git a/picture_in_picture/app/build.gradle.kts b/picture_in_picture/app/build.gradle.kts index bc75e58..b78541d 100644 --- a/picture_in_picture/app/build.gradle.kts +++ b/picture_in_picture/app/build.gradle.kts @@ -22,11 +22,18 @@ android { buildTypes { defaultConfig { - buildConfigField("String", "FW_CLIENT_ID", "\"f6d6ec1275217f178cdff91363825cb390e038c1168f64f6efa23cb95ec6b325\"") + buildConfigField( + "String", + "FW_CLIENT_ID", + "\"f6d6ec1275217f178cdff91363825cb390e038c1168f64f6efa23cb95ec6b325\"", + ) } release { isMinifyEnabled = false - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) } } @@ -62,7 +69,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") @@ -71,12 +78,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) } diff --git a/picture_in_picture/app/src/main/java/com/firework/example/pictureinpicture/ExampleApplication.kt b/picture_in_picture/app/src/main/java/com/firework/example/pictureinpicture/ExampleApplication.kt index 213dd18..9f39044 100644 --- a/picture_in_picture/app/src/main/java/com/firework/example/pictureinpicture/ExampleApplication.kt +++ b/picture_in_picture/app/src/main/java/com/firework/example/pictureinpicture/ExampleApplication.kt @@ -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( diff --git a/picture_in_picture/app/src/main/java/com/firework/example/pictureinpicture/MainActivity.kt b/picture_in_picture/app/src/main/java/com/firework/example/pictureinpicture/MainActivity.kt index 9dba544..1d01ce4 100644 --- a/picture_in_picture/app/src/main/java/com/firework/example/pictureinpicture/MainActivity.kt +++ b/picture_in_picture/app/src/main/java/com/firework/example/pictureinpicture/MainActivity.kt @@ -15,7 +15,6 @@ import com.firework.viewoptions.playerOptions import com.firework.viewoptions.viewOptions class MainActivity : AppCompatActivity() { - private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { @@ -40,16 +39,17 @@ class MainActivity : AppCompatActivity() { private fun initVideoFeedView() { val videoFeedView = binding.fwVideoFeedView - val viewOptions = viewOptions { - baseOptions { - // Check Channel, Playlist, or Dynamic screens for other feed sources - feedResource(FeedResource.Discovery) - } + val viewOptions = + viewOptions { + baseOptions { + // Check Channel, Playlist, or Dynamic screens for other feed sources + feedResource(FeedResource.Discovery) + } - playerOptions { - enablePipMode(true) + playerOptions { + enablePipMode(true) + } } - } videoFeedView.init(viewOptions) } @@ -68,13 +68,14 @@ class MainActivity : AppCompatActivity() { } }, onError = { pipEnterError -> - val cause = when (pipEnterError) { - PipEnterError.SdkIsNotInitialized -> "SDK is not initialized yet" - PipEnterError.NoActivePlayer -> "there is no active player" - PipEnterError.NotSupported -> "PiP feature is not supported by device" - PipEnterError.DisabledByClient -> "PiP feature is not enabled in SDK config" - PipEnterError.DisabledByUser -> "PiP feature is disabled by user" - } + val cause = + when (pipEnterError) { + PipEnterError.SdkIsNotInitialized -> "SDK is not initialized yet" + PipEnterError.NoActivePlayer -> "there is no active player" + PipEnterError.NotSupported -> "PiP feature is not supported by device" + PipEnterError.DisabledByClient -> "PiP feature is not enabled in SDK config" + PipEnterError.DisabledByUser -> "PiP feature is disabled by user" + } Log.i(TAG, "Failed to enter PiP mode cause $cause") }, ) diff --git a/picture_in_picture/build.gradle.kts b/picture_in_picture/build.gradle.kts index 5f669bf..622be7e 100644 --- a/picture_in_picture/build.gradle.kts +++ b/picture_in_picture/build.gradle.kts @@ -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.0.2" apply false - id("com.android.library") version "8.0.2" 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("clean") { diff --git a/picture_in_picture/gradle/wrapper/gradle-wrapper.jar b/picture_in_picture/gradle/wrapper/gradle-wrapper.jar index ccebba7..033e24c 100644 Binary files a/picture_in_picture/gradle/wrapper/gradle-wrapper.jar and b/picture_in_picture/gradle/wrapper/gradle-wrapper.jar differ diff --git a/picture_in_picture/gradle/wrapper/gradle-wrapper.properties b/picture_in_picture/gradle/wrapper/gradle-wrapper.properties index 42defcc..62f495d 100644 --- a/picture_in_picture/gradle/wrapper/gradle-wrapper.properties +++ b/picture_in_picture/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/picture_in_picture/gradlew b/picture_in_picture/gradlew index 79a61d4..fcb6fca 100644 --- a/picture_in_picture/gradlew +++ b/picture_in_picture/gradlew @@ -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 @@ -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. @@ -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 diff --git a/share_link/app/build.gradle.kts b/share_link/app/build.gradle.kts index 5dfa3ea..da03fcd 100644 --- a/share_link/app/build.gradle.kts +++ b/share_link/app/build.gradle.kts @@ -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", + ) } } @@ -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") @@ -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) } diff --git a/share_link/app/src/main/java/com/firework/example/sharelink/ExampleApp.kt b/share_link/app/src/main/java/com/firework/example/sharelink/ExampleApp.kt index 40094a5..993a044 100644 --- a/share_link/app/src/main/java/com/firework/example/sharelink/ExampleApp.kt +++ b/share_link/app/src/main/java/com/firework/example/sharelink/ExampleApp.kt @@ -9,13 +9,14 @@ import com.firework.sdk.FireworkSdkConfig class ExampleApp : Application() { override fun onCreate() { super.onCreate() - val config = FireworkSdkConfig - .Builder(this) - .checksumRequired(false) - .clientId(BuildConfig.FW_CLIENT_ID) - .enableCache(true) - .imageLoader(GlideImageLoaderFactory.createInstance(context = this)) - .build() + val config = + FireworkSdkConfig + .Builder(this) + .checksumRequired(false) + .clientId(BuildConfig.FW_CLIENT_ID) + .enableCache(true) + .imageLoader(GlideImageLoaderFactory.createInstance(context = this)) + .build() FireworkSdk.init( config, onSuccess = { @@ -23,7 +24,7 @@ class ExampleApp : Application() { }, onError = { error -> Log.e("XXXX-init", "Init Failed: $error") - } + }, ) } } diff --git a/share_link/app/src/main/java/com/firework/example/sharelink/MainActivity.kt b/share_link/app/src/main/java/com/firework/example/sharelink/MainActivity.kt index 1d43633..98c18a4 100644 --- a/share_link/app/src/main/java/com/firework/example/sharelink/MainActivity.kt +++ b/share_link/app/src/main/java/com/firework/example/sharelink/MainActivity.kt @@ -11,7 +11,6 @@ import com.firework.viewoptions.playerOptions import com.firework.viewoptions.viewOptions class MainActivity : AppCompatActivity() { - private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { @@ -19,15 +18,16 @@ class MainActivity : AppCompatActivity() { binding = ActivityMainBinding.inflate(LayoutInflater.from(this)) setContentView(binding.root) - val viewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.Discovery) - } - playerOptions { - showShareButton(true) - shareBaseUrl(BASE_SHARE_URL) + val viewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.Discovery) + } + playerOptions { + showShareButton(true) + shareBaseUrl(BASE_SHARE_URL) + } } - } binding.fwVideoFeedView.init(viewOptions) } diff --git a/share_link/app/src/main/java/com/firework/example/sharelink/ShareLinkActivity.kt b/share_link/app/src/main/java/com/firework/example/sharelink/ShareLinkActivity.kt index 0b43e7f..60b5ab7 100644 --- a/share_link/app/src/main/java/com/firework/example/sharelink/ShareLinkActivity.kt +++ b/share_link/app/src/main/java/com/firework/example/sharelink/ShareLinkActivity.kt @@ -13,11 +13,12 @@ class ShareLinkActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - val viewOptions = viewOptions { - playerOptions { - shareBaseUrl(BASE_SHARE_URL) + val viewOptions = + viewOptions { + playerOptions { + shareBaseUrl(BASE_SHARE_URL) + } } - } val url = intent.data?.toString()!! val playerLaunchResult = FireworkSdk.startPlayer(viewOptions = viewOptions, url = url) diff --git a/share_link/build.gradle.kts b/share_link/build.gradle.kts index 5f669bf..622be7e 100644 --- a/share_link/build.gradle.kts +++ b/share_link/build.gradle.kts @@ -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.0.2" apply false - id("com.android.library") version "8.0.2" 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("clean") { diff --git a/share_link/gradle/wrapper/gradle-wrapper.jar b/share_link/gradle/wrapper/gradle-wrapper.jar index ccebba7..033e24c 100644 Binary files a/share_link/gradle/wrapper/gradle-wrapper.jar and b/share_link/gradle/wrapper/gradle-wrapper.jar differ diff --git a/share_link/gradle/wrapper/gradle-wrapper.properties b/share_link/gradle/wrapper/gradle-wrapper.properties index 42defcc..62f495d 100644 --- a/share_link/gradle/wrapper/gradle-wrapper.properties +++ b/share_link/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/share_link/gradlew b/share_link/gradlew index 79a61d4..fcb6fca 100755 --- a/share_link/gradlew +++ b/share_link/gradlew @@ -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 @@ -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. @@ -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 diff --git a/shopping/app/build.gradle.kts b/shopping/app/build.gradle.kts index a4eeb1e..ff20bbe 100644 --- a/shopping/app/build.gradle.kts +++ b/shopping/app/build.gradle.kts @@ -64,7 +64,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") @@ -73,12 +73,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) } diff --git a/shopping/app/src/main/java/com/firework/example/shopping/AddToCartModeActivity.kt b/shopping/app/src/main/java/com/firework/example/shopping/AddToCartModeActivity.kt index 5a3ee78..d1e26f8 100644 --- a/shopping/app/src/main/java/com/firework/example/shopping/AddToCartModeActivity.kt +++ b/shopping/app/src/main/java/com/firework/example/shopping/AddToCartModeActivity.kt @@ -36,7 +36,6 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.launch class AddToCartModeActivity : AppCompatActivity() { - private lateinit var binding: ActivityAddToCartModeBinding private val videoFeedView: FwVideoFeedView @@ -44,11 +43,12 @@ class AddToCartModeActivity : AppCompatActivity() { private val uiScope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate) - private val checkoutFragmentFactory = object : EmbeddedCartFactory { - override fun getInstance(): Fragment { - return ShoppingCartFragment() + private val checkoutFragmentFactory = + object : EmbeddedCartFactory { + override fun getInstance(): Fragment { + return ShoppingCartFragment() + } } - } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -65,11 +65,12 @@ class AddToCartModeActivity : AppCompatActivity() { private fun initVideoFeedView() { val playlistFeedResource = FeedResource.Playlist(channelId = FW_CHANNEL_ID, playlistId = FW_PLAYLIST_ID) - val viewOptions = viewOptions { - baseOptions { - feedResource(playlistFeedResource) + val viewOptions = + viewOptions { + baseOptions { + feedResource(playlistFeedResource) + } } - } videoFeedView.init(viewOptions) } @@ -86,10 +87,11 @@ class AddToCartModeActivity : AppCompatActivity() { shopping.setShoppingViewOptions( ShoppingViewOptions( theme = ShoppingTheme.DARK, - productDetailsOptions = ProductDetailsOptions( - linkButtonOptions = LinkButtonOptions(true), - shoppingCtaButtonOptions = ShoppingCtaButtonOptions(text = ShoppingCtaButtonOptions.Text.ADD_TO_CART), - ), + productDetailsOptions = + ProductDetailsOptions( + linkButtonOptions = LinkButtonOptions(true), + shoppingCtaButtonOptions = ShoppingCtaButtonOptions(text = ShoppingCtaButtonOptions.Text.ADD_TO_CART), + ), ), ) shopping.setShoppingCartBehaviour(Shopping.CartBehaviour.Embedded("some title")) @@ -130,7 +132,11 @@ class AddToCartModeActivity : AppCompatActivity() { } } - private fun hydrateProduct(product: Product, hydrator: ProductHydrator, position: Int) { + private fun hydrateProduct( + product: Product, + hydrator: ProductHydrator, + position: Int, + ) { product.id?.let { id -> hydrator.hydrate(id) { name("new product name") @@ -152,6 +158,7 @@ class AddToCartModeActivity : AppCompatActivity() { companion object { private const val LONG_OPERATION_DELAY = 2000L private const val ALLOW_PRODUCTS_HYDRATION = false + fun getIntent(context: Context): Intent { return Intent(context, AddToCartModeActivity::class.java) } diff --git a/shopping/app/src/main/java/com/firework/example/shopping/ExampleApplication.kt b/shopping/app/src/main/java/com/firework/example/shopping/ExampleApplication.kt index 77782e6..f284b1b 100644 --- a/shopping/app/src/main/java/com/firework/example/shopping/ExampleApplication.kt +++ b/shopping/app/src/main/java/com/firework/example/shopping/ExampleApplication.kt @@ -7,17 +7,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(config) diff --git a/shopping/app/src/main/java/com/firework/example/shopping/MainActivity.kt b/shopping/app/src/main/java/com/firework/example/shopping/MainActivity.kt index 0b42a0b..93253d3 100644 --- a/shopping/app/src/main/java/com/firework/example/shopping/MainActivity.kt +++ b/shopping/app/src/main/java/com/firework/example/shopping/MainActivity.kt @@ -6,6 +6,7 @@ import com.firework.example.shopping.databinding.ActivityMainBinding class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) diff --git a/shopping/app/src/main/java/com/firework/example/shopping/ShopNowModeActivity.kt b/shopping/app/src/main/java/com/firework/example/shopping/ShopNowModeActivity.kt index 002d966..bb3ecbf 100644 --- a/shopping/app/src/main/java/com/firework/example/shopping/ShopNowModeActivity.kt +++ b/shopping/app/src/main/java/com/firework/example/shopping/ShopNowModeActivity.kt @@ -56,11 +56,12 @@ class ShopNowModeActivity : AppCompatActivity(), Shopping.OnShoppingErrorListene private fun initVideoFeedView() { val playlistFeedResource = FeedResource.Playlist(channelId = FW_CHANNEL_ID, playlistId = FW_PLAYLIST_ID) - val viewOptions = viewOptions { - baseOptions { - feedResource(playlistFeedResource) + val viewOptions = + viewOptions { + baseOptions { + feedResource(playlistFeedResource) + } } - } videoFeedView.init(viewOptions) } @@ -79,17 +80,19 @@ class ShopNowModeActivity : AppCompatActivity(), Shopping.OnShoppingErrorListene shopping.setShoppingViewOptions( ShoppingViewOptions( theme = ShoppingTheme.DARK, - productDetailsOptions = ProductDetailsOptions( - linkButtonOptions = LinkButtonOptions(false), - shoppingCtaButtonOptions = ShoppingCtaButtonOptions(text = ShoppingCtaButtonOptions.Text.SHOP_NOW), - ), + productDetailsOptions = + ProductDetailsOptions( + linkButtonOptions = LinkButtonOptions(false), + shoppingCtaButtonOptions = ShoppingCtaButtonOptions(text = ShoppingCtaButtonOptions.Text.SHOP_NOW), + ), ), ) shopping.setOnCtaButtonClicked { _, _, productWebUrl -> val webpage: Uri = Uri.parse(productWebUrl) - val intent = Intent(Intent.ACTION_VIEW, webpage).apply { - flags = Intent.FLAG_ACTIVITY_NEW_TASK - } + val intent = + Intent(Intent.ACTION_VIEW, webpage).apply { + flags = Intent.FLAG_ACTIVITY_NEW_TASK + } startActivity(intent) FireworkSdk.enterPip() } @@ -109,7 +112,11 @@ class ShopNowModeActivity : AppCompatActivity(), Shopping.OnShoppingErrorListene } } - private fun hydrateProduct(product: Product, hydrator: ProductHydrator, position: Int) { + private fun hydrateProduct( + product: Product, + hydrator: ProductHydrator, + position: Int, + ) { product.id?.let { id -> hydrator.hydrate(id) { name("new product name") @@ -136,6 +143,7 @@ class ShopNowModeActivity : AppCompatActivity(), Shopping.OnShoppingErrorListene private val TAG = ShopNowModeActivity::class.java.simpleName private const val ALLOW_PRODUCTS_HYDRATION = false private const val LONG_OPERATION_DELAY = 2000L + fun getIntent(context: Context): Intent { return Intent(context, ShopNowModeActivity::class.java) } diff --git a/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingActivity.kt b/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingActivity.kt index 3cbd73b..b4581fd 100644 --- a/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingActivity.kt +++ b/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingActivity.kt @@ -8,7 +8,6 @@ import androidx.fragment.app.Fragment import com.firework.example.shopping.R class ShoppingActivity : AppCompatActivity(), ShoppingCartListener { - @Suppress("UNCHECKED_CAST", "SetTextI18n") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartAdapter.kt b/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartAdapter.kt index a76b5ea..c0e2bd1 100644 --- a/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartAdapter.kt +++ b/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartAdapter.kt @@ -20,13 +20,19 @@ internal class ShoppingCartAdapter( notifyDataSetChanged() } - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + override fun onCreateViewHolder( + parent: ViewGroup, + viewType: Int, + ): ViewHolder { val inflater = LayoutInflater.from(parent.context) val binding = ProductUnitItemBinding.inflate(inflater, parent, false) return HeaderViewHolder(binding) } - override fun onBindViewHolder(holder: ViewHolder, position: Int) { + override fun onBindViewHolder( + holder: ViewHolder, + position: Int, + ) { holder.bind(items[position]) } diff --git a/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartFragment.kt b/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartFragment.kt index 2b375b1..b6e9e07 100644 --- a/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartFragment.kt +++ b/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartFragment.kt @@ -31,7 +31,10 @@ class ShoppingCartFragment : Fragment() { return binding.root } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + override fun onViewCreated( + view: View, + savedInstanceState: Bundle?, + ) { super.onViewCreated(view, savedInstanceState) binding.rvList.adapter = checkoutAdapter binding.checkoutBtn.setOnClickListener { diff --git a/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartRepository.kt b/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartRepository.kt index 61964af..c2fbc15 100644 --- a/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartRepository.kt +++ b/shopping/app/src/main/java/com/firework/example/shopping/shoppingcart/ShoppingCartRepository.kt @@ -20,7 +20,10 @@ object ShoppingCartRepository { return orders.toMutableList().toList() } - fun add(productId: String, unitId: String) { + fun add( + productId: String, + unitId: String, + ) { val product = products.firstOrNull { it.id == productId } ?: return val unit = product.units.firstOrNull { it.id == unitId } ?: return orders.add(Order(product = product, unit = unit)) diff --git a/shopping/build.gradle.kts b/shopping/build.gradle.kts index 5f669bf..622be7e 100644 --- a/shopping/build.gradle.kts +++ b/shopping/build.gradle.kts @@ -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.0.2" apply false - id("com.android.library") version "8.0.2" 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("clean") { diff --git a/shopping/gradle/wrapper/gradle-wrapper.jar b/shopping/gradle/wrapper/gradle-wrapper.jar index ccebba7..033e24c 100644 Binary files a/shopping/gradle/wrapper/gradle-wrapper.jar and b/shopping/gradle/wrapper/gradle-wrapper.jar differ diff --git a/shopping/gradle/wrapper/gradle-wrapper.properties b/shopping/gradle/wrapper/gradle-wrapper.properties index 42defcc..62f495d 100644 --- a/shopping/gradle/wrapper/gradle-wrapper.properties +++ b/shopping/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/shopping/gradlew b/shopping/gradlew index 79a61d4..fcb6fca 100755 --- a/shopping/gradlew +++ b/shopping/gradlew @@ -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 @@ -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. @@ -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 diff --git a/single_host_livestream/app/build.gradle.kts b/single_host_livestream/app/build.gradle.kts index 4787bc7..18df95a 100644 --- a/single_host_livestream/app/build.gradle.kts +++ b/single_host_livestream/app/build.gradle.kts @@ -71,15 +71,10 @@ 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") - - // Livestream player - implementation("com.firework.external.livestream:singleHostPlayer:$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) + implementation("com.firework.external.livestream:singleHostPlayer") // Livestream player } diff --git a/single_host_livestream/app/src/main/java/com/firework/example/singlehostlivestream/ExampleApplication.kt b/single_host_livestream/app/src/main/java/com/firework/example/singlehostlivestream/ExampleApplication.kt index c19e757..5691644 100644 --- a/single_host_livestream/app/src/main/java/com/firework/example/singlehostlivestream/ExampleApplication.kt +++ b/single_host_livestream/app/src/main/java/com/firework/example/singlehostlivestream/ExampleApplication.kt @@ -9,19 +9,19 @@ 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 - // Single-Host and Multi-Host Livestreams can be used together, and single-host will be used as a fallback if multi-host is missing - .addLivestreamPlayerInitializer(SingleHostLivestreamPlayerInitializer()) - .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 + // Single-Host and Multi-Host Livestreams can be used together, and single-host will be used as a fallback if multi-host is missing + .addLivestreamPlayerInitializer(SingleHostLivestreamPlayerInitializer()) + .build() // initialize Firework Android SDK v6 FireworkSdk.init( diff --git a/single_host_livestream/app/src/main/java/com/firework/example/singlehostlivestream/MainActivity.kt b/single_host_livestream/app/src/main/java/com/firework/example/singlehostlivestream/MainActivity.kt index 1422195..af86eb3 100644 --- a/single_host_livestream/app/src/main/java/com/firework/example/singlehostlivestream/MainActivity.kt +++ b/single_host_livestream/app/src/main/java/com/firework/example/singlehostlivestream/MainActivity.kt @@ -12,7 +12,6 @@ import com.firework.viewoptions.baseOptions import com.firework.viewoptions.viewOptions class MainActivity : AppCompatActivity() { - private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { @@ -38,11 +37,12 @@ class MainActivity : AppCompatActivity() { // Replace this playlist with one including SingleHost Livestream val playlistFeedResource = FeedResource.Playlist(FW_CHANNEL_ID, FW_PLAYLIST_ID) - val viewOptions = viewOptions { - baseOptions { - feedResource(playlistFeedResource) + val viewOptions = + viewOptions { + baseOptions { + feedResource(playlistFeedResource) + } } - } videoFeedView.init(viewOptions) } diff --git a/single_host_livestream/build.gradle.kts b/single_host_livestream/build.gradle.kts index 5f669bf..622be7e 100644 --- a/single_host_livestream/build.gradle.kts +++ b/single_host_livestream/build.gradle.kts @@ -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.0.2" apply false - id("com.android.library") version "8.0.2" 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("clean") { diff --git a/single_host_livestream/gradle/wrapper/gradle-wrapper.jar b/single_host_livestream/gradle/wrapper/gradle-wrapper.jar index ccebba7..033e24c 100644 Binary files a/single_host_livestream/gradle/wrapper/gradle-wrapper.jar and b/single_host_livestream/gradle/wrapper/gradle-wrapper.jar differ diff --git a/single_host_livestream/gradle/wrapper/gradle-wrapper.properties b/single_host_livestream/gradle/wrapper/gradle-wrapper.properties index 42defcc..62f495d 100644 --- a/single_host_livestream/gradle/wrapper/gradle-wrapper.properties +++ b/single_host_livestream/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/single_host_livestream/gradlew b/single_host_livestream/gradlew index 79a61d4..fcb6fca 100755 --- a/single_host_livestream/gradlew +++ b/single_host_livestream/gradlew @@ -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 @@ -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. @@ -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 diff --git a/story_block/app/build.gradle.kts b/story_block/app/build.gradle.kts index 7c059aa..a83f6da 100644 --- a/story_block/app/build.gradle.kts +++ b/story_block/app/build.gradle.kts @@ -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", + ) } } @@ -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") @@ -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) } diff --git a/story_block/app/src/main/java/com/firework/example/storyblock/ExampleApplication.kt b/story_block/app/src/main/java/com/firework/example/storyblock/ExampleApplication.kt index a1fa27d..ebd5cc4 100644 --- a/story_block/app/src/main/java/com/firework/example/storyblock/ExampleApplication.kt +++ b/story_block/app/src/main/java/com/firework/example/storyblock/ExampleApplication.kt @@ -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( diff --git a/story_block/app/src/main/java/com/firework/example/storyblock/MainActivity.kt b/story_block/app/src/main/java/com/firework/example/storyblock/MainActivity.kt index f3c3519..37cb779 100644 --- a/story_block/app/src/main/java/com/firework/example/storyblock/MainActivity.kt +++ b/story_block/app/src/main/java/com/firework/example/storyblock/MainActivity.kt @@ -12,6 +12,7 @@ import com.firework.viewoptions.viewOptions class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) @@ -21,14 +22,15 @@ class MainActivity : AppCompatActivity() { binding.storyBlock.init( fragmentManager = supportFragmentManager, lifecycleOwner = this, - viewOptions = viewOptions { - baseOptions { - feedResource(FeedResource.Discovery) - } - playerOptions { - playerMode(PlayerMode.FIT_MODE) - } - }, + viewOptions = + viewOptions { + baseOptions { + feedResource(FeedResource.Discovery) + } + playerOptions { + playerMode(PlayerMode.FIT_MODE) + } + }, pauseWhenNotVisible = true, ) binding.storyBlock.setOnErrorListener { diff --git a/story_block/build.gradle.kts b/story_block/build.gradle.kts index 5f669bf..622be7e 100644 --- a/story_block/build.gradle.kts +++ b/story_block/build.gradle.kts @@ -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.0.2" apply false - id("com.android.library") version "8.0.2" 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("clean") { diff --git a/story_block/gradle/wrapper/gradle-wrapper.jar b/story_block/gradle/wrapper/gradle-wrapper.jar index ccebba7..033e24c 100644 Binary files a/story_block/gradle/wrapper/gradle-wrapper.jar and b/story_block/gradle/wrapper/gradle-wrapper.jar differ diff --git a/story_block/gradle/wrapper/gradle-wrapper.properties b/story_block/gradle/wrapper/gradle-wrapper.properties index 42defcc..62f495d 100644 --- a/story_block/gradle/wrapper/gradle-wrapper.properties +++ b/story_block/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/story_block/gradlew b/story_block/gradlew index 79a61d4..fcb6fca 100755 --- a/story_block/gradlew +++ b/story_block/gradlew @@ -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 @@ -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. @@ -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 diff --git a/view_options/app/build.gradle.kts b/view_options/app/build.gradle.kts index a5f4ef7..719f675 100644 --- a/view_options/app/build.gradle.kts +++ b/view_options/app/build.gradle.kts @@ -69,12 +69,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) } diff --git a/view_options/app/src/main/java/com/firework/example/viewoptions/ExampleApplication.kt b/view_options/app/src/main/java/com/firework/example/viewoptions/ExampleApplication.kt index 7a8aa68..4af893a 100644 --- a/view_options/app/src/main/java/com/firework/example/viewoptions/ExampleApplication.kt +++ b/view_options/app/src/main/java/com/firework/example/viewoptions/ExampleApplication.kt @@ -8,18 +8,18 @@ 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 - .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 implementation + .muteOnLaunch(true) + .build() // initialize Firework Android SDK v6 FireworkSdk.init( diff --git a/view_options/app/src/main/java/com/firework/example/viewoptions/MainActivity.kt b/view_options/app/src/main/java/com/firework/example/viewoptions/MainActivity.kt index 5a1665e..5c59534 100644 --- a/view_options/app/src/main/java/com/firework/example/viewoptions/MainActivity.kt +++ b/view_options/app/src/main/java/com/firework/example/viewoptions/MainActivity.kt @@ -32,7 +32,6 @@ import com.firework.viewoptions.viewOptions @Suppress("MagicNumber") class MainActivity : AppCompatActivity() { - private lateinit var binding: ActivityMainBinding private val videoFeedView: FwVideoFeedView @@ -73,78 +72,81 @@ class MainActivity : AppCompatActivity() { * Initialization method 3: * - Using [viewOptions] Kotlin DSL methods at runtime */ - val viewOptions = viewOptions { - adBadgeOptions { - adBadgeBackColor(getContextCompatColor(R.color.cyan)) - adBadgeIsHidden(false) - adBadgeLabel(AdBadgeTextType.SPONSORED) - adBadgeShowOnThumbnails(true) - adBadgeTextColor(getContextCompatColor(R.color.white)) - adBadgeTypeface(getContextCompatFont(R.font.roboto_black)) - } - - adOptions { - adsFetchTimeoutInSeconds(15) - vastAttributes(mapOf()) - } - - baseOptions { - feedResource(FeedResource.Discovery) - } - - ctaOptions { - ctaDelay(CtaDelay(0.2f, CtaDelayUnit.PERCENTAGE)) + val viewOptions = + viewOptions { + adBadgeOptions { + adBadgeBackColor(getContextCompatColor(R.color.cyan)) + adBadgeIsHidden(false) + adBadgeLabel(AdBadgeTextType.SPONSORED) + adBadgeShowOnThumbnails(true) + adBadgeTextColor(getContextCompatColor(R.color.white)) + adBadgeTypeface(getContextCompatFont(R.font.roboto_black)) + } + + adOptions { + adsFetchTimeoutInSeconds(15) + vastAttributes(mapOf()) + } + + baseOptions { + feedResource(FeedResource.Discovery) + } + + ctaOptions { + ctaDelay(CtaDelay(0.2f, CtaDelayUnit.PERCENTAGE)) + } + + layoutOptions { + backgroundColor(getContextCompatColor(R.color.black)) + columnCount(3) + feedLayout(FeedLayout.GRID) + feedTitlePosition(FeedTitlePosition.NESTED) + itemSpacing(dpToPx(4f)) + playIconWidth(dpToPx(24f)) + roundedCorner(true) + roundedCornerRadius(dpToPx(16f)) + showPlayIcon(true) + } + + playerOptions { + autoPlayOnComplete(true) + autoplay(true) + enablePipMode(true) + playerMode(PlayerMode.FIT_MODE) + showFireworkLogo(true) + showMuteButton(true) + showPlayPauseButtonInReplay(true) + showShareButton(true) + } + + titleOptions { + feedTitleBackgroundColor(getContextCompatColor(R.color.purple_transparent)) + // This is an example of how to set a gradient background for the feed title, Note: This will get priority over the above color + // feedTitleBackgroundDrawable( + // GradientDrawable( + // GradientDrawable.Orientation.TOP_BOTTOM, + // arrayOf(Color.BLUE, Color.CYAN, Color.MAGENTA).toIntArray() + // ), + // ) + feedTitleTextColor(getContextCompatColor(R.color.black)) + feedTitleTextNumberOfLines(1) + feedTitleTextPadding(dpToPx(8f)) + feedTitleTextSize(spToPx(14f)) + feedTitleTextTypeface(getContextCompatFont(R.font.roboto_regular)) + showFeedTitle(true) + } } - layoutOptions { - backgroundColor(getContextCompatColor(R.color.black)) - columnCount(3) - feedLayout(FeedLayout.GRID) - feedTitlePosition(FeedTitlePosition.NESTED) - itemSpacing(dpToPx(4f)) - playIconWidth(dpToPx(24f)) - roundedCorner(true) - roundedCornerRadius(dpToPx(16f)) - showPlayIcon(true) - } - - playerOptions { - autoPlayOnComplete(true) - autoplay(true) - enablePipMode(true) - playerMode(PlayerMode.FIT_MODE) - showFireworkLogo(true) - showMuteButton(true) - showPlayPauseButtonInReplay(true) - showShareButton(true) - } - - titleOptions { - feedTitleBackgroundColor(getContextCompatColor(R.color.purple_transparent)) - // This is an example of how to set a gradient background for the feed title, Note: This will get priority over the above color - // feedTitleBackgroundDrawable( - // GradientDrawable( - // GradientDrawable.Orientation.TOP_BOTTOM, - // arrayOf(Color.BLUE, Color.CYAN, Color.MAGENTA).toIntArray() - // ), - // ) - feedTitleTextColor(getContextCompatColor(R.color.black)) - feedTitleTextNumberOfLines(1) - feedTitleTextPadding(dpToPx(8f)) - feedTitleTextSize(spToPx(14f)) - feedTitleTextTypeface(getContextCompatFont(R.font.roboto_regular)) - showFeedTitle(true) - } - } - videoFeedView.init(viewOptions) } - private fun getContextCompatColor(@ColorRes colorId: Int) = - ContextCompat.getColor(this, colorId) + private fun getContextCompatColor( + @ColorRes colorId: Int, + ) = ContextCompat.getColor(this, colorId) - private fun getContextCompatFont(@FontRes fontId: Int) = - ResourcesCompat.getFont(this, fontId)!! + private fun getContextCompatFont( + @FontRes fontId: Int, + ) = ResourcesCompat.getFont(this, fontId)!! private fun setupVideoFeedViewCallbacks() { // All errors related to this video feed view can be collected using this callback to handle diff --git a/view_options/build.gradle.kts b/view_options/build.gradle.kts index 5f669bf..622be7e 100644 --- a/view_options/build.gradle.kts +++ b/view_options/build.gradle.kts @@ -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.0.2" apply false - id("com.android.library") version "8.0.2" 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("clean") {