change share for open in
This commit is contained in:
parent
cfb171d488
commit
1f98f23e11
3 changed files with 6 additions and 7 deletions
|
@ -8,6 +8,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -257,7 +258,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
public boolean onMenuItemClick(MenuItem menuItem) {
|
public boolean onMenuItemClick(MenuItem menuItem) {
|
||||||
// Toast message on menu item clicked
|
// Toast message on menu item clicked
|
||||||
//Toast.makeText(MainActivity.this, "You Clicked " + menuItem.getTitle(), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(MainActivity.this, "You Clicked " + menuItem.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
if (menuItem.getTitle() == getResources().getString(R.string.file_share)) {
|
if (menuItem.getTitle() == getResources().getString(R.string.file_external)) {
|
||||||
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());
|
||||||
|
@ -324,10 +325,8 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
Intent shareIntent = new Intent(Intent.ACTION_VIEW);
|
||||||
shareIntent.setType("text/plain");
|
shareIntent.setData(Uri.parse(object));
|
||||||
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Share Link");
|
|
||||||
shareIntent.putExtra(Intent.EXTRA_TEXT, object);
|
|
||||||
startActivity(Intent.createChooser(shareIntent, "choose one"));
|
startActivity(Intent.createChooser(shareIntent, "choose one"));
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/sharefile"
|
android:id="@+id/sharefile"
|
||||||
android:title="@string/file_share" />
|
android:title="@string/file_external" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/deletefile"
|
android:id="@+id/deletefile"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<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="pending_feature">This feature is not implemented yet</string>
|
<string name="pending_feature">This feature is not implemented yet</string>
|
||||||
<string name="file_share">Get link</string>
|
<string name="file_external">Open in</string>
|
||||||
<string name="file_del">Delete</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>
|
||||||
|
|
Loading…
Reference in a new issue