diff --git a/app/src/main/java/com/battlelancer/seriesguide/movies/details/MovieDetailsFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/movies/details/MovieDetailsFragment.kt
index 68b8514486..4f33cd9f24 100644
--- a/app/src/main/java/com/battlelancer/seriesguide/movies/details/MovieDetailsFragment.kt
+++ b/app/src/main/java/com/battlelancer/seriesguide/movies/details/MovieDetailsFragment.kt
@@ -108,38 +108,45 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract {
binding.textViewMovieGenresLabel.isGone = true
binding.labelMovieLastUpdated.isGone = true
- // trailer button
- binding.buttonMovieTrailer.setOnClickListener {
- trailerYoutubeId?.let { ServiceUtils.openYoutube(it, requireContext()) }
- }
- binding.buttonMovieTrailer.isGone = true
- binding.buttonMovieTrailer.isEnabled = false
-
- // similar movies button
- binding.buttonMovieSimilar.apply {
- setOnClickListener {
- movieDetails?.tmdbMovie()
- ?.title
- ?.let {
- startActivity(SimilarMoviesActivity.intent(requireContext(), tmdbId, it))
- }
+ // some action buttons
+ binding.containerMovieButtons.apply {
+ root.isGone = true
+ // trailer button
+ buttonMovieTrailer.apply {
+ setOnClickListener {
+ trailerYoutubeId?.let { ServiceUtils.openYoutube(it, requireContext()) }
+ }
+ isEnabled = false
+ }
+ // similar movies button
+ buttonMovieSimilar.apply {
+ setOnClickListener {
+ movieDetails?.tmdbMovie()
+ ?.title
+ ?.let {
+ startActivity(
+ SimilarMoviesActivity.intent(
+ requireContext(),
+ tmdbId,
+ it
+ )
+ )
+ }
+ }
}
- isGone = true
+ buttonMovieCheckIn.setOnClickListener { onButtonCheckInClick() }
+ TooltipCompat.setTooltipText(
+ buttonMovieCheckIn,
+ buttonMovieCheckIn.contentDescription
+ )
+ StreamingSearch.initButtons(
+ buttonMovieStreamingSearch,
+ buttonMovieStreamingSearchInfo,
+ parentFragmentManager
+ )
}
-
- // important action buttons
- binding.containerMovieButtons.root.isGone = true
- binding.containerMovieButtons.buttonMovieCheckIn.setOnClickListener { onButtonCheckInClick() }
- StreamingSearch.initButtons(
- binding.containerMovieButtons.buttonMovieStreamingSearch,
- binding.containerMovieButtons.buttonMovieStreamingSearchInfo,
- parentFragmentManager
- )
+ // ratings
binding.containerRatings.root.isGone = true
- TooltipCompat.setTooltipText(
- binding.containerMovieButtons.buttonMovieCheckIn,
- binding.containerMovieButtons.buttonMovieCheckIn.contentDescription
- )
// language button
binding.buttonMovieLanguage.isGone = true
@@ -151,9 +158,6 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract {
MovieLocalizationDialogFragment.show(parentFragmentManager)
}
- // comments button
- binding.buttonMovieComments.isGone = true
-
// cast and crew
setCastVisibility(false)
setCrewVisibility(false)
@@ -192,7 +196,7 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract {
model.watchProvider.observe(viewLifecycleOwner) { watchInfo ->
StreamingSearch.configureButton(
binding.containerMovieButtons.buttonMovieStreamingSearch,
- watchInfo
+ watchInfo, true
)
}
@@ -344,11 +348,6 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract {
}
binding.textViewMovieDate.text = releaseAndRuntime.toString()
- // show trailer button (but trailer is loaded separately, just for animation)
- binding.buttonMovieTrailer.isGone = false
- // movie title should be available now, can show similar movies button
- binding.buttonMovieSimilar.isGone = false
-
// hide check-in if not connected to trakt or hexagon is enabled
val isConnectedToTrakt = TraktCredentials.get(requireContext()).hasCredentials()
val hideCheckIn = !isConnectedToTrakt || HexagonSettings.isEnabled(requireContext())
@@ -437,7 +436,18 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract {
}
}
- // show button bar
+ // trakt comments link
+ binding.containerMovieButtons.buttonMovieComments.apply {
+ setOnClickListener { v ->
+ val tmdbId = tmdbId
+ if (tmdbId > 0) {
+ val i = TraktCommentsActivity.intentMovie(requireContext(), movieTitle, tmdbId)
+ Utils.startActivityWithAnimation(activity, i, v)
+ }
+ }
+ }
+
+ // show buttons after configuring them
binding.containerMovieButtons.root.isGone = false
// language button
@@ -496,16 +506,6 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract {
binding.textMovieLastUpdated.text =
TimeTools.formatToLocalDateAndTime(requireContext(), movieDetails.lastUpdatedMillis)
- // trakt comments link
- binding.buttonMovieComments.setOnClickListener { v ->
- val tmdbId = tmdbId
- if (tmdbId > 0) {
- val i = TraktCommentsActivity.intentMovie(requireContext(), movieTitle, tmdbId)
- Utils.startActivityWithAnimation(activity, i, v)
- }
- }
- binding.buttonMovieComments.isGone = false
-
// load poster, cache on external storage
if (tmdbMovie.poster_path.isNullOrEmpty()) {
binding.frameLayoutMoviePoster.isClickable = false
@@ -791,7 +791,7 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract {
) {
if (videoId != null) {
this@MovieDetailsFragment.trailerYoutubeId = videoId
- binding.buttonMovieTrailer.isEnabled = true
+ binding.containerMovieButtons.buttonMovieTrailer.isEnabled = true
}
}
diff --git a/app/src/main/res/layout-w1024dp/fragment_movie.xml b/app/src/main/res/layout-w1024dp/fragment_movie.xml
index 45760442e6..1a501f77fb 100644
--- a/app/src/main/res/layout-w1024dp/fragment_movie.xml
+++ b/app/src/main/res/layout-w1024dp/fragment_movie.xml
@@ -1,4 +1,8 @@
+
+
+
+
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout-w590dp/fragment_movie.xml b/app/src/main/res/layout-w590dp/fragment_movie.xml
index 560c7f51bd..fb6a0d9ce3 100644
--- a/app/src/main/res/layout-w590dp/fragment_movie.xml
+++ b/app/src/main/res/layout-w590dp/fragment_movie.xml
@@ -1,7 +1,11 @@
+
+
+
+
+ android:paddingTop="@dimen/large_padding"
+ android:paddingBottom="@dimen/large_padding">
-
-
-
-
+ android:layout_below="@+id/textViewMovieDate"
+ android:layout_marginTop="8dp"
+ android:layout_toEndOf="@id/frameLayoutMoviePoster" />
@@ -155,8 +138,8 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/large_padding"
- android:layout_marginRight="@dimen/large_padding"
android:layout_marginTop="@dimen/large_padding"
+ android:layout_marginRight="@dimen/large_padding"
android:background="?attr/sgColorDivider" />
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ app:icon="@drawable/ic_play_arrow_black_24dp" />
-
+
+ android:insetLeft="0dp"
+ android:insetRight="8dp"
+ app:icon="@drawable/ic_settings_control_24dp" />
diff --git a/app/src/main/res/layout/fragment_movie.xml b/app/src/main/res/layout/fragment_movie.xml
index fc506145cb..930856bfbb 100644
--- a/app/src/main/res/layout/fragment_movie.xml
+++ b/app/src/main/res/layout/fragment_movie.xml
@@ -1,4 +1,8 @@
+
+
+
+
-
-
-
-
-
-
-
-
-
-