adding some styling changes

This commit is contained in:
tibbi 2022-12-20 10:34:54 +01:00
parent 23d614eb44
commit 54c405bfa7
3 changed files with 40 additions and 58 deletions

View File

@ -67,6 +67,7 @@
<activity <activity
android:name=".activities.SettingsActivity" android:name=".activities.SettingsActivity"
android:configChanges="orientation"
android:exported="true" android:exported="true"
android:label="@string/settings" android:label="@string/settings"
android:parentActivityName=".activities.MainActivity"> android:parentActivityName=".activities.MainActivity">
@ -79,12 +80,14 @@
<activity <activity
android:name="com.simplemobiletools.commons.activities.AboutActivity" android:name="com.simplemobiletools.commons.activities.AboutActivity"
android:configChanges="orientation"
android:exported="false" android:exported="false"
android:label="@string/about" android:label="@string/about"
android:parentActivityName=".activities.MainActivity" /> android:parentActivityName=".activities.MainActivity" />
<activity <activity
android:name="com.simplemobiletools.commons.activities.CustomizationActivity" android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
android:configChanges="orientation"
android:exported="false" android:exported="false"
android:label="@string/customize_colors" android:label="@string/customize_colors"
android:parentActivityName=".activities.SettingsActivity" /> android:parentActivityName=".activities.SettingsActivity" />

View File

@ -1,7 +1,10 @@
package com.simplemobiletools.draw.pro.activities package com.simplemobiletools.draw.pro.activities
import android.os.Bundle import android.os.Bundle
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
import com.simplemobiletools.commons.extensions.isGone
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.helpers.NavigationIcon import com.simplemobiletools.commons.helpers.NavigationIcon
import com.simplemobiletools.commons.helpers.isTiramisuPlus import com.simplemobiletools.commons.helpers.isTiramisuPlus
import com.simplemobiletools.draw.pro.R import com.simplemobiletools.draw.pro.R
@ -11,8 +14,12 @@ 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)
setupMaterialScrollListener(settings_nested_scrollview, settings_toolbar)
} }
override fun onResume() { override fun onResume() {
@ -31,14 +38,10 @@ class SettingsActivity : SimpleActivity() {
arrayOf(settings_color_customization_label, settings_general_settings_label).forEach { arrayOf(settings_color_customization_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()
} }
} }
@ -57,10 +60,6 @@ class SettingsActivity : SimpleActivity() {
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_prevent_phone_from_sleeping_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme)
}
settings_language_holder.setOnClickListener { settings_language_holder.setOnClickListener {
launchChangeAppLanguageIntent() launchChangeAppLanguageIntent()
} }

View File

@ -6,29 +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:layout_scrollFlags="scroll|enterAlways"
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"
@ -43,30 +35,26 @@
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_customize_colors_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"
@ -79,16 +67,13 @@
android:id="@+id/settings_general_settings_holder" android:id="@+id/settings_general_settings_holder"
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"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:id="@+id/settings_use_english_holder" android:id="@+id/settings_use_english_holder"
style="@style/SettingsHolderCheckboxStyle" style="@style/SettingsHolderCheckboxStyle"
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">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox <com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_use_english" android:id="@+id/settings_use_english"
@ -103,8 +88,7 @@
android:id="@+id/settings_language_holder" android:id="@+id/settings_language_holder"
style="@style/SettingsHolderTextViewStyle" style="@style/SettingsHolderTextViewStyle"
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">
<com.simplemobiletools.commons.views.MyTextView <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_language_label" android:id="@+id/settings_language_label"
@ -127,8 +111,7 @@
android:id="@+id/settings_prevent_phone_from_sleeping_holder" android:id="@+id/settings_prevent_phone_from_sleeping_holder"
style="@style/SettingsHolderCheckboxStyle" style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox <com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_prevent_phone_from_sleeping" android:id="@+id/settings_prevent_phone_from_sleeping"
@ -143,8 +126,7 @@
android:id="@+id/settings_show_brush_size_holder" android:id="@+id/settings_show_brush_size_holder"
style="@style/SettingsHolderCheckboxStyle" style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox <com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_show_brush_size" android:id="@+id/settings_show_brush_size"
@ -159,8 +141,7 @@
android:id="@+id/settings_allow_zooming_canvas_holder" android:id="@+id/settings_allow_zooming_canvas_holder"
style="@style/SettingsHolderCheckboxStyle" style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox <com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_allow_zooming_canvas" android:id="@+id/settings_allow_zooming_canvas"
@ -175,8 +156,7 @@
android:id="@+id/settings_force_portrait_holder" android:id="@+id/settings_force_portrait_holder"
style="@style/SettingsHolderCheckboxStyle" style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:background="@drawable/ripple_bottom_corners">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox <com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_force_portrait" android:id="@+id/settings_force_portrait"