Skip to content

Commit

Permalink
4.1.0 (#109)
Browse files Browse the repository at this point in the history
* [4.1.0] Changes and fixes

* [4.1.0] Changes and fixes

* [4.1.0] README changes

* [4.1.0] Android Example changes

* [4.1.0] Android Example changes

* [4.1.0] README changes

* [4.1.0] CI changes so examples won't fail because of a missing version

* [4.1.0] CI changes so examples won't fail because of a missing version

* [4.1.0] CI changes so examples won't fail because of a missing version

* [4.1.0] CI needs a newer Java Version. Let it be the latest LTR

---------

Co-authored-by: Rafael Lins <[email protected]>
  • Loading branch information
g0dkar and rafaellins-swile authored Dec 29, 2023
1 parent 27fd664 commit bae6330
Show file tree
Hide file tree
Showing 21 changed files with 295 additions and 292 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
with:
java-version: "17"
java-version: "21"
distribution: "temurin"
- name: Run Tests
uses: gradle/gradle-build-action@87a9a15658c426a54dd469d4fc7dc1a73ca9d4a6 # v2
with:
arguments: test
arguments: :test
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
> Mostly notable changes from version to version. Some stuff might go undocumented. If you find something that you think
> should be documented, please open an [issue](https://github.com/g0dkar/qrcode-kotlin/issues) :)
## 4.0.7 - Latest
## 4.1.0 - Latest

- Another round of improvements and fixes (special thanks to [ruicanas](https://github.com/ruicanas) and [chphmh](https://github.com/chphmh)!)
- Changed the minimal requirements for the library:
- Reduced the minSdk API Version of the Android implementation to `7` (down from `23`)
- In theory, it can go down to `1` but all API Versions below 7 are considered deprecated.
- Reduced the Java compilation target to `11` (down from `17`)

## 4.0.7

- A bunch of improvements and optimizations (minor changes from the rework)
- MAJOR thanks to [ruicanas](https://github.com/ruicanas) for fixing and improving the iOS implementation!
Expand Down
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,44 @@ that we can provide a better library/API for them. Please, feel free to share if

<!-- TOC -->

## Installation
## 1. Installation

The library is available
from [Maven Central](https://search.maven.org/artifact/io.github.g0dkar/qrcode-kotlin/4.0.7/qrcode-kotlin)
from [Maven Central](https://search.maven.org/artifact/io.github.g0dkar/qrcode-kotlin/4.1.0/qrcode-kotlin)
and [NPM JS](https://www.npmjs.com/package/qrcode-kotlin), so you can add it to your project as a dependency like any
other:

**Gradle:**

```groovy
implementation("io.github.g0dkar:qrcode-kotlin:4.0.7")
// Use this for both Android and JVM
implementation("io.github.g0dkar:qrcode-kotlin:4.1.0")
```

**Maven:**
**Maven - JVM:**

```xml
<dependency>
<groupId>io.github.g0dkar</groupId>
<artifactId>qrcode-kotlin-jvm</artifactId> <!-- or qrcode-kotlin-android -->
<version>4.0.7</version>
<artifactId>qrcode-kotlin-jvm</artifactId>
<version>4.1.0</version>
</dependency>
```

**Maven - Android:**

```xml
<dependency>
<groupId>io.github.g0dkar</groupId>
<artifactId>qrcode-kotlin-android</artifactId>
<version>4.1.0</version>
</dependency>
```

**NodeJS:**

```shell
npm install qrcode-kotlin@4.0.7
npm install qrcode-kotlin@4.1.0
```

**Browser:**
Expand Down Expand Up @@ -159,9 +170,9 @@ The main changes coming from `v3.3.0` are:
3. A bunch of optimizations on how the QRCode is drawn. Previously, we'd had a canvas for each square, which would then
be copied into the QRCode. This was changed to have just one large canvas where each square will be individually
drawn directly.
4. ![Experimental](https://img.shields.io/badge/Experimental-critical) iOS and tvOS Support: Starting from `v4.0.7` an
initial implementation of the `QRCodeGraphics` so that iOS and tvOS are now supported. **Any and
all [feedback](https://github.com/g0dkar/qrcode-kotlin/issues/85) are very welcome!**
4. iOS and tvOS Support: Starting from `v4.0.7` an initial implementation of the `QRCodeGraphics` so that iOS and tvOS
are now supported. **Any and all [feedback](https://github.com/g0dkar/qrcode-kotlin/issues/85) are very welcome!** -
Thanks a lot to [ruicanas](https://github.com/ruicanas) for all his contributions to this feature :D

## License

Expand Down
31 changes: 22 additions & 9 deletions README.pt-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,40 @@ Por favor, sinta-se livre para compartilhar se e como você utiliza este projeto
## Instalação

A biblioteca está disponível através
da [Maven Central](https://search.maven.org/artifact/io.github.g0dkar/qrcode-kotlin/4.0.6/qrcode-kotlin) e
da [Maven Central](https://search.maven.org/artifact/io.github.g0dkar/qrcode-kotlin/4.1.0/qrcode-kotlin) e
do [NPM JS](https://www.npmjs.com/package/qrcode-kotlin), portanto basta adicioná-la a seu projeto como qualquer outra:

**Gradle:**

```groovy
implementation("io.github.g0dkar:qrcode-kotlin:4.0.6")
// Use esse tanto para Android quanto para a JVM
implementation("io.github.g0dkar:qrcode-kotlin:4.1.0")
```

**Maven:**
**Maven - JVM:**

```xml
<dependency>
<groupId>io.github.g0dkar</groupId>
<artifactId>qrcode-kotlin-jvm</artifactId> <!-- ou qrcode-kotlin-android -->
<version>4.0.6</version>
<artifactId>qrcode-kotlin-jvm</artifactId>
<version>4.1.0</version>
</dependency>
```

**Maven - Android:**

```xml
<dependency>
<groupId>io.github.g0dkar</groupId>
<artifactId>qrcode-kotlin-android</artifactId>
<version>4.1.0</version>
</dependency>
```

**NodeJS:**

```shell
npm install qrcode-kotlin@4.0.6
npm install qrcode-kotlin@4.1.0
```

**Browser:**
Expand Down Expand Up @@ -158,9 +169,11 @@ As principais mudanças vindo da versão `v3.3.0` são:
3. Uma grande quantidade de otimizações em como o QRCode é desenhado. Anteriormente, tínhamos um canvas (ecrã) para cada
quadrado, o qual era copiado no canvas do QRCode principal. Isto foi mudado para termos apenas um grande canvas onde
cada quadrado individual será desenhado diretamente.
4. ![Experimental](https://img.shields.io/badge/Experimental-critical) Suporte a iOS e tvOS: A partir da
versão `v4.0.6`, uma implementação experimental inicial da classe `QRCodeGraphics` foi criada para que o iOS e tvOS
sejam suportados. **Todo e qualquer [feedback](https://github.com/g0dkar/qrcode-kotlin/issues/85) é muito bem-vindo!** (pode comentar em português mesmo)
4. Suporte a iOS e tvOS: A partir da versão `v4.0.7`, uma implementação experimental inicial da classe `QRCodeGraphics`
foi criada para que o iOS e tvOS sejam suportados. **Todo e
qualquer [feedback](https://github.com/g0dkar/qrcode-kotlin/issues/85) é muito bem-vindo!** (pode comentar em
português mesmo) - Um imenso agradecimento a [ruicanas](https://github.com/ruicanas) por suas contribuições a essa
feature :D

## Licença

Expand Down
38 changes: 7 additions & 31 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ buildscript {
plugins {
// Dev Plugins
id("idea")
alias(libs.plugins.spotless)

// Base Plugins
alias(libs.plugins.kotlin.multiplatform)
Expand Down Expand Up @@ -41,12 +40,16 @@ repositories {
}

group = "io.github.g0dkar"
val javaVersion = JavaVersion.VERSION_17
val javaVersion = JavaVersion.VERSION_1_8
val javaVersionNumber = javaVersion.majorVersion.toInt()

kotlin {
applyDefaultHierarchyTemplate()

compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}

jvm {
jvmToolchain(javaVersionNumber)

Expand Down Expand Up @@ -130,11 +133,11 @@ kotlin {

android {
namespace = "io.github.g0dkar.qrcode"
compileSdk = 32
compileSdk = 7
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

defaultConfig {
minSdk = 23
minSdk = 7
}

compileOptions {
Expand Down Expand Up @@ -216,33 +219,6 @@ val dokkaJar by tasks.creating(Jar::class) {
from(tasks.dokkaHtml)
}

/* **************** */
/* Lint */
/* **************** */
spotless {
val spotlessFiles = properties["spotlessFiles"]?.toString()?.split(",")

isEnforceCheck = properties.getOrDefault("spotless.enforce", "false") == "true"

val ktlintVersion = libs.versions.ktlint.getOrElse("0.48.2")

kotlin {
val files = fileTree(project.projectDir) {
if (spotlessFiles.isNullOrEmpty()) {
include("**/*.kt")
} else {
include(spotlessFiles)
}

exclude("src/generated/**")
}

target(files)

ktlint(ktlintVersion)
}
}

/* **************** */
/* Publishing */
/* **************** */
Expand Down
5 changes: 2 additions & 3 deletions examples/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ android {
}

dependencies {
implementation(project.rootProject) // <- On your project, use: implementation("io.github.g0dkar:qrcode-kotlin:4.0.4")

implementation("io.github.g0dkar:qrcode-kotlin:4.1.0")
implementation(libs.core.ktx)
implementation(libs.appcompat)
implementation(libs.material)
implementation(libs.constraintlayout)
implementation(libs.navigation.fragment.ktx)
implementation(libs.navigation.ui.ktx)
implementation("androidx.annotation:annotation:1.7.0")
implementation("androidx.annotation:annotation:1.7.1")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
}
65 changes: 32 additions & 33 deletions examples/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
>
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.QRCodeKotlinExampleApp"
tools:targetApi="31">
<activity
android:exported="false"
android:name=".AboutActivity"/>
<activity
android:exported="false"
android:name=".QRCodeDetailActivity"/>
<activity
android:exported="false"
android:label="@string/title_activity_new_qrcode"
android:name=".NewQRCodeActivity"/>
<activity
android:exported="true"
android:label="@string/app_name"
android:name=".QRCodeListActivity"
android:theme="@style/Theme.QRCodeKotlinExampleApp.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.QRCodeKotlinExampleApp"
tools:targetApi="31">
<activity
android:exported="false"
android:name=".AboutActivity" />
<activity
android:exported="false"
android:name=".QRCodeDetailActivity" />
<activity
android:exported="false"
android:label="@string/title_activity_new_qrcode"
android:name=".NewQRCodeActivity" />
<activity
android:exported="true"
android:label="@string/app_name"
android:name=".QRCodeListActivity"
android:theme="@style/Theme.QRCodeKotlinExampleApp.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
37 changes: 18 additions & 19 deletions examples/android/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
tools:context=".AboutActivity">
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
tools:context=".AboutActivity">

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars"/>
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
</androidx.constraintlayout.widget.ConstraintLayout>
Loading

0 comments on commit bae6330

Please sign in to comment.