Small layout improvements (#145)

* Remove unused code

* Ellipsize primary and secondary name in home_episode_item

* Fix play icon color
This commit is contained in:
Jarne Demeulemeester 2022-08-22 23:56:03 +02:00 committed by GitHub
parent a5189eb4fa
commit c19350fa36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 11 deletions

View file

@ -54,7 +54,7 @@ class DownloadSeriesFragment : Fragment() {
viewModel.uiState.collect { uiState ->
when (uiState) {
is DownloadSeriesViewModel.UiState.Normal -> bindUiStateNormal(uiState)
is DownloadSeriesViewModel.UiState.Loading -> bindUiStateLoading(uiState)
is DownloadSeriesViewModel.UiState.Loading -> Unit
is DownloadSeriesViewModel.UiState.Error -> bindUiStateError(uiState)
}
}
@ -79,8 +79,6 @@ class DownloadSeriesFragment : Fragment() {
binding.errorLayout.errorPanel.isVisible = false
}
private fun bindUiStateLoading(uiState: DownloadSeriesViewModel.UiState.Loading) {}
private fun bindUiStateError(uiState: DownloadSeriesViewModel.UiState.Error) {
errorDialog = ErrorDialogFragment(uiState.error)
binding.episodesRecyclerView.isVisible = false

View file

@ -67,8 +67,8 @@ internal class MediaDetailFragment : Fragment() {
Timber.d("$uiState")
when (uiState) {
is MediaInfoViewModel.UiState.Normal -> bindUiStateNormal(uiState)
is MediaInfoViewModel.UiState.Loading -> bindUiStateLoading()
is MediaInfoViewModel.UiState.Error -> bindUiStateError(uiState)
is MediaInfoViewModel.UiState.Loading -> Unit
is MediaInfoViewModel.UiState.Error -> Unit
}
}
}
@ -81,7 +81,7 @@ internal class MediaDetailFragment : Fragment() {
binding.seasonsRow.gridView.adapter = seasonsAdapter
binding.seasonsRow.gridView.verticalSpacing = 25
val castAdapter = PersonListAdapter { person ->
val castAdapter = PersonListAdapter {
Toast.makeText(requireContext(), "Not yet implemented", Toast.LENGTH_SHORT).show()
}
@ -221,10 +221,6 @@ internal class MediaDetailFragment : Fragment() {
}
}
private fun bindUiStateLoading() {}
private fun bindUiStateError(uiState: MediaInfoViewModel.UiState.Error) {}
private fun bindPlayerItems(items: PlayerItems) {
navigateToPlayerActivity(items.items.toTypedArray())
binding.playButton.setImageDrawable(

View file

@ -2,7 +2,8 @@
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:pathData="M5,3l14,9l-14,9l0,-18z"
android:strokeLineJoin="round"

View file

@ -38,6 +38,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
app:layout_constraintEnd_toEndOf="parent"
@ -49,6 +50,7 @@
android:id="@+id/secondary_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="@{String.format(@string/episode_name_extended, episode.parentIndexNumber, episode.indexNumber, episode.name)}"
android:textAppearance="@style/TextAppearance.Material3.BodySmall"

View file

@ -35,6 +35,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
app:layout_constraintEnd_toEndOf="parent"
@ -46,6 +47,7 @@
android:id="@+id/secondary_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="@{String.format(@string/episode_name_extended, episode.parentIndexNumber, episode.indexNumber, episode.name)}"
android:textAppearance="@style/TextAppearance.Material3.BodySmall"