Fix blank box if empty (#1069)

This commit is contained in:
Luqman 2024-02-18 03:46:48 +07:00 committed by GitHub
parent ca81f48c1c
commit f35031db7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -175,20 +175,14 @@ private fun onViewCreated(manga: Manga, context: Context, binding: EditMangaDial
binding.mangaGenresTags.setChips(manga.genre.orEmpty().dropBlank(), scope) binding.mangaGenresTags.setChips(manga.genre.orEmpty().dropBlank(), scope)
binding.title.hint = context.stringResource(SYMR.strings.title_hint, manga.ogTitle) binding.title.hint = context.stringResource(SYMR.strings.title_hint, manga.ogTitle)
if (manga.ogAuthor != null) { binding.mangaAuthor.hint = context.stringResource(SYMR.strings.author_hint, manga.ogAuthor ?: "")
binding.mangaAuthor.hint = context.stringResource(SYMR.strings.author_hint, manga.ogAuthor!!) binding.mangaArtist.hint = context.stringResource(SYMR.strings.artist_hint, manga.ogArtist ?: "")
}
if (manga.ogArtist != null) {
binding.mangaArtist.hint = context.stringResource(SYMR.strings.artist_hint, manga.ogArtist!!)
}
if (!manga.ogDescription.isNullOrBlank()) {
binding.mangaDescription.hint = binding.mangaDescription.hint =
context.stringResource( context.stringResource(
SYMR.strings.description_hint, SYMR.strings.description_hint,
manga.ogDescription!!.replace("\n", " ").chop(20), manga.ogDescription?.takeIf { it.isNotBlank() }?.let { it.replace("\n", " ").chop(20) } ?: ""
) )
} }
}
binding.mangaGenresTags.clearFocus() binding.mangaGenresTags.clearFocus()
binding.resetTags.setOnClickListener { resetTags(manga, binding, scope) } binding.resetTags.setOnClickListener { resetTags(manga, binding, scope) }