From b7beceb8b355858e86717d645ce162e2957e905f Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Thu, 22 Sep 2022 08:05:15 -0700 Subject: [PATCH] working info screen --- .../main/java/asgardius/page/s3manager/ObjectInfo.java | 10 +++++++++- app/src/main/res/layout/activity_object_info.xml | 7 +++++++ app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/asgardius/page/s3manager/ObjectInfo.java b/app/src/main/java/asgardius/page/s3manager/ObjectInfo.java index ac1c11e..ffbc132 100644 --- a/app/src/main/java/asgardius/page/s3manager/ObjectInfo.java +++ b/app/src/main/java/asgardius/page/s3manager/ObjectInfo.java @@ -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"); diff --git a/app/src/main/res/layout/activity_object_info.xml b/app/src/main/res/layout/activity_object_info.xml index a58d65f..4a8f6c1 100644 --- a/app/src/main/res/layout/activity_object_info.xml +++ b/app/src/main/res/layout/activity_object_info.xml @@ -21,6 +21,13 @@ android:textAlignment="center" android:textSize="25sp" /> + + Abir en Tamaño de la carpeta Tamaño del bucket + archivos \ 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 e1ff853..b5b23aa 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -44,6 +44,7 @@ File Size Folder Size Bucket Size + files Create new bucket Bucket created successfully Upload file in current folder