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

View File

@ -1,7 +1,10 @@
package com.simplemobiletools.draw.pro.activities
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.isTiramisuPlus
import com.simplemobiletools.draw.pro.R
@ -11,8 +14,12 @@ import java.util.*
class SettingsActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
isMaterialActivity = true
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
updateMaterialActivityViews(settings_coordinator, settings_holder)
setupMaterialScrollListener(settings_nested_scrollview, settings_toolbar)
}
override fun onResume() {
@ -31,14 +38,10 @@ class SettingsActivity : SimpleActivity() {
arrayOf(settings_color_customization_label, settings_general_settings_label).forEach {
it.setTextColor(getProperPrimaryColor())
}
arrayOf(settings_color_customization_holder, settings_general_settings_holder).forEach {
it.background.applyColorFilter(getProperBackgroundColor().getContrastColor())
}
}
private fun setupCustomizeColors() {
settings_customize_colors_holder.setOnClickListener {
settings_color_customization_holder.setOnClickListener {
startCustomizationActivity()
}
}
@ -57,10 +60,6 @@ class SettingsActivity : SimpleActivity() {
settings_language.text = Locale.getDefault().displayLanguage
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 {
launchChangeAppLanguageIntent()
}

View File

@ -6,29 +6,21 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/settings_app_bar_layout"
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/settings_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/settings_toolbar"
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>
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:title="@string/settings"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
<androidx.core.widget.NestedScrollView
android:id="@+id/settings_nested_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
android:fillViewport="true"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
android:scrollbars="none">
<LinearLayout
android:id="@+id/settings_holder"
@ -43,30 +35,26 @@
android:layout_height="wrap_content"
android:text="@string/color_customization" />
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/settings_color_customization_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
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">
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/settings_customize_colors_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"
android:layout_width="match_parent"
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_customize_colors_label"
style="@style/SettingsTextLabelStyle"
android:layout_width="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
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" />
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
</LinearLayout>
<include
android:id="@+id/settings_color_customization_divider"
layout="@layout/divider" />
<TextView
android:id="@+id/settings_general_settings_label"
@ -79,16 +67,13 @@
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_use_english_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_top_corners">
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_use_english"
@ -103,8 +88,7 @@
android:id="@+id/settings_language_holder"
style="@style/SettingsHolderTextViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_top_corners">
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_language_label"
@ -127,8 +111,7 @@
android:id="@+id/settings_prevent_phone_from_sleeping_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_prevent_phone_from_sleeping"
@ -143,8 +126,7 @@
android:id="@+id/settings_show_brush_size_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_show_brush_size"
@ -159,8 +141,7 @@
android:id="@+id/settings_allow_zooming_canvas_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_allow_zooming_canvas"
@ -175,8 +156,7 @@
android:id="@+id/settings_force_portrait_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_bottom_corners">
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_force_portrait"