commit what I've got

This commit is contained in:
Aria Moradi
2021-07-31 00:41:09 +04:30
parent 7c03c73419
commit 1ed9bcf7c8
2 changed files with 6 additions and 2 deletions
@@ -50,10 +50,9 @@ import java.util.Map;
/**
* Custom context implementation.
*
* TODO Deal with packagemanager for extension sources
*/
public class CustomContext extends Context implements DIAware {
private DI kodein;
private final DI kodein;
public CustomContext() {
this(KodeinGlobalHelper.kodein());
}
@@ -63,14 +63,19 @@ object Source {
val props: Any
)
var lastPreferenceScreen: PreferenceScreen? = null
fun getSourcePreferences(sourceId: Long): List<PreferenceObject> {
val source = getHttpSource(sourceId)
if (source is ConfigurableSource) {
val screen = PreferenceScreen(context)
lastPreferenceScreen = screen
source.setupPreferenceScreen(screen)
screen.preferences.first().callChangeListener("yo")
return screen.preferences.map {
PreferenceObject(it::class.java.name, it)
}