new release

This commit is contained in:
Page Asgardius 2022-12-29 19:28:14 -07:00
parent 7f61ec6ea5
commit a3d90da346
10 changed files with 51 additions and 8 deletions

View file

@ -9,8 +9,8 @@ android {
applicationId "asgardius.page.s3manager" applicationId "asgardius.page.s3manager"
minSdk 23 minSdk 23
targetSdk 33 targetSdk 33
versionCode 52 versionCode 53
versionName "0.5.0" versionName "0.5.1"
setProperty("archivesBaseName", "s3-manager-$versionName") setProperty("archivesBaseName", "s3-manager-$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View file

@ -8,6 +8,9 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.os.AsyncTask; import android.os.AsyncTask;
@ -175,6 +178,8 @@ public class BucketSelect extends AppCompatActivity {
} else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) { } else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) {
objectInfo(Name.get(position).toString()); objectInfo(Name.get(position).toString());
} else if (menuItem.getTitle() == getResources().getString(R.string.copy_name)) {
copyName(Name.get(position).toString());
} else if (menuItem.getTitle() == getResources().getString(R.string.cors_config)) { } else if (menuItem.getTitle() == getResources().getString(R.string.cors_config)) {
corsConfig(Name.get(position).toString()); corsConfig(Name.get(position).toString());
} else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) { } else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
@ -355,4 +360,10 @@ public class BucketSelect extends AppCompatActivity {
startActivity(intent); startActivity(intent);
} }
public void copyName (String name) {
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("name", name);
clipboard.setPrimaryClip(clip);
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_name_ok), Toast.LENGTH_SHORT).show();
}
} }

View file

@ -7,6 +7,8 @@ import androidx.recyclerview.widget.RecyclerView;
import android.app.AppOpsManager; import android.app.AppOpsManager;
import android.app.PictureInPictureParams; import android.app.PictureInPictureParams;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
@ -399,6 +401,8 @@ public class ObjectSelect extends AppCompatActivity {
download(Name.get(position).toString(), true); download(Name.get(position).toString(), true);
} else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) { } else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) {
objectInfo(prefix + Name.get(position).toString(), Name.get(position).toString()); objectInfo(prefix + Name.get(position).toString(), Name.get(position).toString());
} else if (menuItem.getTitle() == getResources().getString(R.string.copy_name)) {
copyName(Name.get(position).toString());
} else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) { } else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
if (Name.size() == 1 && treelevel >= 1) { if (Name.size() == 1 && treelevel >= 1) {
Toast.makeText(ObjectSelect.this, getResources().getString(R.string.only_item_onlist), Toast.LENGTH_SHORT).show(); Toast.makeText(ObjectSelect.this, getResources().getString(R.string.only_item_onlist), Toast.LENGTH_SHORT).show();
@ -432,6 +436,8 @@ public class ObjectSelect extends AppCompatActivity {
share(prefix + Name.get(position).toString(), Name.get(position).toString(), Img.get(position).equals(R.drawable.audiofile) || Img.get(position).equals(R.drawable.videofile)); share(prefix + Name.get(position).toString(), Name.get(position).toString(), Img.get(position).equals(R.drawable.audiofile) || Img.get(position).equals(R.drawable.videofile));
} else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) { } else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) {
objectInfo(prefix + Name.get(position).toString(), Name.get(position).toString()); objectInfo(prefix + Name.get(position).toString(), Name.get(position).toString());
} else if (menuItem.getTitle() == getResources().getString(R.string.copy_name)) {
copyName(Name.get(position).toString());
} else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) { } else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
if (menuItem.getTitle() == getResources().getString(R.string.file_del)) { if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
if (Name.size() == 1 && treelevel >= 1) { if (Name.size() == 1 && treelevel >= 1) {
@ -669,4 +675,16 @@ public class ObjectSelect extends AppCompatActivity {
intent.putExtra("isfolder", isfolder); intent.putExtra("isfolder", isfolder);
startActivity(intent); startActivity(intent);
} }
public void copyName (String name) {
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip;
if(name.endsWith("/")) {
clip = ClipData.newPlainText("name", name.replace("/", ""));
} else {
clip = ClipData.newPlainText("name", name);
}
clipboard.setPrimaryClip(clip);
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_name_ok), Toast.LENGTH_SHORT).show();
}
} }

View file

@ -20,17 +20,13 @@
android:id="@+id/addaccount" android:id="@+id/addaccount"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/accountadd_button" android:text="@string/accountadd_button" />
tools:ignore="MissingConstraints"
style="?android:attr/buttonStyle" />
<Button <Button
android:id="@+id/settings_button" android:id="@+id/settings_button"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
android:text="@string/settings" android:text="@string/settings" />
tools:ignore="MissingConstraints"
style="?android:attr/buttonStyle" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -17,6 +17,10 @@
android:id="@+id/info" android:id="@+id/info"
android:title="@string/object_info" /> android:title="@string/object_info" />
<item
android:id="@+id/copy_name"
android:title="@string/copy_name" />
<item <item
android:id="@+id/cors_config" android:id="@+id/cors_config"
android:title="@string/cors_config" /> android:title="@string/cors_config" />

View file

@ -13,6 +13,10 @@
android:id="@+id/info" android:id="@+id/info"
android:title="@string/object_info" /> android:title="@string/object_info" />
<item
android:id="@+id/copy_name"
android:title="@string/copy_name" />
<item <item
android:id="@+id/deletefolder" android:id="@+id/deletefolder"
android:title="@string/file_del" /> android:title="@string/file_del" />

View file

@ -17,6 +17,10 @@
android:id="@+id/info" android:id="@+id/info"
android:title="@string/object_info" /> android:title="@string/object_info" />
<item
android:id="@+id/copy_name"
android:title="@string/copy_name" />
<item <item
android:id="@+id/deletefile" android:id="@+id/deletefile"
android:title="@string/file_del" /> android:title="@string/file_del" />

View file

@ -107,4 +107,6 @@
<string name="download_bucket">Descargar contenido del bucket</string> <string name="download_bucket">Descargar contenido del bucket</string>
<string name="download_folder">Descargar contenido de la carpeta</string> <string name="download_folder">Descargar contenido de la carpeta</string>
<string name="batch_download_success">Archivos descargados exitosamente</string> <string name="batch_download_success">Archivos descargados exitosamente</string>
<string name="copy_name">Copiar nombre al portapapeles</string>
<string name="copy_name_ok">Nombre copiado al portapapeles</string>
</resources> </resources>

View file

@ -110,4 +110,6 @@
<string name="delete_cors">Delete CORS</string> <string name="delete_cors">Delete CORS</string>
<string name="cors_error">Cannot change CORS policy</string> <string name="cors_error">Cannot change CORS policy</string>
<string name="cors_ok">CORS policy changed successfully</string> <string name="cors_ok">CORS policy changed successfully</string>
<string name="copy_name">Copy name to clipboard</string>
<string name="copy_name_ok">Name copied to clipboard</string>
</resources> </resources>

View file

@ -0,0 +1,2 @@
* UI fixes
* Copy file name to clipboard