new release

This commit is contained in:
Page Asgardius 2022-12-31 11:36:38 -07:00
parent 5dd93a01c5
commit 0177c5d7b4
8 changed files with 57 additions and 10 deletions

View file

@ -9,7 +9,7 @@ android {
applicationId "asgardius.page.s3manager" applicationId "asgardius.page.s3manager"
minSdk 23 minSdk 23
targetSdk 33 targetSdk 33
versionCode 57 versionCode 58
versionName "0.6.0" versionName "0.6.0"
setProperty("archivesBaseName", "s3-manager-$versionName") setProperty("archivesBaseName", "s3-manager-$versionName")

View file

@ -64,6 +64,7 @@
android:exported="false" /> android:exported="false" />
<activity <activity
android:name=".ImageViewer" android:name=".ImageViewer"
android:hardwareAccelerated="false"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden" android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
android:exported="false" /> android:exported="false" />
<activity <activity

View file

@ -15,13 +15,17 @@ import java.net.URL;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class ImageViewer extends AppCompatActivity { public class ImageViewer extends AppCompatActivity {
String videoURL; String videoURL, title;
ImageView iv; ImageView iv;
boolean controls = false;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_viewer); setContentView(R.layout.activity_image_viewer);
videoURL = getIntent().getStringExtra("video_url");
title = getIntent().getStringExtra("title");
getSupportActionBar().setTitle(title);
final ProgressBar simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar); final ProgressBar simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
iv = (ImageView) findViewById(R.id.imageViewer); iv = (ImageView) findViewById(R.id.imageViewer);
//System.out.println(videoURL); //System.out.println(videoURL);
@ -31,7 +35,6 @@ public class ImageViewer extends AppCompatActivity {
public void run() { public void run() {
try { try {
//Your code goes here //Your code goes here
videoURL = getIntent().getStringExtra("video_url");
URL thumb_u = new URL(videoURL); URL thumb_u = new URL(videoURL);
Drawable thumb_d = Drawable.createFromStream(thumb_u.openStream(), "src"); Drawable thumb_d = Drawable.createFromStream(thumb_u.openStream(), "src");
@ -45,6 +48,17 @@ public class ImageViewer extends AppCompatActivity {
} }
}); });
} catch (OutOfMemoryError e) {
e.printStackTrace();
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getApplicationContext(),getResources().getString(R.string.picture_too_big), Toast.LENGTH_SHORT).show();
finish();
}
});
finish();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@ -60,21 +74,48 @@ public class ImageViewer extends AppCompatActivity {
} }
}); });
imgread.start(); imgread.start();
iv.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
//buttonaction
if(controls) {
controls = false;
hideSystemBars();
}
else {
controls = true;
showSystemBars();
}
}
});
} }
@Override @Override
public void onWindowFocusChanged(boolean hasFocus) { public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus); super.onWindowFocusChanged(hasFocus);
controls = false;
hideSystemBars();
}
private void hideSystemBars() {
// Set the IMMERSIVE flag.
// Set the content to appear under the system bars so that the content
// doesn't resize when the system bars hide and show.
View decorView = getWindow().getDecorView(); View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility( decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); | View.SYSTEM_UI_FLAG_IMMERSIVE);
}
private void showSystemBars() {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
} }
} }

View file

@ -190,7 +190,9 @@ public class ObjectSelect extends AppCompatActivity {
else if (Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".pdf")) { else if (Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".pdf")) {
Img.add(R.drawable.pdffile); Img.add(R.drawable.pdffile);
} }
else if (Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".jpg") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".jpeg") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".png") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".gif")) { else if (Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".jpg") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".jpeg")
|| Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".png") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".gif")
|| Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".webp")) {
Img.add(R.drawable.imagefile); Img.add(R.drawable.imagefile);
} }
else if (Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".opus") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".ogg") else if (Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".opus") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".ogg")
@ -255,7 +257,7 @@ public class ObjectSelect extends AppCompatActivity {
try { try {
GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()); GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString());
URL objectURL = s3client.generatePresignedUrl(request); URL objectURL = s3client.generatePresignedUrl(request);
imageViewer(objectURL.toString()); imageViewer(objectURL.toString(), Name.get(position).toString());
} catch (Exception e) { } catch (Exception e) {
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show(); Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
} }
@ -476,10 +478,11 @@ public class ObjectSelect extends AppCompatActivity {
} }
private void imageViewer(String url) { private void imageViewer(String url, String title) {
Intent intent = new Intent(this, ImageViewer.class); Intent intent = new Intent(this, ImageViewer.class);
intent.putExtra("video_url", url); intent.putExtra("video_url", url);
intent.putExtra("title", title);
startActivity(intent); startActivity(intent);
} }

View file

@ -116,4 +116,5 @@
<string name="copy_name">Copiar nombre al portapapeles</string> <string name="copy_name">Copiar nombre al portapapeles</string>
<string name="copy_name_ok">Nombre copiado al portapapeles</string> <string name="copy_name_ok">Nombre copiado al portapapeles</string>
<string name="upload_calculate">Calculando tamaño de la carpeta</string> <string name="upload_calculate">Calculando tamaño de la carpeta</string>
<string name="picture_too_big">Imagen demasiado grande</string>
</resources> </resources>

View file

@ -119,4 +119,5 @@
<string name="copy_name">Copy name to clipboard</string> <string name="copy_name">Copy name to clipboard</string>
<string name="copy_name_ok">Name copied to clipboard</string> <string name="copy_name_ok">Name copied to clipboard</string>
<string name="upload_calculate">Calculating folder size</string> <string name="upload_calculate">Calculating folder size</string>
<string name="picture_too_big">Picture too big</string>
</resources> </resources>

View file

@ -3,7 +3,7 @@ File Explorer to manage servers compatible with S3 Object Storage Protocol
Current feature list Current feature list
<li>Audio and Video playback (opus, ogg, oga, mp3, m4a, flac, mka, mkv, mp4, m4v, webm)</li> <li>Audio and Video playback (opus, ogg, oga, mp3, m4a, flac, mka, mkv, mp4, m4v, webm)</li>
<li>Picture preview (jpg, jpeg, png, gif)</li> <li>Picture preview (jpg, jpeg, png, gif, webp)</li>
<li>Plain text file preview (txt, md)</li> <li>Plain text file preview (txt, md)</li>
<li>Webpage viewer (htm, html)</li> <li>Webpage viewer (htm, html)</li>
<li>Multiple account support</li> <li>Multiple account support</li>