From fb8a9d3974c7539582683020155ea241e716a1fc Mon Sep 17 00:00:00 2001 From: Apostolof Date: Sat, 1 Sep 2018 12:39:05 +0300 Subject: [PATCH] Uploads minor fixes --- .../gr/thmmy/mthmmy/activities/upload/UploadActivity.java | 5 ++++- app/src/main/res/layout/activity_upload_fields_builder.xml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java index 4350d01b..a847d0e2 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java +++ b/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.Intent; import android.content.SharedPreferences; -import android.content.pm.ResolveInfo; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.net.Uri; @@ -244,6 +243,7 @@ public class UploadActivity extends BaseActivity { } if (categorySelected.equals("-1") || uploadTitleText.equals("") || fileUri == null) { + progressBar.setVisibility(View.GONE); return; } @@ -258,6 +258,8 @@ public class UploadActivity extends BaseActivity { tempFilePath = UploadsHelper.createTempFile(this, fileUri, uploadFilename); if (tempFilePath == null) { //Something went wrong, abort + Toast.makeText(this, "Could not create temporary file for renaming", Toast.LENGTH_SHORT).show(); + progressBar.setVisibility(View.GONE); return; } } @@ -305,6 +307,7 @@ public class UploadActivity extends BaseActivity { .startUpload(); } catch (Exception exception) { Timber.e(exception, "AndroidUploadService: %s", exception.getMessage()); + progressBar.setVisibility(View.GONE); } }); diff --git a/app/src/main/res/layout/activity_upload_fields_builder.xml b/app/src/main/res/layout/activity_upload_fields_builder.xml index 80966eaa..af3daae6 100644 --- a/app/src/main/res/layout/activity_upload_fields_builder.xml +++ b/app/src/main/res/layout/activity_upload_fields_builder.xml @@ -37,6 +37,7 @@ android:id="@+id/upload_fields_builder_content_linear" android:layout_width="match_parent" android:layout_height="wrap_content" + android:focusableInTouchMode="true" android:orientation="vertical">