mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-04-28 08:38:44 +02:00
adding some setting UI changes
This commit is contained in:
parent
eebf28a48b
commit
ab782a00a9
@ -56,7 +56,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:5cd2e8dc9b'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:3536629452'
|
||||||
implementation 'com.facebook.stetho:stetho:1.5.0'
|
implementation 'com.facebook.stetho:stetho:1.5.0'
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
|
@ -23,6 +23,14 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
setupUseEnglish()
|
setupUseEnglish()
|
||||||
setupCloseApp()
|
setupCloseApp()
|
||||||
updateTextColors(settings_holder)
|
updateTextColors(settings_holder)
|
||||||
|
|
||||||
|
arrayOf(settings_color_customization_label, settings_general_settings_label).forEach {
|
||||||
|
it.setTextColor(getAdjustedPrimaryColor())
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayOf(settings_color_customization_holder, settings_general_settings_holder).forEach {
|
||||||
|
it.background.applyColorFilter(baseConfig.backgroundColor.getContrastColor())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
@ -32,6 +40,12 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun setupPurchaseThankYou() {
|
private fun setupPurchaseThankYou() {
|
||||||
settings_purchase_thank_you_holder.beGoneIf(isOrWasThankYouInstalled())
|
settings_purchase_thank_you_holder.beGoneIf(isOrWasThankYouInstalled())
|
||||||
|
|
||||||
|
// make sure the corners at ripple fit the stroke rounded corners
|
||||||
|
if (settings_purchase_thank_you_holder.isGone()) {
|
||||||
|
settings_use_english_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme)
|
||||||
|
}
|
||||||
|
|
||||||
settings_purchase_thank_you_holder.setOnClickListener {
|
settings_purchase_thank_you_holder.setOnClickListener {
|
||||||
launchPurchaseThankYouIntent()
|
launchPurchaseThankYouIntent()
|
||||||
}
|
}
|
||||||
@ -47,6 +61,11 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
private fun setupUseEnglish() {
|
private fun setupUseEnglish() {
|
||||||
settings_use_english_holder.beVisibleIf(config.wasUseEnglishToggled || Locale.getDefault().language != "en")
|
settings_use_english_holder.beVisibleIf(config.wasUseEnglishToggled || Locale.getDefault().language != "en")
|
||||||
settings_use_english.isChecked = config.useEnglish
|
settings_use_english.isChecked = config.useEnglish
|
||||||
|
|
||||||
|
if (settings_use_english_holder.isGone() && settings_purchase_thank_you_holder.isGone()) {
|
||||||
|
settings_close_app_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme)
|
||||||
|
}
|
||||||
|
|
||||||
settings_use_english_holder.setOnClickListener {
|
settings_use_english_holder.setOnClickListener {
|
||||||
settings_use_english.toggle()
|
settings_use_english.toggle()
|
||||||
config.useEnglish = settings_use_english.isChecked
|
config.useEnglish = settings_use_english.isChecked
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/settings_scrollview"
|
android:id="@+id/settings_scrollview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
@ -11,92 +10,128 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
<TextView
|
||||||
android:id="@+id/settings_purchase_thank_you_holder"
|
android:id="@+id/settings_color_customization_label"
|
||||||
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/activity_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:gravity="center_horizontal"
|
||||||
android:paddingLeft="@dimen/normal_margin"
|
android:text="@string/color_customization"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:textSize="@dimen/big_text_size" />
|
||||||
android:paddingRight="@dimen/normal_margin"
|
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<LinearLayout
|
||||||
android:id="@+id/settings_purchase_thank_you"
|
android:id="@+id/settings_color_customization_holder"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:paddingStart="@dimen/medium_margin"
|
|
||||||
android:text="@string/purchase_simple_thank_you" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
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_margin="@dimen/medium_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="@drawable/section_holder_stroke"
|
||||||
android:paddingLeft="@dimen/normal_margin"
|
android:orientation="vertical">
|
||||||
android:paddingTop="@dimen/activity_margin"
|
|
||||||
android:paddingRight="@dimen/normal_margin"
|
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<RelativeLayout
|
||||||
android:id="@+id/settings_customize_colors_label"
|
android:id="@+id/settings_customize_colors_holder"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:paddingStart="@dimen/medium_margin"
|
|
||||||
android:text="@string/customize_colors" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/settings_use_english_holder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:paddingLeft="@dimen/normal_margin"
|
|
||||||
android:paddingTop="@dimen/activity_margin"
|
|
||||||
android:paddingRight="@dimen/normal_margin"
|
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
|
||||||
android:id="@+id/settings_use_english"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@null"
|
android:background="@drawable/ripple_all_corners"
|
||||||
android:clickable="false"
|
android:paddingLeft="@dimen/normal_margin"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingTop="@dimen/bigger_margin"
|
||||||
android:text="@string/use_english_language"
|
android:paddingRight="@dimen/normal_margin"
|
||||||
app:switchPadding="@dimen/medium_margin" />
|
android:paddingBottom="@dimen/bigger_margin">
|
||||||
|
|
||||||
</RelativeLayout>
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/settings_customize_colors_label"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:paddingStart="@dimen/medium_margin"
|
||||||
|
android:text="@string/customize_colors" />
|
||||||
|
|
||||||
<RelativeLayout
|
</RelativeLayout>
|
||||||
android:id="@+id/settings_close_app_holder"
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/settings_general_settings_label"
|
||||||
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/activity_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:gravity="center_horizontal"
|
||||||
android:paddingLeft="@dimen/normal_margin"
|
android:text="@string/general_settings"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:textSize="@dimen/big_text_size" />
|
||||||
android:paddingRight="@dimen/normal_margin"
|
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
<LinearLayout
|
||||||
android:id="@+id/settings_close_app"
|
android:id="@+id/settings_general_settings_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="@dimen/medium_margin"
|
||||||
|
android:background="@drawable/section_holder_stroke"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/settings_purchase_thank_you_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@null"
|
android:background="@drawable/ripple_top_corners"
|
||||||
android:clickable="false"
|
android:paddingLeft="@dimen/normal_margin"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingTop="@dimen/bigger_margin"
|
||||||
android:text="@string/close_app"
|
android:paddingRight="@dimen/normal_margin"
|
||||||
app:switchPadding="@dimen/medium_margin" />
|
android:paddingBottom="@dimen/bigger_margin">
|
||||||
|
|
||||||
</RelativeLayout>
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/settings_purchase_thank_you"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:paddingStart="@dimen/medium_margin"
|
||||||
|
android:text="@string/purchase_simple_thank_you" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/settings_use_english_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/ripple_background"
|
||||||
|
android:paddingLeft="@dimen/normal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_margin"
|
||||||
|
android:paddingRight="@dimen/normal_margin"
|
||||||
|
android:paddingBottom="@dimen/activity_margin">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
|
android:id="@+id/settings_use_english"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:button="@null"
|
||||||
|
android:clickable="false"
|
||||||
|
android:drawableEnd="?android:attr/listChoiceIndicatorMultiple"
|
||||||
|
android:drawablePadding="@dimen/activity_margin"
|
||||||
|
android:paddingStart="@dimen/medium_margin"
|
||||||
|
android:text="@string/use_english_language" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/settings_close_app_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/ripple_bottom_corners"
|
||||||
|
android:paddingLeft="@dimen/normal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_margin"
|
||||||
|
android:paddingRight="@dimen/normal_margin"
|
||||||
|
android:paddingBottom="@dimen/activity_margin">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
|
android:id="@+id/settings_close_app"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:button="@null"
|
||||||
|
android:clickable="false"
|
||||||
|
android:drawableEnd="?android:attr/listChoiceIndicatorMultiple"
|
||||||
|
android:drawablePadding="@dimen/activity_margin"
|
||||||
|
android:paddingStart="@dimen/medium_margin"
|
||||||
|
android:text="@string/close_app" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user