mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 20:57:24 +01:00
Track search dialog adjustments (#5479)
* Add clear text button to track search dialog text input * Track search item adjustments
This commit is contained in:
parent
db0c1b2634
commit
64b1c9636b
@ -3,10 +3,11 @@ package eu.kanade.tachiyomi.ui.manga.track
|
|||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import coil.clear
|
import coil.clear
|
||||||
import coil.load
|
import coil.loadAny
|
||||||
|
import coil.transform.RoundedCornersTransformation
|
||||||
import eu.kanade.tachiyomi.data.track.model.TrackSearch
|
import eu.kanade.tachiyomi.data.track.model.TrackSearch
|
||||||
import eu.kanade.tachiyomi.databinding.TrackSearchItemBinding
|
import eu.kanade.tachiyomi.databinding.TrackSearchItemBinding
|
||||||
import eu.kanade.tachiyomi.util.view.setMaxLinesAndEllipsize
|
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
class TrackSearchHolder(
|
class TrackSearchHolder(
|
||||||
@ -23,7 +24,9 @@ class TrackSearchHolder(
|
|||||||
binding.trackSearchTitle.text = track.title
|
binding.trackSearchTitle.text = track.title
|
||||||
binding.trackSearchCover.clear()
|
binding.trackSearchCover.clear()
|
||||||
if (track.cover_url.isNotEmpty()) {
|
if (track.cover_url.isNotEmpty()) {
|
||||||
binding.trackSearchCover.load(track.cover_url)
|
binding.trackSearchCover.loadAny(track.cover_url) {
|
||||||
|
transformations(RoundedCornersTransformation(6.dpToPx.toFloat()))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val hasStatus = track.publishing_status.isNotBlank()
|
val hasStatus = track.publishing_status.isNotBlank()
|
||||||
@ -51,8 +54,11 @@ class TrackSearchHolder(
|
|||||||
binding.trackSearchStartResult.text = track.start_date
|
binding.trackSearchStartResult.text = track.start_date
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.trackSearchSummary.setMaxLinesAndEllipsize()
|
val hasSummary = track.summary.isNotBlank()
|
||||||
binding.trackSearchSummary.text = track.summary
|
binding.trackSearchSummary.isVisible = hasSummary
|
||||||
|
if (hasSummary) {
|
||||||
|
binding.trackSearchSummary.text = track.summary
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setUnchecked() {
|
fun setUnchecked() {
|
||||||
|
@ -36,7 +36,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="12dp"
|
android:layout_marginHorizontal="12dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:hint="@string/title">
|
android:hint="@string/title"
|
||||||
|
app:endIconMode="clear_text">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/title_input_edit_text"
|
android:id="@+id/title_input_edit_text"
|
||||||
|
@ -15,15 +15,17 @@
|
|||||||
android:id="@+id/linearLayout"
|
android:id="@+id/linearLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/track_search_cover"
|
android:id="@+id/track_search_cover"
|
||||||
android:layout_width="130dp"
|
android:layout_width="68dp"
|
||||||
android:layout_height="180dp"
|
android:layout_height="95dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
android:contentDescription="@string/description_cover"
|
android:contentDescription="@string/description_cover"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:src="@mipmap/ic_launcher" />
|
tools:src="@mipmap/ic_launcher" />
|
||||||
@ -32,7 +34,7 @@
|
|||||||
android:id="@+id/track_search_title"
|
android:id="@+id/track_search_title"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="36dp"
|
android:layout_marginEnd="36dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
@ -122,18 +124,27 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/track_search_summary"
|
android:id="@+id/track_search_summary"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:ellipsize="end"
|
||||||
|
android:maxLines="4"
|
||||||
android:textAppearance="?attr/textAppearanceCaption"
|
android:textAppearance="?attr/textAppearanceCaption"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="@+id/track_search_status"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/track_search_status"
|
app:layout_constraintTop_toBottomOf="@id/barrier"
|
||||||
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas condimentum et turpis ut sollicitudin. Donec tellus dolor, rhoncus a mattis eget, tempor quis augue. Fusce eleifend dignissim turpis a molestie. Praesent tincidunt, risus sed egestas fringilla, urna orci ultrices libero, id iaculis sem lorem placerat lacus." />
|
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas condimentum et turpis ut sollicitudin. Donec tellus dolor, rhoncus a mattis eget, tempor quis augue. Fusce eleifend dignissim turpis a molestie. Praesent tincidunt, risus sed egestas fringilla, urna orci ultrices libero, id iaculis sem lorem placerat lacus." />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Barrier
|
||||||
|
android:id="@+id/barrier"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:barrierDirection="bottom"
|
||||||
|
app:constraint_referenced_ids="track_search_start_result,track_search_title,track_search_type_result,track_search_status,track_search_cover,track_search_status_result,track_search_type,track_search_start" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
Loading…
Reference in New Issue
Block a user