Skip to content

Commit

Permalink
Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriy Budiyev committed Sep 22, 2017
1 parent bd7d831 commit 98ea1d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Code scanner library based on [ZXing](https://github.com/zxing/zxing)
Add dependency:
```
dependencies {
implementation 'com.budiyev.android:code-scanner:1.2.1'
implementation 'com.budiyev.android:code-scanner:1.3.0'
}
```
Add camera permission to AndroidManifest.xml (Don't forget about dynamic permissions on API >= 23):
Expand Down Expand Up @@ -65,21 +65,19 @@ public class MainActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
CodeScannerView scannerView = findViewById(R.id.scanner_view);
mCodeScanner = new CodeScanner(this, scannerView);
mCodeScanner.setAutoFocusEnabled(true); // true by default
mCodeScanner.setFlashEnabled(false); // false by default
mCodeScanner.setDecodeCallback(new DecodeCallback() {
@Override
public void onDecoded(@NonNull final Result result) {
runOnUiThread(new Runnable() {
mCodeScanner =
CodeScanner.builder().autoFocus(true).flash(false).onDecoded(new DecodeCallback() {
@Override
public void run() {
Toast.makeText(MainActivity.this, result.getText(), Toast.LENGTH_LONG)
.show();
public void onDecoded(@NonNull final Result result) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity.this, result.getText(),
Toast.LENGTH_LONG).show();
}
});
}
});
}
});
}).build(this, scannerView);
scannerView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.jfrog.bintray'
ext {
libraryName = 'CodeScanner'
libraryDescription = 'Code scanner library based on ZXing'
libraryVersion = '1.2.1'
libraryVersion = '1.3.0'
artifact = 'code-scanner'
developerId = 'yuriy-budiyev'
developerName = 'Yuriy Budiyev'
Expand All @@ -46,7 +46,7 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 13
versionCode 14
versionName libraryVersion
}

Expand Down

0 comments on commit 98ea1d4

Please sign in to comment.