-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #435 from juliuscanute/gradle-upgrade
imp: upgrade compile sdk, fix custom frame
- Loading branch information
Showing
19 changed files
with
108 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include: package:pedantic/analysis_options.yaml | ||
include: package:flutter_lints/flutter.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.touchcapture.qr.flutterqr" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
<manifest package="net.touchcapture.qr.flutterqr" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" /> | ||
</manifest> |
50 changes: 0 additions & 50 deletions
50
android/src/main/kotlin/net/touchcapture/qr/flutterqr/CustomFramingRectBarcodeView.java
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
android/src/main/kotlin/net/touchcapture/qr/flutterqr/CustomFramingRectBarcodeView.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package net.touchcapture.qr.flutterqr | ||
|
||
import android.content.Context | ||
import android.graphics.Rect | ||
import android.util.AttributeSet | ||
import com.journeyapps.barcodescanner.BarcodeView | ||
import com.journeyapps.barcodescanner.Size | ||
|
||
class CustomFramingRectBarcodeView : BarcodeView { | ||
private var bottomOffset = BOTTOM_OFFSET_NOT_SET_VALUE | ||
|
||
constructor(context: Context?) : super(context) {} | ||
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {} | ||
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super( | ||
context, | ||
attrs, | ||
defStyleAttr | ||
) | ||
|
||
override fun calculateFramingRect(container: Rect, surface: Rect): Rect { | ||
val containerArea = Rect(container) | ||
val intersects = | ||
containerArea.intersect(surface) //adjusts the containerArea (code from super.calculateFramingRect) | ||
val scanAreaRect = super.calculateFramingRect(container, surface) | ||
if (bottomOffset != BOTTOM_OFFSET_NOT_SET_VALUE) { //if the setFramingRect function was called, then we shift the scan area by Y | ||
val scanAreaRectWithOffset = Rect(scanAreaRect) | ||
scanAreaRectWithOffset.bottom -= bottomOffset | ||
scanAreaRectWithOffset.top -= bottomOffset | ||
val belongsToContainer = scanAreaRectWithOffset.intersect(containerArea) | ||
if (belongsToContainer) { | ||
return scanAreaRectWithOffset | ||
} | ||
} | ||
return scanAreaRect | ||
} | ||
|
||
fun setFramingRect(rectWidth: Int, rectHeight: Int, bottomOffset: Int) { | ||
this.bottomOffset = bottomOffset | ||
framingRectSize = Size(rectWidth, rectHeight) | ||
} | ||
|
||
companion object { | ||
private const val BOTTOM_OFFSET_NOT_SET_VALUE = -1 | ||
} | ||
} |
44 changes: 11 additions & 33 deletions
44
android/src/main/kotlin/net/touchcapture/qr/flutterqr/FlutterQrPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include: package:flutter_lints/flutter.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
example/android/app/src/main/kotlin/net/touchcapture/qr/flutterqrexample/MainActivity.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Thu Dec 10 21:49:57 CET 2020 | ||
#Fri Oct 08 10:14:36 CEST 2021 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip | ||
zipStoreBase=GRADLE_USER_HOME |
Oops, something went wrong.