Commit fe9478b4 authored by Schoumi's avatar Schoumi

Fix bug on upload blocked at 100% event if it's done

Fixes #18
parent 0e75b7c4
......@@ -302,6 +302,9 @@ public class UploadActivity extends AppCompatActivity {
}
if(linkIntent != null) {
resetImages();
fileInError.clear();
errorMsg.clear();
results.clear();
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
startActivity(linkIntent);
}
......@@ -533,25 +536,35 @@ public class UploadActivity extends AppCompatActivity {
if(resultCode == RESULT_OK){
//retrieve uri from the request image activity and prepare
ClipData clip = null;
boolean hasAddUri = false;
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2)
clip = returnIntent.getClipData();
if(clip == null) {
Uri imageUri = returnIntent.getData();
if(imageUri == null)
return;
uris.add(imageUri);
hasAddUri = true;
updateSpanCount();
adapter.addUri(this,imageUri);
} else {
for(int i = 0; clip != null && i < clip.getItemCount(); i++) {
Uri imageUri = clip.getItemAt(i).getUri();
if(imageUri == null)
continue;
uris.add(imageUri);
hasAddUri = true;
updateSpanCount();
adapter.addUri(this,imageUri);
adapter.addUri(this, imageUri);
}
}
Button uploadBt = (Button) findViewById(R.id.upload_button);
uploadBt.setEnabled(false);
if(hasAddUri) {
Button uploadBt = (Button) findViewById(R.id.upload_button);
uploadBt.setEnabled(false);
}
}
}
......
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