delete menu template

This commit is contained in:
Page Asgardius 2022-09-08 16:32:10 -07:00
parent ceb9df7d33
commit cfb171d488
5 changed files with 36 additions and 2 deletions

View file

@ -16,6 +16,7 @@
<entry key="app/src/main/res/layout/activity_video_player.xml" value="0.1" /> <entry key="app/src/main/res/layout/activity_video_player.xml" value="0.1" />
<entry key="app/src/main/res/layout/activity_web_view.xml" value="0.17119565217391305" /> <entry key="app/src/main/res/layout/activity_web_view.xml" value="0.17119565217391305" />
<entry key="app/src/main/res/layout/list_buckets.xml" value="0.19610507246376813" /> <entry key="app/src/main/res/layout/list_buckets.xml" value="0.19610507246376813" />
<entry key="app/src/main/res/menu/folder_menu.xml" value="0.2713541666666667" />
<entry key="app/src/main/res/menu/object_menu.xml" value="0.20260416666666667" /> <entry key="app/src/main/res/menu/object_menu.xml" value="0.20260416666666667" />
<entry key="app/src/main/res/menu/popup_menu.xml" value="0.2713541666666667" /> <entry key="app/src/main/res/menu/popup_menu.xml" value="0.2713541666666667" />
</map> </map>

View file

@ -228,7 +228,24 @@ public class ObjectSelect extends AppCompatActivity {
//System.out.println("Long click on "+Name.get(position).toString()); //System.out.println("Long click on "+Name.get(position).toString());
if (Img.get(position).equals(R.drawable.folder)) { if (Img.get(position).equals(R.drawable.folder)) {
//go to subfolder //go to subfolder
//explorer(Name.get(position).toString()); /// Initializing the popup menu and giving the reference as current context
PopupMenu popupMenu = new PopupMenu(ObjectSelect.this, recyclerView);
// Inflating popup menu from popup_menu.xml file
popupMenu.getMenuInflater().inflate(R.menu.folder_menu, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
// Toast message on menu item clicked
//Toast.makeText(MainActivity.this, "You Clicked " + menuItem.getTitle(), Toast.LENGTH_SHORT).show();
if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
Toast.makeText(ObjectSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
}
return true;
}
});
// Showing the popup menu
popupMenu.show();
} else { } else {
// Initializing the popup menu and giving the reference as current context // Initializing the popup menu and giving the reference as current context
PopupMenu popupMenu = new PopupMenu(ObjectSelect.this, recyclerView); PopupMenu popupMenu = new PopupMenu(ObjectSelect.this, recyclerView);
@ -244,6 +261,8 @@ public class ObjectSelect extends AppCompatActivity {
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);
share(objectURL.toString()); share(objectURL.toString());
} else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
Toast.makeText(ObjectSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
} }
return true; return true;
} }

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/deletefolder"
android:title="@string/file_del" />
</menu>

View file

@ -5,5 +5,8 @@
android:id="@+id/sharefile" android:id="@+id/sharefile"
android:title="@string/file_share" /> android:title="@string/file_share" />
<item
android:id="@+id/deletefile"
android:title="@string/file_del" />
</menu> </menu>

View file

@ -3,7 +3,9 @@
<string name="aws_endpoint">.amazonaws.com</string> <string name="aws_endpoint">.amazonaws.com</string>
<string name="title_activity_video_player">VideoPlayer</string> <string name="title_activity_video_player">VideoPlayer</string>
<string name="broken_database">Local database is corrupted. Please reinstall this app</string> <string name="broken_database">Local database is corrupted. Please reinstall this app</string>
<string name="file_share">Get object link</string> <string name="pending_feature">This feature is not implemented yet</string>
<string name="file_share">Get link</string>
<string name="file_del">Delete</string>
<string name="accountselect">Please choose an account</string> <string name="accountselect">Please choose an account</string>
<string name="accountadd_button">Add Account</string> <string name="accountadd_button">Add Account</string>
<string name="accounttest_button">Test credentials</string> <string name="accounttest_button">Test credentials</string>