Skip to content

Commit 80f7c11

Browse files
committed
update dependencies and improve UI LAF
Change-Id: I00fba286d31c9c3b0842b8c90ee99190571152ae Signed-off-by: AbdAlMoniem AlHifnawy <hifnawy_moniem@hotmail.com>
1 parent 629b638 commit 80f7c11

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

app/src/main/java/com/hifnawy/caffeinate/view/MainActivity.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,9 +1175,10 @@ class MainActivity : AppCompatActivity(), SharedPrefsObserver, ServiceStatusObse
11751175
is ServiceStatus.Running -> status.startTimeout.toComponents { hours, _, _, _ -> hours }.toInt()
11761176
}
11771177

1178-
pipLayout.progressIndicator.progress = when (status) {
1179-
is ServiceStatus.Stopped -> 0.seconds
1180-
is ServiceStatus.Running -> status.remaining
1178+
pipLayout.progressIndicator.progress = when {
1179+
status is ServiceStatus.Stopped -> 0.seconds
1180+
status is ServiceStatus.Running && !status.isRestarted && status.isCountingDown -> status.remaining
1181+
else -> 0.seconds
11811182
}
11821183
}
11831184
}

app/src/main/res/layout/picture_in_picture.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent"
67
android:animateLayoutChanges="true">
@@ -31,6 +32,8 @@
3132
app:textAlign="center"
3233
app:textColor="?colorPrimary"
3334
app:textPadding="5dp"
34-
app:textStyle="normal" />
35-
<!--app:textFontFamily="@font/manrope"/>-->
35+
app:textStyle="normal"
36+
tools:ignore="PxUsage" />
37+
<!-- since the DPI changes when this view is in Picture-in-Picture mode
38+
we need to ignore this warning -->
3639
</androidx.constraintlayout.widget.ConstraintLayout>

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ materialNumberPickerVersion = "1.0.5"
1111
junitVersion = "4.13.2"
1212
androidxJunitVersion = "1.2.1"
1313
espressoCoreVersion = "3.6.1"
14-
androidApplicationVersion = "8.7.2"
15-
kotlinVersion = "1.9.22"
14+
androidApplicationVersion = "8.7.3"
15+
kotlinVersion = "2.1.0"
1616

1717
[libraries]
1818
androidxCoreKtx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtxVersion" }

0 commit comments

Comments
 (0)