working info screen

This commit is contained in:
Page Asgardius 2022-09-22 08:05:15 -07:00
parent 245f31bccb
commit b7beceb8b3
4 changed files with 18 additions and 1 deletions

View file

@ -30,7 +30,7 @@ public class ObjectInfo extends AppCompatActivity {
AWSCredentials myCredentials;
AmazonS3 s3client;
ProgressBar simpleProgressBar;
TextView filesize, filesizeinfo;
TextView filesize, filesizeinfo, objectcount;
boolean isobject, isfolder;
long totalSize = 0;
int totalItems = 0;
@ -47,12 +47,18 @@ public class ObjectInfo extends AppCompatActivity {
simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
filesize = (TextView) findViewById(R.id.size);
filesizeinfo = (TextView) findViewById(R.id.size_info);
objectcount = (TextView) findViewById(R.id.object_count);
endpoint = getIntent().getStringExtra("endpoint");
username = getIntent().getStringExtra("username");
password = getIntent().getStringExtra("password");
bucket = getIntent().getStringExtra("bucket");
location = getIntent().getStringExtra("region");
object = getIntent().getStringExtra("object");
if (object == null) {
getSupportActionBar().setTitle(bucket+"/");
} else {
getSupportActionBar().setTitle(bucket+"/"+object);
}
region = Region.getRegion(location);
s3ClientOptions = S3ClientOptions.builder().build();
myCredentials = new BasicAWSCredentials(username, password);
@ -101,11 +107,13 @@ public class ObjectInfo extends AppCompatActivity {
if (isobject) {
if (isfolder) {
filesizeinfo.setText(getResources().getString(R.string.folder_size));
objectcount.setText(totalItems+" "+getResources().getString(R.string.file_count));
} else {
filesizeinfo.setText(getResources().getString(R.string.file_size));
}
} else {
filesizeinfo.setText(getResources().getString(R.string.bucket_size));
objectcount.setText(totalItems+" "+getResources().getString(R.string.file_count));
}
if (totalSize >= GiB) {
filesize.setText(Long.toString(totalSize/GiB)+" GiB");

View file

@ -21,6 +21,13 @@
android:textAlignment="center"
android:textSize="25sp" />
<TextView
android:id="@+id/object_count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textSize="25sp" />
<ProgressBar
android:id="@+id/simpleProgressBar"
android:layout_width="fill_parent"

View file

@ -82,4 +82,5 @@
<string name="file_external">Abir en</string>
<string name="folder_size">Tamaño de la carpeta</string>
<string name="bucket_size">Tamaño del bucket</string>
<string name="file_count">archivos</string>
</resources>

View file

@ -44,6 +44,7 @@
<string name="file_size">File Size</string>
<string name="folder_size">Folder Size</string>
<string name="bucket_size">Bucket Size</string>
<string name="file_count">files</string>
<string name="create_bucket">Create new bucket</string>
<string name="create_bucket_success">Bucket created successfully</string>
<string name="upload_file_here">Upload file in current folder</string>