From 28522c1551b2f92a056a6e917d863d57ab4d63a3 Mon Sep 17 00:00:00 2001 From: OstapOpalynskyi-fw <101661405+OstapOpalynskyi-fw@users.noreply.github.com> Date: Fri, 29 Sep 2023 18:27:16 +0200 Subject: [PATCH] ASDK-1572: Update story block sample app to use 6.7.0 (#66) **What** Update story block sample app to use 6.7.0 **Why** - ASDK-1572 **How** - Remove extra container from the layout. - Update init() function params --- story_block/app/build.gradle.kts | 2 +- .../example/storyblock/MainActivity.kt | 8 +++---- .../app/src/main/res/layout/activity_main.xml | 21 +++++++------------ 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/story_block/app/build.gradle.kts b/story_block/app/build.gradle.kts index 87e514a..7c059aa 100644 --- a/story_block/app/build.gradle.kts +++ b/story_block/app/build.gradle.kts @@ -73,7 +73,7 @@ dependencies { implementation("com.github.bumptech.glide:glide:4.13.2") // Firework SDK - val fireworkSdkVersion = "6.3.4" + val fireworkSdkVersion = "6.7.0" implementation("com.firework:sdk:$fireworkSdkVersion") // Glide (optional image loader) 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 ec14c77..f3c3519 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 @@ -19,9 +19,9 @@ class MainActivity : AppCompatActivity() { setContentView(binding.root) binding.storyBlock.init( - supportFragmentManager, - lifecycle, - viewOptions { + fragmentManager = supportFragmentManager, + lifecycleOwner = this, + viewOptions = viewOptions { baseOptions { feedResource(FeedResource.Discovery) } @@ -29,7 +29,7 @@ class MainActivity : AppCompatActivity() { playerMode(PlayerMode.FIT_MODE) } }, - binding.storyBlockContainer, + pauseWhenNotVisible = true, ) binding.storyBlock.setOnErrorListener { Log.i("StoryBlock-Fragment", it.toString()) diff --git a/story_block/app/src/main/res/layout/activity_main.xml b/story_block/app/src/main/res/layout/activity_main.xml index e7461c9..376df63 100644 --- a/story_block/app/src/main/res/layout/activity_main.xml +++ b/story_block/app/src/main/res/layout/activity_main.xml @@ -19,27 +19,20 @@ android:layout_height="0dp" android:layout_gravity="center" android:layout_marginVertical="16dp" + app:layout_constraintBottom_toTopOf="@+id/button_container" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintBottom_toTopOf="@+id/button_container" app:layout_constraintTop_toBottomOf="@+id/tv_top"> - - - - - + app:layout_constraintTop_toTopOf="parent" /> @@ -49,16 +42,16 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:padding="16dp" + app:layout_constraintBottom_toTopOf="@+id/tv_bottom" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintBottom_toTopOf="@+id/tv_bottom"> + app:layout_constraintStart_toStartOf="parent">