diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/WebviewFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/WebviewFragment.kt index 4fa2ee92..cfbd0950 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/WebviewFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/WebviewFragment.kt @@ -29,11 +29,10 @@ class WebviewFragment : Fragment() { request: WebResourceRequest? ): Boolean { val requestUrl = request?.url.toString() - val repoUrl = if (requestUrl.startsWith("https://cs.repo")) { "https://" + requestUrl.substringAfter("?") } else if (URI(requestUrl).scheme == appStringRepo) { - "https://" + requestUrl.replaceFirst(appStringRepo, "https") + requestUrl.replaceFirst(appStringRepo, "https") } else { 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 8045c0fb..ffc99585 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 @@ -287,19 +287,19 @@ open class ResultFragment : ResultTrailerPlayer() { 2 -> { result_bookmark_fab?.isGone = result_bookmark_fab?.context?.isTvSettings() == true result_bookmark_fab?.extend() - if (result_bookmark_button?.context?.isTrueTvSettings() == true) { - when { - result_play_movie?.isVisible == true -> { - result_play_movie?.requestFocus() - } - result_resume_series_button?.isVisible == true -> { - result_resume_series_button?.requestFocus() - } - else -> { - result_bookmark_button?.requestFocus() - } - } - } + //if (result_bookmark_button?.context?.isTrueTvSettings() == true) { + // when { + // result_play_movie?.isVisible == true -> { + // result_play_movie?.requestFocus() + // } + // result_resume_series_button?.isVisible == true -> { + // result_resume_series_button?.requestFocus() + // } + // else -> { + // result_bookmark_button?.requestFocus() + // } + // } + //} result_loading?.isVisible = false result_finish_loading?.isVisible = true @@ -498,6 +498,17 @@ open class ResultFragment : ResultTrailerPlayer() { viewModel.updateWatchStatus(WatchType.values()[it]) } } + + result_bookmark_button?.setOnClickListener { fab -> + activity?.showBottomDialog( + WatchType.values().map { fab.context.getString(it.stringRes) }.toList(), + watchType.ordinal, + fab.context.getString(R.string.action_add_to_bookmarks), + showApply = false, + {}) { + viewModel.updateWatchStatus(WatchType.values()[it]) + } + } } // This is to band-aid FireTV navigation @@ -859,7 +870,7 @@ open class ResultFragment : ResultTrailerPlayer() { .contains(DubStatus.Dubbed) ) DubStatus.Dubbed else DubStatus.Subbed - result_bookmark_button?.isVisible = ctx.isTvSettings() + //result_bookmark_button?.isVisible = ctx.isTvSettings() val settingsManager = PreferenceManager.getDefaultSharedPreferences(ctx) val showFillers = diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentPhone.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentPhone.kt index fe3021b3..1cd3641d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentPhone.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragmentPhone.kt @@ -159,6 +159,7 @@ class ResultFragmentPhone : ResultFragment() { activity?.popCurrentPage() } + /* result_bookmark_button?.setOnClickListener { it.popupMenuNoIcons( items = WatchType.values() @@ -167,7 +168,7 @@ class ResultFragmentPhone : ResultFragment() { ) { viewModel.updateWatchStatus(WatchType.fromInternalId(this.itemId)) } - } + }*/ result_mini_sync?.adapter = ImageAdapter( R.layout.result_mini_image, @@ -300,8 +301,8 @@ class ResultFragmentPhone : ResultFragment() { if (result_season_button?.isVisible == true) if (result_resume_parent?.isVisible == true) setFocusUpAndDown(result_resume_series_button, result_season_button) - else - setFocusUpAndDown(result_bookmark_button, result_season_button) + //else + // setFocusUpAndDown(result_bookmark_button, result_season_button) } observe(viewModel.selectedDubStatus) { status -> @@ -311,8 +312,8 @@ class ResultFragmentPhone : ResultFragment() { if (result_season_button?.isVisible != true && result_episode_select?.isVisible != true) { if (result_resume_parent?.isVisible == true) setFocusUpAndDown(result_resume_series_button, result_dub_select) - else - setFocusUpAndDown(result_bookmark_button, result_dub_select) + //else + // setFocusUpAndDown(result_bookmark_button, result_dub_select) } } observe(viewModel.selectedRange) { range -> @@ -323,8 +324,8 @@ class ResultFragmentPhone : ResultFragment() { if (result_season_button?.isVisible != true) { if (result_resume_parent?.isVisible == true) setFocusUpAndDown(result_resume_series_button, result_episode_select) - else - setFocusUpAndDown(result_bookmark_button, result_episode_select) + //else + // setFocusUpAndDown(result_bookmark_button, result_episode_select) } } diff --git a/app/src/main/res/layout/fragment_result.xml b/app/src/main/res/layout/fragment_result.xml index 47f82f46..d26c1b5a 100644 --- a/app/src/main/res/layout/fragment_result.xml +++ b/app/src/main/res/layout/fragment_result.xml @@ -394,7 +394,7 @@ - + + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/result_root" + style="@style/DarkFragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="?attr/primaryBlackBackground"> + android:id="@+id/result_loading" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + android:orientation="vertical" + app:shimmer_auto_start="true" + app:shimmer_base_alpha="0.2" + app:shimmer_duration="@integer/loading_time" + app:shimmer_highlight_alpha="0.3" + tools:visibility="gone"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/result_padding" + android:orientation="vertical"> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginBottom="@dimen/loading_margin" + android:orientation="horizontal"> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginStart="@dimen/loading_margin" + android:layout_marginEnd="@dimen/loading_margin" + android:orientation="vertical"> @@ -54,9 +54,9 @@ + android:layout_width="match_parent" + android:layout_height="20dp" + tools:ignore="ContentDescription" /> @@ -67,202 +67,202 @@ + + + + + + - - - - - - + android:layout_margin="5dp" + android:gravity="center" + android:textColor="?attr/textColor" /> + android:id="@+id/result_finish_loading" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:visibility="gone" + tools:visibility="visible"> + android:layout_height="wrap_content" + android:background="?attr/primaryGrayBackground"> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="?attr/primaryBlackBackground" + android:orientation="vertical"> + android:id="@+id/result_trailer_loading" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:orientation="vertical" + android:visibility="gone" + app:shimmer_auto_start="true" + app:shimmer_base_alpha="0.2" + app:shimmer_duration="@integer/loading_time" + app:shimmer_highlight_alpha="0.3" + tools:visibility="gone"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/result_padding" + android:orientation="vertical"> + android:layout_width="match_parent" + android:layout_height="150dp" + android:background="@color/grayShimmer" + android:foreground="@drawable/outline_drawable" + app:cardCornerRadius="@dimen/loading_radius" /> + android:id="@+id/result_smallscreen_holder" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:descendantFocusability="blocksDescendants"> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:clipToPadding="false" + android:orientation="vertical" + android:paddingStart="@dimen/result_padding" + android:paddingEnd="@dimen/result_padding"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + android:layout_marginBottom="15dp" + android:orientation="horizontal" + android:visibility="visible"> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + android:layout_width="wrap_content" + android:layout_height="30dp" + android:layout_marginBottom="10dp" + android:orientation="horizontal"> + android:nextFocusDown="@id/result_description" + android:src="@drawable/ic_baseline_arrow_back_24" + app:tint="?attr/white" /> + android:id="@+id/result_title" + android:layout_width="wrap_content" + android:layout_height="30dp" + android:layout_marginBottom="5dp" + android:gravity="center_vertical" + android:maxLines="1" + android:textColor="?attr/textColor" + android:textSize="20sp" + android:textStyle="bold" + tools:text="The Perfect Run The Perfect Run" /> + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:itemSpacing="10dp"> + android:id="@+id/result_meta_site" + style="@style/SmallBlackButton" + android:layout_gravity="center_vertical" + tools:text="Gogoanime" /> + android:id="@+id/result_meta_type" + style="@style/ResultInfoText" + tools:text="Movie" /> + android:id="@+id/result_meta_year" + style="@style/ResultInfoText" + tools:text="2022" /> + android:id="@+id/result_meta_rating" + style="@style/ResultInfoText" + tools:text="Rated: 8.5/10.0" /> + android:id="@+id/result_meta_status" + style="@style/ResultInfoText" + tools:text="Ongoing" /> + android:id="@+id/result_meta_duration" + style="@style/ResultInfoText" + tools:text="121min" /> + android:id="@+id/result_description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:ellipsize="end" + android:foreground="@drawable/outline_drawable" + android:maxLength="1000" + android:nextFocusUp="@id/result_back" + android:nextFocusDown="@id/result_play_movie" + android:padding="5dp" + android:textColor="?attr/textColor" + android:textSize="15sp" + tools:text="Ryan Quicksave Romano is an eccentric adventurer with a strange power: he can create a save-point in time and redo his life whenever he dies. Arriving in New Rome, the glitzy capital of sin of a rebuilding Europe, he finds the city torn between mega-corporations, sponsored heroes, superpowered criminals, and true monsters. It's a time of chaos, where potions can grant the power to rule the world and dangers lurk everywhere. " /> + android:id="@+id/result_cast_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="5dp" + android:ellipsize="end" + android:maxLines="2" + android:textColor="?attr/grayTextColor" + android:textSize="15sp" + tools:text="Cast: Joe Ligma" /> + android:descendantFocusability="afterDescendants" + android:fadingEdge="horizontal" + android:focusable="false" + android:focusableInTouchMode="false" + android:nextFocusUp="@id/result_back" + android:nextFocusDown="@id/result_play_movie" + android:orientation="horizontal" + android:paddingTop="5dp" + android:requiresFadingEdge="horizontal" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:itemCount="2" + tools:listitem="@layout/cast_item" + tools:visibility="visible" /> + android:id="@+id/result_vpn" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="?attr/grayTextColor" + android:textSize="15sp" + tools:text="@string/vpn_torrent" /> + android:id="@+id/result_info" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="5dp" + android:textColor="?attr/grayTextColor" + android:textSize="15sp" + tools:text="@string/provider_info_meta" /> + android:id="@+id/result_no_episodes" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="5dp" + android:textColor="?attr/grayTextColor" + android:textSize="15sp" + tools:text="@string/no_episodes_found" /> + android:id="@+id/result_tag_holder" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + android:layout_marginBottom="10dp" + android:text="@string/result_tags" + android:textColor="?attr/textColor" + android:textSize="17sp" + android:textStyle="normal" + android:visibility="gone" /> + android:id="@+id/result_tag" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + android:id="@+id/result_coming_soon" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:gravity="center" + android:paddingTop="50dp" + android:text="@string/coming_soon" + android:textColor="?attr/textColor" + android:textSize="20sp" + android:textStyle="bold" + android:visibility="gone" /> + android:id="@+id/result_data_holder" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + android:layout_marginBottom="10dp" + android:text="@string/add_sync" + android:visibility="gone" + app:icon="@drawable/ic_baseline_add_24" /> + android:id="@+id/result_movie_parent" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="5dp" + android:orientation="horizontal" + tools:visibility="visible"> + android:layout_marginStart="0dp" + android:layout_marginEnd="5dp" + android:layout_marginBottom="10dp" + android:layout_weight="1" + android:minWidth="250dp" + android:nextFocusRight="@id/result_download_movie" + android:nextFocusUp="@id/result_cast_items" + android:nextFocusDown="@id/result_resume_series_button_play" + android:text="@string/play_movie_button" + android:visibility="visible" + app:icon="@drawable/ic_baseline_play_arrow_24"> + android:nextFocusRight="@id/result_bookmark_button" + android:id="@+id/result_movie_progress_downloaded_holder" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="5dp" + android:layout_marginEnd="5dp" + android:layout_weight="1" + android:minWidth="250dp"> - - - - - - - - - - - - - - - - - - + android:clickable="true" + android:focusable="true" + android:nextFocusLeft="@id/result_play_movie" + android:nextFocusUp="@id/result_cast_items" + android:nextFocusDown="@id/result_resume_series_button_play" - + android:visibility="visible" /> - + + + - - + tools:text="Downloading" /> + + + + + + + + + + + + + + + + + + android:id="@+id/result_resume_series_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:gravity="center" + android:paddingStart="10dp" + android:paddingEnd="10dp" + android:textColor="?attr/textColor" + android:textSize="17sp" + android:textStyle="bold" + tools:text="S1E1 Episode 1" /> + + + android:id="@+id/result_resume_progress_holder" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:paddingTop="10dp" + android:visibility="gone" + tools:visibility="visible"> + android:id="@+id/result_resume_series_progress" + style="?android:attr/progressBarStyleHorizontal" + android:layout_width="match_parent" + android:layout_height="20dp" + android:layout_gravity="end|center_vertical" + android:layout_weight="1" + android:indeterminate="false" + android:max="100" + android:progress="0" + android:progressBackgroundTint="?attr/colorPrimary" + android:visibility="visible" + tools:progress="50" + tools:visibility="visible" /> + + + + android:nextFocusUp="@id/result_resume_series_button_play" + android:nextFocusDown="@id/result_range_selection" + android:orientation="horizontal" + android:paddingBottom="10dp" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:listitem="@layout/result_selection" /> + android:nextFocusUp="@id/result_season_selection" + android:nextFocusDown="@id/result_dub_selection" + android:orientation="horizontal" + android:paddingBottom="10dp" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:listitem="@layout/result_selection" /> - - + android:nextFocusUp="@id/result_range_selection" + android:nextFocusDown="@id/result_episodes" + android:orientation="horizontal" + android:paddingBottom="10dp" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:listitem="@layout/result_selection" /> + + - - + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginEnd="20dp" + android:textColor="?attr/textColor" + android:textSize="17sp" + android:textStyle="normal" + tools:text="8 Episodes" /> + android:id="@+id/result_next_airing" + + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:textColor="?attr/grayTextColor" + android:textSize="17sp" + android:textStyle="normal" + tools:text="Episode 1022 will be released in" /> + + + android:id="@+id/result_episode_loading" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + android:layout_marginTop="15dp" + android:orientation="vertical" + app:shimmer_auto_start="true" + app:shimmer_base_alpha="0.2" + app:shimmer_duration="@integer/loading_time" + app:shimmer_highlight_alpha="0.3" + tools:visibility="gone"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> @@ -725,61 +744,61 @@ android:layout_height="50dp" />--> + android:id="@+id/result_episodes" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:clipToPadding="false" + android:nextFocusUp="@id/result_dub_selection" + android:nextFocusDown="@id/result_recommendations_filter_selection" + android:orientation="horizontal" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:listitem="@layout/result_episode" /> + android:id="@+id/result_recommendations_holder" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:paddingTop="10dp" + android:paddingBottom="10dp"> + android:nextFocusDown="@id/result_recommendations" + android:orientation="horizontal" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:itemCount="2" + tools:listitem="@layout/result_selection" /> + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:gravity="center_vertical" + android:text="@string/recommended" + android:textColor="?attr/textColor" + android:textSize="17sp" /> + android:layout_height="wrap_content" + android:background="?attr/primaryBlackBackground" + android:clipToPadding="false" + android:descendantFocusability="afterDescendants" + android:nextFocusUp="@id/result_recommendations_filter_selection" + android:orientation="vertical" + app:spanCount="8" + tools:listitem="@layout/search_result_grid" />