Skip to content

Commit fe5d59c

Browse files
committed
Fix select another resource
1 parent 1e562ae commit fe5d59c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

sample/src/main/java/dev/arkbuilders/sample/ScoreActivity.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,20 @@ class ScoreActivity : AppCompatActivity() {
8686
)
8787
scoreWidgetController.init(scoreStorage)
8888

89-
findViewById<ComposeView>(R.id.score_widget_horizontal).setContent {
89+
val horizontal = findViewById<ComposeView>(R.id.score_widget_horizontal)
90+
val vertical = findViewById<ComposeView>(R.id.score_widget_vertical)
91+
92+
horizontal.disposeComposition()
93+
horizontal.setContent {
9094
HorizontalScoreWidgetComposable(
95+
modifier = Modifier.padding(60.dp),
9196
size = DpSize(200.dp, 80.dp),
9297
controller = scoreWidgetController
9398
)
9499
}
95100

96-
findViewById<ComposeView>(R.id.score_widget_vertical).setContent {
101+
vertical.disposeComposition()
102+
vertical.setContent {
97103
VerticalScoreWidgetComposable(
98104
modifier = Modifier.padding(40.dp),
99105
size = DpSize(50.dp, 120.dp),

sample/src/main/res/layout/activity_score.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
android:layout_width="wrap_content"
3030
android:layout_height="wrap_content"
3131
android:layout_marginTop="50dp"
32-
android:padding="50dp"
3332
app:layout_constraintEnd_toEndOf="parent"
3433
app:layout_constraintStart_toStartOf="parent"
3534
app:layout_constraintTop_toBottomOf="@id/btn_pick_resource" />

0 commit comments

Comments
 (0)