Skip to content

Commit

Permalink
ASDK-1572: Update storyblock sample app to use 6.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OstapOpalynskyi-fw committed Sep 29, 2023
1 parent 7202933 commit 3e42908
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
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 @@ -17,7 +17,7 @@ class ExampleApplication : Application() {
.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
.imageLoader(GlideImageLoaderFactory.createInstance(this)) // glide, picasso, or your implementation
.build()

// initialize Firework Android SDK v6
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

0 comments on commit 3e42908

Please sign in to comment.