From 03eeef777f96daf699ca20a7f671a517d8e329eb Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Thu, 15 Sep 2022 10:31:40 -0700 Subject: [PATCH] fix uploader interface --- app/src/main/AndroidManifest.xml | 3 +++ .../java/asgardius/page/s3manager/Downloader.java | 14 ++++++++++++++ .../java/asgardius/page/s3manager/Uploader.java | 7 +++---- app/src/main/res/layout/activity_downloader.xml | 9 +++++++++ app/src/main/res/values/strings.xml | 2 +- 5 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 app/src/main/java/asgardius/page/s3manager/Downloader.java create mode 100644 app/src/main/res/layout/activity_downloader.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f1cedad..38c5b4d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,6 +18,9 @@ android:supportsRtl="true" android:theme="@style/Theme.AsgardiusS3Manager" tools:targetApi="31"> + diff --git a/app/src/main/java/asgardius/page/s3manager/Downloader.java b/app/src/main/java/asgardius/page/s3manager/Downloader.java new file mode 100644 index 0000000..e2f1d01 --- /dev/null +++ b/app/src/main/java/asgardius/page/s3manager/Downloader.java @@ -0,0 +1,14 @@ +package asgardius.page.s3manager; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class Downloader extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_downloader); + } +} \ No newline at end of file diff --git a/app/src/main/java/asgardius/page/s3manager/Uploader.java b/app/src/main/java/asgardius/page/s3manager/Uploader.java index 790c157..20fbd29 100644 --- a/app/src/main/java/asgardius/page/s3manager/Uploader.java +++ b/app/src/main/java/asgardius/page/s3manager/Uploader.java @@ -5,7 +5,6 @@ import static android.content.ContentValues.TAG; import androidx.appcompat.app.AppCompatActivity; import android.app.Activity; -import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.net.Uri; @@ -41,7 +40,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.TimeUnit; public class Uploader extends AppCompatActivity { String username, password, endpoint, bucket, prefix, location, fkey; @@ -102,7 +100,7 @@ public class Uploader extends AppCompatActivity { //System.out.println(file.getPath()); simpleProgressBar.setVisibility(View.VISIBLE); fileUpload.setEnabled(false); - fileUpload.setText(getResources().getString(R.string.wait)); + fileUpload.setText(getResources().getString(R.string.upload_in_progress)); Thread uploadFile = new Thread(new Runnable() { @Override @@ -130,7 +128,7 @@ public class Uploader extends AppCompatActivity { public void run() { //simpleProgressBar.setProgress(100); simpleProgressBar.setVisibility(View.INVISIBLE); - fileUpload.setText(getResources().getString(R.string.success)); + fileUpload.setText(getResources().getString(R.string.upload_success)); Toast.makeText(getApplicationContext(),getResources().getString(R.string.upload_success), Toast.LENGTH_SHORT).show(); //simpleProgressBar.setVisibility(View.INVISIBLE); } @@ -144,6 +142,7 @@ public class Uploader extends AppCompatActivity { @Override public void run() { + simpleProgressBar.setVisibility(View.INVISIBLE); fileUpload.setEnabled(true); fileUpload.setText(getResources().getString(R.string.retry)); Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/res/layout/activity_downloader.xml b/app/src/main/res/layout/activity_downloader.xml new file mode 100644 index 0000000..e152f71 --- /dev/null +++ b/app/src/main/res/layout/activity_downloader.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b0cdaa0..bfcd455 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -22,7 +22,7 @@ Object prefix Please select a file File uploaded successfully - Wait + Upload in progress Retry Success Create new bucket