Skip to content

Commit

Permalink
ShowFragment: add full show title, copy on long press
Browse files Browse the repository at this point in the history
  • Loading branch information
UweTrottmann committed Sep 13, 2024
1 parent 3deec72 commit 210de87
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Version 2024.4
--------------
*in development*

* 🔧 Show details: display full show title, touch and hold to copy it to clipboard (like for episode
and movie titles).
* 🔨 Android 15: turn off predictive back animation due to unresolved issues.
* 📝 Latest user interface translations from Crowdin.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import com.battlelancer.seriesguide.SgApp
import com.battlelancer.seriesguide.comments.TraktCommentsActivity
import com.battlelancer.seriesguide.databinding.LayoutRatingsBinding
import com.battlelancer.seriesguide.notifications.NotificationService
import com.battlelancer.seriesguide.people.PeopleListHelper
import com.battlelancer.seriesguide.people.Credits
import com.battlelancer.seriesguide.people.PeopleListHelper
import com.battlelancer.seriesguide.settings.NotificationSettings
import com.battlelancer.seriesguide.shows.database.SgShow2
import com.battlelancer.seriesguide.shows.overview.OverviewActivityImpl.OverviewLayoutType.MULTI_PANE_VERTICAL
Expand Down Expand Up @@ -87,6 +87,7 @@ class ShowFragment() : Fragment() {
val scrollViewShow: NestedScrollView
val containerPoster: View
val imageViewPoster: ImageView
val textViewTitle: TextView
val textViewStatus: TextView
val textViewBaseInfo: TextView
val textViewOverview: TextView
Expand Down Expand Up @@ -122,6 +123,7 @@ class ShowFragment() : Fragment() {
scrollViewShow = view.findViewById(R.id.scrollViewShow)
containerPoster = view.findViewById(R.id.containerShowPoster)
imageViewPoster = view.findViewById(R.id.imageViewShowPoster)
textViewTitle = view.findViewById(R.id.textViewShowTitle)
textViewStatus = view.findViewById(R.id.textViewShowStatus)
textViewBaseInfo = view.findViewById(R.id.textViewShowBaseInfo)
textViewOverview = view.findViewById(R.id.textViewShowOverview)
Expand Down Expand Up @@ -200,6 +202,7 @@ class ShowFragment() : Fragment() {
setCrewVisibility(binding, false)

// set up long-press to copy text to clipboard (d-pad friendly vs text selection)
binding.textViewTitle.copyTextToClipboardOnLongClick()
binding.textViewOverview.copyTextToClipboardOnLongClick()
binding.textViewGenres.copyTextToClipboardOnLongClick()
binding.textViewContentRating.copyTextToClipboardOnLongClick()
Expand Down Expand Up @@ -275,6 +278,7 @@ class ShowFragment() : Fragment() {

// Release time, base info and status
binding.buttonEditReleaseTime.text = showForUi.releaseTime
binding.textViewTitle.text = showForUi.show.title
binding.textViewBaseInfo.text = showForUi.baseInfo
binding.textViewStatus.text = ShowStatus.buildYearAndStatus(requireContext(), show)

Expand Down
37 changes: 28 additions & 9 deletions app/src/main/res/layout/fragment_show_narrow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,33 @@

</com.google.android.material.card.MaterialCardView>

<!-- Reduce font size to match Body2 style of items below. -->
<TextView
android:id="@+id/textViewShowTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:background="?attr/selectableItemBackground"
android:focusable="true"
android:textAppearance="@style/TextAppearance.SeriesGuide.Headline6"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/containerShowPoster"
app:layout_constraintTop_toTopOf="@+id/containerShowPoster"
tools:text="Demon Slayer: Kimetsu no Yaiba" />

<TextView
android:id="@+id/textViewShowStatus"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="12dp"
android:textAppearance="@style/TextAppearance.SeriesGuide.Body2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/containerShowPoster"
app:layout_constraintTop_toTopOf="@+id/containerShowPoster"
app:layout_constraintTop_toBottomOf="@+id/textViewShowTitle"
tools:text="2023 / Continuing" />

<TextView
Expand All @@ -94,15 +111,18 @@

<Button
android:id="@+id/buttonEditReleaseTime"
style="@style/Widget.SeriesGuide.Button.Borderless"
android:layout_width="wrap_content"
style="@style/Widget.SeriesGuide.Button.MediaItem"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:gravity="start|center_vertical"
android:textColor="?attr/colorPrimary"
app:icon="@drawable/ic_schedule_black_24dp"
app:iconTint="?attr/colorPrimary"
app:layout_constraintBottom_toTopOf="@+id/buttonShowFavorite"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@+id/containerShowPoster"
app:layout_constraintTop_toBottomOf="@id/textViewShowBaseInfo"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/barrierPosterAndInfoBottom"
tools:text="Sat 08:00 PM" />

<Button
Expand All @@ -118,9 +138,8 @@
app:layout_constraintBottom_toTopOf="@+id/buttonShowNotify"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/barrierPosterAndInfoBottom" />
app:layout_constraintTop_toBottomOf="@+id/buttonEditReleaseTime" />

<!-- Slightly larger weight as this button contains single long word in many languages. -->
<Button
android:id="@+id/buttonShowNotify"
style="@style/Widget.SeriesGuide.Button.MediaItem"
Expand Down Expand Up @@ -156,7 +175,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="containerShowPoster,buttonEditReleaseTime" />
app:constraint_referenced_ids="containerShowPoster,textViewShowBaseInfo" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
17 changes: 16 additions & 1 deletion app/src/main/res/layout/fragment_show_regular.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@

</com.google.android.material.card.MaterialCardView>

<TextView
android:id="@+id/textViewShowTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="12dp"
android:background="?attr/selectableItemBackground"
android:focusable="true"
android:textAppearance="@style/TextAppearance.SeriesGuide.Headline6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/containerShowPoster"
app:layout_constraintTop_toTopOf="@+id/containerShowPoster"
tools:text="Demon Slayer: Kimetsu no Yaiba" />

<TextView
android:id="@+id/textViewShowStatus"
android:layout_width="0dp"
Expand All @@ -68,7 +83,7 @@
android:textAppearance="@style/TextAppearance.SeriesGuide.Body1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/containerShowPoster"
app:layout_constraintTop_toTopOf="@+id/containerShowPoster"
app:layout_constraintTop_toBottomOf="@+id/textViewShowTitle"
tools:text="2023 / Continuing" />

<TextView
Expand Down

0 comments on commit 210de87

Please sign in to comment.