Browse Source

Uploads minor fixes

pull/50/head
Apostolos Fanakis 6 years ago
parent
commit
fb8a9d3974
  1. 5
      app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java
  2. 1
      app/src/main/res/layout/activity_upload_fields_builder.xml

5
app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java

@ -4,7 +4,6 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
@ -244,6 +243,7 @@ public class UploadActivity extends BaseActivity {
} }
if (categorySelected.equals("-1") || uploadTitleText.equals("") || fileUri == null) { if (categorySelected.equals("-1") || uploadTitleText.equals("") || fileUri == null) {
progressBar.setVisibility(View.GONE);
return; return;
} }
@ -258,6 +258,8 @@ public class UploadActivity extends BaseActivity {
tempFilePath = UploadsHelper.createTempFile(this, fileUri, uploadFilename); tempFilePath = UploadsHelper.createTempFile(this, fileUri, uploadFilename);
if (tempFilePath == null) { if (tempFilePath == null) {
//Something went wrong, abort //Something went wrong, abort
Toast.makeText(this, "Could not create temporary file for renaming", Toast.LENGTH_SHORT).show();
progressBar.setVisibility(View.GONE);
return; return;
} }
} }
@ -305,6 +307,7 @@ public class UploadActivity extends BaseActivity {
.startUpload(); .startUpload();
} catch (Exception exception) { } catch (Exception exception) {
Timber.e(exception, "AndroidUploadService: %s", exception.getMessage()); Timber.e(exception, "AndroidUploadService: %s", exception.getMessage());
progressBar.setVisibility(View.GONE);
} }
}); });

1
app/src/main/res/layout/activity_upload_fields_builder.xml

@ -37,6 +37,7 @@
android:id="@+id/upload_fields_builder_content_linear" android:id="@+id/upload_fields_builder_content_linear"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:focusableInTouchMode="true"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView

Loading…
Cancel
Save