From c890eab78611b6c6967fe7e71941fdfd5f05394c Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Mon, 12 Sep 2022 03:52:57 -0700 Subject: [PATCH] about page template --- .idea/misc.xml | 2 +- app/src/main/assets/about.htm | 9 ++++++++ .../page/s3manager/MainActivity.java | 13 +++++++++-- .../page/s3manager/ObjectSelect.java | 23 +++++++------------ app/src/main/res/layout/activity_main.xml | 2 +- app/src/main/res/values/strings.xml | 1 + 6 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 app/src/main/assets/about.htm diff --git a/.idea/misc.xml b/.idea/misc.xml index 61220cb..aab6f58 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -11,7 +11,7 @@ - + diff --git a/app/src/main/assets/about.htm b/app/src/main/assets/about.htm new file mode 100644 index 0000000..940b484 --- /dev/null +++ b/app/src/main/assets/about.htm @@ -0,0 +1,9 @@ + + + Reserved + + + +

Reserved

+ + diff --git a/app/src/main/java/asgardius/page/s3manager/MainActivity.java b/app/src/main/java/asgardius/page/s3manager/MainActivity.java index 50cdeff..0ad68e3 100644 --- a/app/src/main/java/asgardius/page/s3manager/MainActivity.java +++ b/app/src/main/java/asgardius/page/s3manager/MainActivity.java @@ -201,11 +201,12 @@ public class MainActivity extends AppCompatActivity { }); //This is to launch file explorer test - Button explorertest = (Button)findViewById(R.id.ltest); - explorertest.setOnClickListener(new View.OnClickListener(){ + Button about = (Button)findViewById(R.id.ltest); + about.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View view) { //buttonaction + aboutPage(); } }); } @@ -235,4 +236,12 @@ public class MainActivity extends AppCompatActivity { startActivity(intent); } + + private void aboutPage () { + + Intent intent = new Intent(this, WebBrowser.class); + intent.putExtra("web_url", "file:///android_asset/about.htm"); + startActivity(intent); + + } } \ No newline at end of file diff --git a/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java b/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java index d539190..23c2961 100644 --- a/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java +++ b/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java @@ -1,8 +1,5 @@ package asgardius.page.s3manager; -import static com.amazonaws.regions.Regions.US_EAST_1; -import static com.amazonaws.regions.Regions.US_WEST_1; - import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; @@ -24,15 +21,11 @@ import com.amazonaws.regions.Region; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client; import com.amazonaws.services.s3.S3ClientOptions; -import com.amazonaws.services.s3.model.Bucket; import com.amazonaws.services.s3.model.DeleteObjectRequest; import com.amazonaws.services.s3.model.DeleteObjectsRequest; import com.amazonaws.services.s3.model.GeneratePresignedUrlRequest; import com.amazonaws.services.s3.model.ListObjectsRequest; -import com.amazonaws.services.s3.model.ListObjectsV2Request; -import com.amazonaws.services.s3.model.ListObjectsV2Result; import com.amazonaws.services.s3.model.ObjectListing; -import com.amazonaws.services.s3.model.S3Object; import com.amazonaws.services.s3.model.S3ObjectSummary; import java.net.URL; @@ -213,7 +206,7 @@ public class ObjectSelect extends AppCompatActivity { try { GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()); URL objectURL = s3client.generatePresignedUrl(request); - imageviewer(objectURL.toString()); + imageViewer(objectURL.toString()); } catch (Exception e) { Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show(); } @@ -222,7 +215,7 @@ public class ObjectSelect extends AppCompatActivity { try { GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()); URL objectURL = s3client.generatePresignedUrl(request); - textviewer(objectURL.toString()); + textViewer(objectURL.toString()); } catch (Exception e) { Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show(); } @@ -231,7 +224,7 @@ public class ObjectSelect extends AppCompatActivity { try { GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()); URL objectURL = s3client.generatePresignedUrl(request); - webbrowser(objectURL.toString()); + webBrowser(objectURL.toString()); } catch (Exception e) { Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show(); } @@ -240,7 +233,7 @@ public class ObjectSelect extends AppCompatActivity { try { GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()); URL objectURL = s3client.generatePresignedUrl(request); - videoplayer(objectURL.toString()); + videoPlayer(objectURL.toString()); } catch (Exception e) { Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show(); } @@ -320,14 +313,14 @@ public class ObjectSelect extends AppCompatActivity { })); } - private void videoplayer(String url) { + private void videoPlayer(String url) { Intent intent = new Intent(this, VideoPlayer.class); intent.putExtra("video_url", url); startActivity(intent); } - private void textviewer(String url) { + private void textViewer(String url) { Intent intent = new Intent(this, TextViewer.class); intent.putExtra("video_url", url); @@ -335,7 +328,7 @@ public class ObjectSelect extends AppCompatActivity { } - private void imageviewer(String url) { + private void imageViewer(String url) { Intent intent = new Intent(this, ImageViewer.class); intent.putExtra("video_url", url); @@ -343,7 +336,7 @@ public class ObjectSelect extends AppCompatActivity { } - private void webbrowser (String url) { + private void webBrowser(String url) { Intent intent = new Intent(this, WebBrowser.class); intent.putExtra("web_url", url); diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 0e28020..558731a 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -31,7 +31,7 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" - android:text="@string/dummy_button" + android:text="@string/about_button" tools:ignore="MissingConstraints" style="?android:attr/buttonStyle" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b5ec3ea..abb25d6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -58,6 +58,7 @@ Cannot retrieve remote file Invalid media file Cannot connect to server + About this app Dummy Button DUMMY\nCONTENT \ No newline at end of file