Skip to content

Commit fb6cc1a

Browse files
committed
Merge branch 'development'
2 parents 626fe2f + d8dfdfc commit fb6cc1a

44 files changed

Lines changed: 899 additions & 241 deletions

Some content is hidden

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

app/build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ plugins {
99
alias(libs.plugins.sentry.android.gradle)
1010
alias(libs.plugins.android.dagger.hilt)
1111
alias(libs.plugins.kotlin.parcelize)
12-
alias(libs.plugins.jetbrains.kotlin.android)
12+
alias(libs.plugins.kotlin.android)
1313
alias(libs.plugins.compose.compiler)
14-
alias(libs.plugins.jetbrains.kotlin.serialization)
15-
alias(libs.plugins.jetbrains.kotlin.kapt)
14+
alias(libs.plugins.kotlin.serialization)
15+
alias(libs.plugins.kotlin.kapt)
1616
}
1717

1818
private val keystoreProperties = getKeystoreProperties()
1919

2020
val vMajor = 3
21-
val vMinor = 0
21+
val vMinor = 1
2222
val vPatch = 0
2323
val isAlpha = true
2424

@@ -35,7 +35,7 @@ android {
3535
versionName = "${vMajor}.${vMinor}.${vPatch}"
3636
}
3737

38-
if(keystoreProperties.isNotEmpty()) {
38+
if (keystoreProperties.isNotEmpty()) {
3939
signingConfigs {
4040
create("release") {
4141
keyAlias = keystoreProperties["keyAlias"] as String
@@ -48,7 +48,6 @@ android {
4848

4949
buildTypes {
5050
release {
51-
manifestPlaceholders += mapOf()
5251
manifestPlaceholders.putAll(mapOf("appName" to "PiFire", "environment" to "production"))
5352
isMinifyEnabled = true
5453
isShrinkResources = true
@@ -145,6 +144,7 @@ dependencies {
145144
implementation(libs.androidx.datastore)
146145
implementation(libs.androidx.splashscreen)
147146
implementation(libs.androidx.crypto)
147+
implementation(libs.androidx.biometric)
148148
implementation(libs.kotlinx.coroutines.core)
149149
implementation(libs.kotlinx.coroutines.android)
150150
implementation(libs.kotlinx.serialization.json)

app/src/main/java/com/weberbox/pifire/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package com.weberbox.pifire
33
import android.annotation.SuppressLint
44
import android.content.Context
55
import android.os.Bundle
6-
import androidx.activity.ComponentActivity
76
import androidx.activity.compose.setContent
87
import androidx.activity.enableEdgeToEdge
98
import androidx.activity.viewModels
9+
import androidx.appcompat.app.AppCompatActivity
1010
import androidx.compose.foundation.isSystemInDarkTheme
1111
import androidx.compose.material3.Scaffold
1212
import androidx.compose.material3.SnackbarHost
@@ -44,7 +44,7 @@ import kotlinx.coroutines.launch
4444
import javax.inject.Inject
4545

4646
@AndroidEntryPoint
47-
class MainActivity : ComponentActivity() {
47+
class MainActivity : AppCompatActivity() {
4848
@Inject
4949
lateinit var appUpdateManager: UpdateManager
5050

app/src/main/java/com/weberbox/pifire/changelog/data/model/ChangelogDto.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ import kotlinx.serialization.Serializable
44

55
@Serializable
66
data class ChangelogDto(
7-
var changelog: List<Changelog> = listOf()
7+
val changelog: List<Changelog> = listOf()
88
) {
99

1010
@Serializable
1111
data class Changelog(
12-
var version: String? = null,
13-
var date: String? = null,
14-
var current: Boolean? = null,
15-
var logs: List<Logs> = listOf()
12+
val version: String? = null,
13+
val date: String? = null,
14+
val current: Boolean? = null,
15+
val isAlpha: Boolean? = null,
16+
val logs: List<Logs> = listOf()
1617
)
1718

1819
@Serializable
1920
data class Logs(
20-
var type: String? = null,
21-
var text: String? = null
21+
val type: String? = null,
22+
val text: String? = null
2223
)
2324
}

app/src/main/java/com/weberbox/pifire/changelog/domain/ChangelogDtoToDataMapper.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ object ChangelogDtoToDataMapper : Mapper<ChangelogDto, ChangelogData> {
1313
version = data.version.orEmpty(),
1414
date = data.date.orEmpty(),
1515
current = data.current == true,
16+
isAlpha = data.isAlpha == true,
1617
logs = data.logs.map { log ->
1718
Log(
1819
type = log.type ?: "new",

app/src/main/java/com/weberbox/pifire/changelog/presentation/component/LogHeader.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ internal fun LogHeader(
2323
current: Boolean,
2424
version: String,
2525
date: String,
26+
isAlpha: Boolean,
2627
modifier: Modifier = Modifier
2728
) {
2829
Box(
@@ -51,6 +52,15 @@ internal fun LogHeader(
5152
style = MaterialTheme.typography.titleSmall
5253
)
5354
}
55+
if (isAlpha) {
56+
Text(
57+
text = " - Alpha Release",
58+
modifier = modifier.padding(end = 5.dp),
59+
style = MaterialTheme.typography.titleSmall,
60+
color = if (current) MaterialTheme.colorScheme.tertiaryContainer else
61+
MaterialTheme.colorScheme.onSurface,
62+
)
63+
}
5464
}
5565
HorizontalDivider(
5666
color = MaterialTheme.colorScheme.inverseOnSurface,
@@ -70,7 +80,8 @@ private fun LogHeaderPreview() {
7080
LogHeader(
7181
current = true,
7282
version = "3.0.0",
73-
date = "4-24-2025"
83+
date = "",
84+
isAlpha = true
7485
)
7586
}
7687
}

app/src/main/java/com/weberbox/pifire/changelog/presentation/model/ChangelogData.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ data class ChangelogData(
1010
val version: String = "",
1111
val date: String = "",
1212
val current: Boolean = false,
13+
val isAlpha: Boolean = false,
1314
val logs: List<Log> = listOf()
1415
)
1516

app/src/main/java/com/weberbox/pifire/changelog/presentation/screens/ChangelogScreen.kt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import androidx.compose.ui.text.font.FontWeight
3232
import androidx.compose.ui.tooling.preview.Preview
3333
import androidx.hilt.navigation.compose.hiltViewModel
3434
import androidx.navigation.NavHostController
35+
import com.weberbox.pifire.BuildConfig
3536
import com.weberbox.pifire.R
3637
import com.weberbox.pifire.changelog.presentation.component.LogAnimation
3738
import com.weberbox.pifire.changelog.presentation.component.LogHeader
@@ -117,15 +118,23 @@ private fun ChangelogScreen(
117118
.hazeSource(state = hazeState)
118119
.fillMaxSize(),
119120
) {
120-
items(items = state.changelogData.changelog) { item ->
121+
val visibleItems = state.changelogData.changelog.filter { item ->
122+
!item.isAlpha || BuildConfig.ALPHA_BUILD
123+
}
124+
items(items = visibleItems) { item ->
121125
Column {
122-
LogHeader(item.current, item.version, item.date)
126+
LogHeader(
127+
current = item.current,
128+
version = item.version,
129+
date = item.date,
130+
isAlpha = item.isAlpha,
131+
)
123132
item.logs.forEach { log ->
124133
LogItem(log)
125134
}
126135
}
127136
}
128-
if (state.changelogData.changelog.isEmpty()) {
137+
if (visibleItems.isEmpty()) {
129138
item {
130139
Column(
131140
modifier = Modifier
@@ -182,6 +191,7 @@ private fun buildChangelogItems(): List<Changelog> {
182191
version = "3.0.0",
183192
date = "",
184193
current = true,
194+
isAlpha = true,
185195
logs = listOf(
186196
Log(
187197
type = "new",

app/src/main/java/com/weberbox/pifire/common/presentation/sheets/ConfirmSheet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import androidx.compose.ui.text.font.FontWeight
2121
import androidx.compose.ui.text.style.TextAlign
2222
import androidx.compose.ui.tooling.preview.Preview
2323
import com.weberbox.pifire.R
24-
import com.weberbox.pifire.common.presentation.theme.SettingsTheme
24+
import com.weberbox.pifire.common.presentation.theme.PiFireTheme
2525
import com.weberbox.pifire.common.presentation.theme.spacing
2626

2727
@Composable
@@ -107,7 +107,7 @@ fun ConfirmSheet(
107107
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, showBackground = true)
108108
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, showBackground = true)
109109
private fun ButtonSheetPreview() {
110-
SettingsTheme {
110+
PiFireTheme {
111111
Surface {
112112
ConfirmSheet(
113113
title = stringResource(R.string.dialog_confirm_action),

app/src/main/java/com/weberbox/pifire/common/presentation/theme/Theme.kt

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -82,51 +82,6 @@ fun PiFireTheme(
8282
}
8383
}
8484

85-
@Composable
86-
fun SettingsTheme(
87-
darkTheme: Boolean = isSystemInDarkTheme(),
88-
dynamicColor: Boolean = false,
89-
content: @Composable () -> Unit,
90-
) {
91-
val context = LocalContext.current
92-
val colorScheme =
93-
when {
94-
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
95-
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
96-
}
97-
98-
darkTheme -> mediumContrastDarkColorScheme
99-
else -> mediumContrastLightColorScheme
100-
}
101-
102-
val view = LocalView.current
103-
if (!view.isInEditMode) {
104-
SideEffect {
105-
val window = (context as Activity).window
106-
WindowCompat.setDecorFitsSystemWindows(window, false)
107-
val windowBackgroundColor = colorScheme.background.toArgb()
108-
window.setBackgroundDrawable(windowBackgroundColor.toDrawable())
109-
val insetsController = WindowCompat.getInsetsController(window, view)
110-
insetsController.isAppearanceLightStatusBars = !darkTheme
111-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
112-
@Suppress("DEPRECATION")
113-
window.statusBarColor = Color.Transparent.toArgb()
114-
@Suppress("DEPRECATION")
115-
window.navigationBarColor = Color.Transparent.toArgb()
116-
}
117-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
118-
insetsController.isAppearanceLightNavigationBars = !darkTheme
119-
}
120-
}
121-
}
122-
123-
MaterialTheme(
124-
colorScheme = colorScheme,
125-
typography = AppTypography,
126-
content = content
127-
)
128-
}
129-
13085
@Suppress("unused")
13186
private val lightScheme = lightColorScheme(
13287
primary = primaryLight,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.weberbox.pifire.common.presentation.util
2+
3+
import java.util.Collections
4+
5+
fun <T> List<T>.toImmutableList(): List<T> = when (size) {
6+
0 -> emptyList()
7+
1 -> listOf(first())
8+
else -> Collections.unmodifiableList(toList())
9+
}
10+
11+
fun <K, V> Map<K, V>.toImmutableMap(): Map<K, V> {
12+
return Collections.unmodifiableMap(this.toMap())
13+
}

0 commit comments

Comments
 (0)