mirror of
https://github.com/SimpleMobileTools/Simple-Thank-You.git
synced 2025-02-22 06:17:40 +01:00
updating the settings activities UI
This commit is contained in:
parent
4232204e56
commit
4af0dafe06
@ -12,9 +12,14 @@ import kotlinx.android.synthetic.main.activity_settings.*
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class SettingsActivity : SimpleActivity() {
|
class SettingsActivity : SimpleActivity() {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
isMaterialActivity = true
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_settings)
|
setContentView(R.layout.activity_settings)
|
||||||
|
|
||||||
|
updateMaterialActivityViews(settings_coordinator, settings_holder, true)
|
||||||
|
setupMaterialScrollListener(settings_nested_scrollview, settings_toolbar)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
@ -27,17 +32,13 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
setupHideLauncherIcon()
|
setupHideLauncherIcon()
|
||||||
updateTextColors(settings_nested_scrollview)
|
updateTextColors(settings_nested_scrollview)
|
||||||
|
|
||||||
arrayOf(settings_color_customization_label, settings_general_settings_label).forEach {
|
arrayOf(settings_color_customization_section_label, settings_general_settings_label).forEach {
|
||||||
it.setTextColor(getProperPrimaryColor())
|
it.setTextColor(getProperPrimaryColor())
|
||||||
}
|
}
|
||||||
|
|
||||||
arrayOf(settings_color_customization_holder, settings_general_settings_holder).forEach {
|
|
||||||
it.background.applyColorFilter(getProperBackgroundColor().getContrastColor())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupCustomizeColors() {
|
private fun setupCustomizeColors() {
|
||||||
settings_customize_colors_holder.setOnClickListener {
|
settings_color_customization_holder.setOnClickListener {
|
||||||
startCustomizationActivity()
|
startCustomizationActivity()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,11 +56,6 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
private fun setupLanguage() {
|
private fun setupLanguage() {
|
||||||
settings_language.text = Locale.getDefault().displayLanguage
|
settings_language.text = Locale.getDefault().displayLanguage
|
||||||
settings_language_holder.beVisibleIf(isTiramisuPlus())
|
settings_language_holder.beVisibleIf(isTiramisuPlus())
|
||||||
|
|
||||||
if (settings_use_english_holder.isGone() && settings_language_holder.isGone()) {
|
|
||||||
settings_hide_launcher_icon_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme)
|
|
||||||
}
|
|
||||||
|
|
||||||
settings_language_holder.setOnClickListener {
|
settings_language_holder.setOnClickListener {
|
||||||
launchChangeAppLanguageIntent()
|
launchChangeAppLanguageIntent()
|
||||||
}
|
}
|
||||||
|
@ -6,28 +6,21 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/settings_app_bar_layout"
|
android:id="@+id/settings_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
app:title="@string/settings"
|
||||||
android:id="@+id/settings_toolbar"
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:background="@color/color_primary"
|
|
||||||
app:title="@string/settings"
|
|
||||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
android:id="@+id/settings_nested_scrollview"
|
android:id="@+id/settings_nested_scrollview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="?attr/actionBarSize"
|
||||||
android:fillViewport="true"
|
android:fillViewport="true"
|
||||||
android:scrollbars="none"
|
android:scrollbars="none">
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/settings_holder"
|
android:id="@+id/settings_holder"
|
||||||
@ -36,36 +29,32 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/settings_color_customization_label"
|
android:id="@+id/settings_color_customization_section_label"
|
||||||
style="@style/SettingsSectionLabelStyle"
|
style="@style/SettingsSectionLabelStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/color_customization" />
|
android:text="@string/color_customization" />
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/settings_color_customization_holder"
|
android:id="@+id/settings_color_customization_holder"
|
||||||
|
style="@style/SettingsHolderTextViewOneLinerStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:layout_margin="@dimen/medium_margin"
|
|
||||||
android:background="@drawable/section_holder_stroke"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<RelativeLayout
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/settings_customize_colors_holder"
|
android:id="@+id/settings_color_customization_label"
|
||||||
style="@style/SettingsHolderTextViewOneLinerStyle"
|
style="@style/SettingsTextLabelStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ripple_all_corners">
|
android:text="@string/customize_colors"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
android:id="@+id/settings_customize_colors_label"
|
|
||||||
style="@style/SettingsTextLabelStyle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/customize_colors" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
<include
|
||||||
</LinearLayout>
|
android:id="@+id/settings_color_customization_divider"
|
||||||
|
layout="@layout/divider" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/settings_general_settings_label"
|
android:id="@+id/settings_general_settings_label"
|
||||||
@ -74,70 +63,59 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/general_settings" />
|
android:text="@string/general_settings" />
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/settings_general_settings_holder"
|
<RelativeLayout
|
||||||
|
android:id="@+id/settings_use_english_holder"
|
||||||
|
style="@style/SettingsHolderCheckboxStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:layout_margin="@dimen/medium_margin"
|
|
||||||
android:background="@drawable/section_holder_stroke"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<RelativeLayout
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
android:id="@+id/settings_use_english_holder"
|
android:id="@+id/settings_use_english"
|
||||||
style="@style/SettingsHolderCheckboxStyle"
|
style="@style/SettingsCheckboxStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ripple_top_corners">
|
android:text="@string/use_english_language" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
</RelativeLayout>
|
||||||
android:id="@+id/settings_use_english"
|
|
||||||
style="@style/SettingsCheckboxStyle"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/use_english_language" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
<RelativeLayout
|
||||||
|
android:id="@+id/settings_language_holder"
|
||||||
|
style="@style/SettingsHolderTextViewStyle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<RelativeLayout
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/settings_language_holder"
|
android:id="@+id/settings_language_label"
|
||||||
style="@style/SettingsHolderTextViewStyle"
|
style="@style/SettingsTextLabelStyle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/language" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/settings_language"
|
||||||
|
style="@style/SettingsTextValueStyle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/settings_language_label"
|
||||||
|
tools:text="English" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/settings_hide_launcher_icon_holder"
|
||||||
|
style="@style/SettingsHolderCheckboxStyle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
|
android:id="@+id/settings_hide_launcher_icon"
|
||||||
|
style="@style/SettingsCheckboxStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ripple_top_corners">
|
android:text="@string/hide_launcher_icon" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
</RelativeLayout>
|
||||||
android:id="@+id/settings_language_label"
|
|
||||||
style="@style/SettingsTextLabelStyle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/language" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/settings_language"
|
|
||||||
style="@style/SettingsTextValueStyle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/settings_language_label"
|
|
||||||
tools:text="English" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/settings_hide_launcher_icon_holder"
|
|
||||||
style="@style/SettingsHolderCheckboxStyle"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/ripple_bottom_corners">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
|
||||||
android:id="@+id/settings_hide_launcher_icon"
|
|
||||||
style="@style/SettingsCheckboxStyle"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/hide_launcher_icon" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user