Skip to content

Commit bff2ecb

Browse files
committed
Merge remote-tracking branch 'upstream'
2 parents bd575e0 + 94026d2 commit bff2ecb

File tree

215 files changed

+9722
-5078
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+9722
-5078
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*.aar
99
*.ap_
1010
*.aab
11+
*.dm
1112

1213
# Files for the ART/Dalvik VM
1314
*.dex

.idea/emulatorDisplays.xml

Lines changed: 0 additions & 47 deletions
This file was deleted.

app/app/build.gradle.kts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ android {
3131
minSdk = libs.versions.minSdk.get().toInt()
3232
targetSdk = libs.versions.targetSdk.get().toInt()
3333
@SuppressLint("HighAppVersionCode")
34-
versionCode = System.getenv("VERSION_CODE_OVERRIDE")?.toIntOrNull() ?: 2024122400
35-
versionName = "1.34.1"
34+
versionCode = System.getenv("VERSION_CODE_OVERRIDE")?.toIntOrNull() ?: 2025042101
35+
versionName = "1.35.4"
3636
signingConfig = signingConfigs.getByName("debug")
3737
}
3838

@@ -105,21 +105,11 @@ dependencies {
105105

106106
//Android Jetpack
107107
implementation(libs.androidx.appcompat)
108-
implementation(libs.androidx.browser)
109-
implementation(libs.androidx.palette)
110108
implementation(libs.androidx.core)
111-
implementation(libs.androidx.exifinterface)
112-
implementation(libs.materialcomponents.core)
113-
implementation(libs.androidx.constraintlayout.views)
114-
115-
implementation(libs.bundles.androidx.lifecycle)
116-
117-
implementation(libs.androidx.work)
118109

119110
implementation(libs.coil.core)
120111
implementation(libs.coil.svg)
121112

122-
123113
implementation(libs.koin.android)
124114

125115
implementation(project(":services:accounts"))
@@ -165,6 +155,6 @@ dependencies {
165155
implementation(project(":services:plugins"))
166156
implementation(project(":core:devicepose"))
167157

168-
// Uncomment this if you want annoying notifications in your debug builds yelling at you how terrible your code is
158+
// Uncomment this if you want annoying notifications in your debug builds
169159
//debugImplementation(libs.leakcanary)
170160
}

app/app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5+
<uses-feature
6+
android:name="android.hardware.telephony"
7+
android:required="false" />
8+
59
<uses-permission android:name="android.permission.SET_ALARM" />
610
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
711
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
@@ -23,8 +27,10 @@
2327
android:name="android.permission.QUERY_ALL_PACKAGES"
2428
tools:ignore="QueryAllPackagesPermission" />
2529
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
30+
<uses-permission android:name="android.permission.CALL_PHONE" />
2631

2732
<uses-permission android:name="android.permission.VIBRATE" />
33+
<uses-permission android:name="org.tasks.permission.READ_TASKS" />
2834

2935
<application
3036
android:name=".LauncherApplication"

app/ui/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ android {
4646
"-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi",
4747
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
4848
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
49+
"-opt-in=androidx.compose.material3.ExperimentalMaterial3ExpressiveApi",
4950
"-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi",
5051
"-opt-in=androidx.compose.animation.ExperimentalAnimationApi",
5152
"-opt-in=com.google.accompanist.pager.ExperimentalPagerApi",

app/ui/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@
5454
android:label="@string/settings"
5555
android:launchMode="singleTop"
5656
android:parentActivityName=".launcher.LauncherActivity"
57-
android:taskAffinity="de.mm20.launcher2.settings"
58-
android:theme="@style/SettingsTheme.NoActionBar"
57+
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar"
5958
android:enableOnBackInvokedCallback="true"
6059
>
6160
<intent-filter>

app/ui/src/main/java/de/mm20/launcher2/ui/base/ProvideSettings.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import de.mm20.launcher2.widgets.FavoritesWidget
1313
import de.mm20.launcher2.widgets.WidgetRepository
1414
import kotlinx.coroutines.flow.combine
1515
import kotlinx.coroutines.flow.distinctUntilChanged
16-
import kotlinx.coroutines.flow.map
1716
import org.koin.androidx.compose.inject
1817

1918
@Composable

app/ui/src/main/java/de/mm20/launcher2/ui/common/FavoritesTagSelector.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ fun FavoritesTagSelector(
5959
modifier = Modifier
6060
.fillMaxWidth()
6161
.padding(
62-
top = if (reverse) 8.dp else 4.dp,
63-
bottom = if (reverse) 4.dp else 8.dp,
62+
top = 4.dp,
63+
bottom = 4.dp,
6464
end = if (editButton) 8.dp else 0.dp
6565
),
6666
targetState = expanded,

app/ui/src/main/java/de/mm20/launcher2/ui/common/FavoritesVM.kt

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@ import de.mm20.launcher2.searchable.PinnedLevel
1212
import de.mm20.launcher2.services.favorites.FavoritesService
1313
import de.mm20.launcher2.widgets.CalendarWidget
1414
import de.mm20.launcher2.widgets.WidgetRepository
15-
import kotlinx.coroutines.flow.*
15+
import kotlinx.coroutines.flow.Flow
16+
import kotlinx.coroutines.flow.MutableStateFlow
17+
import kotlinx.coroutines.flow.SharingStarted
18+
import kotlinx.coroutines.flow.combine
19+
import kotlinx.coroutines.flow.emitAll
20+
import kotlinx.coroutines.flow.flatMapLatest
21+
import kotlinx.coroutines.flow.map
22+
import kotlinx.coroutines.flow.shareIn
23+
import kotlinx.coroutines.flow.stateIn
24+
import kotlinx.coroutines.flow.transformLatest
1625
import org.koin.core.component.KoinComponent
1726
import org.koin.core.component.inject
1827

@@ -25,7 +34,8 @@ abstract class FavoritesVM : ViewModel(), KoinComponent {
2534

2635
val selectedTag = MutableStateFlow<String?>(null)
2736

28-
val showEditButton = settings.showEditButton.stateIn(viewModelScope, SharingStarted.Lazily, false)
37+
val showEditButton =
38+
settings.showEditButton.stateIn(viewModelScope, SharingStarted.Lazily, false)
2939
abstract val tagsExpanded: Flow<Boolean>
3040
abstract val compactTags: Flow<Boolean>
3141

@@ -46,34 +56,44 @@ abstract class FavoritesVM : ViewModel(), KoinComponent {
4656
) { (a, b) -> a as Boolean to b as FavoritesSettingsData }
4757
.transformLatest {
4858

49-
val columns = it.second.columns
50-
val excludeCalendar = it.first
51-
val includeFrequentlyUsed = it.second.frequentlyUsed
52-
val frequentlyUsedRows = it.second.frequentlyUsedRows
59+
val columns = it.second.columns
60+
val excludeCalendar = it.first
61+
val includeFrequentlyUsed = it.second.frequentlyUsed
62+
val frequentlyUsedRows = it.second.frequentlyUsedRows
5363

54-
val pinned = favoritesService.getFavorites(
55-
excludeTypes = if (excludeCalendar) listOf("calendar", "tag", "plugin.calendar") else listOf("tag"),
56-
minPinnedLevel = PinnedLevel.AutomaticallySorted,
57-
limit = 10 * columns,
58-
)
59-
if (includeFrequentlyUsed) {
60-
emitAll(pinned.flatMapLatest { pinned ->
61-
favoritesService.getFavorites(
62-
excludeTypes = if (excludeCalendar) listOf("calendar", "tag", "plugin.calendar") else listOf("tag"),
63-
maxPinnedLevel = PinnedLevel.FrequentlyUsed,
64-
minPinnedLevel = PinnedLevel.FrequentlyUsed,
65-
limit = frequentlyUsedRows * columns - pinned.size % columns,
66-
).map {
67-
pinned + it
68-
}
69-
.withCustomLabels(customAttributesRepository)
70-
})
71-
} else {
72-
emitAll(
73-
pinned.withCustomLabels(customAttributesRepository)
64+
val pinned = favoritesService.getFavorites(
65+
excludeTypes = if (excludeCalendar) listOf(
66+
"calendar",
67+
"tasks.org",
68+
"tag",
69+
"plugin.calendar"
70+
) else listOf("tag"),
71+
minPinnedLevel = PinnedLevel.AutomaticallySorted,
72+
limit = 10 * columns,
7473
)
74+
if (includeFrequentlyUsed) {
75+
emitAll(pinned.flatMapLatest { pinned ->
76+
favoritesService.getFavorites(
77+
excludeTypes = if (excludeCalendar) listOf(
78+
"calendar",
79+
"tasks.org",
80+
"tag",
81+
"plugin.calendar"
82+
) else listOf("tag"),
83+
maxPinnedLevel = PinnedLevel.FrequentlyUsed,
84+
minPinnedLevel = PinnedLevel.FrequentlyUsed,
85+
limit = frequentlyUsedRows * columns - pinned.size % columns,
86+
).map {
87+
pinned + it
88+
}
89+
.withCustomLabels(customAttributesRepository)
90+
})
91+
} else {
92+
emitAll(
93+
pinned.withCustomLabels(customAttributesRepository)
94+
)
95+
}
7596
}
76-
}
7797
} else {
7898
customAttributesRepository
7999
.getItemsForTag(tag)

app/ui/src/main/java/de/mm20/launcher2/ui/component/Banner.kt

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,68 @@
11
package de.mm20.launcher2.ui.component
22

3-
import androidx.compose.foundation.layout.*
4-
import androidx.compose.foundation.shape.RoundedCornerShape
5-
import androidx.compose.material3.*
3+
import androidx.compose.foundation.layout.Arrangement
4+
import androidx.compose.foundation.layout.Box
5+
import androidx.compose.foundation.layout.Column
6+
import androidx.compose.foundation.layout.FlowRow
7+
import androidx.compose.foundation.layout.Row
8+
import androidx.compose.foundation.layout.fillMaxWidth
9+
import androidx.compose.foundation.layout.padding
10+
import androidx.compose.material3.CardDefaults
11+
import androidx.compose.material3.Icon
12+
import androidx.compose.material3.MaterialTheme
13+
import androidx.compose.material3.OutlinedCard
14+
import androidx.compose.material3.Text
615
import androidx.compose.runtime.Composable
716
import androidx.compose.ui.Alignment
817
import androidx.compose.ui.Modifier
918
import androidx.compose.ui.graphics.Color
1019
import androidx.compose.ui.graphics.vector.ImageVector
11-
import androidx.compose.ui.text.font.FontWeight
1220
import androidx.compose.ui.unit.dp
13-
import com.google.accompanist.flowlayout.FlowCrossAxisAlignment
14-
import com.google.accompanist.flowlayout.FlowRow
15-
import com.google.accompanist.flowlayout.MainAxisAlignment
1621

1722
@Composable
1823
fun Banner(
1924
modifier: Modifier = Modifier,
2025
text: String,
2126
icon: ImageVector,
22-
color: Color = MaterialTheme.colorScheme.surfaceVariant,
27+
color: Color = MaterialTheme.colorScheme.surfaceContainer,
2328
primaryAction: (@Composable () -> Unit)? = null,
2429
secondaryAction: (@Composable () -> Unit)? = null,
2530
) {
26-
Card(
31+
OutlinedCard(
2732
modifier = modifier,
28-
colors = CardDefaults.cardColors(
33+
colors = CardDefaults.outlinedCardColors(
2934
containerColor = color,
35+
contentColor = MaterialTheme.colorScheme.secondary,
3036
),
3137
shape = MaterialTheme.shapes.small,
3238
) {
3339
Column {
3440
Row(
35-
modifier = Modifier.fillMaxWidth(),
41+
modifier = Modifier
42+
.fillMaxWidth()
43+
.padding(16.dp),
3644
verticalAlignment = Alignment.CenterVertically
3745
) {
3846
Icon(
39-
modifier = Modifier.padding(16.dp),
47+
modifier = Modifier.padding(end = 16.dp),
4048
imageVector = icon,
4149
contentDescription = null
4250
)
4351
Text(
4452
text = text,
4553
modifier = Modifier
46-
.weight(1f)
47-
.padding(vertical = 16.dp)
48-
.padding(end = 16.dp),
49-
style = MaterialTheme.typography.labelMedium
54+
.weight(1f),
55+
style = MaterialTheme.typography.bodySmallEmphasized
5056
)
5157
}
5258
if (secondaryAction != null || primaryAction != null) {
5359
FlowRow(
5460
Modifier
5561
.align(Alignment.End)
56-
.padding(8.dp),
57-
crossAxisSpacing = 8.dp,
58-
crossAxisAlignment = FlowCrossAxisAlignment.End,
59-
mainAxisAlignment = MainAxisAlignment.End
62+
.padding(start = 12.dp, end = 12.dp, bottom = 12.dp),
63+
horizontalArrangement = Arrangement.End,
64+
verticalArrangement = Arrangement.Bottom,
65+
itemVerticalAlignment = Alignment.CenterVertically,
6066
) {
6167
Box {
6268
secondaryAction?.invoke()

app/ui/src/main/java/de/mm20/launcher2/ui/ktx/Color.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package de.mm20.launcher2.ui.ktx
22

33
import androidx.compose.ui.graphics.Color
4+
import androidx.compose.ui.graphics.toArgb
45
import hct.Hct
56
import kotlin.math.atan2
67
import kotlin.math.roundToInt
@@ -20,6 +21,14 @@ fun Color.Companion.hct(hue: Float, chroma: Float, tone: Float): Color {
2021
return Color(hct.toInt())
2122
}
2223

24+
fun Color.atTone(tone: Int): Color {
25+
return Color(
26+
Hct.fromInt(this.toArgb()).apply {
27+
this.tone = tone.toDouble()
28+
}.toInt()
29+
)
30+
}
31+
2332
val Color.hue: Float
2433
get() {
2534
val r = this.red / 255f
@@ -28,3 +37,5 @@ val Color.hue: Float
2837
// sqrt(3)
2938
return atan2(1.7320508f * (g - b), 2f * r - g - b)
3039
}
40+
41+
fun android.graphics.Color.toComposeColor() = Color(this.toArgb())

0 commit comments

Comments
 (0)