File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
app/src/main/java/eu/kanade/tachiyomi/ui/extension Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
33
33
*/
34
34
private var adapter: ExtensionDetailsPrefsButtonAdapter ? = null
35
35
36
+ private var sources: List <ConfigurableSource >? = null
36
37
override fun inflateView (inflater : LayoutInflater , container : ViewGroup ): View {
37
38
binding = ExtensionDetailControllerBinding .inflate(inflater)
38
39
return binding.root
@@ -82,21 +83,21 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
82
83
binding.extensionDetailsRecycler.adapter = adapter
83
84
binding.extensionDetailsRecycler.setHasFixedSize(true )
84
85
86
+ sources = presenter.extension?.sources?.filterIsInstance<ConfigurableSource >()
87
+
85
88
adapter!! .updateDataSet(
86
- presenter.extension?.sources?.filterIsInstance<ConfigurableSource >()
87
- ?.map { ExtensionDetailsPrefsButtonItem (it.toString()) }
89
+ sources?.map { ExtensionDetailsPrefsButtonItem (it.toString()) }
88
90
)
91
+ }
89
92
90
- /* presenter.extension?.sources?.filterIsInstance<ConfigurableSource>()?.forEach { source ->
91
- binding.extensionPrefs.visible()
92
- binding.extensionPrefs.clicks()
93
- .onEach { openPreferences(source.id) }
94
- .launchIn(scope)
95
- }*/
93
+ override fun onDestroyView (view : View ) {
94
+ adapter = null
95
+ sources = null
96
+ super .onDestroyView(view)
96
97
}
97
98
98
99
override fun onItemClick (view : View ? , position : Int ): Boolean {
99
- val id = presenter.extension?. sources?.filterIsInstance< ConfigurableSource >() ?.get(position)?.id
100
+ val id = sources?.get(position)?.id
100
101
return if (id != null ) {
101
102
openPreferences(id)
102
103
true
You can’t perform that action at this time.
0 commit comments