Bug fixes , download page redesign , new theme(Emerald) (#95)
* Restart option when choosing custom theme Typo fix Extension page bug fix * Downloaded manga page redesign(lol) * quick fix * New theme(Emerald) Fine-tuned colors.xml * Toggle for list view and compact view in downloaded manga and novels (much more)
This commit is contained in:
parent
5339593e17
commit
eb75d299d2
15 changed files with 762 additions and 449 deletions
|
@ -47,15 +47,19 @@ class InstalledMangaExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
val skipIcons = loadData("skip_extension_icons") ?: false
|
||||
private val mangaExtensionManager: MangaExtensionManager = Injekt.get()
|
||||
private val extensionsAdapter = MangaExtensionsAdapter({ pkg ->
|
||||
val name= pkg.name
|
||||
val changeUIVisibility: (Boolean) -> Unit = { show ->
|
||||
val activity = requireActivity() as ExtensionsActivity
|
||||
val visibility = if (show) View.VISIBLE else View.GONE
|
||||
activity.findViewById<ViewPager2>(R.id.viewPager).visibility = visibility
|
||||
activity.findViewById<TabLayout>(R.id.tabLayout).visibility = visibility
|
||||
activity.findViewById<TextInputLayout>(R.id.searchView).visibility = visibility
|
||||
activity.findViewById<ImageView>(R.id.languageselect).visibility = visibility
|
||||
activity.findViewById<TextView>(R.id.extensions).text = if (show) getString(R.string.extensions) else name
|
||||
activity.findViewById<FrameLayout>(R.id.fragmentExtensionsContainer).visibility =
|
||||
if (show) View.GONE else View.VISIBLE
|
||||
}
|
||||
var itemSelected = false
|
||||
val allSettings = pkg.sources.filterIsInstance<ConfigurableSource>()
|
||||
if (allSettings.isNotEmpty()) {
|
||||
var selectedSetting = allSettings[0]
|
||||
|
@ -65,6 +69,7 @@ class InstalledMangaExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
.setTitle("Select a Source")
|
||||
.setSingleChoiceItems(names, selectedIndex) { dialog, which ->
|
||||
itemSelected = true
|
||||
selectedIndex = which
|
||||
selectedSetting = allSettings[selectedIndex]
|
||||
dialog.dismiss()
|
||||
|
@ -80,6 +85,11 @@ class InstalledMangaExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
.addToBackStack(null)
|
||||
.commit()
|
||||
}
|
||||
.setOnDismissListener {
|
||||
if (!itemSelected) {
|
||||
changeUIVisibility(true)
|
||||
}
|
||||
}
|
||||
.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue