mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-17 23:43:00 +00:00
Add support for creating entries from shared images
This commit is contained in:
parent
158eb4609c
commit
167f2d6dad
2 changed files with 29 additions and 1 deletions
|
@ -300,7 +300,10 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
}
|
||||
|
||||
private void onScanImageResult(Intent intent) {
|
||||
Uri inputFile = (intent.getData());
|
||||
decodeQrCodeImage(intent.getData());
|
||||
}
|
||||
|
||||
private void decodeQrCodeImage(Uri inputFile) {
|
||||
Bitmap bitmap;
|
||||
|
||||
try {
|
||||
|
@ -431,6 +434,23 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
}
|
||||
}
|
||||
|
||||
private void handleSharedImage() {
|
||||
if (_app.isVaultLocked()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = getIntent();
|
||||
String action = intent.getAction();
|
||||
Uri uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||
|
||||
if (Intent.ACTION_SEND.equals(action) && uri != null) {
|
||||
intent.setAction(null);
|
||||
intent.removeExtra(Intent.EXTRA_STREAM);
|
||||
|
||||
decodeQrCodeImage(uri);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
@ -475,6 +495,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
}
|
||||
|
||||
handleDeeplink();
|
||||
handleSharedImage();
|
||||
updateLockIcon();
|
||||
doShortcutActions();
|
||||
updateBackupErrorBar();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue