mirror of
https://github.com/SimpleMobileTools/Simple-Thank-You.git
synced 2025-02-16 11:31:34 +01:00
updating commons and min OS to 6
This commit is contained in:
parent
34a9afc3e7
commit
4232204e56
@ -13,7 +13,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.simplemobiletools.thankyou"
|
||||
minSdkVersion 21
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 33
|
||||
versionCode 28
|
||||
versionName "5.7.0"
|
||||
@ -61,5 +61,5 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:f74a128e2e'
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:7e489f7121'
|
||||
}
|
||||
|
@ -27,10 +27,12 @@
|
||||
|
||||
<activity
|
||||
android:name=".activities.MainActivity"
|
||||
android:configChanges="orientation"
|
||||
android:exported="false" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.SettingsActivity"
|
||||
android:configChanges="orientation"
|
||||
android:exported="true"
|
||||
android:label="@string/settings"
|
||||
android:parentActivityName=".activities.MainActivity">
|
||||
@ -43,28 +45,18 @@
|
||||
|
||||
<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.LicenseActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/third_party_licences"
|
||||
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity" />
|
||||
|
||||
<activity
|
||||
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
|
||||
android:configChanges="orientation"
|
||||
android:exported="false"
|
||||
android:label="@string/customize_colors"
|
||||
android:parentActivityName=".activities.SettingsActivity" />
|
||||
|
||||
<activity
|
||||
android:name="com.simplemobiletools.commons.activities.FAQActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/frequently_asked_questions"
|
||||
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity" />
|
||||
|
||||
<provider
|
||||
android:name=".contentproviders.MyContentProvider"
|
||||
android:authorities="com.simplemobiletools.commons.provider"
|
||||
|
@ -2,10 +2,7 @@ package com.simplemobiletools.thankyou.activities
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.simplemobiletools.commons.extensions.appLaunched
|
||||
import com.simplemobiletools.commons.extensions.checkWhatsNew
|
||||
import com.simplemobiletools.commons.extensions.hideKeyboard
|
||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.models.FAQItem
|
||||
import com.simplemobiletools.commons.models.Release
|
||||
import com.simplemobiletools.thankyou.BuildConfig
|
||||
@ -13,23 +10,34 @@ import com.simplemobiletools.thankyou.R
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
|
||||
class MainActivity : SimpleActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
isMaterialActivity = true
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
appLaunched(BuildConfig.APPLICATION_ID)
|
||||
refreshMenuItems()
|
||||
setupOptionsMenu()
|
||||
checkWhatsNewDialog()
|
||||
updateMaterialActivityViews(main_coordinator, activity_main, true)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
updateTextColors(activity_main)
|
||||
setupToolbar(main_toolbar)
|
||||
setupToolbar(main_toolbar, statusBarColor = getProperBackgroundColor())
|
||||
}
|
||||
|
||||
private fun refreshMenuItems() {
|
||||
main_toolbar.menu.apply {
|
||||
findItem(R.id.more_apps_from_us).isVisible = !resources.getBoolean(R.bool.hide_google_relations)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupOptionsMenu() {
|
||||
main_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||
when (menuItem.itemId) {
|
||||
R.id.more_apps_from_us -> launchMoreAppsFromUsIntent()
|
||||
R.id.settings -> launchSettings()
|
||||
R.id.about -> launchAbout()
|
||||
else -> return@setOnMenuItemClickListener false
|
||||
|
@ -6,13 +6,11 @@ import android.database.Cursor
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import android.database.sqlite.SQLiteOpenHelper
|
||||
import com.simplemobiletools.commons.R
|
||||
import com.simplemobiletools.commons.helpers.INVALID_NAVIGATION_BAR_COLOR
|
||||
import com.simplemobiletools.commons.helpers.MyContentProvider.Companion.COL_ACCENT_COLOR
|
||||
import com.simplemobiletools.commons.helpers.MyContentProvider.Companion.COL_APP_ICON_COLOR
|
||||
import com.simplemobiletools.commons.helpers.MyContentProvider.Companion.COL_BACKGROUND_COLOR
|
||||
import com.simplemobiletools.commons.helpers.MyContentProvider.Companion.COL_ID
|
||||
import com.simplemobiletools.commons.helpers.MyContentProvider.Companion.COL_LAST_UPDATED_TS
|
||||
import com.simplemobiletools.commons.helpers.MyContentProvider.Companion.COL_NAVIGATION_BAR_COLOR
|
||||
import com.simplemobiletools.commons.helpers.MyContentProvider.Companion.COL_PRIMARY_COLOR
|
||||
import com.simplemobiletools.commons.helpers.MyContentProvider.Companion.COL_TEXT_COLOR
|
||||
import com.simplemobiletools.commons.helpers.MyContentProvider.Companion.fillThemeContentValues
|
||||
@ -32,9 +30,10 @@ class MyContentProviderDbHelper private constructor(private val context: Context
|
||||
}
|
||||
|
||||
override fun onCreate(db: SQLiteDatabase) {
|
||||
db.execSQL("CREATE TABLE $TABLE_NAME ($COL_ID INTEGER PRIMARY KEY AUTOINCREMENT, $COL_TEXT_COLOR INTEGER DEFAULT 0, $COL_BACKGROUND_COLOR INTEGER DEFAULT 0," +
|
||||
" $COL_PRIMARY_COLOR INTEGER DEFAULT 0, $COL_APP_ICON_COLOR INTEGER DEFAULT 0, $COL_NAVIGATION_BAR_COLOR INTEGER DEFAULT $INVALID_NAVIGATION_BAR_COLOR," +
|
||||
" $COL_LAST_UPDATED_TS INTEGER DEFAULT 0, $COL_ACCENT_COLOR INTEGER DEFAULT 0)")
|
||||
db.execSQL(
|
||||
"CREATE TABLE $TABLE_NAME ($COL_ID INTEGER PRIMARY KEY AUTOINCREMENT, $COL_TEXT_COLOR INTEGER DEFAULT 0, $COL_BACKGROUND_COLOR INTEGER DEFAULT 0," +
|
||||
" $COL_PRIMARY_COLOR INTEGER DEFAULT 0, $COL_APP_ICON_COLOR INTEGER DEFAULT 0, $COL_LAST_UPDATED_TS INTEGER DEFAULT 0, $COL_ACCENT_COLOR INTEGER DEFAULT 0)"
|
||||
)
|
||||
}
|
||||
|
||||
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
||||
@ -42,10 +41,6 @@ class MyContentProviderDbHelper private constructor(private val context: Context
|
||||
db.execSQL("ALTER TABLE $TABLE_NAME ADD COLUMN $COL_APP_ICON_COLOR INTEGER DEFAULT 0")
|
||||
}
|
||||
|
||||
if (oldVersion < 3) {
|
||||
db.execSQL("ALTER TABLE $TABLE_NAME ADD COLUMN $COL_NAVIGATION_BAR_COLOR INTEGER DEFAULT $INVALID_NAVIGATION_BAR_COLOR")
|
||||
}
|
||||
|
||||
if (oldVersion < 4) {
|
||||
db.execSQL("ALTER TABLE $TABLE_NAME ADD COLUMN $COL_ACCENT_COLOR INTEGER DEFAULT 0")
|
||||
}
|
||||
@ -53,9 +48,10 @@ class MyContentProviderDbHelper private constructor(private val context: Context
|
||||
|
||||
private fun insertDefaultTheme() {
|
||||
val resources = context.resources
|
||||
val theme = SharedTheme(resources.getColor(R.color.theme_dark_text_color), resources.getColor(R.color.theme_dark_background_color),
|
||||
resources.getColor(R.color.color_primary), resources.getColor(R.color.color_primary), INVALID_NAVIGATION_BAR_COLOR, 0,
|
||||
resources.getColor(R.color.color_primary))
|
||||
val theme = SharedTheme(
|
||||
resources.getColor(R.color.theme_dark_text_color), resources.getColor(R.color.theme_dark_background_color),
|
||||
resources.getColor(R.color.color_primary), resources.getColor(R.color.color_primary), 0, resources.getColor(R.color.color_primary)
|
||||
)
|
||||
insertTheme(theme, mDb)
|
||||
}
|
||||
|
||||
@ -92,7 +88,15 @@ class MyContentProviderDbHelper private constructor(private val context: Context
|
||||
return null
|
||||
}
|
||||
|
||||
val cols = arrayOf(COL_TEXT_COLOR, COL_BACKGROUND_COLOR, COL_PRIMARY_COLOR, COL_APP_ICON_COLOR, COL_NAVIGATION_BAR_COLOR, COL_LAST_UPDATED_TS, COL_ACCENT_COLOR)
|
||||
val cols = arrayOf(
|
||||
COL_TEXT_COLOR,
|
||||
COL_BACKGROUND_COLOR,
|
||||
COL_PRIMARY_COLOR,
|
||||
COL_APP_ICON_COLOR,
|
||||
COL_LAST_UPDATED_TS,
|
||||
COL_ACCENT_COLOR
|
||||
)
|
||||
|
||||
val selection = "$COL_ID = ?"
|
||||
val selectionArgs = arrayOf(THEME_ID.toString())
|
||||
return mDb.query(TABLE_NAME, cols, selection, selectionArgs, null, null, null)
|
||||
|
@ -3,33 +3,23 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_coordinator"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
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"
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/main_toolbar"
|
||||
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>
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/color_primary"
|
||||
app:menu="@menu/menu_main"
|
||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/activity_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
android:layout_marginTop="?attr/actionBarSize">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/text"
|
||||
|
@ -1,6 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/more_apps_from_us"
|
||||
android:icon="@drawable/ic_google_play_vector"
|
||||
android:title="@string/more_apps_from_us"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/settings"
|
||||
android:icon="@drawable/ic_settings_cog_vector"
|
||||
|
@ -9,7 +9,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.2.2'
|
||||
classpath 'com.android.tools.build:gradle:7.3.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||
|
Loading…
x
Reference in New Issue
Block a user