mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-12 00:06:16 +00:00
Better extension page(maybe) (#45)
* Fixed Mono icon not loading/Extension page customization * Better extension page(maybe)
This commit is contained in:
@@ -209,8 +209,15 @@ class InstalledAnimeExtensionsFragment : Fragment() {
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val extension = getItem(position) // Use getItem() from ListAdapter
|
||||
val extension = getItem(position) // Use getItem() from ListAdapter
|
||||
val nsfw = if (extension.isNsfw) {
|
||||
"(18+)"
|
||||
} else {
|
||||
""
|
||||
}
|
||||
|
||||
holder.extensionNameTextView.text = extension.name
|
||||
holder.extensionVersionTextView.text = "${extension.versionName} $nsfw"
|
||||
if (!skipIcons) {
|
||||
holder.extensionIconImageView.setImageDrawable(extension.icon)
|
||||
}
|
||||
@@ -235,6 +242,7 @@ class InstalledAnimeExtensionsFragment : Fragment() {
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val extensionNameTextView: TextView = view.findViewById(R.id.extensionNameTextView)
|
||||
val extensionVersionTextView: TextView = view.findViewById(R.id.extensionVersionTextView)
|
||||
val settingsImageView: ImageView = view.findViewById(R.id.settingsImageView)
|
||||
val extensionIconImageView: ImageView = view.findViewById(R.id.extensionIconImageView)
|
||||
val closeTextView: TextView = view.findViewById(R.id.closeTextView)
|
||||
|
||||
@@ -204,7 +204,13 @@ class InstalledMangaExtensionsFragment : Fragment() {
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val extension = getItem(position) // Use getItem() from ListAdapter
|
||||
val nsfw = if (extension.isNsfw) {
|
||||
"(18+)"
|
||||
} else {
|
||||
""
|
||||
}
|
||||
holder.extensionNameTextView.text = extension.name
|
||||
holder.extensionVersionTextView.text = "${extension.versionName} $nsfw"
|
||||
if (!skipIcons) {
|
||||
holder.extensionIconImageView.setImageDrawable(extension.icon)
|
||||
}
|
||||
@@ -229,6 +235,7 @@ class InstalledMangaExtensionsFragment : Fragment() {
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val extensionNameTextView: TextView = view.findViewById(R.id.extensionNameTextView)
|
||||
val extensionVersionTextView: TextView = view.findViewById(R.id.extensionVersionTextView)
|
||||
val settingsImageView: ImageView = view.findViewById(R.id.settingsImageView)
|
||||
val extensionIconImageView: ImageView = view.findViewById(R.id.extensionIconImageView)
|
||||
val closeTextView: TextView = view.findViewById(R.id.closeTextView)
|
||||
|
||||
@@ -151,8 +151,14 @@ class AnimeExtensionAdapter(private val clickListener: OnAnimeInstallClickListen
|
||||
}
|
||||
}
|
||||
val extensionIconImageView: ImageView = binding.extensionIconImageView
|
||||
fun bind(extension: AnimeExtension.Available) {
|
||||
fun bind(extension: AnimeExtension.Available) {
|
||||
val nsfw = if (extension.isNsfw) {
|
||||
"(18+)"
|
||||
} else {
|
||||
""
|
||||
}
|
||||
binding.extensionNameTextView.text = extension.name
|
||||
binding.extensionVersionTextView.text = "${extension.versionName} $nsfw"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,13 @@ class MangaExtensionAdapter(private val clickListener: OnMangaInstallClickListen
|
||||
}
|
||||
val extensionIconImageView: ImageView = binding.extensionIconImageView
|
||||
fun bind(extension: MangaExtension.Available) {
|
||||
val nsfw = if (extension.isNsfw) {
|
||||
"(18+)"
|
||||
} else {
|
||||
""
|
||||
}
|
||||
binding.extensionNameTextView.text = extension.name
|
||||
binding.extensionVersionTextView.text = "${extension.versionName} $nsfw"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,24 +4,49 @@
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/extensionIconImageView"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="16dp"/>
|
||||
android:layout_marginEnd="3dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/extensionNameTextView"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textSize="18sp"
|
||||
android:text="Extension Name" />
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/extensionNameTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Extension Name"
|
||||
android:textSize="15sp"
|
||||
android:fontFamily="@font/poppins_semi_bold"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/extensionVersionTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/closeTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:textStyle="bold"
|
||||
android:text="Uninstall"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/settingsImageView"
|
||||
@@ -31,16 +56,6 @@
|
||||
app:tint="?attr/colorOnBackground"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="0"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:contentDescription="Settings"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/closeTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textStyle="bold"
|
||||
android:text="Uninstall"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:textSize="14sp"/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -3,24 +3,38 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/extensionIconImageView"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="16dp"/>
|
||||
android:layout_marginEnd="3dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/extensionNameTextView"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:textAlignment="textStart"
|
||||
android:textSize="18sp"
|
||||
android:text="Extension Name" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/extensionNameTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Extension Name"
|
||||
android:textSize="15sp"
|
||||
android:fontFamily="@font/poppins_semi_bold"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/extensionVersionTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/closeTextView"
|
||||
|
||||
Reference in New Issue
Block a user