From ed49946fb324c997383604782e77cea097a38918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sch=C3=BCller?= Date: Fri, 4 Feb 2022 21:02:54 +0100 Subject: [PATCH] feat: Added search WiP --- CI_LOCAL.md | 11 +- TODO.md | 2 +- .../data/repository/VideoRepositoryImpl.kt | 4 + .../domain/repository/VideoRepository.kt | 2 + .../domain/source/SearchPagingSource.kt | 63 ++++++ .../domain/use_case/SearchVideoListUseCase.kt | 27 +++ .../presentation/video/VideoListViewModel.kt | 44 ++++- .../video/components/SearchBar.kt | 184 ++++++++++++++++++ .../appBarTop/TopAppBarComponent.kt | 28 ++- .../video/events/VideoListEvent.kt | 3 + .../video/states/VideoSearchState.kt | 5 + 11 files changed, 358 insertions(+), 15 deletions(-) create mode 100644 app/src/main/java/net/schueller/peertube/feature_video/domain/source/SearchPagingSource.kt create mode 100644 app/src/main/java/net/schueller/peertube/feature_video/domain/use_case/SearchVideoListUseCase.kt create mode 100644 app/src/main/java/net/schueller/peertube/feature_video/presentation/video/components/SearchBar.kt create mode 100644 app/src/main/java/net/schueller/peertube/feature_video/presentation/video/states/VideoSearchState.kt diff --git a/CI_LOCAL.md b/CI_LOCAL.md index 446eb17..bd04023 100644 --- a/CI_LOCAL.md +++ b/CI_LOCAL.md @@ -1,4 +1,5 @@ -## Required Gitlab CI Variables +# Required Gitlab CI Variables +``` github_token # git hub token to push release to github GITLAB_TOKEN # token from gitlab user so the version bump can be commited google_play_service_account_api_key_json # google play store json @@ -6,8 +7,8 @@ signing_jks_file_hex # We store this binary file in a variable as hex with this signing_key_alias # Alias name of signing key signing_key_password # Key password signing_keystore_password # keystore password - -## Testing CI locally +``` +#### Testing CI locally ``` cd ${repo} @@ -22,10 +23,10 @@ sudo docker run --rm -v "$(pwd):/build/project" -w "/build/project" -it thorium sudo docker run --rm -v "$(pwd):/build/project" -w "/build/project" -it thorium bundle exec fastlane buildRelease ``` -# warning running this on your local repo may create files owned by root because of docker for example the build dir. +#### warning running this on your local repo may create files owned by root because of docker for example the build dir. These have to be removed with sudo -# Update fastlane +#### Update fastlane ``` sudo docker run --rm -v "$(pwd):/build/project" -w "/build/project" -it thorium bundle update sudo chown -R myuser * diff --git a/TODO.md b/TODO.md index 52a181d..e519496 100644 --- a/TODO.md +++ b/TODO.md @@ -34,4 +34,4 @@ Issues: - playback rotate on click doesn't re-hide buttons - Explore list is memory intensive, leak?? - Access Token refresh circular injection problem - +- app crashes when clicking items in background list while player is visible (minimode) diff --git a/app/src/main/java/net/schueller/peertube/feature_video/data/repository/VideoRepositoryImpl.kt b/app/src/main/java/net/schueller/peertube/feature_video/data/repository/VideoRepositoryImpl.kt index 1c6ed6b..5fc3d1f 100644 --- a/app/src/main/java/net/schueller/peertube/feature_video/data/repository/VideoRepositoryImpl.kt +++ b/app/src/main/java/net/schueller/peertube/feature_video/data/repository/VideoRepositoryImpl.kt @@ -21,6 +21,10 @@ class VideoRepositoryImpl @Inject constructor( return api.getVideos(start, count, sort, nsfw, filter, languages).toVideoList() } + override suspend fun searchVideos(start: Int, count: Int, sort: String?,nsfw: String?, searchQuery: String?, filter: String?, languages: Set?): List