mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-04 18:51:14 +02:00
setting up the Settings screen
This commit is contained in:
parent
68e840daf6
commit
dfb0a5b89b
@ -15,11 +15,18 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_settings)
|
setContentView(R.layout.activity_settings)
|
||||||
|
|
||||||
|
setupCustomizeColors()
|
||||||
setupFontSize()
|
setupFontSize()
|
||||||
setupWidgetNote()
|
setupWidgetNote()
|
||||||
setupGravity()
|
setupGravity()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setupCustomizeColors() {
|
||||||
|
settings_customize_colors_holder.setOnClickListener {
|
||||||
|
startCustomizationActivity()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupFontSize() {
|
private fun setupFontSize() {
|
||||||
settings_font_size.setSelection(config.fontSize)
|
settings_font_size.setSelection(config.fontSize)
|
||||||
settings_font_size.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
settings_font_size.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||||
|
@ -12,30 +12,21 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/settings_dark_theme_holder"
|
android:id="@+id/settings_customize_colors_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:padding="@dimen/activity_margin">
|
android:padding="@dimen/activity_margin">
|
||||||
|
|
||||||
<TextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/settings_dark_theme_label"
|
android:id="@+id/settings_customize_colors_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:paddingLeft="@dimen/medium_margin"
|
android:paddingLeft="@dimen/medium_margin"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:text="@string/dark_theme"/>
|
android:text="@string/customize_colors"/>
|
||||||
|
|
||||||
<android.support.v7.widget.SwitchCompat
|
|
||||||
android:id="@+id/settings_dark_theme"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:background="@null"
|
|
||||||
android:clickable="false"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@ -44,12 +35,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
android:padding="@dimen/activity_margin">
|
||||||
android:paddingRight="@dimen/medium_margin"
|
|
||||||
android:paddingTop="@dimen/activity_margin">
|
|
||||||
|
|
||||||
<TextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/settings_font_size_label"
|
android:id="@+id/settings_font_size_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -58,7 +47,7 @@
|
|||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:text="@string/note_font_size"/>
|
android:text="@string/note_font_size"/>
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatSpinner
|
<com.simplemobiletools.commons.views.MyAppCompatSpinner
|
||||||
android:id="@+id/settings_font_size"
|
android:id="@+id/settings_font_size"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -73,12 +62,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
android:padding="@dimen/activity_margin">
|
||||||
android:paddingRight="@dimen/medium_margin"
|
|
||||||
android:paddingTop="@dimen/activity_margin">
|
|
||||||
|
|
||||||
<TextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/settings_gravity_label"
|
android:id="@+id/settings_gravity_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -87,7 +74,7 @@
|
|||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:text="@string/gravity"/>
|
android:text="@string/gravity"/>
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatSpinner
|
<com.simplemobiletools.commons.views.MyAppCompatSpinner
|
||||||
android:id="@+id/settings_gravity"
|
android:id="@+id/settings_gravity"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -102,12 +89,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
android:padding="@dimen/activity_margin">
|
||||||
android:paddingRight="@dimen/medium_margin"
|
|
||||||
android:paddingTop="@dimen/activity_margin">
|
|
||||||
|
|
||||||
<TextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/settings_widget_note_label"
|
android:id="@+id/settings_widget_note_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -116,7 +101,7 @@
|
|||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:text="@string/widget_note"/>
|
android:text="@string/widget_note"/>
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatSpinner
|
<com.simplemobiletools.commons.views.MyAppCompatSpinner
|
||||||
android:id="@+id/settings_widget_note"
|
android:id="@+id/settings_widget_note"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user