diff --git a/app/build.gradle b/app/build.gradle
index f77a8c1..7bd41e4 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -9,8 +9,8 @@ android {
applicationId "asgardius.page.s3manager"
minSdk 23
targetSdk 33
- versionCode 52
- versionName "0.5.0"
+ versionCode 53
+ versionName "0.5.1"
setProperty("archivesBaseName", "s3-manager-$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
diff --git a/app/src/main/java/asgardius/page/s3manager/BucketSelect.java b/app/src/main/java/asgardius/page/s3manager/BucketSelect.java
index 500d7fc..81bcd00 100644
--- a/app/src/main/java/asgardius/page/s3manager/BucketSelect.java
+++ b/app/src/main/java/asgardius/page/s3manager/BucketSelect.java
@@ -8,6 +8,9 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
+import android.content.ClipData;
+import android.content.ClipboardManager;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.AsyncTask;
@@ -175,6 +178,8 @@ public class BucketSelect extends AppCompatActivity {
} else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) {
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)) {
corsConfig(Name.get(position).toString());
} else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
@@ -355,4 +360,10 @@ public class BucketSelect extends AppCompatActivity {
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();
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java b/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java
index c2601bc..bcbd0a1 100644
--- a/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java
+++ b/app/src/main/java/asgardius/page/s3manager/ObjectSelect.java
@@ -7,6 +7,8 @@ import androidx.recyclerview.widget.RecyclerView;
import android.app.AppOpsManager;
import android.app.PictureInPictureParams;
+import android.content.ClipData;
+import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -399,6 +401,8 @@ public class ObjectSelect extends AppCompatActivity {
download(Name.get(position).toString(), true);
} else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) {
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)) {
if (Name.size() == 1 && treelevel >= 1) {
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));
} else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) {
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)) {
if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
if (Name.size() == 1 && treelevel >= 1) {
@@ -669,4 +675,16 @@ public class ObjectSelect extends AppCompatActivity {
intent.putExtra("isfolder", isfolder);
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();
+ }
}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 76dcb71..92d8139 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -20,17 +20,13 @@
android:id="@+id/addaccount"
android:layout_width="match_parent"
android:layout_height="70dp"
- android:text="@string/accountadd_button"
- tools:ignore="MissingConstraints"
- style="?android:attr/buttonStyle" />
+ android:text="@string/accountadd_button" />
+ android:text="@string/settings" />
+
+
diff --git a/app/src/main/res/menu/folder_menu.xml b/app/src/main/res/menu/folder_menu.xml
index 35e4701..bba106f 100644
--- a/app/src/main/res/menu/folder_menu.xml
+++ b/app/src/main/res/menu/folder_menu.xml
@@ -13,6 +13,10 @@
android:id="@+id/info"
android:title="@string/object_info" />
+
+
diff --git a/app/src/main/res/menu/object_menu.xml b/app/src/main/res/menu/object_menu.xml
index d8e0549..2973896 100644
--- a/app/src/main/res/menu/object_menu.xml
+++ b/app/src/main/res/menu/object_menu.xml
@@ -17,6 +17,10 @@
android:id="@+id/info"
android:title="@string/object_info" />
+
+
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 03b616d..2365bc5 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -107,4 +107,6 @@
Descargar contenido del bucket
Descargar contenido de la carpeta
Archivos descargados exitosamente
+ Copiar nombre al portapapeles
+ Nombre copiado al portapapeles
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 7e8af3f..f5d1cd3 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -110,4 +110,6 @@
Delete CORS
Cannot change CORS policy
CORS policy changed successfully
+ Copy name to clipboard
+ Name copied to clipboard
\ No newline at end of file
diff --git a/fastlane/metadata/android/en-US/changelogs/53.txt b/fastlane/metadata/android/en-US/changelogs/53.txt
new file mode 100644
index 0000000..a22183b
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/53.txt
@@ -0,0 +1,2 @@
+* UI fixes
+* Copy file name to clipboard
\ No newline at end of file