allow changing text gravity

This commit is contained in:
tibbi
2016-11-27 10:50:45 +01:00
parent e83c41fa35
commit 8cf5df20b2
16 changed files with 96 additions and 3 deletions

View File

@ -19,6 +19,7 @@ class SettingsActivity : SimpleActivity() {
setupDarkTheme()
setupFontSize()
setupWidgetNote()
setupGravity()
}
private fun setupDarkTheme() {
@ -66,6 +67,18 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupGravity() {
settings_gravity.setSelection(config.gravity)
settings_gravity.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
config.gravity = settings_gravity.selectedItemPosition
}
override fun onNothingSelected(parent: AdapterView<*>?) {
}
}
}
private fun getNoteIndexWithId(id: Int, notes: List<Note>): Int {
for (i in 0..notes.count() - 1) {
if (notes[i].id == id) {