updating gradle, target SDK to 31

This commit is contained in:
tibbi 2022-04-20 19:46:47 +02:00
parent ed503aa7e4
commit deba1c77d6
9 changed files with 67 additions and 23 deletions

View File

@ -10,12 +10,12 @@ if (keystorePropertiesFile.exists()) {
}
android {
compileSdkVersion 30
compileSdkVersion 31
defaultConfig {
applicationId "com.simplemobiletools.clock"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31
versionCode 25
versionName "5.6.1"
setProperty("archivesBaseName", "clock")
@ -69,7 +69,7 @@ android {
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:eee4809d37'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.shawnlin:number-picker:2.4.6'
implementation "androidx.preference:preference-ktx:1.1.1"
implementation "androidx.work:work-runtime-ktx:2.6.0"

View File

@ -19,6 +19,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"
@ -26,6 +27,7 @@
<activity
android:name=".activities.SplashActivity"
android:exported="false"
android:launchMode="singleTask"
android:theme="@style/SplashTheme">
@ -37,34 +39,47 @@
<activity
android:name=".activities.MainActivity"
android:exported="false"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan"/>
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".activities.ReminderActivity"
android:exported="false"
android:launchMode="singleTask" />
<activity
android:name=".activities.SettingsActivity"
android:exported="true"
android:label="@string/settings"
android:parentActivityName=".activities.MainActivity" />
android:parentActivityName=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.simplemobiletools.commons.activities.AboutActivity"
android:exported="false"
android:label="@string/about"
android:parentActivityName=".activities.MainActivity" />
<activity
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
android:exported="false"
android:label="@string/customize_colors"
android:parentActivityName=".activities.SettingsActivity" />
<activity
android:name=".activities.SnoozeReminderActivity"
android:exported="false"
android:theme="@style/Theme.Transparent" />
<activity
android:name=".activities.WidgetDateTimeConfigureActivity"
android:exported="true"
android:theme="@style/MyWidgetConfigTheme">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
@ -83,7 +98,9 @@
<receiver android:name=".receivers.DateTimeWidgetUpdateReceiver" />
<receiver android:name=".receivers.BootCompletedReceiver">
<receiver
android:name=".receivers.BootCompletedReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
@ -93,7 +110,9 @@
<receiver
android:name=".helpers.MyWidgetDateTimeProvider"
android:exported="true"
android:label="@string/clock_and_date">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.appwidget.action.APPWIDGET_ENABLED" />
@ -104,7 +123,10 @@
android:resource="@xml/widget_date_time_info" />
</receiver>
<receiver android:name=".receivers.UpdateWidgetReceiver">
<receiver
android:name=".receivers.UpdateWidgetReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.TIME_SET" />
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
@ -115,6 +137,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">
@ -128,6 +151,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">
@ -141,6 +165,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">
@ -154,6 +179,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">
@ -167,6 +193,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">
@ -180,6 +207,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">
@ -193,6 +221,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">
@ -206,6 +235,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">
@ -219,6 +249,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">
@ -232,6 +263,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">
@ -245,6 +277,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">
@ -258,6 +291,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">
@ -271,6 +305,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">
@ -284,6 +319,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">
@ -297,6 +333,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">
@ -309,6 +346,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">
@ -322,6 +360,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">
@ -335,6 +374,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">
@ -348,6 +388,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

@ -19,10 +19,11 @@ import com.simplemobiletools.commons.extensions.isVisible
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.views.MyRecyclerView
import kotlinx.android.synthetic.main.item_alarm.view.*
import java.util.*
class AlarmsAdapter(activity: SimpleActivity, var alarms: ArrayList<Alarm>, val toggleAlarmInterface: ToggleAlarmInterface,
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
class AlarmsAdapter(
activity: SimpleActivity, var alarms: ArrayList<Alarm>, val toggleAlarmInterface: ToggleAlarmInterface,
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit
) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) {
init {
setupDragListener(true)

View File

@ -17,7 +17,7 @@ import kotlinx.android.synthetic.main.item_lap.view.*
import java.util.*
class StopwatchAdapter(activity: SimpleActivity, var laps: ArrayList<Lap>, recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) :
MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
MyRecyclerViewAdapter(activity, recyclerView, itemClick) {
private var lastLapTimeView: TextView? = null
private var lastTotalTimeView: TextView? = null
private var lastLapId = 0

View File

@ -17,7 +17,7 @@ import kotlinx.android.synthetic.main.item_time_zone.view.*
import java.util.*
class TimeZonesAdapter(activity: SimpleActivity, var timeZones: ArrayList<MyTimeZone>, recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) :
MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
MyRecyclerViewAdapter(activity, recyclerView, itemClick) {
var todayDateString = activity.getFormattedDate(Calendar.getInstance())

View File

@ -23,7 +23,7 @@ class TimerAdapter(
recyclerView: MyRecyclerView,
onRefresh: () -> Unit,
onItemClick: (Timer) -> Unit,
) : MyRecyclerViewListAdapter<Timer>(simpleActivity, recyclerView, diffUtil, null, onItemClick, onRefresh) {
) : MyRecyclerViewListAdapter<Timer>(simpleActivity, recyclerView, diffUtil, onItemClick, onRefresh) {
companion object {
private val diffUtil = object : DiffUtil.ItemCallback<Timer>() {

View File

@ -92,13 +92,15 @@ class TimerFragment : Fragment() {
private fun refreshTimers(scrollToLatest: Boolean = false) {
activity?.timerHelper?.getTimers { timers ->
timerAdapter.submitList(timers) {
getView()?.post {
if (timerPositionToScrollTo != INVALID_POSITION && timerAdapter.itemCount > timerPositionToScrollTo) {
view.timers_list.scrollToPosition(timerPositionToScrollTo)
timerPositionToScrollTo = INVALID_POSITION
} else if (scrollToLatest) {
view.timers_list.scrollToPosition(timers.lastIndex)
activity?.runOnUiThread {
timerAdapter.submitList(timers) {
getView()?.post {
if (timerPositionToScrollTo != INVALID_POSITION && timerAdapter.itemCount > timerPositionToScrollTo) {
view.timers_list.scrollToPosition(timerPositionToScrollTo)
timerPositionToScrollTo = INVALID_POSITION
} else if (scrollToLatest) {
view.timers_list.scrollToPosition(timers.lastIndex)
}
}
}
}

View File

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.5.31'
ext.kotlin_version = '1.6.20'
repositories {
google()
@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong

View File

@ -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.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip