diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/episodes/EpisodeDetailsFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/episodes/EpisodeDetailsFragment.kt
index eadb765867..e4650b03da 100644
--- a/app/src/main/java/com/battlelancer/seriesguide/shows/episodes/EpisodeDetailsFragment.kt
+++ b/app/src/main/java/com/battlelancer/seriesguide/shows/episodes/EpisodeDetailsFragment.kt
@@ -128,31 +128,32 @@ class EpisodeDetailsFragment : Fragment(), EpisodeActionsContract {
bindingRatings!!.textViewRatingsRange.text = getString(R.string.format_rating_range, 10)
- StreamingSearch.initButtons(
- bindingButtons!!.buttonEpisodeStreamingSearch,
- bindingButtons!!.buttonEpisodeStreamingSearchInfo,
- parentFragmentManager
- )
-
- // other bottom buttons
- bindingBottom!!.buttonEpisodeShare.setOnClickListener { shareEpisode() }
- bindingBottom!!.buttonEpisodeCalendar.setOnClickListener {
- val show = show
- val episode = episode
- if (show != null && episode != null) {
- ShareUtils.suggestCalendarEvent(
- requireContext(),
- show.title,
- TextTools.getNextEpisodeString(
+ // Episode action buttons
+ bindingButtons!!.apply {
+ buttonEpisodeShare.setOnClickListener { shareEpisode() }
+ buttonEpisodeCalendar.setOnClickListener {
+ val show = show
+ val episode = episode
+ if (show != null && episode != null) {
+ ShareUtils.suggestCalendarEvent(
requireContext(),
- episode.season,
- episode.number,
- episodeTitle
- ),
- episode.firstReleasedMs,
- show.runtime
- )
+ show.title,
+ TextTools.getNextEpisodeString(
+ requireContext(),
+ episode.season,
+ episode.number,
+ episodeTitle
+ ),
+ episode.firstReleasedMs,
+ show.runtime
+ )
+ }
}
+ StreamingSearch.initButtons(
+ buttonEpisodeStreamingSearch,
+ buttonEpisodeStreamingSearchInfo,
+ parentFragmentManager
+ )
}
// set up long-press to copy text to clipboard (d-pad friendly vs text selection)
@@ -193,7 +194,7 @@ class EpisodeDetailsFragment : Fragment(), EpisodeActionsContract {
if (watchInfo != null && b != null) {
StreamingSearch.configureButton(
b.includeButtons.buttonEpisodeStreamingSearch,
- watchInfo
+ watchInfo, replaceButtonText = true
)
}
}
@@ -611,6 +612,16 @@ class EpisodeDetailsFragment : Fragment(), EpisodeActionsContract {
)
)
}
+
+ // Trakt comments
+ bindingButtons.buttonEpisodeComments.setOnClickListener { v: View? ->
+ val episodeId = episodeId
+ if (episodeId > 0) {
+ val intent =
+ TraktCommentsActivity.intentEpisode(requireContext(), episodeTitle, episodeId)
+ Utils.startActivityWithAnimation(requireActivity(), intent, v)
+ }
+ }
}
private fun updateSecondaryButtons(episode: SgEpisode2, show: SgShow2) {
@@ -638,16 +649,6 @@ class EpisodeDetailsFragment : Fragment(), EpisodeActionsContract {
TmdbTools.buildEpisodeUrl(show.tmdbId, episode.season, episode.number)
)
}
-
- // Trakt comments
- bindingBottom.buttonEpisodeComments.setOnClickListener { v: View? ->
- val episodeId = episodeId
- if (episodeId > 0) {
- val intent =
- TraktCommentsActivity.intentEpisode(requireContext(), episodeTitle, episodeId)
- Utils.startActivityWithAnimation(requireActivity(), intent, v)
- }
- }
}
private fun loadTraktRatings() {
diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/overview/OverviewFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/overview/OverviewFragment.kt
index 06ec12d959..129cbc8d4b 100644
--- a/app/src/main/java/com/battlelancer/seriesguide/shows/overview/OverviewFragment.kt
+++ b/app/src/main/java/com/battlelancer/seriesguide/shows/overview/OverviewFragment.kt
@@ -172,6 +172,15 @@ class OverviewFragment() : Fragment(), EpisodeActionsContract {
buttonEpisodeWatched.setOnClickListener { onButtonWatchedClick() }
buttonEpisodeCollected.setOnClickListener { onButtonCollectedClick() }
buttonEpisodeSkip.setOnClickListener { onButtonSkipClicked() }
+ buttonEpisodeShare.setOnClickListener { shareEpisode() }
+ buttonEpisodeCalendar.setOnClickListener { createCalendarEvent() }
+ buttonEpisodeComments.setOnClickListener {
+ onButtonCommentsClick(buttonEpisodeComments)
+ }
+ initButtons(
+ buttonEpisodeStreamingSearch, buttonEpisodeStreamingSearchInfo,
+ parentFragmentManager
+ )
TooltipCompat.setTooltipText(
buttonEpisodeCheckin,
@@ -185,10 +194,6 @@ class OverviewFragment() : Fragment(), EpisodeActionsContract {
buttonEpisodeSkip,
buttonEpisodeSkip.contentDescription
)
- initButtons(
- buttonEpisodeStreamingSearch, buttonEpisodeStreamingSearchInfo,
- parentFragmentManager
- )
}
// ratings
@@ -201,14 +206,6 @@ class OverviewFragment() : Fragment(), EpisodeActionsContract {
textViewRatingsRange.text = getString(R.string.format_rating_range, 10)
}
- with(includeServices.includeMore) {
- buttonEpisodeShare.setOnClickListener { shareEpisode() }
- buttonEpisodeCalendar.setOnClickListener { createCalendarEvent() }
- buttonEpisodeComments.setOnClickListener {
- onButtonCommentsClick(buttonEpisodeComments)
- }
- }
-
// set up long-press to copy text to clipboard (d-pad friendly vs text selection)
textViewEpisodeDescription.copyTextToClipboardOnLongClick()
textGuestStars.copyTextToClipboardOnLongClick()
@@ -244,7 +241,7 @@ class OverviewFragment() : Fragment(), EpisodeActionsContract {
this.binding?.let {
StreamingSearch.configureButton(
it.includeButtons.buttonEpisodeStreamingSearch,
- watchInfo
+ watchInfo, replaceButtonText = true
)
}
}
@@ -527,18 +524,15 @@ class OverviewFragment() : Fragment(), EpisodeActionsContract {
}
// dvd number
- var isShowingMeta = ViewTools.setLabelValueOrHide(
+ ViewTools.setLabelValueOrHide(
binding.labelDvdNumber, binding.textDvdNumber, episode.dvdNumber
)
// guest stars
- isShowingMeta = isShowingMeta or ViewTools.setLabelValueOrHide(
+ ViewTools.setLabelValueOrHide(
binding.labelGuestStars,
binding.textGuestStars,
TextTools.splitPipeSeparatedStrings(episode.guestStars)
)
- // hide divider if no meta is visible
- binding.dividerOverviewEpisodeDetails.visibility =
- if (isShowingMeta) View.VISIBLE else View.GONE
// Trakt rating
binding.includeRatings.also {
diff --git a/app/src/main/res/layout/buttons_episode.xml b/app/src/main/res/layout/buttons_episode.xml
index 62c54fec5d..68fa694dc2 100644
--- a/app/src/main/res/layout/buttons_episode.xml
+++ b/app/src/main/res/layout/buttons_episode.xml
@@ -1,5 +1,8 @@
+
+
+
-
-
-
-
-
-
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="16dp">
+
+
+
+
+
+
+
+
+
+
+
+
+ app:iconGravity="start" />
-
+
+ android:insetLeft="0dp"
+ android:insetRight="8dp"
+ app:icon="@drawable/ic_settings_control_24dp" />
diff --git a/app/src/main/res/layout/buttons_episode_more.xml b/app/src/main/res/layout/buttons_episode_more.xml
index 5ecb1ce5dd..1a6f01f7e3 100644
--- a/app/src/main/res/layout/buttons_episode_more.xml
+++ b/app/src/main/res/layout/buttons_episode_more.xml
@@ -1,66 +1,55 @@
+
+
+
-
+
+
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/buttons_services.xml b/app/src/main/res/layout/buttons_services.xml
index ba274c2f7f..443e0e7a35 100644
--- a/app/src/main/res/layout/buttons_services.xml
+++ b/app/src/main/res/layout/buttons_services.xml
@@ -3,25 +3,22 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:paddingTop="@dimen/default_padding"
- android:paddingBottom="@dimen/large_padding">
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp">
-
-
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/buttons_services_wide.xml b/app/src/main/res/layout/buttons_services_wide.xml
index 9d6037d0d2..168ffde301 100644
--- a/app/src/main/res/layout/buttons_services_wide.xml
+++ b/app/src/main/res/layout/buttons_services_wide.xml
@@ -16,6 +16,7 @@
layout="@layout/buttons_episode_more"
android:layout_width="0dp"
android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
android:layout_weight="1" />
-
-
-
-
+ layout="@layout/buttons_services" />
diff --git a/app/src/main/res/layout/layout_episode.xml b/app/src/main/res/layout/layout_episode.xml
index 37490c915c..2abd63fa86 100644
--- a/app/src/main/res/layout/layout_episode.xml
+++ b/app/src/main/res/layout/layout_episode.xml
@@ -28,8 +28,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/large_padding"
- android:layout_marginRight="@dimen/large_padding"
android:layout_marginTop="12dp"
+ android:layout_marginRight="@dimen/large_padding"
android:background="?attr/selectableItemBackground"
android:focusable="true"
android:nextFocusDown="@+id/textViewEpisodeReleaseTime"
@@ -45,8 +45,8 @@
android:layout_marginBottom="@dimen/large_padding"
android:background="?attr/selectableItemBackground"
android:focusable="true"
- android:nextFocusDown="@+id/containerEpisodeImage"
android:nextFocusUp="@+id/textViewEpisodeTitle"
+ android:nextFocusDown="@+id/containerEpisodeImage"
android:textAppearance="@style/TextAppearance.SeriesGuide.Caption"
tools:text="OCT 15, 2013 (TUE) ยท 52" />
@@ -88,19 +88,12 @@
android:id="@+id/include_buttons"
layout="@layout/buttons_episode" />
-
-
-
-