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
Dependencies updated
  • Loading branch information
philips77 committed Aug 27, 2024
commit c6c96db7002af6e2d10342cef0586ea8df51dea5
2 changes: 1 addition & 1 deletion ble-ktx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {

dependencies {
api project(':ble')
api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1'
}

// === Maven Central configuration ===
Expand Down
2 changes: 1 addition & 1 deletion ble-livedata/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {
api project(':ble')

// https://developer.android.com/jetpack/androidx/releases/lifecycle
api 'androidx.lifecycle:lifecycle-livedata:2.6.2'
api 'androidx.lifecycle:lifecycle-livedata:2.8.4'
}

// === Maven Central configuration ===
Expand Down
2 changes: 1 addition & 1 deletion ble/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {
}

dependencies {
api 'androidx.annotation:annotation:1.7.0'
api 'androidx.annotation:annotation:1.8.2'

testImplementation 'junit:junit:4.13.2'
}
Expand Down
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
buildscript {
// https://kotlinlang.org/docs/releases.html#release-details
ext.kotlin_version = '1.9.10'
ext.kotlin_version = '2.0.20'
// https://plugins.gradle.org/plugin/io.github.gradle-nexus.publish-plugin
ext.gradle_nexus_publish_plugin = '1.3.0'

repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.2'
classpath 'com.android.tools.build:gradle:8.5.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.48"
classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlin_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.51.1"
classpath "io.github.gradle-nexus:publish-plugin:$gradle_nexus_publish_plugin"
classpath "com.squareup.wire:wire-gradle-plugin:4.7.0"
}
Expand All @@ -26,7 +28,7 @@ allprojects {
}
}

task clean(type: Delete) {
tasks.register('clean', Delete) {
delete rootProject.buildDir
}

Expand Down
8 changes: 4 additions & 4 deletions examples/ble-gatt-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ android {
}

dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

implementation project(':ble-ktx')

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}
8 changes: 4 additions & 4 deletions examples/ble-gatt-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ android {
}

dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

implementation project(':ble-ktx')

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}
27 changes: 13 additions & 14 deletions examples/trivia/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id 'com.squareup.wire'
id 'org.jetbrains.kotlin.plugin.compose'
}

android {
Expand Down Expand Up @@ -37,9 +38,6 @@ android {
compose true
buildConfig true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.3'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
Expand All @@ -55,31 +53,32 @@ dependencies {
implementation project(path: ':ble-ktx')

// Dagger and Hilt
implementation 'com.google.dagger:hilt-android:2.48'
kapt 'com.google.dagger:hilt-compiler:2.48'
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'
kapt 'androidx.hilt:hilt-compiler:1.0.0'
implementation 'com.google.dagger:hilt-android:2.51.1'
kapt 'com.google.dagger:hilt-compiler:2.51.1'
implementation 'androidx.hilt:hilt-navigation-compose:1.2.0'
kapt 'androidx.hilt:hilt-compiler:1.2.0'

// Nordic theme
implementation 'no.nordicsemi.android.common:theme:1.8.4'
implementation 'no.nordicsemi.android.common:permissions-ble:1.8.4'
implementation 'no.nordicsemi.android.common:navigation:1.8.4'
implementation 'no.nordicsemi.android.common:ui:2.0.0'
implementation 'no.nordicsemi.android.common:theme:2.0.0'
implementation 'no.nordicsemi.android.common:permissions-ble:2.0.0'
implementation 'no.nordicsemi.android.common:navigation:2.0.0'

// Jetpack Compose bom
implementation platform('androidx.compose:compose-bom:2023.08.00')
implementation platform('androidx.compose:compose-bom:2024.08.00')

// Text, color, Surface
implementation "androidx.compose.material3:material3"
implementation 'androidx.activity:activity-compose:1.8.0'
implementation 'androidx.activity:activity-compose:1.9.1'
implementation "androidx.compose.runtime:runtime-livedata"

// To show Preview
implementation 'androidx.compose.ui:ui-tooling'
implementation 'androidx.compose.ui:ui-tooling-preview'

// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.11.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.11.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
// https://square.github.io/okhttp/changelog/
implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package no.nordicsemi.android.ble.trivia.client
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
Expand All @@ -18,7 +19,7 @@ import no.nordicsemi.android.ble.trivia.server.view.ResultView
import no.nordicsemi.android.ble.ktx.state.ConnectionState
import no.nordicsemi.android.common.permissions.ble.RequireBluetooth
import no.nordicsemi.android.common.permissions.ble.RequireLocation
import no.nordicsemi.android.common.theme.view.NordicAppBar
import no.nordicsemi.android.common.ui.view.NordicAppBar

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand All @@ -28,9 +29,13 @@ fun ClientScreen(
Column {
var playersName by rememberSaveable { mutableStateOf("") }
NordicAppBar(
text = when (playersName.isNotEmpty()) {
true -> stringResource(id = R.string.good_luck_player, playersName)
else -> stringResource(id = R.string.good_luck_player, "")
title = {
Text(
text = when (playersName.isNotEmpty()) {
true -> stringResource(id = R.string.good_luck_player, playersName)
else -> stringResource(id = R.string.good_luck_player, "")
}
)
},
onNavigationButtonClick = onNavigationUp
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package no.nordicsemi.android.ble.trivia.server
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
Expand All @@ -22,7 +23,7 @@ import no.nordicsemi.android.ble.trivia.server.view.StartGameView
import no.nordicsemi.android.ble.trivia.server.view.WaitingForClientsView
import no.nordicsemi.android.ble.trivia.server.viewmodel.ServerViewModel
import no.nordicsemi.android.common.permissions.ble.RequireBluetooth
import no.nordicsemi.android.common.theme.view.NordicAppBar
import no.nordicsemi.android.common.ui.view.NordicAppBar

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand All @@ -32,10 +33,15 @@ fun ServerScreen(
Column {
var playersName by rememberSaveable { mutableStateOf("") }
NordicAppBar(
text = when (playersName.isNotEmpty()) {
true -> stringResource(id = R.string.good_luck_player, playersName)
else -> stringResource(id = R.string.good_luck_player, "")
title = {
Text(
text = when (playersName.isNotEmpty()) {
true -> stringResource(id = R.string.good_luck_player, playersName)
else -> stringResource(id = R.string.good_luck_player, "")
}
)
},

onNavigationButtonClick = onNavigationUp
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import no.nordicsemi.android.ble.trivia.R
import no.nordicsemi.android.common.theme.view.NordicAppBar
import no.nordicsemi.android.common.ui.view.NordicAppBar

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand All @@ -20,7 +20,7 @@ fun StartScreen(
) {
Column {
NordicAppBar(
text = stringResource(id = R.string.welcome_message)
title = { Text(text = stringResource(id = R.string.welcome_message)) },
)

Column(
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Apr 15 11:00:45 CEST 2021
#Tue Aug 27 10:46:52 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
25 changes: 12 additions & 13 deletions test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id 'org.jetbrains.kotlin.plugin.compose'
}

android {
Expand Down Expand Up @@ -38,9 +39,6 @@ android {
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.3'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
Expand All @@ -51,29 +49,30 @@ android {
dependencies {
implementation project(path: ':ble-ktx')
// Nordic theme
implementation "no.nordicsemi.android.common:theme:1.8.4"
implementation 'no.nordicsemi.android.common:permissions-ble:1.8.4'
implementation 'no.nordicsemi.android.common:navigation:1.8.4'
implementation "no.nordicsemi.android.common:ui:2.0.0"
implementation "no.nordicsemi.android.common:theme:2.0.0"
implementation 'no.nordicsemi.android.common:permissions-ble:2.0.0'
implementation 'no.nordicsemi.android.common:navigation:2.0.0'

implementation 'com.github.jeziellago:compose-markdown:0.3.6'

// Jetpack Compose bom
implementation platform('androidx.compose:compose-bom:2023.08.00')
implementation platform('androidx.compose:compose-bom:2024.08.00')

// Text, Color, Surface
implementation 'androidx.compose.material3:material3'
implementation 'androidx.activity:activity-compose:1.8.0'
implementation "androidx.lifecycle:lifecycle-runtime-compose:2.6.2"
implementation 'androidx.activity:activity-compose:1.9.1'
implementation "androidx.lifecycle:lifecycle-runtime-compose:2.8.4"

// Preview
debugImplementation "androidx.compose.ui:ui-tooling"
implementation "androidx.compose.ui:ui-tooling-preview"

// Dagger and Hilt
implementation 'com.google.dagger:hilt-android:2.48'
kapt 'com.google.dagger:hilt-compiler:2.48'
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'
kapt 'androidx.hilt:hilt-compiler:1.0.0'
implementation 'com.google.dagger:hilt-android:2.51.1'
kapt 'com.google.dagger:hilt-compiler:2.51.1'
implementation 'androidx.hilt:hilt-navigation-compose:1.2.0'
kapt 'androidx.hilt:hilt-compiler:1.2.0'

// Test
testImplementation 'junit:junit:4.13.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import no.nordicsemi.android.common.theme.view.NordicAppBar
import no.nordicsemi.android.common.ui.view.NordicAppBar

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand All @@ -18,7 +18,9 @@ fun HomeScreen(
onScanNavigation: () -> Unit,
) {
Column {
NordicAppBar(text = stringResource(id = R.string.welcome_message))
NordicAppBar(
title = { Text(text = stringResource(id = R.string.welcome_message)) }
)
Column(
modifier = Modifier
.padding(16.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package no.nordicsemi.andorid.ble.test.client.view

import androidx.compose.foundation.layout.Column
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.res.stringResource
Expand All @@ -14,13 +15,15 @@ import no.nordicsemi.andorid.ble.test.server.view.ResultView
import no.nordicsemi.android.ble.ktx.state.ConnectionState
import no.nordicsemi.android.common.permissions.ble.RequireBluetooth
import no.nordicsemi.android.common.permissions.ble.RequireLocation
import no.nordicsemi.android.common.theme.view.NordicAppBar
import no.nordicsemi.android.common.ui.view.NordicAppBar

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ClientScreen() {
Column {
NordicAppBar(text = stringResource(id = R.string.scanner))
NordicAppBar(
title = { Text(text = stringResource(id = R.string.scanner)) }
)
RequireBluetooth {
RequireLocation {
val clientViewModel: ClientViewModel = hiltViewModel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package no.nordicsemi.andorid.ble.test.server.view

import androidx.compose.foundation.layout.Column
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.res.stringResource
Expand All @@ -11,13 +12,15 @@ import no.nordicsemi.andorid.ble.test.R
import no.nordicsemi.andorid.ble.test.server.viewmodel.ServerViewModel
import no.nordicsemi.andorid.ble.test.server.viewmodel.WaitingForClient
import no.nordicsemi.android.common.permissions.ble.RequireBluetooth
import no.nordicsemi.android.common.theme.view.NordicAppBar
import no.nordicsemi.android.common.ui.view.NordicAppBar

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ServerScreen() {
Column {
NordicAppBar(text = stringResource(id = R.string.advertiser))
NordicAppBar(
title = { Text(text = stringResource(id = R.string.advertiser)) }
)
RequireBluetooth {
val serverViewModel: ServerViewModel = hiltViewModel()
val serverViewState by serverViewModel.serverViewState.collectAsStateWithLifecycle()
Expand Down