mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-22 06:49:12 +00:00
Scanner now only supports QR
This commit is contained in:
parent
f508eb6645
commit
4b4bf6ace5
1 changed files with 13 additions and 1 deletions
|
@ -9,8 +9,12 @@ import android.os.Bundle;
|
|||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.Result;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import me.dm7.barcodescanner.zxing.ZXingScannerView;
|
||||
|
||||
public class ScannerActivity extends Activity implements ZXingScannerView.ResultHandler {
|
||||
|
@ -21,7 +25,8 @@ public class ScannerActivity extends Activity implements ZXingScannerView.Result
|
|||
super.onCreate(state);
|
||||
mScannerView = new ZXingScannerView(this); // Programmatically initialize the scanner view
|
||||
setContentView(mScannerView); // Set the scanner view as the content view
|
||||
|
||||
mScannerView.setFormats(getSupportedFormats());
|
||||
mScannerView.
|
||||
ActivityCompat.requestPermissions(ScannerActivity.this, new String[]{Manifest.permission.CAMERA}, 1);
|
||||
}
|
||||
|
||||
|
@ -66,4 +71,11 @@ public class ScannerActivity extends Activity implements ZXingScannerView.Result
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<BarcodeFormat> getSupportedFormats() {
|
||||
ArrayList<BarcodeFormat> supportedFormats = new ArrayList<>();
|
||||
supportedFormats.add(BarcodeFormat.QR_CODE);
|
||||
|
||||
return supportedFormats;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue