mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Restore separate artist field
This commit is contained in:
		@@ -6,6 +6,7 @@ import android.view.LayoutInflater
 | 
			
		||||
import android.view.View
 | 
			
		||||
import android.view.ViewGroup
 | 
			
		||||
import androidx.core.content.ContextCompat
 | 
			
		||||
import androidx.core.view.isVisible
 | 
			
		||||
import androidx.recyclerview.widget.RecyclerView
 | 
			
		||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
 | 
			
		||||
import eu.kanade.tachiyomi.R
 | 
			
		||||
@@ -143,6 +144,21 @@ class MangaInfoHeaderAdapter(
 | 
			
		||||
                }
 | 
			
		||||
                .launchIn(scope)
 | 
			
		||||
 | 
			
		||||
            binding.mangaArtist.longClicks()
 | 
			
		||||
                .onEach {
 | 
			
		||||
                    controller.activity?.copyToClipboard(
 | 
			
		||||
                        binding.mangaArtist.text.toString(),
 | 
			
		||||
                        binding.mangaArtist.text.toString()
 | 
			
		||||
                    )
 | 
			
		||||
                }
 | 
			
		||||
                .launchIn(scope)
 | 
			
		||||
 | 
			
		||||
            binding.mangaArtist.clicks()
 | 
			
		||||
                .onEach {
 | 
			
		||||
                    controller.performGlobalSearch(binding.mangaArtist.text.toString())
 | 
			
		||||
                }
 | 
			
		||||
                .launchIn(scope)
 | 
			
		||||
 | 
			
		||||
            binding.mangaSummary.longClicks()
 | 
			
		||||
                .onEach {
 | 
			
		||||
                    controller.activity?.copyToClipboard(
 | 
			
		||||
@@ -172,19 +188,25 @@ class MangaInfoHeaderAdapter(
 | 
			
		||||
         * @param source the source of the manga.
 | 
			
		||||
         */
 | 
			
		||||
        private fun setMangaInfo(manga: Manga, source: Source?) {
 | 
			
		||||
            // update full title TextView.
 | 
			
		||||
            // Update full title TextView.
 | 
			
		||||
            binding.mangaFullTitle.text = if (manga.title.isBlank()) {
 | 
			
		||||
                view.context.getString(R.string.unknown)
 | 
			
		||||
            } else {
 | 
			
		||||
                manga.title
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Update author/artist TextView.
 | 
			
		||||
            val authors = listOf(manga.author, manga.artist).filter { !it.isNullOrBlank() }.distinct()
 | 
			
		||||
            binding.mangaAuthor.text = if (authors.isEmpty()) {
 | 
			
		||||
            // Update author TextView.
 | 
			
		||||
            binding.mangaAuthor.text = if (manga.author.isNullOrBlank()) {
 | 
			
		||||
                view.context.getString(R.string.unknown)
 | 
			
		||||
            } else {
 | 
			
		||||
                authors.joinToString(", ")
 | 
			
		||||
                manga.author
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Update artist TextView.
 | 
			
		||||
            val hasArtist = !manga.artist.isNullOrBlank() && manga.artist != manga.author
 | 
			
		||||
            binding.mangaArtist.isVisible = hasArtist
 | 
			
		||||
            if (hasArtist) {
 | 
			
		||||
                binding.mangaArtist.text = manga.artist
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // If manga source is known update source TextView.
 | 
			
		||||
 
 | 
			
		||||
@@ -52,12 +52,21 @@
 | 
			
		||||
                style="@style/TextAppearance.Regular.Body1.Secondary"
 | 
			
		||||
                android:layout_width="0dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginTop="8dp"
 | 
			
		||||
                android:textIsSelectable="false"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/manga_full_title"
 | 
			
		||||
                tools:text="Author" />
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/manga_artist"
 | 
			
		||||
                style="@style/TextAppearance.Regular.Body1.Secondary"
 | 
			
		||||
                android:layout_width="0dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:textIsSelectable="false"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/manga_author"
 | 
			
		||||
                tools:text="Artist" />
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/manga_status"
 | 
			
		||||
                style="@style/TextAppearance.Regular.Body1.Secondary"
 | 
			
		||||
@@ -69,7 +78,8 @@
 | 
			
		||||
                android:textIsSelectable="false"
 | 
			
		||||
                app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/manga_author" />
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/manga_artist"
 | 
			
		||||
                tools:text="Source" />
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/manga_source"
 | 
			
		||||
@@ -81,7 +91,8 @@
 | 
			
		||||
                android:textIsSelectable="false"
 | 
			
		||||
                app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/manga_status" />
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/manga_status"
 | 
			
		||||
                tools:text="Status" />
 | 
			
		||||
 | 
			
		||||
        </androidx.constraintlayout.widget.ConstraintLayout>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -55,10 +55,11 @@
 | 
			
		||||
                app:layout_constraintTop_toTopOf="parent"
 | 
			
		||||
                tools:src="@mipmap/ic_launcher" />
 | 
			
		||||
 | 
			
		||||
            <androidx.constraintlayout.widget.ConstraintLayout
 | 
			
		||||
            <LinearLayout
 | 
			
		||||
                android:id="@+id/manga_info_section"
 | 
			
		||||
                android:layout_width="0dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:orientation="vertical"
 | 
			
		||||
                android:layout_marginStart="0dp"
 | 
			
		||||
                android:layout_marginTop="16dp"
 | 
			
		||||
                android:layout_marginEnd="16dp"
 | 
			
		||||
@@ -78,47 +79,46 @@
 | 
			
		||||
                    app:autoSizeMaxTextSize="20sp"
 | 
			
		||||
                    app:autoSizeMinTextSize="12sp"
 | 
			
		||||
                    app:autoSizeStepGranularity="2sp"
 | 
			
		||||
                    app:autoSizeTextType="uniform"
 | 
			
		||||
                    app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                    app:layout_constraintTop_toTopOf="parent" />
 | 
			
		||||
                    app:autoSizeTextType="uniform" />
 | 
			
		||||
 | 
			
		||||
                <TextView
 | 
			
		||||
                    android:id="@+id/manga_author"
 | 
			
		||||
                    style="@style/TextAppearance.Regular.Body1.Secondary"
 | 
			
		||||
                    android:layout_width="0dp"
 | 
			
		||||
                    android:layout_width="wrap_content"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:textIsSelectable="false"
 | 
			
		||||
                    app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                    app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                    app:layout_constraintTop_toBottomOf="@+id/manga_full_title"
 | 
			
		||||
                    tools:text="Author" />
 | 
			
		||||
 | 
			
		||||
                <TextView
 | 
			
		||||
                    android:id="@+id/manga_artist"
 | 
			
		||||
                    style="@style/TextAppearance.Regular.Body1.Secondary"
 | 
			
		||||
                    android:layout_width="wrap_content"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:textIsSelectable="false"
 | 
			
		||||
                    tools:text="Artist" />
 | 
			
		||||
 | 
			
		||||
                <TextView
 | 
			
		||||
                    android:id="@+id/manga_status"
 | 
			
		||||
                    style="@style/TextAppearance.Regular.Body1.Secondary"
 | 
			
		||||
                    android:layout_width="0dp"
 | 
			
		||||
                    android:layout_width="wrap_content"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:layout_marginTop="8dp"
 | 
			
		||||
                    android:ellipsize="end"
 | 
			
		||||
                    android:maxLines="1"
 | 
			
		||||
                    android:textIsSelectable="false"
 | 
			
		||||
                    app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                    app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                    app:layout_constraintTop_toBottomOf="@+id/manga_author" />
 | 
			
		||||
                    tools:text="Status" />
 | 
			
		||||
 | 
			
		||||
                <TextView
 | 
			
		||||
                    android:id="@+id/manga_source"
 | 
			
		||||
                    style="@style/TextAppearance.Regular.Body1.Secondary"
 | 
			
		||||
                    android:layout_width="0dp"
 | 
			
		||||
                    android:layout_width="wrap_content"
 | 
			
		||||
                    android:layout_height="wrap_content"
 | 
			
		||||
                    android:ellipsize="end"
 | 
			
		||||
                    android:maxLines="1"
 | 
			
		||||
                    android:textIsSelectable="false"
 | 
			
		||||
                    app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                    app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                    app:layout_constraintTop_toBottomOf="@+id/manga_status" />
 | 
			
		||||
                    tools:text="Source" />
 | 
			
		||||
 | 
			
		||||
            </androidx.constraintlayout.widget.ConstraintLayout>
 | 
			
		||||
            </LinearLayout>
 | 
			
		||||
 | 
			
		||||
        </androidx.constraintlayout.widget.ConstraintLayout>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user