diff --git a/README.md b/README.md index eb50069..08ab779 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Code scanner library for [Android](https://developer.android.com), based on [ZXi ### Usage ([sample](https://github.com/yuriy-budiyev/lib-demo-app)) Step 1. Add it in your root build.gradle at the end of repositories: + ```gradle allprojects { @@ -39,6 +40,7 @@ allprojects { ``` or in settings.gradle file: + ```gradle dependencyResolutionManagement { @@ -50,12 +52,15 @@ dependencyResolutionManagement { ``` Step 2. Add dependency: + ```gradle dependencies { - implementation 'com.github.yuriy-budiyev:code-scanner:2.3.0' + implementation 'com.github.yuriy-budiyev:code-scanner:2.3.1' } ``` + Add camera permission and hardware feature to AndroidManifest.xml (Don't forget about dynamic permissions on API >= 23): + ```xml @@ -63,34 +68,53 @@ Add camera permission and hardware feature to AndroidManifest.xml (Don't forget android:name="android.hardware.camera" android:required="false"/> ``` + Define a view in your layout file: + ```xml + android:layout_height="match_parent"/> ``` + +You can use XML attributes to set view parameters: + +``` +maskColor +maskVisible +frameColor +frameVisible +frameThickness +frameCornersSize +frameCornersRadius +frameAspectRatioWidth +frameAspectRatioHeight +frameSize +frameVerticalBias +autoFocusButtonColor +autoFocusButtonVisible +autoFocusButtonPaddingHorizontal +autoFocusButtonPaddingVertical +autoFocusButtonOnIcon +autoFocusButtonOffIcon +autoFocusButtonPosition +flashButtonColor +flashButtonVisible +flashButtonPaddingHorizontal +flashButtonPaddingVertical +flashButtonOnIcon +flashButtonOffIcon +flashButtonPosition +``` + And add following code to your activity: Kotlin @@ -145,6 +169,7 @@ class MainActivity : AppCompatActivity() { ``` Java + ```java public class MainActivity extends AppCompatActivity { private CodeScanner mCodeScanner; diff --git a/build.gradle b/build.gradle index 7cac75b..e392bf1 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ apply plugin: 'com.android.library' apply plugin: 'maven-publish' ext { - libraryVersion = '2.3.0' + libraryVersion = '2.3.1' publishedGroupId = 'com.budiyev.android' } @@ -41,7 +41,7 @@ android { defaultConfig { minSdkVersion 19 targetSdkVersion 32 - versionCode 61 + versionCode 62 versionName libraryVersion }