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"
minSdk 23
targetSdk 33
versionCode 57
versionCode 58
versionName "0.6.0"
setProperty("archivesBaseName", "s3-manager-$versionName")

View file

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

View file

@ -15,13 +15,17 @@ import java.net.URL;
import java.util.stream.Collectors;
public class ImageViewer extends AppCompatActivity {
String videoURL;
String videoURL, title;
ImageView iv;
boolean controls = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
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);
iv = (ImageView) findViewById(R.id.imageViewer);
//System.out.println(videoURL);
@ -31,7 +35,6 @@ public class ImageViewer extends AppCompatActivity {
public void run() {
try {
//Your code goes here
videoURL = getIntent().getStringExtra("video_url");
URL thumb_u = new URL(videoURL);
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) {
e.printStackTrace();
runOnUiThread(new Runnable() {
@ -60,21 +74,48 @@ 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();
}
}
});
}
@Override
public void onWindowFocusChanged(boolean 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();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| 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")) {
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);
}
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 {
GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString());
URL objectURL = s3client.generatePresignedUrl(request);
imageViewer(objectURL.toString());
imageViewer(objectURL.toString(), Name.get(position).toString());
} catch (Exception e) {
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.putExtra("video_url", url);
intent.putExtra("title", title);
startActivity(intent);
}

View file

@ -116,4 +116,5 @@
<string name="copy_name">Copiar nombre 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="picture_too_big">Imagen demasiado grande</string>
</resources>

View file

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

View file

@ -3,7 +3,7 @@ File Explorer to manage servers compatible with S3 Object Storage Protocol
Current feature list
<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>Webpage viewer (htm, html)</li>
<li>Multiple account support</li>