Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ASDK-1572: Update story block sample app to use 6.7.0 #66

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion story_block/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ class MainActivity : AppCompatActivity() {
setContentView(binding.root)

binding.storyBlock.init(
supportFragmentManager,
lifecycle,
viewOptions {
fragmentManager = supportFragmentManager,
lifecycleOwner = this,
viewOptions = viewOptions {
baseOptions {
feedResource(FeedResource.Discovery)
}
playerOptions {
playerMode(PlayerMode.FIT_MODE)
}
},
binding.storyBlockContainer,
pauseWhenNotVisible = true,
)
binding.storyBlock.setOnErrorListener {
Log.i("StoryBlock-Fragment", it.toString())
Expand Down
21 changes: 7 additions & 14 deletions story_block/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

<FrameLayout
android:id="@+id/story_block_container"
<com.firework.storyblock.FwStoryBlockView
android:id="@+id/story_block"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="9:16"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<com.firework.storyblock.FwStoryBlockView
android:id="@+id/story_block"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</FrameLayout>
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand All @@ -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">

<com.google.android.material.button.MaterialButton
android:id="@+id/btn_play"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:text="@string/play" />

<com.google.android.material.button.MaterialButton
Expand Down