From 3056ac5c2449bc87d0cf54f0d99177200f2e16c5 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Fri, 19 Jan 2018 04:07:31 -0800 Subject: [PATCH 1/3] Add MIT license --- LICENSE | 22 +++++++++++++++- .../barcodescan/BarcodeScannerActivity.kt | 21 ---------------- .../barcodescan/BarcodeScanPlugin.kt | 25 +++++++++++++++++++ .../barcodescanexample/MainActivity.kt | 13 ++++++++++ 4 files changed, 59 insertions(+), 22 deletions(-) create mode 100644 android/src/main/kotlin/com/yourcompany/barcodescan/BarcodeScanPlugin.kt create mode 100644 example/android/app/src/main/kotlin/com/yourcompany/barcodescanexample/MainActivity.kt diff --git a/LICENSE b/LICENSE index ba75c69..736d914 100644 --- a/LICENSE +++ b/LICENSE @@ -1 +1,21 @@ -TODO: Add your license here. +The MIT License + +Copyright (c) 2018 AppTree Software http://www.apptreesoftware.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/android/src/main/kotlin/com/apptreesoftware/barcodescan/BarcodeScannerActivity.kt b/android/src/main/kotlin/com/apptreesoftware/barcodescan/BarcodeScannerActivity.kt index 5113947..f8c211b 100644 --- a/android/src/main/kotlin/com/apptreesoftware/barcodescan/BarcodeScannerActivity.kt +++ b/android/src/main/kotlin/com/apptreesoftware/barcodescan/BarcodeScannerActivity.kt @@ -1,24 +1,3 @@ -/* - * ************************************************************************ - * * - * * AppTree Software Inc CONFIDENTIAL - * * __________________ - * * - * * [2012] - [2016] AppTree Software Inc - * * All Rights Reserved. - * * - * * NOTICE: All information contained herein is, and remains - * * the property of AppTree Software Inc and its suppliers, - * * if any. The intellectual and technical concepts contained - * * herein are proprietary to AppTree Software Inc - * * and its suppliers and may be covered by U.S. and Foreign Patents, - * * patents in process, and are protected by trade secret or copyright law. - * * Dissemination of this information or reproduction of this material - * * is strictly forbidden unless prior written permission is obtained - * * from AppTree Software Inc. - * - */ - package com.apptreesoftware.barcodescan import android.Manifest diff --git a/android/src/main/kotlin/com/yourcompany/barcodescan/BarcodeScanPlugin.kt b/android/src/main/kotlin/com/yourcompany/barcodescan/BarcodeScanPlugin.kt new file mode 100644 index 0000000..96a64ff --- /dev/null +++ b/android/src/main/kotlin/com/yourcompany/barcodescan/BarcodeScanPlugin.kt @@ -0,0 +1,25 @@ +package com.yourcompany.barcodescan + +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugin.common.MethodChannel.MethodCallHandler +import io.flutter.plugin.common.MethodChannel.Result +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.PluginRegistry.Registrar + +class BarcodeScanPlugin(): MethodCallHandler { + companion object { + @JvmStatic + fun registerWith(registrar: Registrar): Unit { + val channel = MethodChannel(registrar.messenger(), "barcode_scan") + channel.setMethodCallHandler(BarcodeScanPlugin()) + } + } + + override fun onMethodCall(call: MethodCall, result: Result): Unit { + if (call.method.equals("getPlatformVersion")) { + result.success("Android ${android.os.Build.VERSION.RELEASE}") + } else { + result.notImplemented() + } + } +} diff --git a/example/android/app/src/main/kotlin/com/yourcompany/barcodescanexample/MainActivity.kt b/example/android/app/src/main/kotlin/com/yourcompany/barcodescanexample/MainActivity.kt new file mode 100644 index 0000000..ca56e6d --- /dev/null +++ b/example/android/app/src/main/kotlin/com/yourcompany/barcodescanexample/MainActivity.kt @@ -0,0 +1,13 @@ +package com.yourcompany.barcodescanexample + +import android.os.Bundle + +import io.flutter.app.FlutterActivity +import io.flutter.plugins.GeneratedPluginRegistrant + +class MainActivity(): FlutterActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + GeneratedPluginRegistrant.registerWith(this) + } +} From ca9c812e33f83c0b5eb8de91252fdbee8a23fbeb Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Fri, 19 Jan 2018 04:12:34 -0800 Subject: [PATCH 2/3] update change log --- CHANGELOG.md | 7 +++++- .../barcodescan/BarcodeScanPlugin.kt | 25 ------------------- 2 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 android/src/main/kotlin/com/yourcompany/barcodescan/BarcodeScanPlugin.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index aa4f751..1e77a7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,4 +5,9 @@ ## [0.0.2] - 11/7/17 -* Rewrite iOS scanner in Objective-C to avoid Swift use_frameworks! conflicts with other plugins (see https://github.com/flutter/flutter/issues/10968) \ No newline at end of file +* Rewrite iOS scanner in Objective-C to avoid Swift use_frameworks! conflicts with other plugins (see https://github.com/flutter/flutter/issues/10968) + +## [0.0.3] - 1/19/17 + +* Improved permission handling (thanks to [BenSower](https://github.com/BenSower)) +* Added MIT license \ No newline at end of file diff --git a/android/src/main/kotlin/com/yourcompany/barcodescan/BarcodeScanPlugin.kt b/android/src/main/kotlin/com/yourcompany/barcodescan/BarcodeScanPlugin.kt deleted file mode 100644 index 96a64ff..0000000 --- a/android/src/main/kotlin/com/yourcompany/barcodescan/BarcodeScanPlugin.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.yourcompany.barcodescan - -import io.flutter.plugin.common.MethodChannel -import io.flutter.plugin.common.MethodChannel.MethodCallHandler -import io.flutter.plugin.common.MethodChannel.Result -import io.flutter.plugin.common.MethodCall -import io.flutter.plugin.common.PluginRegistry.Registrar - -class BarcodeScanPlugin(): MethodCallHandler { - companion object { - @JvmStatic - fun registerWith(registrar: Registrar): Unit { - val channel = MethodChannel(registrar.messenger(), "barcode_scan") - channel.setMethodCallHandler(BarcodeScanPlugin()) - } - } - - override fun onMethodCall(call: MethodCall, result: Result): Unit { - if (call.method.equals("getPlatformVersion")) { - result.success("Android ${android.os.Build.VERSION.RELEASE}") - } else { - result.notImplemented() - } - } -} From d6d7b22387a13dc697806656aea4ae89cb81e206 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Fri, 19 Jan 2018 04:25:23 -0800 Subject: [PATCH 3/3] remove incorrect package --- .../yourcompany/barcodescanexample/MainActivity.kt | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 example/android/app/src/main/kotlin/com/yourcompany/barcodescanexample/MainActivity.kt diff --git a/example/android/app/src/main/kotlin/com/yourcompany/barcodescanexample/MainActivity.kt b/example/android/app/src/main/kotlin/com/yourcompany/barcodescanexample/MainActivity.kt deleted file mode 100644 index ca56e6d..0000000 --- a/example/android/app/src/main/kotlin/com/yourcompany/barcodescanexample/MainActivity.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.yourcompany.barcodescanexample - -import android.os.Bundle - -import io.flutter.app.FlutterActivity -import io.flutter.plugins.GeneratedPluginRegistrant - -class MainActivity(): FlutterActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - GeneratedPluginRegistrant.registerWith(this) - } -}