better onActivityResult handling for qr code import, remove unimplemented import button

This commit is contained in:
Dominik Schürmann 2014-01-18 21:20:20 +01:00
parent f3638d5b44
commit 1c5acc9721
3 changed files with 25 additions and 33 deletions

View File

@ -37,13 +37,13 @@
bootstrapbutton:bb_icon_left="fa-download"
bootstrapbutton:bb_type="info" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/import_sign_and_upload"
android:layout_width="match_parent"
android:layout_height="60dp"
android:padding="4dp"
android:text="@string/import_sign_and_upload"
bootstrapbutton:bb_type="info" />
<!-- <com.beardedhen.androidbootstrap.BootstrapButton -->
<!-- android:id="@+id/import_sign_and_upload" -->
<!-- android:layout_width="match_parent" -->
<!-- android:layout_height="60dp" -->
<!-- android:padding="4dp" -->
<!-- android:text="@string/import_sign_and_upload" -->
<!-- bootstrapbutton:bb_type="info" /> -->
</LinearLayout>
<FrameLayout

View File

@ -79,7 +79,8 @@ public class ImportKeysActivity extends DrawerActivity implements OnNavigationLi
Fragment mCurrentFragment;
BootstrapButton mImportButton;
BootstrapButton mImportSignUploadButton;
// BootstrapButton mImportSignUploadButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -94,13 +95,13 @@ public class ImportKeysActivity extends DrawerActivity implements OnNavigationLi
importKeys();
}
});
mImportSignUploadButton = (BootstrapButton) findViewById(R.id.import_sign_and_upload);
mImportSignUploadButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
signAndUploadOnClick();
}
});
// mImportSignUploadButton = (BootstrapButton) findViewById(R.id.import_sign_and_upload);
// mImportSignUploadButton.setOnClickListener(new OnClickListener() {
// @Override
// public void onClick(View v) {
// signAndUploadOnClick();
// }
// });
getSupportActionBar().setDisplayShowTitleEnabled(false);
@ -300,15 +301,6 @@ public class ImportKeysActivity extends DrawerActivity implements OnNavigationLi
// }
// }
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// required for qr code scanning
if (mCurrentFragment != null) {
mCurrentFragment.onActivityResult(requestCode, resultCode, data);
}
// super.onActivityResult(requestCode, resultCode, data);
}
/**
* Import keys with mImportData
*/
@ -419,14 +411,14 @@ public class ImportKeysActivity extends DrawerActivity implements OnNavigationLi
importKeys();
}
public void signAndUploadOnClick() {
// first, import!
// importOnClick(view);
// TODO: implement sign and upload!
Toast.makeText(ImportKeysActivity.this, "Not implemented right now!", Toast.LENGTH_SHORT)
.show();
}
// public void signAndUploadOnClick() {
// // first, import!
// // importOnClick(view);
//
// // TODO: implement sign and upload!
// Toast.makeText(ImportKeysActivity.this, "Not implemented right now!", Toast.LENGTH_SHORT)
// .show();
// }
/**
* NFC

View File

@ -91,7 +91,7 @@ public class ImportKeysQrCodeFragment extends Fragment {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
switch (requestCode & 0xFFFF) {
case IntentIntegrator.REQUEST_CODE: {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode,
data);