new release

This commit is contained in:
Page Asgardius 2023-01-21 14:48:23 -07:00
parent b3c1953a3b
commit 95bba1f473
10 changed files with 94 additions and 59 deletions

View file

@ -28,7 +28,7 @@
</map>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View file

@ -9,8 +9,8 @@ android {
applicationId "asgardius.page.s3manager"
minSdk 23
targetSdk 33
versionCode 68
versionName "0.7.6"
versionCode 69
versionName "0.7.7"
setProperty("archivesBaseName", "s3-manager-$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -33,7 +33,7 @@ android {
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
def exoplayer_version = "2.18.2"
@ -42,11 +42,11 @@ dependencies {
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation"com.otaliastudios:zoomlayout:1.9.0"
// BEGIN AWS DEPENDENCIES
def aws_version = "2.61.0"
def aws_version = "2.62.0"
implementation "com.amazonaws:aws-android-sdk-s3:$aws_version"
implementation ("com.amazonaws:aws-android-sdk-mobile-client:$aws_version") { transitive = true }
// END AWS DEPENDENCIES
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

View file

@ -9,7 +9,7 @@
<H3>Created by Page Asgardius</H3>
<H3>Libraries used in this app</H3>
<ul>
<li>Amazon Web Services SDK 2.61.0</li>
<li>Amazon Web Services SDK 2.62.0</li>
<li>ExoPlayer 2.18.2</li>
<li>ZoomLayout 1.9.0</li>
<li>Adwaita Icon Theme for GNOME 43</li>

View file

@ -2,9 +2,11 @@ package asgardius.page.s3manager;
import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ProgressBar;
import android.widget.Toast;
@ -76,6 +78,9 @@ public class ImageViewer extends AppCompatActivity {
}
});
imgread.start();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}
iv.setOnTouchListener((v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN) {

View file

@ -119,46 +119,14 @@ public class Share extends AppCompatActivity {
savelinks.setVisibility(View.VISIBLE);
} else {
share.setVisibility(View.VISIBLE);
copylinks.setVisibility(View.VISIBLE);
}
share.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
//buttonaction
try {
if (datepick.getText().toString().equals("")) {
date = 0;
} else {
date = Integer.parseInt(datepick.getText().toString());
}
if (hourpick.getText().toString().equals("")) {
hour = 0;
} else {
hour = Integer.parseInt(hourpick.getText().toString());
}
if (minutepick.getText().toString().equals("")) {
minute = 0;
} else {
minute = Integer.parseInt(minutepick.getText().toString());
}
expiration = new Date();
//System.out.println("today is " + mycal.getTime());
mycal.setTime(expiration);
if (date == 0 && hour == 0 && minute == 0) {
if (mediafile) {
mycal.add(Calendar.HOUR, videotime);
} else {
mycal.add(Calendar.MINUTE, 15);
}
} else {
mycal.add(Calendar.DATE, date);
mycal.add(Calendar.HOUR, hour);
mycal.add(Calendar.MINUTE, minute);
}
//System.out.println("Expiration date: " + mycal.getTime());
expiration = mycal.getTime();
//System.out.println(expiration);
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);
objectURL = s3client.generatePresignedUrl(request);
sharefile();
//System.out.println(URLify(objectURL.toString()));
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
@ -180,22 +148,40 @@ public class Share extends AppCompatActivity {
public void run() {
try {
//load media file
getLinks();
if(object == null || object.endsWith("/")) {
getLinks();
runOnUiThread(new Runnable() {
runOnUiThread(new Runnable() {
@Override
public void run() {
// Sending reference and data to Adapter
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip;
clip = ClipData.newPlainText("name", objectlist);
clipboard.setPrimaryClip(clip);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_ok), Toast.LENGTH_SHORT).show();
@Override
public void run() {
// Sending reference and data to Adapter
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip;
clip = ClipData.newPlainText("name", objectlist);
clipboard.setPrimaryClip(clip);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_ok), Toast.LENGTH_SHORT).show();
}
}
}
});
});
} else {
sharefile();
runOnUiThread(new Runnable() {
@Override
public void run() {
// Sending reference and data to Adapter
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip;
clip = ClipData.newPlainText("name", URLify(objectURL.toString()));
clipboard.setPrimaryClip(clip);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_ok), Toast.LENGTH_SHORT).show();
}
}
});
}
//System.out.println("tree "+treelevel);
//System.out.println("prefix "+prefix);
@ -317,6 +303,43 @@ public class Share extends AppCompatActivity {
}
}
private void sharefile() {
if (datepick.getText().toString().equals("")) {
date = 0;
} else {
date = Integer.parseInt(datepick.getText().toString());
}
if (hourpick.getText().toString().equals("")) {
hour = 0;
} else {
hour = Integer.parseInt(hourpick.getText().toString());
}
if (minutepick.getText().toString().equals("")) {
minute = 0;
} else {
minute = Integer.parseInt(minutepick.getText().toString());
}
expiration = new Date();
//System.out.println("today is " + mycal.getTime());
mycal.setTime(expiration);
if (date == 0 && hour == 0 && minute == 0) {
if (mediafile) {
mycal.add(Calendar.HOUR, videotime);
} else {
mycal.add(Calendar.MINUTE, 15);
}
} else {
mycal.add(Calendar.DATE, date);
mycal.add(Calendar.HOUR, hour);
mycal.add(Calendar.MINUTE, minute);
}
//System.out.println("Expiration date: " + mycal.getTime());
expiration = mycal.getTime();
//System.out.println(expiration);
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);
objectURL = s3client.generatePresignedUrl(request);
}
private void savelinks() {
Thread saveLinks = new Thread(new Runnable() {

View file

@ -17,6 +17,7 @@ import android.support.v4.media.session.MediaSessionCompat;
import android.util.Rational;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
@ -80,6 +81,9 @@ public class VideoPlayer extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video_player);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}
if(Build.VERSION.SDK_INT >=Build.VERSION_CODES.O){
NotificationChannel channel= new NotificationChannel("playback","Video Playback", NotificationManager.IMPORTANCE_DEFAULT);

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".ImageViewer">
<com.otaliastudios.zoom.ZoomImageView

View file

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'com.android.application' version '7.4.0' apply false
id 'com.android.library' version '7.4.0' apply false
}
task clean(type: Delete) {

View file

@ -0,0 +1,2 @@
* UI fixes
* Better support for notched devices

View file

@ -1,6 +1,6 @@
#Sat Aug 27 12:12:23 MST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME