updating commons and target SDK to 31

This commit is contained in:
tibbi 2022-04-02 16:09:49 +02:00
parent d8536a02e9
commit 356b56fe71
9 changed files with 58 additions and 29 deletions

View File

@ -10,12 +10,12 @@ if (keystorePropertiesFile.exists()) {
}
android {
compileSdk 30
compileSdk 31
defaultConfig {
applicationId "com.simplemobiletools.keyboard"
minSdk 23
targetSdk 30
targetSdk 31
versionCode 5
versionName "5.0.4"
multiDexEnabled true
@ -64,7 +64,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:4bbd82056d'
implementation 'com.github.SimpleMobileTools:Simple-Commons:a6fa9c19ac'
kapt 'androidx.room:room-compiler:2.3.0'
implementation 'androidx.room:room-runtime:2.3.0'

View File

@ -15,6 +15,7 @@
<application
android:name=".App"
android:allowBackup="true"
android:appCategory="productivity"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_launcher_name"
android:roundIcon="@mipmap/ic_launcher"
@ -23,17 +24,23 @@
<activity
android:name=".activities.SplashActivity"
android:exported="false"
android:theme="@style/SplashTheme" />
<activity android:name=".activities.MainActivity" />
<activity
android:name=".activities.MainActivity"
android:exported="false" />
<activity
android:name=".activities.ManageClipboardItemsActivity"
android:exported="false"
android:label="@string/manage_clipboard_items"
android:parentActivityName=".activities.SettingsActivity" />
<service
android:name=".services.SimpleKeyboardIME"
android:exported="true"
android:label="@string/app_name"
android:permission="android.permission.BIND_INPUT_METHOD">
<meta-data
@ -46,11 +53,18 @@
<activity
android:name=".activities.SettingsActivity"
android:exported="true"
android:label="@string/settings"
android:parentActivityName=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
@ -66,6 +80,7 @@
<activity-alias
android:name=".activities.SplashActivity.Red"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_red"
android:roundIcon="@mipmap/ic_launcher_red"
android:targetActivity=".activities.SplashActivity">
@ -79,6 +94,7 @@
<activity-alias
android:name=".activities.SplashActivity.Pink"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_pink"
android:roundIcon="@mipmap/ic_launcher_pink"
android:targetActivity=".activities.SplashActivity">
@ -92,6 +108,7 @@
<activity-alias
android:name=".activities.SplashActivity.Purple"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_purple"
android:roundIcon="@mipmap/ic_launcher_purple"
android:targetActivity=".activities.SplashActivity">
@ -105,6 +122,7 @@
<activity-alias
android:name=".activities.SplashActivity.Deep_purple"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_deep_purple"
android:roundIcon="@mipmap/ic_launcher_deep_purple"
android:targetActivity=".activities.SplashActivity">
@ -118,6 +136,7 @@
<activity-alias
android:name=".activities.SplashActivity.Indigo"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_indigo"
android:roundIcon="@mipmap/ic_launcher_indigo"
android:targetActivity=".activities.SplashActivity">
@ -131,6 +150,7 @@
<activity-alias
android:name=".activities.SplashActivity.Blue"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_blue"
android:roundIcon="@mipmap/ic_launcher_blue"
android:targetActivity=".activities.SplashActivity">
@ -144,6 +164,7 @@
<activity-alias
android:name=".activities.SplashActivity.Light_blue"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_light_blue"
android:roundIcon="@mipmap/ic_launcher_light_blue"
android:targetActivity=".activities.SplashActivity">
@ -157,6 +178,7 @@
<activity-alias
android:name=".activities.SplashActivity.Cyan"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_cyan"
android:roundIcon="@mipmap/ic_launcher_cyan"
android:targetActivity=".activities.SplashActivity">
@ -170,6 +192,7 @@
<activity-alias
android:name=".activities.SplashActivity.Teal"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_teal"
android:roundIcon="@mipmap/ic_launcher_teal"
android:targetActivity=".activities.SplashActivity">
@ -183,6 +206,7 @@
<activity-alias
android:name=".activities.SplashActivity.Green"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_green"
android:roundIcon="@mipmap/ic_launcher_green"
android:targetActivity=".activities.SplashActivity">
@ -196,6 +220,7 @@
<activity-alias
android:name=".activities.SplashActivity.Light_green"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_light_green"
android:roundIcon="@mipmap/ic_launcher_light_green"
android:targetActivity=".activities.SplashActivity">
@ -209,6 +234,7 @@
<activity-alias
android:name=".activities.SplashActivity.Lime"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_lime"
android:roundIcon="@mipmap/ic_launcher_lime"
android:targetActivity=".activities.SplashActivity">
@ -222,6 +248,7 @@
<activity-alias
android:name=".activities.SplashActivity.Yellow"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_yellow"
android:roundIcon="@mipmap/ic_launcher_yellow"
android:targetActivity=".activities.SplashActivity">
@ -235,6 +262,7 @@
<activity-alias
android:name=".activities.SplashActivity.Amber"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_amber"
android:roundIcon="@mipmap/ic_launcher_amber"
android:targetActivity=".activities.SplashActivity">
@ -248,6 +276,7 @@
<activity-alias
android:name=".activities.SplashActivity.Orange"
android:enabled="true"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:targetActivity=".activities.SplashActivity">
@ -260,6 +289,7 @@
<activity-alias
android:name=".activities.SplashActivity.Deep_orange"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_deep_orange"
android:roundIcon="@mipmap/ic_launcher_deep_orange"
android:targetActivity=".activities.SplashActivity">
@ -273,6 +303,7 @@
<activity-alias
android:name=".activities.SplashActivity.Brown"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_brown"
android:roundIcon="@mipmap/ic_launcher_brown"
android:targetActivity=".activities.SplashActivity">
@ -286,6 +317,7 @@
<activity-alias
android:name=".activities.SplashActivity.Blue_grey"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_blue_grey"
android:roundIcon="@mipmap/ic_launcher_blue_grey"
android:targetActivity=".activities.SplashActivity">
@ -299,6 +331,7 @@
<activity-alias
android:name=".activities.SplashActivity.Grey_black"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_grey_black"
android:roundIcon="@mipmap/ic_launcher_grey_black"
android:targetActivity=".activities.SplashActivity">

View File

@ -14,7 +14,6 @@ import com.simplemobiletools.commons.helpers.LICENSE_GSON
import com.simplemobiletools.commons.models.FAQItem
import com.simplemobiletools.keyboard.BuildConfig
import com.simplemobiletools.keyboard.R
import com.simplemobiletools.keyboard.extensions.config
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : SimpleActivity() {
@ -44,7 +43,7 @@ class MainActivity : SimpleActivity() {
updateTextColors(main_holder)
updateChangeKeyboardColor()
main_holder.setBackgroundColor(config.backgroundColor)
main_holder.setBackgroundColor(getProperBackgroundColor())
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
@ -80,9 +79,9 @@ class MainActivity : SimpleActivity() {
private fun updateChangeKeyboardColor() {
val applyBackground = resources.getDrawable(R.drawable.button_background_rounded, theme) as RippleDrawable
(applyBackground as LayerDrawable).findDrawableByLayerId(R.id.button_background_holder).applyColorFilter(getAdjustedPrimaryColor())
(applyBackground as LayerDrawable).findDrawableByLayerId(R.id.button_background_holder).applyColorFilter(getProperPrimaryColor())
change_keyboard.background = applyBackground
change_keyboard.setTextColor(getAdjustedPrimaryColor().getContrastColor())
change_keyboard.setTextColor(getProperPrimaryColor().getContrastColor())
}
private fun isKeyboardEnabled(): Boolean {

View File

@ -9,7 +9,10 @@ import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.simplemobiletools.commons.dialogs.FilePickerDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.helpers.PERMISSION_READ_STORAGE
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.commons.helpers.isQPlus
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
import com.simplemobiletools.keyboard.R
import com.simplemobiletools.keyboard.adapters.ClipsActivityAdapter
@ -23,7 +26,6 @@ import kotlinx.android.synthetic.main.activity_manage_clipboard_items.*
import java.io.File
import java.io.InputStream
import java.io.OutputStream
import java.util.*
class ManageClipboardItemsActivity : SimpleActivity(), RefreshRecyclerViewListener {
private val PICK_EXPORT_CLIPS_INTENT = 21
@ -38,7 +40,7 @@ class ManageClipboardItemsActivity : SimpleActivity(), RefreshRecyclerViewListen
clipboard_items_placeholder.text = "${getText(R.string.manage_clipboard_empty)}\n\n${getText(R.string.manage_clips)}"
clipboard_items_placeholder_2.apply {
underlineText()
setTextColor(getAdjustedPrimaryColor())
setTextColor(getProperPrimaryColor())
setOnClickListener {
addOrEditClip()
}

View File

@ -38,11 +38,11 @@ class SettingsActivity : SimpleActivity() {
updateTextColors(settings_scrollview)
arrayOf(settings_color_customization_label, settings_general_settings_label).forEach {
it.setTextColor(getAdjustedPrimaryColor())
it.setTextColor(getProperPrimaryColor())
}
arrayOf(settings_color_customization_holder, settings_general_settings_holder).forEach {
it.background.applyColorFilter(baseConfig.backgroundColor.getContrastColor())
it.background.applyColorFilter(getProperBackgroundColor().getContrastColor())
}
}

View File

@ -9,13 +9,9 @@ import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.simplemobiletools.commons.extensions.applyColorFilter
import com.simplemobiletools.commons.extensions.performHapticFeedback
import com.simplemobiletools.commons.extensions.removeUnderlines
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.keyboard.R
import com.simplemobiletools.keyboard.extensions.clipsDB
import com.simplemobiletools.keyboard.extensions.config
import com.simplemobiletools.keyboard.extensions.getCurrentClip
import com.simplemobiletools.keyboard.helpers.ClipsHelper
@ -27,7 +23,6 @@ import com.simplemobiletools.keyboard.models.ClipsSectionLabel
import com.simplemobiletools.keyboard.models.ListItem
import kotlinx.android.synthetic.main.item_clip_on_keyboard.view.*
import kotlinx.android.synthetic.main.item_section_label.view.*
import java.util.*
class ClipsKeyboardAdapter(
val context: Context, var items: ArrayList<ListItem>, val refreshClipsListener: RefreshClipsListener,
@ -36,8 +31,8 @@ class ClipsKeyboardAdapter(
private val layoutInflater = LayoutInflater.from(context)
private val baseConfig = context.config
private var textColor = baseConfig.textColor
private var backgroundColor = baseConfig.backgroundColor
private var textColor = context.getProperTextColor()
private var backgroundColor = context.getProperBackgroundColor()
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val layoutId = when (viewType) {

View File

@ -212,9 +212,9 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
mLabelTextSize = resources.getDimension(R.dimen.label_text_size).toInt()
mPreviewHeight = resources.getDimension(R.dimen.key_height).toInt()
mSpaceMoveThreshold = resources.getDimension(R.dimen.medium_margin).toInt()
mTextColor = context.config.textColor
mBackgroundColor = context.config.backgroundColor
mPrimaryColor = context.getAdjustedPrimaryColor()
mTextColor = context.getProperTextColor()
mBackgroundColor = context.getProperBackgroundColor()
mPrimaryColor = context.getProperPrimaryColor()
mPreviewPopup = PopupWindow(context)
mPreviewText = inflater.inflate(resources.getLayout(R.layout.keyboard_key_preview), null) as TextView
@ -263,9 +263,9 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
closeClipboardManager()
if (visibility == VISIBLE) {
mTextColor = context.config.textColor
mBackgroundColor = context.config.backgroundColor
mPrimaryColor = context.getAdjustedPrimaryColor()
mTextColor = context.getProperTextColor()
mBackgroundColor = context.getProperBackgroundColor()
mPrimaryColor = context.getProperPrimaryColor()
if (changedView == mini_keyboard_view) {
val previewBackground = background as LayerDrawable

View File

@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong

View File

@ -1,6 +1,6 @@
#Tue Jan 04 09:48:27 CET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME