fix uploader interface

This commit is contained in:
Page Asgardius 2022-09-15 10:31:40 -07:00
parent 061eff31f1
commit 03eeef777f
5 changed files with 30 additions and 5 deletions

View file

@ -18,6 +18,9 @@
android:supportsRtl="true"
android:theme="@style/Theme.AsgardiusS3Manager"
tools:targetApi="31">
<activity
android:name=".Downloader"
android:exported="false" />
<activity
android:name=".CreateBucket"
android:exported="false" />

View file

@ -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);
}
}

View file

@ -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();

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Downloader">
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -22,7 +22,7 @@
<string name="upload_prefix">Object prefix</string>
<string name="no_file_selected">Please select a file</string>
<string name="upload_success">File uploaded successfully</string>
<string name="wait">Wait</string>
<string name="upload_in_progress">Upload in progress</string>
<string name="retry">Retry</string>
<string name="success">Success</string>
<string name="create_bucket">Create new bucket</string>