Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayodele Kehinde authored and skyestudiosDev committed Apr 19, 2024
1 parent d0f9b6c commit 74c7319
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 9 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ plugins {
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.publish) apply false
}
1 change: 1 addition & 0 deletions composeApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>


<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand Down
5 changes: 1 addition & 4 deletions composeApp/src/commonMain/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.AlertDialog
import androidx.compose.material.Button
import androidx.compose.material.CircularProgressIndicator
Expand Down Expand Up @@ -46,7 +44,6 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.ui.tooling.preview.Preview


@OptIn(ExperimentalResourceApi::class)
@Composable
@Preview
fun App() {
Expand Down Expand Up @@ -74,7 +71,7 @@ fun App() {
showDialog = message.isNotEmpty()
}

Column(Modifier.fillMaxSize().verticalScroll(rememberScrollState()), horizontalAlignment = Alignment.CenterHorizontally) {
Column(Modifier.fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally) {
TopAppBar(modifier = Modifier.fillMaxWidth(), title = { Text("Discovered Bluetooth devices") })
AnimatedVisibility(showContent) {
ConnectionItem(bluetoothConnection, connectionState, scope)
Expand Down
18 changes: 16 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
[versions]
agp = "8.1.4"
android-compileSdk = "34"
android-minSdk = "24"
android-minSdk = "26"
android-targetSdk = "34"
androidx-activityCompose = "1.8.0"
androidx-appcompat = "1.6.1"
compose-plugin = "1.6.1"
jetpack-compose-bom = "2024.01.00"
kotlin = "1.9.23"
coroutines = "1.7.1"
kotlin1922 = "1.9.22"
core-ktx = "1.12.0"
junit = "4.13.2"
androidx-test-ext-junit = "1.1.5"
espresso-core = "3.5.1"
material = "1.11.0"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Expand All @@ -21,11 +27,19 @@ compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref =

compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
qrcode = "io.github.kalinjul.easyqrscan:scanner:0.1.3"

kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin1922" }
publish = { id = "com.vanniktech.maven.publish", version = "0.25.3" }
6 changes: 6 additions & 0 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
C75123682BD13C970000D3AB /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
C751236A2BD13CA60000D3AB /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
C751236C2BD13CC70000D3AB /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -45,6 +48,9 @@
42799AB246E5F90AF97AA0EF /* Frameworks */ = {
isa = PBXGroup;
children = (
C751236C2BD13CC70000D3AB /* CoreLocation.framework */,
C751236A2BD13CA60000D3AB /* libz.tbd */,
C75123682BD13C970000D3AB /* libc++.tbd */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down
2 changes: 2 additions & 0 deletions iosApp/iosApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<true/>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Allow bluetooth</string>
<key>NSCameraUsageDescription</key>
<string>Allow camera</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand Down
6 changes: 3 additions & 3 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import com.vanniktech.maven.publish.SonatypeHost
//import com.vanniktech.maven.publish.SonatypeHost

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary)
id("com.vanniktech.maven.publish").version("0.25.3")
alias(libs.plugins.publish)
}

kotlin {
Expand Down Expand Up @@ -50,7 +50,7 @@ android {
}
@Suppress("UnstableApiUsage")
mavenPublishing {
publishToMavenCentral(SonatypeHost.S01, true)
//publishToMavenCentral(SonatypeHost.S01, true)
val versionTxt = "0.0.1"
val isDev = findProperty("env")?.equals("dev") ?: false
val version = if (isDev) versionTxt.plus("-SNAPSHOT") else versionTxt
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pluginManagement {

dependencyResolutionManagement {
repositories {
mavenLocal()
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
Expand Down

0 comments on commit 74c7319

Please sign in to comment.