From 0f5de62e92a25d2b959696a510f15c46cb2c7286 Mon Sep 17 00:00:00 2001 From: LagradOst Date: Sun, 23 May 2021 14:10:39 +0200 Subject: [PATCH] player stuff --- .../animeproviders/ShiroProvider.kt | 2 +- .../cloudstream3/ui/result/ResultFragment.kt | 1 + .../cloudstream3/ui/result/ResultViewModel.kt | 2 +- .../drawable/ic_baseline_aspect_ratio_24.xml | 5 + .../drawable/ic_baseline_brightness_7_24.xml | 5 + .../drawable/ic_baseline_playlist_play_24.xml | 8 + .../res/drawable/ic_baseline_speed_24.xml | 5 + .../res/drawable/ic_baseline_volume_up_24.xml | 5 + app/src/main/res/drawable/netflix_pause.xml | 12 + app/src/main/res/drawable/netflix_play.xml | 9 + .../main/res/drawable/netflix_skip_back.xml | 23 + .../res/drawable/netflix_skip_forward.xml | 23 + app/src/main/res/drawable/outline_card.xml | 21 + .../drawable/progress_drawable_vertical.xml | 18 + app/src/main/res/drawable/video_locked.xml | 31 + .../video_tap_button_always_white.xml | 10 + .../res/drawable/video_tap_button_skip.xml | 10 + app/src/main/res/drawable/video_unlocked.xml | 26 + app/src/main/res/layout/fragment_player.xml | 3 +- .../main/res/layout/player_custom_layout.xml | 679 ++++++++++++++++++ app/src/main/res/values/colors.xml | 6 +- app/src/main/res/values/dimens.xml | 1 + app/src/main/res/values/strings.xml | 2 + 23 files changed, 902 insertions(+), 5 deletions(-) create mode 100644 app/src/main/res/drawable/ic_baseline_aspect_ratio_24.xml create mode 100644 app/src/main/res/drawable/ic_baseline_brightness_7_24.xml create mode 100644 app/src/main/res/drawable/ic_baseline_playlist_play_24.xml create mode 100644 app/src/main/res/drawable/ic_baseline_speed_24.xml create mode 100644 app/src/main/res/drawable/ic_baseline_volume_up_24.xml create mode 100644 app/src/main/res/drawable/netflix_pause.xml create mode 100644 app/src/main/res/drawable/netflix_play.xml create mode 100644 app/src/main/res/drawable/netflix_skip_back.xml create mode 100644 app/src/main/res/drawable/netflix_skip_forward.xml create mode 100644 app/src/main/res/drawable/outline_card.xml create mode 100644 app/src/main/res/drawable/progress_drawable_vertical.xml create mode 100644 app/src/main/res/drawable/video_locked.xml create mode 100644 app/src/main/res/drawable/video_tap_button_always_white.xml create mode 100644 app/src/main/res/drawable/video_tap_button_skip.xml create mode 100644 app/src/main/res/drawable/video_unlocked.xml create mode 100644 app/src/main/res/layout/player_custom_layout.xml diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ShiroProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ShiroProvider.kt index 13ccf444..b8a4c662 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ShiroProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ShiroProvider.kt @@ -197,8 +197,8 @@ class ShiroProvider : MainAPI() { if (isDubbed) episodes else null, if (!isDubbed) episodes else null, status, - ArrayList(data.genres ?: ArrayList()), data.synopsis, + ArrayList(data.genres ?: ArrayList()), ArrayList(data.synonyms ?: ArrayList()), null, null, diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt index c595fe68..26528883 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt @@ -111,6 +111,7 @@ class ResultFragment : Fragment() { } observe(viewModel.episodes) { episodes -> + if(result_episodes == null) return@observe (result_episodes.adapter as EpisodeAdapter).cardList = episodes (result_episodes.adapter as EpisodeAdapter).notifyDataSetChanged() } diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel.kt index 98e4a004..03c46a73 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel.kt @@ -93,7 +93,7 @@ class ResultViewModel : ViewModel() { val allEpisodes: LiveData>> get() = _allEpisodes - private lateinit var _apiName: MutableLiveData + private var _apiName: MutableLiveData = MutableLiveData() fun loadEpisode(episode: ResultEpisode, callback: (Resource) -> Unit) { loadEpisode(episode.id, episode.data, callback) diff --git a/app/src/main/res/drawable/ic_baseline_aspect_ratio_24.xml b/app/src/main/res/drawable/ic_baseline_aspect_ratio_24.xml new file mode 100644 index 00000000..c7b8b5f5 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_aspect_ratio_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_brightness_7_24.xml b/app/src/main/res/drawable/ic_baseline_brightness_7_24.xml new file mode 100644 index 00000000..dc94884a --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_brightness_7_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_playlist_play_24.xml b/app/src/main/res/drawable/ic_baseline_playlist_play_24.xml new file mode 100644 index 00000000..6ff89010 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_playlist_play_24.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_baseline_speed_24.xml b/app/src/main/res/drawable/ic_baseline_speed_24.xml new file mode 100644 index 00000000..1add8a09 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_speed_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_volume_up_24.xml b/app/src/main/res/drawable/ic_baseline_volume_up_24.xml new file mode 100644 index 00000000..45bf404e --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_volume_up_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/netflix_pause.xml b/app/src/main/res/drawable/netflix_pause.xml new file mode 100644 index 00000000..1a8965b8 --- /dev/null +++ b/app/src/main/res/drawable/netflix_pause.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/netflix_play.xml b/app/src/main/res/drawable/netflix_play.xml new file mode 100644 index 00000000..00d17877 --- /dev/null +++ b/app/src/main/res/drawable/netflix_play.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/netflix_skip_back.xml b/app/src/main/res/drawable/netflix_skip_back.xml new file mode 100644 index 00000000..bb63e948 --- /dev/null +++ b/app/src/main/res/drawable/netflix_skip_back.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/netflix_skip_forward.xml b/app/src/main/res/drawable/netflix_skip_forward.xml new file mode 100644 index 00000000..a244c5b4 --- /dev/null +++ b/app/src/main/res/drawable/netflix_skip_forward.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/outline_card.xml b/app/src/main/res/drawable/outline_card.xml new file mode 100644 index 00000000..ef6f6bb5 --- /dev/null +++ b/app/src/main/res/drawable/outline_card.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/progress_drawable_vertical.xml b/app/src/main/res/drawable/progress_drawable_vertical.xml new file mode 100644 index 00000000..207196f5 --- /dev/null +++ b/app/src/main/res/drawable/progress_drawable_vertical.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/video_locked.xml b/app/src/main/res/drawable/video_locked.xml new file mode 100644 index 00000000..fe0be191 --- /dev/null +++ b/app/src/main/res/drawable/video_locked.xml @@ -0,0 +1,31 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/video_tap_button_always_white.xml b/app/src/main/res/drawable/video_tap_button_always_white.xml new file mode 100644 index 00000000..b36b807d --- /dev/null +++ b/app/src/main/res/drawable/video_tap_button_always_white.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/video_tap_button_skip.xml b/app/src/main/res/drawable/video_tap_button_skip.xml new file mode 100644 index 00000000..ac1bff2c --- /dev/null +++ b/app/src/main/res/drawable/video_tap_button_skip.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/video_unlocked.xml b/app/src/main/res/drawable/video_unlocked.xml new file mode 100644 index 00000000..5da2cba6 --- /dev/null +++ b/app/src/main/res/drawable/video_unlocked.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/app/src/main/res/layout/fragment_player.xml b/app/src/main/res/layout/fragment_player.xml index bf511fad..7bf599d7 100644 --- a/app/src/main/res/layout/fragment_player.xml +++ b/app/src/main/res/layout/fragment_player.xml @@ -11,8 +11,6 @@ android:screenOrientation="userLandscape" app:surface_type="texture_view" > - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index ebf51a5a..4d8ab435 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -7,7 +7,6 @@ #F53B66 #3700B3 #3b65f5 - #80FFFFFF #2B2C30 #1C1C20 @@ -28,4 +27,9 @@ #4DF53B66 #F54A3B #4DF54A3B + + #80FFFFFF + #66000000 + #C0121212 + #121212 \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index c94483bf..e8350c2c 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -4,4 +4,5 @@ 16dp 4dp 0dp + 2dp \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 58969e65..5e4b57b9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -13,4 +13,6 @@ More Options Play Episode Go back + Next episode + 10 \ No newline at end of file