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

Bookmarks - Add search on podcast page #1211

Merged
merged 7 commits into from
Jul 28, 2023

Conversation

ashiagr
Copy link
Contributor

@ashiagr ashiagr commented Jul 27, 2023

Description

This adds bookmark search on the podcast page.

Testing Instructions

  1. Launch the app
  2. Play an episode and add a few bookmarks
  3. Go to the corresponding Podcast Details page
  4. Tap on bookmarks tab
  5. Search for bookmark title
  6. ✅ Notice that the bookmark is displayed
  7. Search for bookmark's episode title
  8. ✅ Notice that the bookmark for that episode is displayed

Screenshots or Screencast

search.mp4

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews

I have tested any UI changes...

  • with different themes
  • with a landscape orientation
  • with the device set to have a large display and font size
  • for accessibility with TalkBack

@ashiagr ashiagr marked this pull request as ready for review July 27, 2023 16:11
@ashiagr ashiagr requested a review from a team as a code owner July 27, 2023 16:11
Comment on lines +83 to +92
@Composable
fun SearchView(
bookmarkHeader: BookmarkHeader,
modifier: Modifier = Modifier,
) {
val hintText = stringResource(id = LR.string.bookmarks_search)
AndroidView(
modifier = modifier,
factory = { context ->
EpisodeSearchView(context).apply {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we haven't moved to material3 yet, which includes a search bar component for Compose, I have reused the existing search component in the Compose view.

Comment on lines 67 to 73
"""SELECT bookmarks.*
FROM bookmarks
LEFT JOIN podcast_episodes ON bookmarks.episode_uuid = podcast_episodes.uuid
WHERE bookmarks.podcast_uuid = :podcastUuid
AND UPPER(bookmarks.title) LIKE UPPER(:title)
OR UPPER(podcast_episodes.title) LIKE UPPER(:title)
AND deleted = :deleted"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Searching for both episode and bookmark titles while searching bookmarks for a podcast.

@ashiagr ashiagr force-pushed the task/podcast-page-bookmarks-search branch from 9875a3d to 0bd594e Compare July 28, 2023 05:01
@ashiagr ashiagr enabled auto-merge (squash) July 28, 2023 05:19
@ashiagr ashiagr merged commit f12f256 into main Jul 28, 2023
@ashiagr ashiagr deleted the task/podcast-page-bookmarks-search branch July 28, 2023 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants