fix #18, adding a toggle for starting names with surname

This commit is contained in:
tibbi 2020-05-31 10:36:56 +02:00
parent 38e7ae863b
commit ece538e9c2
3 changed files with 33 additions and 1 deletions

View File

@ -56,6 +56,6 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.28.25'
implementation 'com.simplemobiletools:commons:5.28.27'
implementation 'com.github.tibbi:IndicatorFastScroll:08f512858a'
}

View File

@ -36,6 +36,7 @@ class SettingsActivity : SimpleActivity() {
setupFontSize()
setupDefaultTab()
setupGroupSubsequentCalls()
setupStartNameWithSurname()
updateTextColors(settings_holder)
invalidateOptionsMenu()
}
@ -132,4 +133,12 @@ class SettingsActivity : SimpleActivity() {
config.groupSubsequentCalls = settings_group_subsequent_calls.isChecked
}
}
private fun setupStartNameWithSurname() {
settings_start_with_surname.isChecked = config.startNameWithSurname
settings_start_with_surname_holder.setOnClickListener {
settings_start_with_surname.toggle()
config.startNameWithSurname = settings_start_with_surname.isChecked
}
}
}

View File

@ -204,5 +204,28 @@
app:switchPadding="@dimen/medium_margin" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_start_with_surname_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_start_with_surname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingStart="@dimen/medium_margin"
android:text="@string/start_name_with_surname"
app:switchPadding="@dimen/medium_margin" />
</RelativeLayout>
</LinearLayout>
</ScrollView>