Commit c9ac11ef authored by Nastuzzi Samy's avatar Nastuzzi Samy

Merge branch 'release/v0.12.4'

parents b931cf21 50b65110
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.utc.simde.jessy" package="fr.utc.simde.jessy"
android:versionCode="46" android:versionCode="47"
android:versionName="0.12.3"> android:versionName="0.12.4">
<uses-permission android:name="android.permission.NFC" /> <uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
......
...@@ -100,8 +100,44 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result ...@@ -100,8 +100,44 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
dialog.infoDialog(APIActivity.this, getString(R.string.badge_read), getString(R.string.api_not_recognized)); dialog.infoDialog(APIActivity.this, getString(R.string.badge_read), getString(R.string.api_not_recognized));
} }
}); });
} else } else {
handleAPI(buttonTag.isChecked() ? inputInfo.getText().toString().toUpperCase() : inputInfo.getText().toString(), apiInfo, null, null, buttonTag.isChecked()); GingerResponse gingerResponse = null;
if (!buttonTag.isChecked()) {
runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.startLoading(APIActivity.this, getString(R.string.api_execution), getString(R.string.user_ginger_info_collecting));
}
});
try {
ginger.getInfo(inputInfo.getText().toString());
Thread.sleep(100);
gingerResponse = new ObjectMapper().readValue(ginger.getRequest().getResponse(), GingerResponse.class);
} catch (final Exception e) {
Log.e(LOG_TAG, e.getMessage());
if (ginger.getRequest().getResponseCode() != 404) {
runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.infoDialog(APIActivity.this, getString(R.string.api_execution), e.getMessage(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
resumeReading();
}
});
}
});
return;
}
}
}
handleAPI(buttonTag.isChecked() ? inputInfo.getText().toString().toUpperCase() : inputInfo.getText().toString(), apiInfo, gingerResponse, null, buttonTag.isChecked());
}
} }
}).start(); }).start();
} }
......
...@@ -187,16 +187,12 @@ public abstract class BaseActivity extends InternetActivity { ...@@ -187,16 +187,12 @@ public abstract class BaseActivity extends InternetActivity {
} }
protected void startMainActivity(final Activity activity) { protected void startMainActivity(final Activity activity) {
if (activity instanceof MainActivity) disconnect();
((MainActivity) activity).launch();
else {
disconnect();
Intent intent = new Intent(activity, MainActivity.class); Intent intent = new Intent(activity, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
finish(); finish();
activity.startActivity(intent); activity.startActivity(intent);
}
} }
protected void startFoundationListActivity(final Activity activity) { protected void startFoundationListActivity(final Activity activity) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment