Skip to content

Commit

Permalink
Merge pull request #460 from mjaakko/fix_deprecations
Browse files Browse the repository at this point in the history
Fix deprecations
  • Loading branch information
mjaakko authored Jan 28, 2025
2 parents c402bdf + ee57f2e commit 9b135cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION") //PhoneStateListener is deprecated on Android 12+ś

package xyz.malkki.neostumbler.extensions

import android.Manifest
Expand All @@ -24,7 +26,6 @@ fun TelephonyManager.getServiceStateFlow(): Flow<ServiceState> {
}
}

@Suppress("DEPRECATION")
private fun TelephonyManager.getServiceStateFlowLegacy(): Flow<ServiceState> = callbackFlow {
var listener: PhoneStateListener? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
Expand Down Expand Up @@ -111,7 +112,7 @@ fun SuggestedServicesDialog(onServiceSelected: (SuggestedService?) -> Unit) {
onValueChange = {},
readOnly = true,
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded.value) },
modifier = Modifier.menuAnchor()
modifier = Modifier.menuAnchor(type = MenuAnchorType.PrimaryNotEditable)
)

ExposedDropdownMenu(
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/xyz/malkki/neostumbler/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ fun NeoStumblerTheme(
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.primary.toArgb()

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
@Suppress("DEPRECATION")
window.statusBarColor = colorScheme.primary.toArgb()
}

WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
}
}
Expand Down

0 comments on commit 9b135cc

Please sign in to comment.