react-native-flic2 0.3.26 → 2.0.0-alpha.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Flic2.podspec +22 -0
- package/{LICENSE.md → LICENSE} +1 -1
- package/README.md +17 -523
- package/android/build.gradle +64 -132
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +17 -29
- package/android/src/main/java/com/flic2/Flic2ButtonListener.kt +132 -0
- package/android/src/main/java/com/flic2/Flic2Converter.kt +103 -0
- package/android/src/main/java/com/flic2/Flic2Module.kt +480 -0
- package/android/src/main/java/com/flic2/Flic2Package.kt +33 -0
- package/android/src/main/java/com/flic2/Flic2Service.kt +112 -0
- package/ios/Flic2.h +9 -4
- package/ios/Flic2.mm +610 -0
- package/ios/flic2lib.framework/Headers/FLICButton.h +1 -1
- package/ios/flic2lib.framework/Headers/FLICManager.h +1 -1
- package/ios/flic2lib.framework/Info.plist +0 -0
- package/ios/flic2lib.framework/Modules/module.modulemap +1 -1
- package/ios/flic2lib.framework/flic2lib +0 -0
- package/lib/module/NativeFlic2.js +14 -0
- package/lib/module/NativeFlic2.js.map +1 -0
- package/lib/module/index.js +91 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeFlic2.d.ts +119 -0
- package/lib/typescript/src/NativeFlic2.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +81 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +132 -19
- package/src/NativeFlic2.ts +157 -0
- package/src/index.tsx +159 -0
- package/.editorconfig +0 -7
- package/.gitattributes +0 -1
- package/.idea/codeStyles/Project.xml +0 -116
- package/.idea/modules.xml +0 -8
- package/.idea/react-native-flic2.iml +0 -9
- package/.idea/vcs.xml +0 -6
- package/.idea/workspace.xml +0 -140
- package/android/.classpath +0 -6
- package/android/.gradle/5.4.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/5.4.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/5.4.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/5.4.1/fileContent/fileContent.lock +0 -0
- package/android/.gradle/5.4.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/5.4.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/5.4.1/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/5.4.1/gc.properties +0 -0
- package/android/.gradle/5.4.1/javaCompile/classAnalysis.bin +0 -0
- package/android/.gradle/5.4.1/javaCompile/jarAnalysis.bin +0 -0
- package/android/.gradle/5.4.1/javaCompile/javaCompile.lock +0 -0
- package/android/.gradle/5.4.1/javaCompile/taskHistory.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/caches/build_file_checksums.ser +0 -0
- package/android/.idea/codeStyles/Project.xml +0 -116
- package/android/.idea/gradle.xml +0 -18
- package/android/.idea/libraries/Gradle__android_arch_core_common_1_1_1_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__android_arch_core_runtime_1_1_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_1_1_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__android_arch_lifecycle_livedata_1_1_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__android_arch_lifecycle_livedata_core_1_1_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_1_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__android_arch_lifecycle_viewmodel_1_1_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_animated_vector_drawable_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_appcompat_v7_28_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_android_support_asynclayoutinflater_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_collections_28_0_0_jar.xml +0 -9
- package/android/.idea/libraries/Gradle__com_android_support_coordinatorlayout_28_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_android_support_cursoradapter_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_customview_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_documentfile_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_drawerlayout_28_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_android_support_interpolator_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_loader_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_localbroadcastmanager_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_print_28_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_android_support_slidingpanelayout_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_support_annotations_28_0_0_jar.xml +0 -9
- package/android/.idea/libraries/Gradle__com_android_support_support_compat_28_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_android_support_support_core_ui_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_support_core_utils_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_support_fragment_28_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_android_support_support_vector_drawable_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_swiperefreshlayout_28_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_android_support_versionedparcelable_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_android_support_viewpager_28_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_1_10_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_1_10_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_1_10_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_1_10_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_base_1_10_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp3_1_10_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_infer_annotation_infer_annotation_0_11_2_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_59_10_aar.xml +0 -17
- package/android/.idea/libraries/Gradle__com_facebook_soloader_soloader_0_6_0_aar.xml +0 -14
- package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_2_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_3_12_1_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_urlconnection_3_12_1_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_1_15_0_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__io_flic_flic2lib_android_1_1_0_aar.xml +0 -14
- package/android/.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml +0 -13
- package/android/.idea/misc.xml +0 -14
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/runConfigurations.xml +0 -12
- package/android/.idea/vcs.xml +0 -6
- package/android/.idea/workspace.xml +0 -348
- package/android/.project +0 -34
- package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
- package/android/README.md +0 -14
- package/android/android.iml +0 -139
- package/android/build/generated/source/buildConfig/debug/nl/xguard/flic2/BuildConfig.java +0 -13
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -46
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +0 -1
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -15
- package/android/build/intermediates/incremental/packageDebugResources/merged.dir/values/values.xml +0 -4
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -46
- package/android/build/intermediates/merged_manifests/debug/output.json +0 -1
- package/android/build/intermediates/packaged_res/debug/drawable/ic_launcher_background.xml +0 -74
- package/android/build/intermediates/packaged_res/debug/drawable-v24/ic_launcher_foreground.xml +0 -34
- package/android/build/intermediates/packaged_res/debug/mipmap-anydpi-v26/ic_launcher.xml +0 -5
- package/android/build/intermediates/packaged_res/debug/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
- package/android/build/intermediates/packaged_res/debug/mipmap-hdpi-v4/ic_launcher.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-hdpi-v4/ic_launcher_round.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-mdpi-v4/ic_launcher.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-mdpi-v4/ic_launcher_round.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-xhdpi-v4/ic_launcher.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-xhdpi-v4/ic_launcher_round.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-xxhdpi-v4/ic_launcher.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-xxhdpi-v4/ic_launcher_round.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-xxxhdpi-v4/ic_launcher.png +0 -0
- package/android/build/intermediates/packaged_res/debug/mipmap-xxxhdpi-v4/ic_launcher_round.png +0 -0
- package/android/build/intermediates/packaged_res/debug/values/values.xml +0 -4
- package/android/build/intermediates/res/symbol-table-with-package/debug/package-aware-r.txt +0 -989
- package/android/build/intermediates/symbols/debug/R.txt +0 -1302
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -95
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/android/gradlew +0 -172
- package/android/gradlew.bat +0 -84
- package/android/local.properties +0 -8
- package/android/src/main/ic_launcher-web.png +0 -0
- package/android/src/main/java/nl/xguard/flic2/Flic2.java +0 -213
- package/android/src/main/java/nl/xguard/flic2/Flic2Package.java +0 -28
- package/android/src/main/java/nl/xguard/flic2/communication/IReactEvent.java +0 -15
- package/android/src/main/java/nl/xguard/flic2/communication/NullReactEvent.java +0 -47
- package/android/src/main/java/nl/xguard/flic2/communication/ReactEvent.java +0 -230
- package/android/src/main/java/nl/xguard/flic2/model/IReactFlic2Manager.java +0 -27
- package/android/src/main/java/nl/xguard/flic2/model/NullReactFlic2Manager.java +0 -70
- package/android/src/main/java/nl/xguard/flic2/model/ReactAndroidHandler.java +0 -33
- package/android/src/main/java/nl/xguard/flic2/model/ReactFlic2ButtonListener.java +0 -106
- package/android/src/main/java/nl/xguard/flic2/model/ReactFlic2Manager.java +0 -168
- package/android/src/main/java/nl/xguard/flic2/model/ReactFlic2ScanCallback.java +0 -48
- package/android/src/main/java/nl/xguard/flic2/model/ReactLogger.java +0 -14
- package/android/src/main/java/nl/xguard/flic2/service/Flic2Service.java +0 -200
- package/android/src/main/java/nl/xguard/flic2/service/Flic2ServiceConnection.java +0 -41
- package/android/src/main/java/nl/xguard/flic2/service/IFlic2Service.java +0 -13
- package/android/src/main/java/nl/xguard/flic2/sharedpreferences/flic2SharedPreferences.java +0 -35
- package/android/src/main/java/nl/xguard/flic2/util/ActivityUtil.java +0 -29
- package/android/src/main/java/nl/xguard/flic2/util/Consumer.java +0 -12
- package/android/src/main/res/drawable/ic_launcher_background.xml +0 -74
- package/android/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -34
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
- package/android/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/android/src/main/res/values/ids.xml +0 -5
- package/build/generated/source/buildConfig/debug/com/flic2/BuildConfig.java +0 -13
- package/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -46
- package/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output.json +0 -1
- package/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt +0 -0
- package/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
- package/build/intermediates/incremental/debug-mergeJniLibs/merge-state +0 -0
- package/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -15
- package/build/intermediates/incremental/packageDebugResources/merger.xml +0 -2
- package/build/intermediates/intermediate-jars/debug/classes.jar +0 -0
- package/build/intermediates/intermediate-jars/debug/res.jar +0 -0
- package/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/flic2/BuildConfig.class +0 -0
- package/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/flic2/Flic2Module$1.class +0 -0
- package/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/flic2/Flic2Module.class +0 -0
- package/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/flic2/Flic2Package.class +0 -0
- package/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/flic2/callback/flic2ButtonCallback.class +0 -0
- package/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/flic2/communication/ReactEvent.class +0 -0
- package/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/flic2/service/Flic2Service$BootUpReceiver.class +0 -0
- package/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/flic2/service/Flic2Service$UpdateReceiver.class +0 -0
- package/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/flic2/service/Flic2Service.class +0 -0
- package/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -46
- package/build/intermediates/merged_manifests/debug/output.json +0 -1
- package/build/intermediates/packaged-classes/debug/classes.jar +0 -0
- package/build/intermediates/packaged_res/debug/drawable/ic_launcher_background.xml +0 -74
- package/build/intermediates/packaged_res/debug/drawable-v24/ic_launcher_foreground.xml +0 -34
- package/build/intermediates/packaged_res/debug/mipmap-anydpi-v26/ic_launcher.xml +0 -5
- package/build/intermediates/packaged_res/debug/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
- package/build/intermediates/packaged_res/debug/mipmap-hdpi-v4/ic_launcher.png +0 -0
- package/build/intermediates/packaged_res/debug/mipmap-hdpi-v4/ic_launcher_round.png +0 -0
- package/build/intermediates/packaged_res/debug/mipmap-mdpi-v4/ic_launcher.png +0 -0
- package/build/intermediates/packaged_res/debug/mipmap-mdpi-v4/ic_launcher_round.png +0 -0
- package/build/intermediates/packaged_res/debug/mipmap-xhdpi-v4/ic_launcher.png +0 -0
- package/build/intermediates/packaged_res/debug/mipmap-xhdpi-v4/ic_launcher_round.png +0 -0
- package/build/intermediates/packaged_res/debug/mipmap-xxhdpi-v4/ic_launcher.png +0 -0
- package/build/intermediates/packaged_res/debug/mipmap-xxhdpi-v4/ic_launcher_round.png +0 -0
- package/build/intermediates/packaged_res/debug/mipmap-xxxhdpi-v4/ic_launcher.png +0 -0
- package/build/intermediates/packaged_res/debug/mipmap-xxxhdpi-v4/ic_launcher_round.png +0 -0
- package/build/intermediates/res/symbol-table-with-package/debug/package-aware-r.txt +0 -1290
- package/build/intermediates/symbols/debug/R.txt +0 -1764
- package/build/intermediates/transforms/mergeJavaRes/debug/0.jar +0 -0
- package/build/intermediates/transforms/mergeJavaRes/debug/__content__.json +0 -1
- package/build/intermediates/transforms/mergeJniLibs/debug/__content__.json +0 -1
- package/build/intermediates/transforms/stripDebugSymbol/debug/__content__.json +0 -1
- package/build/outputs/aar/react-native-flic2-debug.aar +0 -0
- package/build/outputs/logs/manifest-merger-debug-report.txt +0 -95
- package/flic2Button.js +0 -170
- package/index.js +0 -430
- package/ios/Flic2.m +0 -611
- package/ios/Flic2.xcodeproj/project.pbxproj +0 -320
- package/ios/Flic2.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
- package/ios/Flic2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/Flic2.xcodeproj/project.xcworkspace/xcuserdata/wesdewitte.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Flic2.xcodeproj/xcshareddata/xcschemes/Flic2.xcscheme +0 -66
- package/ios/Flic2.xcodeproj/xcuserdata/wesdewitte.xcuserdatad/xcschemes/xcschememanagement.plist +0 -22
- package/ios/Flic2.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/Flic2.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/Flic2.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -5
- package/ios/Flic2.xcworkspace/xcuserdata/wesdewitte.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Flic2.xcworkspace/xcuserdata/wesdewitte.xcuserdatad/WorkspaceSettings.xcsettings +0 -14
- package/react-native-flic2.podspec +0 -26
package/Flic2.podspec
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "Flic2"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/X-Guard/react-native-flic2.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
17
|
+
s.private_header_files = "ios/**/*.h"
|
|
18
|
+
|
|
19
|
+
s.ios.vendored_frameworks = 'ios/flic2lib.framework'
|
|
20
|
+
|
|
21
|
+
install_modules_dependencies(s)
|
|
22
|
+
end
|
package/{LICENSE.md → LICENSE}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## License for React Native Flic 2 module
|
|
4
4
|
MIT License
|
|
5
5
|
|
|
6
|
-
Copyright (c) 2019 X-Guard B.V.
|
|
6
|
+
Copyright (c) 2019 - 2025 X-Guard B.V.
|
|
7
7
|
|
|
8
8
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
9
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,545 +1,39 @@
|
|
|
1
1
|
# react-native-flic2
|
|
2
|
-
[](https://www.npmjs.com/package/react-native-flic2)   
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
React Native Flic plugin made with the Flic2 SDK (unofficial)
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
- Android: https://github.com/50ButtonsEach/flic2lib-android
|
|
8
|
-
- iOS: https://github.com/50ButtonsEach/flic2lib-ios
|
|
5
|
+
## Installation
|
|
9
6
|
|
|
10
|
-
## Getting started
|
|
11
7
|
|
|
12
|
-
|
|
8
|
+
```sh
|
|
9
|
+
npm install react-native-flic2
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
```
|
|
15
12
|
|
|
16
|
-
`$ react-native link react-native-flic2`
|
|
17
13
|
|
|
18
14
|
## Usage
|
|
19
|
-
```javascript
|
|
20
|
-
import Flic2 from 'react-native-flic2';
|
|
21
|
-
|
|
22
|
-
// Flic2 Module
|
|
23
|
-
Flic.start(); // Starts the module, fixes auto bluetooth permission question
|
|
24
|
-
Flic2.isInitialized(); // returns a boolean if the manager is initialized or not
|
|
25
|
-
Flic2.startScan(); // start a scan
|
|
26
|
-
Flic2.stopScan(); // stop a scan
|
|
27
|
-
Flic2.startService(); // enable background capabilities through a service on Android, ignored by iOS
|
|
28
|
-
Flic2.addEventListener(event, fn); // listen for events (manager & all buttons). Possible events are: managerInitialized, didReceiveButtonDown, didReceiveButtonUp, didReceiveButtonClick, didReceiveButtonDoubleClick, didReceiveButtonHold
|
|
29
|
-
Flic2.connectAllKnownButtons(); // connect to known buttons
|
|
30
|
-
Flic2.buttonConnect(uuid); // connect to a button with this uuid
|
|
31
|
-
Flic2.buttonForget(uuid); // disconnect and forget the button
|
|
32
|
-
Flic2.forgetAllButtons(); // disconnect and forget all known buttons
|
|
33
|
-
Flic2.buttonDisconnect(uuid); // disconnect a button with this uuid
|
|
34
|
-
Flic2.disconnectAllKnownButtons(); // disconnect all known buttons
|
|
35
|
-
Flic2.getButtons(); // array of Flic2Button instances
|
|
36
|
-
Flic2.getButton(uuid); // get a button by uuid, returns a Flic2Button instance
|
|
37
|
-
Flic2.buttonSetMode(uuid, mode); // change the button trigger mode by uuid. Use the constants to change the mode (see example below).
|
|
38
|
-
Flic2.buttonSetName(uuid, name); // change the nickname by uuid
|
|
39
|
-
|
|
40
|
-
// Flic2Button instance definition
|
|
41
|
-
Flic2Button.addEventListener(event, fn); // listen for button events for this particular button. Possible events are: didReceiveButtonDown, didReceiveButtonUp, didReceiveButtonClick, didReceiveButtonDoubleClick, didReceiveButtonHold
|
|
42
|
-
Flic2Button.connect() // connect this button
|
|
43
|
-
Flic2Button.disconnect(); // disconnect this button
|
|
44
|
-
Flic2Button.forget(); // removes the button completely
|
|
45
|
-
Flic2Button.getUuid(); // get the button uuid
|
|
46
|
-
Flic2Button.getBluetoothAddress(); // get the button bluetooth address
|
|
47
|
-
Flic2Button.getName(); // get the button nickname
|
|
48
|
-
Flic2Button.getBatteryLevelIsOk(); // get the battery state (true, false), True = battery is ok, False = battery should be changed soon
|
|
49
|
-
Flic2Button.getVoltage(); // get the estimated battery voltage
|
|
50
|
-
Flic2Button.getPressCount(); // get button count since last reset
|
|
51
|
-
Flic2Button.getFirmwareRevision(); // get current hardware version
|
|
52
|
-
Flic2Button.getSerialNumber(); // get the serial number of the button
|
|
53
|
-
Flic2Button.getIsReady(); // get the ready state of the button
|
|
54
|
-
Flic2Button.getIsUnpaired(); // get the unpaired state of the button
|
|
55
|
-
Flic2Button.setMode(mode); // change the button trigger for this particular button. Use the constants to change the mode (see example below).
|
|
56
|
-
Flic2Button.setName(name); // sets the nickname of the button
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// Constants
|
|
60
|
-
//
|
|
61
|
-
// These are the possible result codes for the variable 'result' in the
|
|
62
|
-
// event 'scanResult' (see example below)
|
|
63
|
-
//
|
|
64
|
-
// These constants are available through Flic2.constants
|
|
65
|
-
SCAN_RESULT_SUCCESS = 0;
|
|
66
|
-
SCAN_RESULT_ERROR_ALREADY_RUNNING = 1;
|
|
67
|
-
SCAN_RESULT_ERROR_BLUETOOTH_NOT_ACTIVATED = 2;
|
|
68
|
-
SCAN_RESULT_ERROR_UNKNOWN = 3;
|
|
69
|
-
SCAN_RESULT_ERROR_NO_PUBLIC_BUTTON_DISCOVERED = 4;
|
|
70
|
-
SCAN_RESULT_ERROR_ALREADY_CONNECTED_TO_ANOTHER_DEVICE = 5;
|
|
71
|
-
SCAN_RESULT_ERROR_CONNECTION_TIMEOUT = 6;
|
|
72
|
-
SCAN_RESULT_ERROR_INVALID_VERIFIER = 7;
|
|
73
|
-
SCAN_RESULT_ERROR_BLE_PAIRING_FAILED_PREVIOUS_PAIRING_ALREADY_EXISTING = 8;
|
|
74
|
-
SCAN_RESULT_ERROR_BLE_PAIRING_FAILED_USER_CANCELED = 9;
|
|
75
|
-
SCAN_RESULT_ERROR_BLE_PAIRING_FAILED_UNKNOWN_REASON = 10;
|
|
76
|
-
SCAN_RESULT_ERROR_APP_CREDENTIALS_DONT_MATCH = 11;
|
|
77
|
-
SCAN_RESULT_ERROR_USER_CANCELED = 12;
|
|
78
|
-
SCAN_RESULT_ERROR_INVALID_BLUETOOTH_ADDRESS = 13;
|
|
79
|
-
SCAN_RESULT_ERROR_GENUINE_CHECK_FAILED = 14;
|
|
80
|
-
SCAN_RESULT_ERROR_TOO_MANY_APPS = 15;
|
|
81
|
-
SCAN_RESULT_ERROR_COULD_NOT_SET_BLUETOOTH_NOTIFY = 16;
|
|
82
|
-
SCAN_RESULT_ERROR_COULD_NOT_DISCOVER_BLUETOOTH_SERVICES = 17;
|
|
83
|
-
SCAN_RESULT_ERROR_BUTTON_DISCONNECTED_DURING_VERIFICATION = 18;
|
|
84
|
-
SCAN_RESULT_ERROR_FAILED_TO_ESTABLISH = 19;
|
|
85
|
-
SCAN_RESULT_ERROR_CONNECTION_LIMIT_REACHED = 20;
|
|
86
|
-
SCAN_RESULT_ERROR_NOT_IN_PUBLIC_MODE = 21;
|
|
87
|
-
|
|
88
|
-
// These constants can be used to change the mode of the buttons
|
|
89
|
-
// These constants are available through Flic2.constants
|
|
90
|
-
BUTTON_TRIGGER_MODE_CLICK_AND_HOLD = 0;
|
|
91
|
-
BUTTON_TRIGGER_MODE_CLICK_AND_DOUBLE_CLICK = 1;
|
|
92
|
-
BUTTON_TRIGGER_MODE_CLICK_AND_DOUBLE_CLICK_AND_HOLD = 2;
|
|
93
|
-
BUTTON_TRIGGER_MODE_CLICK = 3;
|
|
94
|
-
|
|
95
|
-
// Scan result:
|
|
96
|
-
Flic2.addEventListener('scanResult', ((int) result, (Flic2Button) button) => {
|
|
97
|
-
|
|
98
|
-
if (result === Flic2.constants.SCAN_RESULT_SUCCESS) {
|
|
99
|
-
|
|
100
|
-
doSomethingWithButton(button);
|
|
101
|
-
|
|
102
|
-
} else
|
|
103
|
-
if(result === Flic2.constants.SCAN_RESULT_ERROR_ALREADY_CONNECTED_TO_ANOTHER_DEVICE) {
|
|
104
|
-
|
|
105
|
-
alert('This button is already connected to another device');
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
// ... etc
|
|
109
|
-
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
// Button events:
|
|
113
|
-
//
|
|
114
|
-
// didReceiveButtonDown
|
|
115
|
-
// didReceiveButtonUp
|
|
116
|
-
// didReceiveButtonClick
|
|
117
|
-
// didReceiveButtonDoubleClick
|
|
118
|
-
// didReceiveButtonHold
|
|
119
|
-
Flic2.addEventListener('didReceiveButtonHold', ((object) eventData) => {
|
|
120
|
-
|
|
121
|
-
// eventData:
|
|
122
|
-
// { int age, bool queued, Flic2Button button }
|
|
123
15
|
|
|
124
|
-
});
|
|
125
16
|
|
|
126
|
-
```
|
|
17
|
+
```js
|
|
18
|
+
import { multiply } from 'react-native-flic2';
|
|
127
19
|
|
|
128
|
-
|
|
129
|
-
Changing the title, text and icon of the service,
|
|
130
|
-
Or the notification channel name and description.
|
|
131
|
-
Place the following meta-data's inside the application tag of your manifest
|
|
20
|
+
// ...
|
|
132
21
|
|
|
133
|
-
|
|
134
|
-
<application>
|
|
135
|
-
<meta-data android:name="nl.xguard.flic2.notification_title" android:value="Flic 2 Button"/>
|
|
136
|
-
<meta-data android:name="nl.xguard.flic2.notification_text" android:value="Service active"/>
|
|
137
|
-
<meta-data android:name="nl.xguard.flic2.notification_icon" android:resource="@mipmap/xguard_adaptive_launcher"/>
|
|
138
|
-
<meta-data android:name="nl.xguard.flic2.notification_channel_name" android:value="Flic 2 Channel Name"/>
|
|
139
|
-
<meta-data android:name="nl.xguard.flic2.notification_channel_description" android:value="Flic 2 Channel Description"/>
|
|
140
|
-
</application>
|
|
22
|
+
const result = multiply(3, 7);
|
|
141
23
|
```
|
|
142
24
|
|
|
143
|
-
# Example component
|
|
144
|
-
You can install and test this example at https://github.com/X-Guard/react-native-flic2-example
|
|
145
|
-
|
|
146
|
-
```javascript
|
|
147
|
-
// react and react native imports
|
|
148
|
-
import React, { Component } from 'react';
|
|
149
|
-
import { View, FlatList, TouchableOpacity, Text, StyleSheet, StatusBar, Platform, Vibration } from 'react-native';
|
|
150
|
-
|
|
151
|
-
// the Flic2 module
|
|
152
|
-
import Flic2 from 'react-native-flic2';
|
|
153
|
-
|
|
154
|
-
// icons
|
|
155
|
-
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome';
|
|
156
|
-
import { faPause, faPlay, faTrash, faEdit, faBatteryQuarter, faBatteryFull } from '@fortawesome/free-solid-svg-icons';
|
|
157
|
-
|
|
158
|
-
// plugins to make it more fancy
|
|
159
|
-
import prompt from 'react-native-prompt-android';
|
|
160
|
-
import { request as requestPermission, PERMISSIONS } from 'react-native-permissions';
|
|
161
|
-
import * as Animatable from 'react-native-animatable';
|
|
162
|
-
import Toast from 'react-native-root-toast';
|
|
163
|
-
|
|
164
|
-
export default class App extends Component {
|
|
165
|
-
|
|
166
|
-
constructor(props) {
|
|
167
|
-
|
|
168
|
-
// man
|
|
169
|
-
super(props);
|
|
170
|
-
|
|
171
|
-
// init state
|
|
172
|
-
this.state = {
|
|
173
|
-
buttons: [],
|
|
174
|
-
scanning: false,
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
// bindings
|
|
178
|
-
this.didReceiveButtonClickFunction = this.didReceiveButtonClick.bind(this);
|
|
179
|
-
this.onScanResultFunction = this.onScanResult.bind(this);
|
|
180
|
-
this.onInitializedFunction = this.onInitialized.bind(this);
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
componentDidMount() {
|
|
185
|
-
|
|
186
|
-
// start module
|
|
187
|
-
Flic2.start();
|
|
188
|
-
|
|
189
|
-
if (typeof Flic2.isInitialized === 'function' && Flic2.isInitialized() === true) {
|
|
190
|
-
this.onInitialized();
|
|
191
|
-
} else {
|
|
192
|
-
Flic2.addListener('managerInitialized', this.onInitializedFunction);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// listen bindings
|
|
196
|
-
Flic2.addListener('didReceiveButtonClick', this.didReceiveButtonClickFunction);
|
|
197
|
-
Flic2.addListener('scanResult', this.onScanResultFunction);
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
componentWillUnmount() {
|
|
202
|
-
|
|
203
|
-
// remove bindings
|
|
204
|
-
Flic2.removeListener('buttonEvent', this.handleButtonEventFunction);
|
|
205
|
-
Flic2.removeListener('scanResult', this.onScanResultFunction);
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
onInitialized() {
|
|
210
|
-
|
|
211
|
-
// connect to all known buttons
|
|
212
|
-
Flic2.connectAllKnownButtons();
|
|
213
|
-
|
|
214
|
-
// get the buttons
|
|
215
|
-
this.getButtons();
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
async getButtons() {
|
|
219
|
-
|
|
220
|
-
// async calls for init
|
|
221
|
-
this.setState({
|
|
222
|
-
buttons: await Flic2.getButtons(),
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
async forgetAllButtons() {
|
|
228
|
-
|
|
229
|
-
await Flic2.forgetAllButtons();
|
|
230
|
-
this.getButtons();
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
async startScan() {
|
|
235
|
-
|
|
236
|
-
// check os
|
|
237
|
-
if (Platform.OS === 'android') {
|
|
238
|
-
|
|
239
|
-
// on android we need the permission ACCESS_FINE_LOCATION first
|
|
240
|
-
// we are just going to assume the permission is granted after calling this
|
|
241
|
-
// in your real application, please create an actual permission check here
|
|
242
|
-
await requestPermission(PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION);
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// set to scanning
|
|
247
|
-
this.setState({
|
|
248
|
-
scanning: true,
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
// go!
|
|
252
|
-
Flic2.startScan();
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
stopScan() {
|
|
257
|
-
|
|
258
|
-
this.setState({
|
|
259
|
-
scanning: false,
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
Flic2.stopScan();
|
|
263
|
-
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
connectButton(button) {
|
|
267
|
-
|
|
268
|
-
// connect it
|
|
269
|
-
button.connect(button);
|
|
270
|
-
|
|
271
|
-
// update our button list
|
|
272
|
-
this.getButtons();
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
disconnectButton(button) {
|
|
277
25
|
|
|
278
|
-
|
|
279
|
-
button.disconnect(button);
|
|
26
|
+
## Contributing
|
|
280
27
|
|
|
281
|
-
|
|
282
|
-
|
|
28
|
+
- [Development workflow](CONTRIBUTING.md#development-workflow)
|
|
29
|
+
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
|
|
30
|
+
- [Code of conduct](CODE_OF_CONDUCT.md)
|
|
283
31
|
|
|
284
|
-
|
|
32
|
+
## License
|
|
285
33
|
|
|
286
|
-
|
|
34
|
+
MIT
|
|
287
35
|
|
|
288
|
-
|
|
289
|
-
button.forget();
|
|
36
|
+
---
|
|
290
37
|
|
|
291
|
-
|
|
292
|
-
this.getButtons();
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
editButtonName(button) {
|
|
297
|
-
|
|
298
|
-
// use the prompt to change the name
|
|
299
|
-
prompt(
|
|
300
|
-
'Edit Flic nickname',
|
|
301
|
-
'Choose a name you will recognize',
|
|
302
|
-
[
|
|
303
|
-
{ text: 'Cancel', style: 'cancel' },
|
|
304
|
-
{
|
|
305
|
-
text: 'OK',
|
|
306
|
-
onPress: value => {
|
|
307
|
-
|
|
308
|
-
// save
|
|
309
|
-
button.setName(value);
|
|
310
|
-
|
|
311
|
-
// get new buttons
|
|
312
|
-
this.getButtons();
|
|
313
|
-
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
],
|
|
317
|
-
{
|
|
318
|
-
type: 'plain-text',
|
|
319
|
-
cancelable: true,
|
|
320
|
-
defaultValue: button.getName(),
|
|
321
|
-
}
|
|
322
|
-
);
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
onScanResult(data) {
|
|
327
|
-
|
|
328
|
-
if (data.event === 'completion') {
|
|
329
|
-
|
|
330
|
-
this.setState({
|
|
331
|
-
scanning: false,
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
// check
|
|
335
|
-
if (data.error === false) {
|
|
336
|
-
|
|
337
|
-
alert('The button has been added');
|
|
338
|
-
this.getButtons();
|
|
339
|
-
|
|
340
|
-
} else {
|
|
341
|
-
|
|
342
|
-
if (data.result === Flic2.constants.SCAN_RESULT_ERROR_ALREADY_CONNECTED_TO_ANOTHER_DEVICE) {
|
|
343
|
-
|
|
344
|
-
alert('This button is already connected to another device');
|
|
345
|
-
|
|
346
|
-
} else
|
|
347
|
-
if (data.result === Flic2.constants.SCAN_RESULT_ERROR_NO_PUBLIC_BUTTON_DISCOVERED) {
|
|
348
|
-
|
|
349
|
-
alert('No buttons found');
|
|
350
|
-
|
|
351
|
-
} else {
|
|
352
|
-
|
|
353
|
-
alert(`Could not connect\n\nError code: ${data.result}`);
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
didReceiveButtonClick(eventData) {
|
|
361
|
-
|
|
362
|
-
console.log('Received click event', eventData);
|
|
363
|
-
|
|
364
|
-
// update list
|
|
365
|
-
this.getButtons();
|
|
366
|
-
|
|
367
|
-
// do something with the click like showing a notification
|
|
368
|
-
Toast.show(`Button ${eventData.button.getName()} has been pressed ${eventData.button.getPressCount()} times`);
|
|
369
|
-
|
|
370
|
-
// wobble
|
|
371
|
-
// we do this extensive check because when you develop the app with live reload, the _logoRef will break.
|
|
372
|
-
if (typeof this._logoRef !== 'undefined' && this._logoRef !== null && typeof this._logoRef.wobble === 'function') {
|
|
373
|
-
|
|
374
|
-
// wobble wobble
|
|
375
|
-
this._logoRef.wobble();
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// vibrate
|
|
380
|
-
Vibration.vibrate(200);
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
getBatteryIcon(batteryPercentage) {
|
|
385
|
-
|
|
386
|
-
if (batteryPercentage === true) {
|
|
387
|
-
return faBatteryFull;
|
|
388
|
-
} else {
|
|
389
|
-
return faBatteryQuarter;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
render() {
|
|
396
|
-
|
|
397
|
-
return (
|
|
398
|
-
<View style={style.container}>
|
|
399
|
-
<StatusBar barStyle="light-content" />
|
|
400
|
-
|
|
401
|
-
{/* eslint-disable-next-line */}
|
|
402
|
-
<Animatable.Image ref={ image => this._logoRef = image } style={style.logo} useNativeDriver={true} source={require('./images/flic-logo.png')} />
|
|
403
|
-
|
|
404
|
-
{/* Scan button */}
|
|
405
|
-
{this.state.scanning === false ?
|
|
406
|
-
<TouchableOpacity onPress={this.startScan.bind(this)}>
|
|
407
|
-
<View style={style.button}><Text style={style.buttonText}>Start scan</Text></View>
|
|
408
|
-
</TouchableOpacity>
|
|
409
|
-
:
|
|
410
|
-
<TouchableOpacity onPress={this.stopScan.bind(this)}>
|
|
411
|
-
<View style={style.button}><Text style={style.buttonText}>Scanning... (click to cancel)</Text></View>
|
|
412
|
-
</TouchableOpacity> }
|
|
413
|
-
|
|
414
|
-
<TouchableOpacity onPress={this.forgetAllButtons.bind(this)}>
|
|
415
|
-
<View style={style.button}><Text style={style.buttonText}>Forget all buttons</Text></View>
|
|
416
|
-
</TouchableOpacity>
|
|
417
|
-
|
|
418
|
-
<View style={style.buttonContainer}>
|
|
419
|
-
|
|
420
|
-
<Text style={style.heading}>Button list:</Text>
|
|
421
|
-
|
|
422
|
-
{this.state.buttons.length > 0 ?
|
|
423
|
-
<FlatList
|
|
424
|
-
data={this.state.buttons}
|
|
425
|
-
keyExtractor={item => item.uuid}
|
|
426
|
-
renderItem={row => {
|
|
427
|
-
|
|
428
|
-
// define button
|
|
429
|
-
const button = row.item;
|
|
430
|
-
|
|
431
|
-
// eslint-disable-next-line react-native/no-inline-styles
|
|
432
|
-
return <View style={[style.listItem, { borderColor: button.getIsReady() ? '#006e1a' : '#b00000'}]}>
|
|
433
|
-
<FontAwesomeIcon style={style.icon} icon={this.getBatteryIcon(button.getBatteryLevelIsOk())} size={16} />
|
|
434
|
-
<Text style={style.pressCount}>{button.getPressCount()}</Text>
|
|
435
|
-
<Text style={style.listItemText}>{button.getName()}</Text>
|
|
436
|
-
<View style={style.icons}>
|
|
437
|
-
{button.getIsReady() === true ?
|
|
438
|
-
<TouchableOpacity onPress={this.disconnectButton.bind(this, button)}><FontAwesomeIcon icon={faPause} size={16} /></TouchableOpacity>
|
|
439
|
-
:
|
|
440
|
-
<TouchableOpacity onPress={this.connectButton.bind(this, button)}><FontAwesomeIcon icon={faPlay} size={16} /></TouchableOpacity>
|
|
441
|
-
}
|
|
442
|
-
<TouchableOpacity onPress={this.forgetButton.bind(this, button)}><FontAwesomeIcon icon={faTrash} size={16} /></TouchableOpacity>
|
|
443
|
-
<TouchableOpacity onPress={this.editButtonName.bind(this, button)}><FontAwesomeIcon icon={faEdit} size={16} /></TouchableOpacity>
|
|
444
|
-
</View>
|
|
445
|
-
</View>;
|
|
446
|
-
|
|
447
|
-
}}
|
|
448
|
-
/> : <Text>There are no buttons paired to this app. Click 'start scan' and hold your flic button to add a new button.</Text>}
|
|
449
|
-
|
|
450
|
-
</View>
|
|
451
|
-
|
|
452
|
-
</View>
|
|
453
|
-
);
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
// define stylesheet
|
|
459
|
-
const style = StyleSheet.create({
|
|
460
|
-
|
|
461
|
-
// container
|
|
462
|
-
container: {
|
|
463
|
-
paddingTop: 20,
|
|
464
|
-
padding: 10,
|
|
465
|
-
backgroundColor: '#45454d',
|
|
466
|
-
flex: 1,
|
|
467
|
-
},
|
|
468
|
-
|
|
469
|
-
// logo
|
|
470
|
-
logo: {
|
|
471
|
-
width: 100,
|
|
472
|
-
alignSelf: 'center',
|
|
473
|
-
resizeMode: 'contain',
|
|
474
|
-
},
|
|
475
|
-
|
|
476
|
-
// button
|
|
477
|
-
button: {
|
|
478
|
-
padding: 10,
|
|
479
|
-
borderRadius: 10,
|
|
480
|
-
backgroundColor: '#ff0089',
|
|
481
|
-
marginTop: 15,
|
|
482
|
-
},
|
|
483
|
-
buttonText: {
|
|
484
|
-
color: 'white',
|
|
485
|
-
textAlign: 'center',
|
|
486
|
-
fontSize: 20,
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
-
// button container
|
|
490
|
-
buttonContainer: {
|
|
491
|
-
padding: 10,
|
|
492
|
-
backgroundColor: 'rgba(255, 255, 255, 1)',
|
|
493
|
-
borderRadius: 10,
|
|
494
|
-
marginTop: 20,
|
|
495
|
-
},
|
|
496
|
-
|
|
497
|
-
// heading
|
|
498
|
-
heading: {
|
|
499
|
-
fontSize: 20,
|
|
500
|
-
fontWeight: 'bold',
|
|
501
|
-
marginBottom: 10,
|
|
502
|
-
},
|
|
503
|
-
|
|
504
|
-
// list item
|
|
505
|
-
listItem: {
|
|
506
|
-
padding: 20,
|
|
507
|
-
paddingLeft: 15,
|
|
508
|
-
paddingRight: 15,
|
|
509
|
-
flex: 1,
|
|
510
|
-
flexDirection: 'row',
|
|
511
|
-
justifyContent: 'flex-start',
|
|
512
|
-
alignItems: 'center',
|
|
513
|
-
borderRadius: 10,
|
|
514
|
-
marginBottom: 10,
|
|
515
|
-
backgroundColor: '#f3f9ff',
|
|
516
|
-
borderWidth: 2,
|
|
517
|
-
},
|
|
518
|
-
listItemText: {
|
|
519
|
-
flex: 1,
|
|
520
|
-
},
|
|
521
|
-
pressCount: {
|
|
522
|
-
width: 25,
|
|
523
|
-
color: 'rgba(40, 40, 40, 0.5)',
|
|
524
|
-
fontSize: 10,
|
|
525
|
-
},
|
|
526
|
-
|
|
527
|
-
// icons
|
|
528
|
-
icons: {
|
|
529
|
-
width: 70,
|
|
530
|
-
flexDirection: 'row',
|
|
531
|
-
justifyContent: 'space-between',
|
|
532
|
-
alignItems: 'center',
|
|
533
|
-
alignSelf: 'flex-end',
|
|
534
|
-
},
|
|
535
|
-
icon: {
|
|
536
|
-
marginRight: 7,
|
|
537
|
-
},
|
|
538
|
-
|
|
539
|
-
});
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
```
|
|
38
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
543
39
|
|
|
544
|
-
## Collaborating
|
|
545
|
-
We are happy to receive PRs! We have not published an NPM package before and are eager to learn!
|