Site icon AppTractor

Simple Settings: простое создание экранов настроек

Simple Settings — это библиотека, которая предоставляет простое в использовании легкое решение для создания экрана настроек.

Пример:

SimpleSettings(this).show {
    Section {
        title = "Test section"
        for (i in 1..4) {
            SwitchPref {
                title = "Test 1.$i"
                summary = "This is a Test 1.$i"
                defaultValue = if(i % 2 == 0) SimpleSwitchPreference.ON else SimpleSwitchPreference.OFF
            }
        }
        if(true) {
            TextPref {
                title = "Test 2"
                summary = "This is a Test 2"
            }
        }
    }
    Section {
        InputPref {
            title = "Test 3"
            summary = "This is a Test 3"
        }
    }
}

Исходники: https://github.com/marcauberer/simple-settings

Exit mobile version