Skip to content

Commit 75e06e0

Browse files
authored
Merge pull request #66 from NordicPlayground/unused-libraries
Unused libraries removed from local toml file
2 parents 0c41622 + 9b59797 commit 75e06e0

File tree

5 files changed

+15
-96
lines changed

5 files changed

+15
-96
lines changed

app/build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ android {
4343
dependencies {
4444
implementation(project(":logger"))
4545

46-
implementation(libs.nordic.theme)
47-
implementation(libs.nordic.navigation)
48-
implementation(libs.nordic.permissions.ble)
49-
implementation(libs.nordic.permissions.nfc)
50-
implementation(libs.nordic.permissions.internet)
51-
implementation(libs.nordic.uilogger)
46+
implementation(project(":theme"))
47+
implementation(project(":navigation"))
48+
implementation(project(":permissions-ble"))
49+
implementation(project(":permissions-nfc"))
50+
implementation(project(":permissions-internet"))
51+
implementation(project(":uilogger"))
5252

5353
implementation(libs.androidx.compose.material.iconsExtended)
5454

gradle/libs.versions.toml

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[versions]
2-
accompanist = "0.32.0"
32
androidDesugarJdkLibs = "2.0.3"
43
androidGradlePlugin = "8.1.1"
54
androidxActivity = "1.7.2"
@@ -14,8 +13,6 @@ androidxDataStore = "1.0.0"
1413
androidxEspresso = "3.5.1"
1514
androidxHiltNavigationCompose = "1.0.0"
1615
androidxLifecycle = "2.6.2"
17-
androidxLocalbroadcastmanager = "1.1.0"
18-
androidxMacroBenchmark = "1.1.1"
1916
androidxNavigation = "2.7.2"
2017
androidxMetrics = "1.0.0-alpha04"
2118
androidxProfileinstaller = "1.3.1"
@@ -28,65 +25,32 @@ androidxTestRules = "1.5.0"
2825
androidxTracing = "1.1.0"
2926
androidxUiAutomator = "2.2.0"
3027
androidxWork = "2.8.1"
31-
coil = "2.4.0"
3228
firebaseBom = "32.3.1"
3329
hilt = "2.48"
3430
hiltExt = "1.0.0"
35-
jacoco = "0.8.7"
3631
junit4 = "4.13.2"
3732
kotlin = "1.9.10"
3833
kotlinxCoroutines = "1.7.3"
3934
kotlinxDatetime = "0.4.1"
4035
kotlinxSerializationJson = "1.6.0"
4136
ksp = "1.9.10-1.0.13"
4237
lint = "31.1.1"
43-
memfault-cloud = "2.0.5"
44-
okhttp = "4.11.0"
45-
protobuf = "3.24.3"
46-
protobufPlugin = "0.9.4"
4738
publishPlugin = "1.2.1"
48-
retrofit = "2.9.0"
49-
retrofitKotlinxSerializationJson = "1.0.0"
50-
room = "2.5.2"
51-
secrets = "2.0.1"
52-
turbine = "1.0.0"
5339
markdown = "0.3.6"
54-
wirePlugin = "4.8.1"
55-
timber = "5.0.1"
56-
chart = "3.1.0"
5740
leakcanary = "2.12"
58-
mockk = "1.13.7"
59-
slf4j = "2.0.9"
60-
robolectric = "4.10.3"
61-
skydovesBallon = "1.6.0"
62-
moshiKotlin = "1.15.0"
63-
moshiAdapters = "1.15.0"
6441

6542
nordic-blek = "1.0.5"
66-
nordic-ble = "2.6.1"
67-
nordic-dfu = "2.3.0"
6843
nordic-log = "2.3.0"
69-
nordic-mcumgr = "1.7.2"
70-
nordic-scanner = "1.6.0"
71-
nordic-common = "1.8.2"
72-
nordic-memfault = "1.0.2"
7344
nordicPlugins = "1.9.5"
7445
dokkaPlugin = "1.9.0"
7546
googleServicesPlugins = "4.4.0"
7647
firebaseCrashlyticsPlugins = "2.9.9"
7748

7849
[libraries]
79-
accompanist-flowlayout = { group = "com.google.accompanist", name = "accompanist-flowlayout", version.ref = "accompanist" }
80-
accompanist-swiperefresh = { group = "com.google.accompanist", name = "accompanist-swiperefresh", version.ref = "accompanist" }
81-
accompanist-systemuicontroller = { group = "com.google.accompanist", name = "accompanist-systemuicontroller", version.ref = "accompanist" }
82-
accompanist-pager = { group = "com.google.accompanist", name = "accompanist-pager", version.ref = "accompanist" }
83-
accompanist-pagerindicators = { group = "com.google.accompanist", name = "accompanist-pager-indicators", version.ref = "accompanist" }
84-
accompanist-placeholder = { group = "com.google.accompanist", name = "accompanist-placeholder-material", version.ref = "accompanist" }
8550
android-desugarJdkLibs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref = "androidDesugarJdkLibs" }
8651
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidxActivity" }
8752
androidx-annotation = { group = "androidx.annotation", name = "annotation", version.ref = "androidxAnnotation" }
8853
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidxAppCompat" }
89-
androidx-benchmark-macro = { group = "androidx.benchmark", name = "benchmark-macro-junit4", version.ref = "androidxMacroBenchmark" }
9054
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidxComposeBom" }
9155
androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }
9256
androidx-compose-foundation-layout = { group = "androidx.compose.foundation", name = "foundation-layout" }
@@ -117,7 +81,6 @@ androidx-lifecycle-service = { group = "androidx.lifecycle", name = "lifecycle-s
11781
androidx-lifecycle-viewModel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "androidxLifecycle" }
11882
androidx-lifecycle-viewModel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "androidxLifecycle" }
11983
androidx-lifecycle-viewModel-savedState = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-savedstate", version.ref = "androidxLifecycle" }
120-
androidx-localbroadcastmanager = { group = "androidx.localbroadcastmanager", name = "localbroadcastmanager", version.ref = "androidxLocalbroadcastmanager" }
12184
androidx-metrics = { group = "androidx.metrics", name = "metrics-performance", version.ref = "androidxMetrics" }
12285
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "androidxNavigation" }
12386
androidx-navigation-testing = { group = "androidx.navigation", name = "navigation-testing", version.ref = "androidxNavigation" }
@@ -133,9 +96,6 @@ androidx-test-uiautomator = { group = "androidx.test.uiautomator", name = "uiaut
13396
androidx-tracing-ktx = {group = "androidx.tracing", name="tracing-ktx", version.ref = "androidxTracing" }
13497
androidx-work-ktx = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "androidxWork" }
13598
androidx-work-testing = { group = "androidx.work", name = "work-testing", version.ref = "androidxWork" }
136-
coil-kt = { group = "io.coil-kt", name = "coil", version.ref = "coil"}
137-
coil-kt-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil"}
138-
coil-kt-svg = { group = "io.coil-kt", name = "coil-svg", version.ref = "coil"}
13999
firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebaseBom"}
140100
firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics-ktx" }
141101
firebase-database = { group = "com.google.firebase", name = "firebase-database-ktx" }
@@ -154,46 +114,12 @@ kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-cor
154114
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinxDatetime" }
155115
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
156116
lint-api = { group = "com.android.tools.lint", name = "lint-api", version.ref = "lint" }
157-
okhttp-logging = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttp" }
158-
protobuf-protoc = { group = "com.google.protobuf", name = "protoc", version.ref = "protobuf" }
159-
protobuf-kotlin-lite = { group = "com.google.protobuf", name = "protobuf-kotlin-lite", version.ref = "protobuf" }
160-
turbine = { group = "app.cash.turbine", name = "turbine", version.ref = "turbine" }
161-
retrofit-core = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }
162-
retrofit-kotlin-serialization = { group = "com.jakewharton.retrofit", name = "retrofit2-kotlinx-serialization-converter", version.ref = "retrofitKotlinxSerializationJson" }
163-
room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
164-
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
165-
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
166117
markdown = { group = "com.github.jeziellago", name = "compose-markdown", version.ref = "markdown" }
167-
memfault-cloud = { group = "com.memfault.cloud", name = "cloud-android", version.ref = "memfault-cloud" }
168-
timber = { group = "com.jakewharton.timber", name = "timber", version.ref = "timber" }
169-
chart = { group = "com.github.PhilJay", name = "MPAndroidChart", version.ref = "chart" }
170118
leakcanary = { group = "com.squareup.leakcanary", name = "leakcanary-android", version.ref = "leakcanary" }
171-
test-slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
172-
test-mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
173-
test-robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" }
174-
skydoves-ballon = {group = "com.github.skydoves", name = "balloon-compose", version.ref = "skydovesBallon"}
175-
moshi-kotlin = {group = "com.squareup.moshi", name = "moshi-kotlin", version.ref = "moshiKotlin"}
176-
moshi-adapters = {group = "com.squareup.moshi", name = "moshi-adapters", version.ref = "moshiAdapters"}
177119

178120
# Nordic
179-
nordic-ble-ktx = { group = "no.nordicsemi.android", name = "ble-ktx", version.ref = "nordic-ble" }
180-
nordic-ble-common = { group = "no.nordicsemi.android", name = "ble-common", version.ref = "nordic-ble" }
181-
nordic-dfu = { group = "no.nordicsemi.android", name = "dfu", version.ref = "nordic-dfu" }
182-
nordic-mcumgr-core = { group = "no.nordicsemi.android", name = "mcumgr-core", version.ref = "nordic-mcumgr" }
183-
nordic-mcumgr-ble = { group = "no.nordicsemi.android", name = "mcumgr-ble", version.ref = "nordic-mcumgr" }
184121
nordic-log = { group = "no.nordicsemi.android", name = "log", version.ref = "nordic-log" }
185122
nordic-log-timber = { group = "no.nordicsemi.android", name = "log-timber", version.ref = "nordic-log" }
186-
nordic-scanner = { group = "no.nordicsemi.android.support.v18", name = "scanner", version.ref = "nordic-scanner" }
187-
nordic-core = { group = "no.nordicsemi.android.common", name = "core", version.ref = "nordic-common" }
188-
nordic-theme = { group = "no.nordicsemi.android.common", name = "theme", version.ref = "nordic-common" }
189-
nordic-analytics = { group = "no.nordicsemi.android.common", name = "analytics", version.ref = "nordic-common" }
190-
nordic-navigation = { group = "no.nordicsemi.android.common", name = "navigation", version.ref = "nordic-common" }
191-
nordic-uiscanner = { group = "no.nordicsemi.android.common", name = "uiscanner", version.ref = "nordic-common" }
192-
nordic-uilogger = { group = "no.nordicsemi.android.common", name = "uilogger", version.ref = "nordic-common" }
193-
nordic-permissions-nfc = { group = "no.nordicsemi.android.common", name = "permissions-nfc", version.ref = "nordic-common" }
194-
nordic-permissions-ble = { group = "no.nordicsemi.android.common", name = "permissions-ble", version.ref = "nordic-common" }
195-
nordic-permissions-internet = { group = "no.nordicsemi.android.common", name = "permissions-internet", version.ref = "nordic-common" }
196-
nordic-memfault = { group = "no.nordicsemi.android", name = "memfault", version.ref = "nordic-memfault" }
197123

198124
# BleK
199125
nordic-blek-client = { group = "no.nordicsemi.android.kotlin.ble", name = "client", version.ref = "nordic-blek" }
@@ -228,9 +154,6 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
228154
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
229155
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
230156
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
231-
protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" }
232-
secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" }
233157
publish = { id = "com.gradle.plugin-publish", version.ref = "publishPlugin" }
234-
wire = { id = "com.squareup.wire", version.ref = "wirePlugin" }
235158
google-services = { id = "com.google.gms.google-services", version.ref = "googleServicesPlugins" }
236159
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebaseCrashlyticsPlugins" }

theme/build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,5 @@ dependencies {
6262
implementation(libs.androidx.activity.compose)
6363
implementation(libs.androidx.core.splashscreen)
6464

65-
implementation(libs.accompanist.pager)
66-
implementation(libs.accompanist.pagerindicators)
67-
6865
implementation(libs.markdown)
6966
}

theme/src/main/java/no/nordicsemi/android/common/theme/view/NordicAppBar.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fun NordicAppBar(
5656
) {
5757
TopAppBar(
5858
title = { Text(text) },
59-
colors = TopAppBarDefaults.smallTopAppBarColors(
59+
colors = TopAppBarDefaults.topAppBarColors(
6060
containerColor = colorResource(id = R.color.appBarColor),
6161
titleContentColor = MaterialTheme.colorScheme.onPrimary,
6262
actionIconContentColor = MaterialTheme.colorScheme.onPrimary,

theme/src/main/java/no/nordicsemi/android/common/theme/view/PagerView.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@
3131

3232
package no.nordicsemi.android.common.theme.view
3333

34+
import androidx.compose.foundation.ExperimentalFoundationApi
3435
import androidx.compose.foundation.layout.Column
3536
import androidx.compose.foundation.layout.PaddingValues
3637
import androidx.compose.foundation.layout.fillMaxWidth
38+
import androidx.compose.foundation.pager.HorizontalPager
39+
import androidx.compose.foundation.pager.PagerState
40+
import androidx.compose.foundation.pager.rememberPagerState
3741
import androidx.compose.material3.*
3842
import androidx.compose.material3.TabRowDefaults.tabIndicatorOffset
3943
import androidx.compose.runtime.Composable
@@ -43,10 +47,6 @@ import androidx.compose.ui.Modifier
4347
import androidx.compose.ui.res.colorResource
4448
import androidx.compose.ui.unit.Dp
4549
import androidx.compose.ui.unit.dp
46-
import com.google.accompanist.pager.ExperimentalPagerApi
47-
import com.google.accompanist.pager.HorizontalPager
48-
import com.google.accompanist.pager.PagerState
49-
import com.google.accompanist.pager.rememberPagerState
5050
import kotlinx.coroutines.CoroutineScope
5151
import kotlinx.coroutines.launch
5252
import no.nordicsemi.android.common.theme.R
@@ -60,7 +60,7 @@ class PagerViewItem(
6060
val drawView: @Composable () -> Unit,
6161
)
6262

63-
@OptIn(ExperimentalPagerApi::class)
63+
@OptIn(ExperimentalFoundationApi::class)
6464
@Composable
6565
fun PagerView(
6666
viewEntity: PagerViewEntity,
@@ -79,15 +79,15 @@ fun PagerView(
7979
)
8080
}
8181

82-
@OptIn(ExperimentalPagerApi::class)
82+
@OptIn(ExperimentalFoundationApi::class)
8383
@Composable
8484
fun PagerView(
8585
viewEntity: PagerViewEntity,
8686
modifier: Modifier = Modifier,
8787
itemSpacing: Dp = 0.dp,
8888
scrollable: Boolean = true,
8989
coroutineScope: CoroutineScope,
90-
pagerState: PagerState = rememberPagerState(),
90+
pagerState: PagerState = rememberPagerState(pageCount = { viewEntity.items.size }),
9191
contentPadding: PaddingValues = PaddingValues(0.dp),
9292
verticalAlignment: Alignment.Vertical = Alignment.Top,
9393
) {
@@ -153,10 +153,9 @@ fun PagerView(
153153
}
154154

155155
HorizontalPager(
156-
count = viewEntity.items.size,
157156
state = pagerState,
158-
itemSpacing = itemSpacing,
159157
contentPadding = contentPadding,
158+
pageSpacing = itemSpacing,
160159
verticalAlignment = verticalAlignment,
161160
modifier = Modifier
162161
.weight(1f)

0 commit comments

Comments
 (0)