Skip to content

Commit 087b51f

Browse files
committed
Show bookmark toasts in demo app.
1 parent fcb32b5 commit 087b51f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

org.librarysimplified.audiobook.demo/src/main/java/org/librarysimplified/audiobook/demo/ExamplePlayerActivity.kt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,17 @@ class ExamplePlayerActivity : AppCompatActivity(R.layout.example_player_activity
174174
)
175175

176176
PlayerBookmarkModel.setBookmarks(bookmarkDatabase.bookmarkList(bookId))
177+
178+
PlayerUIThread.runOnUIThread {
179+
try {
180+
Toast.makeText(this, "" +
181+
"Created bookmark",
182+
Toast.LENGTH_LONG
183+
).show()
184+
} catch (e: Throwable) {
185+
// Don't care
186+
}
187+
}
177188
}
178189

179190
is PlayerEvent.PlayerEventDeleteBookmark -> {
@@ -189,6 +200,17 @@ class ExamplePlayerActivity : AppCompatActivity(R.layout.example_player_activity
189200
bookId,
190201
event.bookmark
191202
)
203+
204+
PlayerUIThread.runOnUIThread {
205+
try {
206+
Toast.makeText(this, "" +
207+
"Deleted bookmark",
208+
Toast.LENGTH_LONG
209+
).show()
210+
} catch (e: Throwable) {
211+
// Don't care
212+
}
213+
}
192214
}
193215

194216
is PlayerEvent.PlayerEventError,

0 commit comments

Comments
 (0)