mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 01:39:22 +02:00
Compare commits
4 commits
d5bc1f9881
...
3206d925e3
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3206d925e3 | ||
![]() |
b0e5a338e6 | ||
![]() |
376b7ca6de | ||
![]() |
1cdaed60e1 |
5 changed files with 32 additions and 17 deletions
|
@ -30,8 +30,8 @@ android {
|
|||
applicationId "io.timelimit.android"
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 35
|
||||
versionCode 218
|
||||
versionName "7.1.0"
|
||||
versionCode 219
|
||||
versionName "7.2.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
kapt {
|
||||
arguments {
|
||||
|
@ -173,16 +173,16 @@ dependencies {
|
|||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.21"
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'androidx.core:core:1.13.1'
|
||||
implementation 'androidx.core:core:1.15.0'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
||||
implementation "com.google.android.material:material:1.12.0"
|
||||
implementation 'androidx.compose.material:material:1.7.4'
|
||||
implementation 'androidx.compose.material:material:1.7.5'
|
||||
implementation 'androidx.activity:activity-compose:1.9.3'
|
||||
implementation "com.google.accompanist:accompanist-flowlayout:0.30.0"
|
||||
implementation 'androidx.compose.material:material-icons-extended:1.7.4'
|
||||
debugImplementation "androidx.compose.ui:ui-tooling:1.7.4"
|
||||
implementation 'androidx.fragment:fragment-ktx:1.8.4'
|
||||
implementation 'androidx.compose.material:material-icons-extended:1.7.5'
|
||||
debugImplementation "androidx.compose.ui:ui-tooling:1.7.5"
|
||||
implementation 'androidx.fragment:fragment-ktx:1.8.5'
|
||||
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
|
||||
implementation "androidx.navigation:navigation-ui:$nav_version"
|
||||
|
|
|
@ -31,6 +31,7 @@ import io.timelimit.android.logic.RemainingTime
|
|||
import io.timelimit.android.ui.manage.category.timelimit_rules.TimeLimitRulesHandlers
|
||||
import io.timelimit.android.ui.util.DateUtil
|
||||
import io.timelimit.android.util.DayNameUtil
|
||||
import io.timelimit.android.util.Option
|
||||
import io.timelimit.android.util.TimeTextUtil
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
|
@ -159,12 +160,24 @@ class AppAndRuleAdapter: RecyclerView.Adapter<AppAndRuleAdapter.Holder>() {
|
|||
val binding = holder.itemView.tag as FragmentCategoryTimeLimitRuleItemBinding
|
||||
val context = binding.root.context
|
||||
val usedTime = date?.let { date ->
|
||||
RemainingTime.getUsedTime(
|
||||
usedTimes = usedTimes,
|
||||
rule = rule,
|
||||
firstDayOfWeekAsEpochDay = date.firstDayOfWeekAsEpochDay,
|
||||
dayOfWeekForDailyRule = if (rule.perDay) date.dayOfWeek else null
|
||||
).toInt()
|
||||
val dayOfWeekForDailyRule: Option<Int?>? =
|
||||
if (rule.perDay) {
|
||||
(0 until 7)
|
||||
.map { (7 + date.dayOfWeek - it) % 7 } // make the current day the last one
|
||||
.firstOrNull { rule.dayMask.toInt() and (1 shl it) != 0 }
|
||||
?.let { Option.Some(it) } // skip calculation if no day matches
|
||||
} else Option.Some(null) // use the value null
|
||||
|
||||
dayOfWeekForDailyRule?.let {
|
||||
RemainingTime.getUsedTime(
|
||||
usedTimes = usedTimes,
|
||||
rule = rule,
|
||||
firstDayOfWeekAsEpochDay = date.firstDayOfWeekAsEpochDay,
|
||||
dayOfWeekForDailyRule =
|
||||
if (it is Option.Some) it.value
|
||||
else null
|
||||
).toInt()
|
||||
}
|
||||
} ?: 0
|
||||
|
||||
binding.maxTimeString = rule.maximumTimeInMillis.let { time ->
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
- verbesserter Umgang mit Fehlern im Hintergrund
|
||||
- Anpassungen für Android 15
|
||||
- falsch angezeigte Nutzungsdauer bei Regeln die je Tag gelten an Tagen, an denen diese nicht gelten, behoben
|
||||
- enthaltene Komponenten aktualisiert
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
- improved handling of errors in the background
|
||||
- adjustments for Android 15
|
||||
- fix incorrect used time at rules that apply per day at days where they do not apply
|
||||
- update contained software
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
|
||||
plugins {
|
||||
id 'com.android.application' version '8.7.1' apply false
|
||||
id 'com.android.library' version '8.7.1' apply false
|
||||
id 'com.android.application' version '8.7.2' apply false
|
||||
id 'com.android.library' version '8.7.2' apply false
|
||||
id 'org.jetbrains.kotlin.android' version "1.9.21" apply false
|
||||
id 'com.google.devtools.ksp' version '1.9.21-1.0.16' apply false
|
||||
id 'androidx.navigation.safeargs' version '2.6.0' apply false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue