Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private const val LOG_TAG = "ANALYTICS"
*/
@Singleton
class NordicAnalytics @Inject internal constructor(
@ApplicationContext private val context: Context,
@param:ApplicationContext private val context: Context,
private val repository: AnalyticsPermissionRepository,
) {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private const val WAS_INFO_SHOWN = "WAS_INFO_SHOWN"

@Singleton
internal class AnalyticsPermissionRepository @Inject constructor(
@ApplicationContext private val context: Context
@param:ApplicationContext private val context: Context
) {
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = FILE)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBars
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
Expand Down Expand Up @@ -295,7 +296,8 @@ class MainActivity : NordicActivity() {
}
}
}
}
},
contentWindowInsets = WindowInsets.statusBars
) { padding ->
// This is a workaround for the issue with the back button going back
// to the previous tab instead of closing the drawer.
Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
accompanist = "0.37.3"
androidGradlePlugin = "8.13.0"
androidxActivity = "1.11.0"
androidxComposeBom = "2025.09.00" # https://developer.android.com/jetpack/compose/bom/bom-mapping
androidxComposeBom = "2025.09.01" # https://developer.android.com/jetpack/compose/bom/bom-mapping
androidxCore = "1.17.0"
androidxCoreSplashscreen = "1.0.1"
androidxDataStore = "1.1.7"
androidxHiltNavigationCompose = "1.2.0"
androidxLifecycle = "2.9.4"
androidxNavigation = "2.9.4"
androidxNavigation = "2.9.5"
#noinspection GradleDependency
firebaseBom = "33.16.0" # https://firebase.google.com/support/release-notes/android#2025-07-21 minSdkVersion increased from 21 to 23
hilt = "2.57.1"
hilt = "2.57.2"
hiltExt = "1.2.0"
kotlin = "2.2.0"
kotlin = "2.2.20"
kotlinxCoroutines = "1.10.2"
kotlinxDatetime = "0.7.1"
kotlinxSerializationJson = "1.9.0"
Expand All @@ -23,7 +23,7 @@ leakcanary = "2.14"

nordic-log = "2.5.0"
nordic-blek = "2.0.0-alpha08"
nordicPlugins = "2.9"
nordicPlugins = "2.10"
dokkaPlugin = "2.0.0"
googleServicesPlugins = "4.4.3"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import javax.inject.Inject
*/
@ActivityRetainedScoped
internal class NavigationManager @Inject constructor(
@ApplicationContext private val context: Context,
@param:ApplicationContext private val context: Context,
) : Navigator {
/** The navigation events class. */
sealed class Event {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private const val REFRESH_PERMISSIONS = "no.nordicsemi.android.common.permission

@Singleton
internal class BluetoothStateManager @Inject constructor(
@ApplicationContext private val context: Context,
@param:ApplicationContext private val context: Context,
) {
private val dataProvider = LocalDataProvider(context)
private val utils = PermissionUtils(context, dataProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private const val REFRESH_PERMISSIONS =

@Singleton
internal class LocationStateManager @Inject constructor(
@ApplicationContext private val context: Context,
@param:ApplicationContext private val context: Context,
) {
private val dataProvider = LocalDataProvider(context)
private val utils = PermissionUtils(context, dataProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ internal fun BluetoothPermissionRequiredView() {
}

private fun openPermissionSettings(context: Context) {
ContextCompat.startActivity(
context,
context.startActivity(
Intent(
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", context.packageName, null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ internal fun LocationPermissionRequiredView(
}

private fun openPermissionSettings(context: Context) {
ContextCompat.startActivity(
context,
context.startActivity(
Intent(
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", context.packageName, null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

package no.nordicsemi.android.common.scanner

import android.util.Log
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -174,5 +175,16 @@ fun rememberFilterState(
selectedFilters = emptySet()
selectedSorting = null
}
//
// override fun equals(other: Any?): Boolean {
// val e = other is ScanFilterState &&
// other.activeSortingOption == activeSortingOption &&
// other.isEmpty == isEmpty &&
// dynamicFilters.foldIndexed(true) { index, acc, _ ->
// acc && (other.isFilterSelected(index) == isFilterSelected(index))
// }
// Log.i("AAA", "ScanFilterState#equals: $e")
// return e
// }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid

sealed class Filter(
@StringRes val title: Int,
@field:StringRes val title: Int,
val icon: ImageVector,
val isInitiallySelected: Boolean,
val predicate: (selected: Boolean, result: ScanResult, highestRssi: Int) -> Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import no.nordicsemi.android.common.scanner.R
import no.nordicsemi.android.common.scanner.data.ScannedPeripheral

sealed class SortingOption(
@StringRes val title: Int,
@field:StringRes val title: Int,
val comparator: Comparator<ScannedPeripheral>
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ import no.nordicsemi.android.common.permissions.ble.RequireBluetooth
import no.nordicsemi.android.common.permissions.ble.RequireLocation
import no.nordicsemi.android.common.scanner.R
import no.nordicsemi.android.common.scanner.ScanFilterState
import no.nordicsemi.android.common.scanner.data.ScannedPeripheral
import no.nordicsemi.android.common.scanner.rememberFilterState
import no.nordicsemi.android.common.scanner.spec.ServiceUuids
import no.nordicsemi.android.common.scanner.data.ScannedPeripheral
import no.nordicsemi.android.common.scanner.viewmodel.ScannerViewModel
import no.nordicsemi.android.common.scanner.viewmodel.ScanningState
import no.nordicsemi.android.common.scanner.viewmodel.UiState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fun NordicLargeAppBar(
LargeTopAppBar(
title = title,
modifier = modifier,
colors = TopAppBarDefaults.largeTopAppBarColors(
colors = TopAppBarDefaults.topAppBarColors(
containerColor = colorResource(id = R.color.appBarColor),
scrolledContainerColor = colorResource(id = R.color.appBarColor),
titleContentColor = MaterialTheme.colorScheme.onPrimary,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fun NordicMediumAppBar(
) {
MediumTopAppBar(
title = title,
colors = TopAppBarDefaults.mediumTopAppBarColors(
colors = TopAppBarDefaults.topAppBarColors(
containerColor = colorResource(id = R.color.appBarColor),
titleContentColor = MaterialTheme.colorScheme.onPrimary,
actionIconContentColor = MaterialTheme.colorScheme.onPrimary,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ScrollableTabRow
import androidx.compose.material3.SecondaryScrollableTabRow
import androidx.compose.material3.Tab
import androidx.compose.material3.TabRow
import androidx.compose.material3.TabRowDefaults.SecondaryIndicator
import androidx.compose.material3.TabRowDefaults.tabIndicatorOffset
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
Expand Down Expand Up @@ -141,14 +139,14 @@ fun PagerView(
contentPadding.calculateRightPadding(LayoutDirection.Rtl)
)
if (scrollable) {
ScrollableTabRow(
SecondaryScrollableTabRow(
edgePadding = edgePadding,
selectedTabIndex = tabIndex,
containerColor = colorResource(id = R.color.appBarColor),
contentColor = MaterialTheme.colorScheme.onPrimary,
indicator = @Composable { tabPositions ->
indicator = @Composable {
SecondaryIndicator(
Modifier.tabIndicatorOffset(tabPositions[tabIndex]),
Modifier.tabIndicatorOffset(tabIndex, matchContentSize = false),
color = MaterialTheme.colorScheme.onPrimary
)
},
Expand All @@ -174,14 +172,14 @@ fun PagerView(
.background(color = colorResource(id = R.color.appBarColor))
.padding(horizontal = edgePadding)
) {
TabRow(
SecondaryScrollableTabRow(
modifier = Modifier.fillMaxWidth(),
selectedTabIndex = tabIndex,
containerColor = colorResource(id = R.color.appBarColor),
contentColor = MaterialTheme.colorScheme.onPrimary,
indicator = @Composable { tabPositions ->
indicator = @Composable {
SecondaryIndicator(
Modifier.tabIndicatorOffset(tabPositions[tabIndex]),
Modifier.tabIndicatorOffset(tabIndex),
color = MaterialTheme.colorScheme.onPrimary
)
},
Expand Down