mirror of
https://github.com/SimpleMobileTools/Simple-Thank-You.git
synced 2025-06-05 22:09:28 +02:00
updating commons with some design tweaks
This commit is contained in:
@@ -61,5 +61,5 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:5bbdbc115b'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:8ee6c0c17b'
|
||||||
}
|
}
|
||||||
|
@@ -2,8 +2,6 @@ package com.simplemobiletools.thankyou.activities
|
|||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Menu
|
|
||||||
import android.view.MenuItem
|
|
||||||
import com.simplemobiletools.commons.extensions.appLaunched
|
import com.simplemobiletools.commons.extensions.appLaunched
|
||||||
import com.simplemobiletools.commons.extensions.checkWhatsNew
|
import com.simplemobiletools.commons.extensions.checkWhatsNew
|
||||||
import com.simplemobiletools.commons.extensions.hideKeyboard
|
import com.simplemobiletools.commons.extensions.hideKeyboard
|
||||||
@@ -19,27 +17,25 @@ class MainActivity : SimpleActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
appLaunched(BuildConfig.APPLICATION_ID)
|
appLaunched(BuildConfig.APPLICATION_ID)
|
||||||
|
setupOptionsMenu()
|
||||||
checkWhatsNewDialog()
|
checkWhatsNewDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
updateTextColors(activity_main)
|
updateTextColors(activity_main)
|
||||||
|
setupToolbar(main_toolbar)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
private fun setupOptionsMenu() {
|
||||||
menuInflater.inflate(R.menu.menu_main, menu)
|
main_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||||
updateMenuItemColors(menu)
|
when (menuItem.itemId) {
|
||||||
return true
|
R.id.settings -> launchSettings()
|
||||||
}
|
R.id.about -> launchAbout()
|
||||||
|
else -> return@setOnMenuItemClickListener false
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
}
|
||||||
when (item.itemId) {
|
return@setOnMenuItemClickListener true
|
||||||
R.id.settings -> launchSettings()
|
|
||||||
R.id.about -> launchAbout()
|
|
||||||
else -> return super.onOptionsItemSelected(item)
|
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun launchSettings() {
|
private fun launchSettings() {
|
||||||
|
@@ -3,6 +3,7 @@ package com.simplemobiletools.thankyou.activities
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
|
import com.simplemobiletools.commons.helpers.NavigationIcon
|
||||||
import com.simplemobiletools.thankyou.BuildConfig
|
import com.simplemobiletools.thankyou.BuildConfig
|
||||||
import com.simplemobiletools.thankyou.R
|
import com.simplemobiletools.thankyou.R
|
||||||
import com.simplemobiletools.thankyou.extensions.config
|
import com.simplemobiletools.thankyou.extensions.config
|
||||||
@@ -17,11 +18,12 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
setupToolbar(settings_toolbar, NavigationIcon.Arrow)
|
||||||
|
|
||||||
setupCustomizeColors()
|
setupCustomizeColors()
|
||||||
setupUseEnglish()
|
setupUseEnglish()
|
||||||
setupHideLauncherIcon()
|
setupHideLauncherIcon()
|
||||||
updateTextColors(settings_holder)
|
updateTextColors(settings_nested_scrollview)
|
||||||
|
|
||||||
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())
|
||||||
|
@@ -1,19 +1,46 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/activity_main"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/main_coordinator"
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/text"
|
android:layout_height="match_parent"
|
||||||
|
tools:context="com.simplemobiletools.calculator.activities.MainActivity"
|
||||||
|
tools:ignore="HardcodedText">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/main_app_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/main_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:menu="@menu/menu_main"
|
||||||
|
app:title="@string/app_launcher_name"
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/activity_main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:autoLink="email|web"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:lineSpacingExtra="3dp"
|
|
||||||
android:padding="40dp"
|
|
||||||
android:text="@string/main_text"
|
|
||||||
android:textSize="@dimen/bigger_text_size"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:autoLink="email|web"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:lineSpacingExtra="3dp"
|
||||||
|
android:padding="40dp"
|
||||||
|
android:text="@string/main_text"
|
||||||
|
android:textSize="@dimen/bigger_text_size" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@@ -1,93 +1,118 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/settings_scrollview"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/settings_coordinator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/settings_holder"
|
android:id="@+id/settings_app_bar_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/settings_color_customization_label"
|
android:id="@+id/settings_toolbar"
|
||||||
style="@style/SettingsSectionLabelStyle"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:text="@string/color_customization" />
|
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
|
||||||
|
android:id="@+id/settings_nested_scrollview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:scrollbars="none"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/settings_color_customization_holder"
|
android:id="@+id/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
|
<TextView
|
||||||
android:id="@+id/settings_customize_colors_holder"
|
android:id="@+id/settings_color_customization_label"
|
||||||
style="@style/SettingsHolderTextViewOneLinerStyle"
|
style="@style/SettingsSectionLabelStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ripple_all_corners">
|
android:text="@string/color_customization" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<LinearLayout
|
||||||
android:id="@+id/settings_customize_colors_label"
|
android:id="@+id/settings_color_customization_holder"
|
||||||
style="@style/SettingsTextLabelStyle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/customize_colors" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/settings_general_settings_label"
|
|
||||||
style="@style/SettingsSectionLabelStyle"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/general_settings" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ripple_top_corners">
|
android:layout_margin="@dimen/medium_margin"
|
||||||
|
android:background="@drawable/section_holder_stroke"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
<RelativeLayout
|
||||||
android:id="@+id/settings_use_english"
|
android:id="@+id/settings_customize_colors_holder"
|
||||||
style="@style/SettingsCheckboxStyle"
|
style="@style/SettingsHolderTextViewOneLinerStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/use_english_language" />
|
android:background="@drawable/ripple_all_corners">
|
||||||
|
|
||||||
</RelativeLayout>
|
<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" />
|
||||||
|
|
||||||
<RelativeLayout
|
</RelativeLayout>
|
||||||
android:id="@+id/settings_hide_launcher_icon_holder"
|
</LinearLayout>
|
||||||
style="@style/SettingsHolderCheckboxStyle"
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/settings_general_settings_label"
|
||||||
|
style="@style/SettingsSectionLabelStyle"
|
||||||
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">
|
android:text="@string/general_settings" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
<LinearLayout
|
||||||
android:id="@+id/settings_hide_launcher_icon"
|
android:id="@+id/settings_general_settings_holder"
|
||||||
style="@style/SettingsCheckboxStyle"
|
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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/hide_launcher_icon" />
|
android:background="@drawable/ripple_top_corners">
|
||||||
|
|
||||||
</RelativeLayout>
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
|
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_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>
|
||||||
</LinearLayout>
|
</androidx.core.widget.NestedScrollView>
|
||||||
</ScrollView>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
Reference in New Issue
Block a user