From 3e67badeb2de254a58e3543d650bcbb416f675eb Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Sun, 1 Jan 2023 14:43:38 -0700 Subject: [PATCH] new release --- app/build.gradle | 4 +- app/src/main/assets/about.htm | 3 +- .../asgardius/page/s3manager/ImageViewer.java | 44 ++++++++++++------- .../main/res/layout/activity_image_viewer.xml | 6 ++- .../metadata/android/en-US/changelogs/59.txt | 1 + 5 files changed, 38 insertions(+), 20 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/59.txt diff --git a/app/build.gradle b/app/build.gradle index 4b51107..7f60c95 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "asgardius.page.s3manager" minSdk 23 targetSdk 33 - versionCode 58 - versionName "0.6.0" + versionCode 59 + versionName "0.6.1" setProperty("archivesBaseName", "s3-manager-$versionName") testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/assets/about.htm b/app/src/main/assets/about.htm index 264087d..cffe284 100644 --- a/app/src/main/assets/about.htm +++ b/app/src/main/assets/about.htm @@ -11,13 +11,14 @@

This software released under GNU General Public License 3

You can find source code at https://patrice.asgardius.company/gitea/asgardius/s3manager
- You need to setup a pdf.js server to use pdf viewer. Just download latest version from official website and upload to any web server with ssl on same root domain than S3 server (can be same subdomain or a different one in some cases). Then set url to pdfjs root folder like https://example.com/pdfjs-dist + You need to setup a pdf.js server to use pdf viewer. You can use https://office.asgardius.company/pdfjs or setup your own.
You can find technical support on official forum https://forum.asgardius.company/t/s3-manager

diff --git a/app/src/main/java/asgardius/page/s3manager/ImageViewer.java b/app/src/main/java/asgardius/page/s3manager/ImageViewer.java index ae8a25e..3fdbf14 100644 --- a/app/src/main/java/asgardius/page/s3manager/ImageViewer.java +++ b/app/src/main/java/asgardius/page/s3manager/ImageViewer.java @@ -2,13 +2,17 @@ package asgardius.page.s3manager; import androidx.appcompat.app.AppCompatActivity; +import android.annotation.SuppressLint; import android.graphics.drawable.Drawable; import android.os.Bundle; +import android.view.MotionEvent; import android.view.View; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.Toast; +import com.otaliastudios.zoom.ZoomImageView; + import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; @@ -16,9 +20,11 @@ import java.util.stream.Collectors; public class ImageViewer extends AppCompatActivity { String videoURL, title; - ImageView iv; + ZoomImageView iv; boolean controls = false; + float cursorx, cursory; + @SuppressLint("ClickableViewAccessibility") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -27,7 +33,7 @@ public class ImageViewer extends AppCompatActivity { title = getIntent().getStringExtra("title"); getSupportActionBar().setTitle(title); final ProgressBar simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar); - iv = (ImageView) findViewById(R.id.imageViewer); + iv = (ZoomImageView) findViewById(R.id.imageViewer); //System.out.println(videoURL); Thread imgread = new Thread(new Runnable() { @@ -74,20 +80,28 @@ public class ImageViewer extends AppCompatActivity { } }); imgread.start(); - iv.setOnClickListener(new View.OnClickListener(){ - @Override - public void onClick(View view) { - //buttonaction - if(controls) { - controls = false; - hideSystemBars(); - } - else { - controls = true; - showSystemBars(); - } - } + iv.setOnTouchListener((v, event) -> { + if (event.getAction() == MotionEvent.ACTION_DOWN) { + cursorx = event.getX(); + cursory = event.getY(); + iv.performClick(); + + return true; + } else if (event.getAction() == MotionEvent.ACTION_UP) { + if(Math.abs(event.getX() - cursorx) < 5 || Math.abs(event.getY() - cursory) < 5) { + if(controls) { + controls = false; + hideSystemBars(); + } + else { + controls = true; + showSystemBars(); + } + } + return true; + } + return false; }); } diff --git a/app/src/main/res/layout/activity_image_viewer.xml b/app/src/main/res/layout/activity_image_viewer.xml index 4b5dce5..60ef848 100644 --- a/app/src/main/res/layout/activity_image_viewer.xml +++ b/app/src/main/res/layout/activity_image_viewer.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" tools:context=".ImageViewer"> - + tools:layout_editor_absoluteY="82dp" + app:minZoom="1.0" + app:maxZoom="25.5" />