Browse Source

Fix clipData may be null bug

Fix length = 0 divide
Fix link_item size
tags/release-v2.4
Schoumi 2 years ago
parent
commit
9358a47de7

+ 3
- 2
app/src/main/java/fr/mobdev/goblim/activity/UploadActivity.java View File

@@ -221,7 +221,8 @@ public class UploadActivity extends AppCompatActivity {
public void run() {
if(progressDialog != null) {
progressDialog.setMessage(getString(R.string.uploading_files)+" "+fileNo+"/"+nbFiles);
progressDialog.setProgress(progress * 100 / length);
if(length != 0)
progressDialog.setProgress(progress * 100 / length);
}
}
});
@@ -531,7 +532,7 @@ public class UploadActivity extends AppCompatActivity {
adapter.addUri(this,imageUri);
} else {
ClipData clip = returnIntent.getClipData();
for(int i = 0; i < clip.getItemCount(); i++) {
for(int i = 0; clip != null && i < clip.getItemCount(); i++) {
Uri imageUri = clip.getItemAt(i).getUri();
uris.add(imageUri);
updateSpanCount();

+ 1
- 1
app/src/main/res/layout/link_item.xml View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="200dp"
android:layout_margin="5dp"
>


Loading…
Cancel
Save