mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-04-24 23:18:43 +02:00
updating gradle, target SDK to 31
This commit is contained in:
parent
ed503aa7e4
commit
deba1c77d6
@ -10,12 +10,12 @@ if (keystorePropertiesFile.exists()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 30
|
compileSdkVersion 31
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.simplemobiletools.clock"
|
applicationId "com.simplemobiletools.clock"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 31
|
||||||
versionCode 25
|
versionCode 25
|
||||||
versionName "5.6.1"
|
versionName "5.6.1"
|
||||||
setProperty("archivesBaseName", "clock")
|
setProperty("archivesBaseName", "clock")
|
||||||
@ -69,7 +69,7 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:eee4809d37'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:eee4809d37'
|
||||||
implementation 'com.facebook.stetho:stetho:1.5.0'
|
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 'com.shawnlin:number-picker:2.4.6'
|
||||||
implementation "androidx.preference:preference-ktx:1.1.1"
|
implementation "androidx.preference:preference-ktx:1.1.1"
|
||||||
implementation "androidx.work:work-runtime-ktx:2.6.0"
|
implementation "androidx.work:work-runtime-ktx:2.6.0"
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
<application
|
<application
|
||||||
android:name=".App"
|
android:name=".App"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
android:appCategory="productivity"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_launcher_name"
|
android:label="@string/app_launcher_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher"
|
android:roundIcon="@mipmap/ic_launcher"
|
||||||
@ -26,6 +27,7 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SplashActivity"
|
android:name=".activities.SplashActivity"
|
||||||
|
android:exported="false"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:theme="@style/SplashTheme">
|
android:theme="@style/SplashTheme">
|
||||||
|
|
||||||
@ -37,34 +39,47 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.MainActivity"
|
android:name=".activities.MainActivity"
|
||||||
|
android:exported="false"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:windowSoftInputMode="adjustPan"/>
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ReminderActivity"
|
android:name=".activities.ReminderActivity"
|
||||||
|
android:exported="false"
|
||||||
android:launchMode="singleTask" />
|
android:launchMode="singleTask" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SettingsActivity"
|
android:name=".activities.SettingsActivity"
|
||||||
|
android:exported="true"
|
||||||
android:label="@string/settings"
|
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
|
<activity
|
||||||
android:name="com.simplemobiletools.commons.activities.AboutActivity"
|
android:name="com.simplemobiletools.commons.activities.AboutActivity"
|
||||||
|
android:exported="false"
|
||||||
android:label="@string/about"
|
android:label="@string/about"
|
||||||
android:parentActivityName=".activities.MainActivity" />
|
android:parentActivityName=".activities.MainActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
|
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
|
||||||
|
android:exported="false"
|
||||||
android:label="@string/customize_colors"
|
android:label="@string/customize_colors"
|
||||||
android:parentActivityName=".activities.SettingsActivity" />
|
android:parentActivityName=".activities.SettingsActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SnoozeReminderActivity"
|
android:name=".activities.SnoozeReminderActivity"
|
||||||
|
android:exported="false"
|
||||||
android:theme="@style/Theme.Transparent" />
|
android:theme="@style/Theme.Transparent" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.WidgetDateTimeConfigureActivity"
|
android:name=".activities.WidgetDateTimeConfigureActivity"
|
||||||
|
android:exported="true"
|
||||||
android:theme="@style/MyWidgetConfigTheme">
|
android:theme="@style/MyWidgetConfigTheme">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
|
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
|
||||||
@ -83,7 +98,9 @@
|
|||||||
|
|
||||||
<receiver android:name=".receivers.DateTimeWidgetUpdateReceiver" />
|
<receiver android:name=".receivers.DateTimeWidgetUpdateReceiver" />
|
||||||
|
|
||||||
<receiver android:name=".receivers.BootCompletedReceiver">
|
<receiver
|
||||||
|
android:name=".receivers.BootCompletedReceiver"
|
||||||
|
android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
|
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
|
||||||
@ -93,7 +110,9 @@
|
|||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".helpers.MyWidgetDateTimeProvider"
|
android:name=".helpers.MyWidgetDateTimeProvider"
|
||||||
|
android:exported="true"
|
||||||
android:label="@string/clock_and_date">
|
android:label="@string/clock_and_date">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_ENABLED" />
|
<action android:name="android.appwidget.action.APPWIDGET_ENABLED" />
|
||||||
@ -104,7 +123,10 @@
|
|||||||
android:resource="@xml/widget_date_time_info" />
|
android:resource="@xml/widget_date_time_info" />
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".receivers.UpdateWidgetReceiver">
|
<receiver
|
||||||
|
android:name=".receivers.UpdateWidgetReceiver"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.TIME_SET" />
|
<action android:name="android.intent.action.TIME_SET" />
|
||||||
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
|
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
|
||||||
@ -115,6 +137,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Red"
|
android:name=".activities.SplashActivity.Red"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_red"
|
android:icon="@mipmap/ic_launcher_red"
|
||||||
android:roundIcon="@mipmap/ic_launcher_red"
|
android:roundIcon="@mipmap/ic_launcher_red"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -128,6 +151,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Pink"
|
android:name=".activities.SplashActivity.Pink"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_pink"
|
android:icon="@mipmap/ic_launcher_pink"
|
||||||
android:roundIcon="@mipmap/ic_launcher_pink"
|
android:roundIcon="@mipmap/ic_launcher_pink"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -141,6 +165,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Purple"
|
android:name=".activities.SplashActivity.Purple"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_purple"
|
android:icon="@mipmap/ic_launcher_purple"
|
||||||
android:roundIcon="@mipmap/ic_launcher_purple"
|
android:roundIcon="@mipmap/ic_launcher_purple"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -154,6 +179,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Deep_purple"
|
android:name=".activities.SplashActivity.Deep_purple"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_deep_purple"
|
android:icon="@mipmap/ic_launcher_deep_purple"
|
||||||
android:roundIcon="@mipmap/ic_launcher_deep_purple"
|
android:roundIcon="@mipmap/ic_launcher_deep_purple"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -167,6 +193,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Indigo"
|
android:name=".activities.SplashActivity.Indigo"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_indigo"
|
android:icon="@mipmap/ic_launcher_indigo"
|
||||||
android:roundIcon="@mipmap/ic_launcher_indigo"
|
android:roundIcon="@mipmap/ic_launcher_indigo"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -180,6 +207,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Blue"
|
android:name=".activities.SplashActivity.Blue"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_blue"
|
android:icon="@mipmap/ic_launcher_blue"
|
||||||
android:roundIcon="@mipmap/ic_launcher_blue"
|
android:roundIcon="@mipmap/ic_launcher_blue"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -193,6 +221,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Light_blue"
|
android:name=".activities.SplashActivity.Light_blue"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_light_blue"
|
android:icon="@mipmap/ic_launcher_light_blue"
|
||||||
android:roundIcon="@mipmap/ic_launcher_light_blue"
|
android:roundIcon="@mipmap/ic_launcher_light_blue"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -206,6 +235,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Cyan"
|
android:name=".activities.SplashActivity.Cyan"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_cyan"
|
android:icon="@mipmap/ic_launcher_cyan"
|
||||||
android:roundIcon="@mipmap/ic_launcher_cyan"
|
android:roundIcon="@mipmap/ic_launcher_cyan"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -219,6 +249,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Teal"
|
android:name=".activities.SplashActivity.Teal"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_teal"
|
android:icon="@mipmap/ic_launcher_teal"
|
||||||
android:roundIcon="@mipmap/ic_launcher_teal"
|
android:roundIcon="@mipmap/ic_launcher_teal"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -232,6 +263,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Green"
|
android:name=".activities.SplashActivity.Green"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_green"
|
android:icon="@mipmap/ic_launcher_green"
|
||||||
android:roundIcon="@mipmap/ic_launcher_green"
|
android:roundIcon="@mipmap/ic_launcher_green"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -245,6 +277,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Light_green"
|
android:name=".activities.SplashActivity.Light_green"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_light_green"
|
android:icon="@mipmap/ic_launcher_light_green"
|
||||||
android:roundIcon="@mipmap/ic_launcher_light_green"
|
android:roundIcon="@mipmap/ic_launcher_light_green"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -258,6 +291,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Lime"
|
android:name=".activities.SplashActivity.Lime"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_lime"
|
android:icon="@mipmap/ic_launcher_lime"
|
||||||
android:roundIcon="@mipmap/ic_launcher_lime"
|
android:roundIcon="@mipmap/ic_launcher_lime"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -271,6 +305,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Yellow"
|
android:name=".activities.SplashActivity.Yellow"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_yellow"
|
android:icon="@mipmap/ic_launcher_yellow"
|
||||||
android:roundIcon="@mipmap/ic_launcher_yellow"
|
android:roundIcon="@mipmap/ic_launcher_yellow"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -284,6 +319,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Amber"
|
android:name=".activities.SplashActivity.Amber"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_amber"
|
android:icon="@mipmap/ic_launcher_amber"
|
||||||
android:roundIcon="@mipmap/ic_launcher_amber"
|
android:roundIcon="@mipmap/ic_launcher_amber"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -297,6 +333,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Orange"
|
android:name=".activities.SplashActivity.Orange"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:roundIcon="@mipmap/ic_launcher"
|
android:roundIcon="@mipmap/ic_launcher"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -309,6 +346,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Deep_orange"
|
android:name=".activities.SplashActivity.Deep_orange"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_deep_orange"
|
android:icon="@mipmap/ic_launcher_deep_orange"
|
||||||
android:roundIcon="@mipmap/ic_launcher_deep_orange"
|
android:roundIcon="@mipmap/ic_launcher_deep_orange"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -322,6 +360,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Brown"
|
android:name=".activities.SplashActivity.Brown"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_brown"
|
android:icon="@mipmap/ic_launcher_brown"
|
||||||
android:roundIcon="@mipmap/ic_launcher_brown"
|
android:roundIcon="@mipmap/ic_launcher_brown"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -335,6 +374,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Blue_grey"
|
android:name=".activities.SplashActivity.Blue_grey"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_blue_grey"
|
android:icon="@mipmap/ic_launcher_blue_grey"
|
||||||
android:roundIcon="@mipmap/ic_launcher_blue_grey"
|
android:roundIcon="@mipmap/ic_launcher_blue_grey"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
@ -348,6 +388,7 @@
|
|||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".activities.SplashActivity.Grey_black"
|
android:name=".activities.SplashActivity.Grey_black"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
android:icon="@mipmap/ic_launcher_grey_black"
|
android:icon="@mipmap/ic_launcher_grey_black"
|
||||||
android:roundIcon="@mipmap/ic_launcher_grey_black"
|
android:roundIcon="@mipmap/ic_launcher_grey_black"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
@ -19,10 +19,11 @@ import com.simplemobiletools.commons.extensions.isVisible
|
|||||||
import com.simplemobiletools.commons.extensions.toast
|
import com.simplemobiletools.commons.extensions.toast
|
||||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
import kotlinx.android.synthetic.main.item_alarm.view.*
|
import kotlinx.android.synthetic.main.item_alarm.view.*
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
class AlarmsAdapter(activity: SimpleActivity, var alarms: ArrayList<Alarm>, val toggleAlarmInterface: ToggleAlarmInterface,
|
class AlarmsAdapter(
|
||||||
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
|
activity: SimpleActivity, var alarms: ArrayList<Alarm>, val toggleAlarmInterface: ToggleAlarmInterface,
|
||||||
|
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit
|
||||||
|
) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setupDragListener(true)
|
setupDragListener(true)
|
||||||
|
@ -17,7 +17,7 @@ import kotlinx.android.synthetic.main.item_lap.view.*
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class StopwatchAdapter(activity: SimpleActivity, var laps: ArrayList<Lap>, recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) :
|
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 lastLapTimeView: TextView? = null
|
||||||
private var lastTotalTimeView: TextView? = null
|
private var lastTotalTimeView: TextView? = null
|
||||||
private var lastLapId = 0
|
private var lastLapId = 0
|
||||||
|
@ -17,7 +17,7 @@ import kotlinx.android.synthetic.main.item_time_zone.view.*
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class TimeZonesAdapter(activity: SimpleActivity, var timeZones: ArrayList<MyTimeZone>, recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) :
|
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())
|
var todayDateString = activity.getFormattedDate(Calendar.getInstance())
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class TimerAdapter(
|
|||||||
recyclerView: MyRecyclerView,
|
recyclerView: MyRecyclerView,
|
||||||
onRefresh: () -> Unit,
|
onRefresh: () -> Unit,
|
||||||
onItemClick: (Timer) -> Unit,
|
onItemClick: (Timer) -> Unit,
|
||||||
) : MyRecyclerViewListAdapter<Timer>(simpleActivity, recyclerView, diffUtil, null, onItemClick, onRefresh) {
|
) : MyRecyclerViewListAdapter<Timer>(simpleActivity, recyclerView, diffUtil, onItemClick, onRefresh) {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val diffUtil = object : DiffUtil.ItemCallback<Timer>() {
|
private val diffUtil = object : DiffUtil.ItemCallback<Timer>() {
|
||||||
|
@ -92,13 +92,15 @@ class TimerFragment : Fragment() {
|
|||||||
|
|
||||||
private fun refreshTimers(scrollToLatest: Boolean = false) {
|
private fun refreshTimers(scrollToLatest: Boolean = false) {
|
||||||
activity?.timerHelper?.getTimers { timers ->
|
activity?.timerHelper?.getTimers { timers ->
|
||||||
timerAdapter.submitList(timers) {
|
activity?.runOnUiThread {
|
||||||
getView()?.post {
|
timerAdapter.submitList(timers) {
|
||||||
if (timerPositionToScrollTo != INVALID_POSITION && timerAdapter.itemCount > timerPositionToScrollTo) {
|
getView()?.post {
|
||||||
view.timers_list.scrollToPosition(timerPositionToScrollTo)
|
if (timerPositionToScrollTo != INVALID_POSITION && timerAdapter.itemCount > timerPositionToScrollTo) {
|
||||||
timerPositionToScrollTo = INVALID_POSITION
|
view.timers_list.scrollToPosition(timerPositionToScrollTo)
|
||||||
} else if (scrollToLatest) {
|
timerPositionToScrollTo = INVALID_POSITION
|
||||||
view.timers_list.scrollToPosition(timers.lastIndex)
|
} else if (scrollToLatest) {
|
||||||
|
view.timers_list.scrollToPosition(timers.lastIndex)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.5.31'
|
ext.kotlin_version = '1.6.20'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
@ -9,7 +9,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// 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
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user