Skip to content

Commit

Permalink
Upgrade compose, set library version to 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsickle committed Nov 20, 2023
1 parent 79e92d3 commit b771963
Show file tree
Hide file tree
Showing 17 changed files with 130 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These are supported funding model platforms

github: [simonsickle]
github: [ simonsickle ]
30 changes: 15 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Publish Artifacts
run: ./gradlew composed-barcodes:publishReleasePublicationToSonatypeRepository publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
GPG_KEY: ${{ secrets.GPG_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Publish Artifacts
run: ./gradlew composed-barcodes:publishReleasePublicationToSonatypeRepository publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
GPG_KEY: ${{ secrets.GPG_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ Composed Barcodes

Make barcode views with ease in Jetpack Compose.


Gradle users:


```
implementation("com.simonsickle:composed-barcodes:1.1.1")
```
Expand Down Expand Up @@ -40,7 +38,8 @@ if (!BarcodeType.CODE_128.isValueValid(URL)) {
Supported Barcode Types
-----------------------

We are using ZXing to generate our barcodes and are limited to the types supported by that library. The following are all supported:
We are using ZXing to generate our barcodes and are limited to the types supported by that library.
The following are all supported:

```
EAN_8
Expand Down
29 changes: 14 additions & 15 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ plugins {
}

android {
compileSdkVersion 33

defaultConfig {
applicationId "com.simonsickle.composedbarcodes"
compileSdk 34
minSdkVersion 26
targetSdkVersion 33
targetSdkVersion 34
versionCode 2
versionName "1.0.3"
versionName "1.1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -24,20 +23,20 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_19
targetCompatibility JavaVersion.VERSION_19
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_19.toString()
}

buildFeatures {
compose true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
kotlinCompilerExtensionVersion = "1.5.4"
}

namespace "com.simonsickle.composedbarcodes"
Expand All @@ -47,14 +46,14 @@ dependencies {
implementation(project(":composed-barcodes"))

implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.8.0")
implementation("com.google.android.material:material:1.10.0")

implementation("androidx.compose.runtime:runtime:1.3.3")
implementation("androidx.compose.ui:ui:1.3.3")
implementation("androidx.compose.foundation:foundation-layout:1.3.1")
implementation("androidx.compose.material:material:1.3.1")
implementation("androidx.compose.ui:ui-tooling:1.3.3")
implementation("androidx.compose.runtime:runtime:1.5.4")
implementation("androidx.compose.ui:ui:1.5.4")
implementation("androidx.compose.foundation:foundation-layout:1.5.4")
implementation("androidx.compose.material:material:1.5.4")
implementation("androidx.compose.ui:ui-tooling:1.5.4")

// Nav components
implementation("androidx.navigation:navigation-compose:2.5.3")
implementation("androidx.navigation:navigation-compose:2.7.5")
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package com.simonsickle.composedbarcodes

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Button
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package com.simonsickle.composedbarcodes

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.*
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Scaffold
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.runtime.Composable
Expand All @@ -14,7 +20,19 @@ import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.simonsickle.compose.barcodes.BarcodeType
import com.simonsickle.composedbarcodes.examples.*
import com.simonsickle.composedbarcodes.examples.Aztec
import com.simonsickle.composedbarcodes.examples.Codabar
import com.simonsickle.composedbarcodes.examples.Code128
import com.simonsickle.composedbarcodes.examples.Code39
import com.simonsickle.composedbarcodes.examples.Code93
import com.simonsickle.composedbarcodes.examples.DataMatrix
import com.simonsickle.composedbarcodes.examples.Ean13
import com.simonsickle.composedbarcodes.examples.Ean8
import com.simonsickle.composedbarcodes.examples.Itf
import com.simonsickle.composedbarcodes.examples.Pdf417
import com.simonsickle.composedbarcodes.examples.Qr
import com.simonsickle.composedbarcodes.examples.UpcA
import com.simonsickle.composedbarcodes.examples.UpcE

@Composable
fun NavigationRegistry() {
Expand All @@ -39,8 +57,12 @@ fun NavigationRegistry() {
)
})
}
) {
Column(modifier = Modifier.verticalScroll(rememberScrollState())) {
) { paddingValues ->
Column(
modifier = Modifier
.padding(paddingValues)
.verticalScroll(rememberScrollState())
) {
NavHost(navController = navController, startDestination = "home") {
composable("home") {
title.value = "Barcode List"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
package com.simonsickle.composedbarcodes.examples

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.simonsickle.compose.barcodes.Barcode
Expand All @@ -18,7 +24,11 @@ fun GenericBarcodeExample(
value: String,
) {
Surface(color = MaterialTheme.colors.background) {
Column(modifier = Modifier.fillMaxSize()) {
Column(
modifier = Modifier
.background(Color.White)
.fillMaxSize()
) {
if (barcodeType.isValueValid(value)) {
Barcode(
modifier = Modifier
Expand Down
32 changes: 4 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

plugins {
id("io.github.gradle-nexus.publish-plugin").version("1.1.0")
}

allprojects {
repositories {
google()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
id("com.android.application") version "8.1.1" apply false
id("com.android.library") version '8.1.1' apply false
id("org.jetbrains.kotlin.android") version "1.9.20" apply false
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

apply from: "${rootDir}/scripts/publish-root.gradle"
29 changes: 14 additions & 15 deletions composed-barcodes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ plugins {

ext {
PUBLISH_GROUP_ID = 'com.simonsickle'
PUBLISH_VERSION = '1.1.1'
PUBLISH_VERSION = '1.2.0'
PUBLISH_ARTIFACT_ID = 'composed-barcodes'
}

apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

android {
compileSdkVersion 33

defaultConfig {
compileSdk 34
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
Expand All @@ -32,20 +31,20 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_19
targetCompatibility JavaVersion.VERSION_19
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_19.toString()
}

buildFeatures {
compose true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
kotlinCompilerExtensionVersion = "1.5.4"
}

packagingOptions {
Expand All @@ -67,11 +66,11 @@ android {
dependencies {
implementation("com.google.zxing:core:3.4.1")

implementation("androidx.compose.runtime:runtime:1.3.3")
implementation("androidx.compose.ui:ui:1.3.3")
implementation("androidx.compose.foundation:foundation:1.3.1")
implementation("androidx.compose.foundation:foundation-layout:1.3.1")
implementation("androidx.compose.material:material:1.3.1")
implementation 'androidx.compose.ui:ui-tooling-preview:1.3.3'
debugImplementation 'androidx.compose.ui:ui-tooling:1.3.3'
implementation("androidx.compose.runtime:runtime:1.5.4")
implementation("androidx.compose.ui:ui:1.5.4")
implementation("androidx.compose.foundation:foundation:1.5.4")
implementation("androidx.compose.foundation:foundation-layout:1.5.4")
implementation("androidx.compose.material:material:1.5.4")
implementation 'androidx.compose.ui:ui-tooling-preview:1.5.4'
debugImplementation 'androidx.compose.ui:ui-tooling:1.5.4'
}
2 changes: 1 addition & 1 deletion composed-barcodes/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ package com.simonsickle.compose.barcodes

import android.util.Log
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.painter.BitmapPainter
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.Dispatchers
Expand Down
Loading

0 comments on commit b771963

Please sign in to comment.