Some improvements

This commit is contained in:
tom79 2019-11-28 19:05:20 +01:00
parent 1994019331
commit b8ff349bfd
3 changed files with 16 additions and 0 deletions

View File

@ -698,6 +698,16 @@ public class Status implements Parcelable {
sendIntent.setType("text/plain");
context.startActivity(Intent.createChooser(sendIntent, context.getString(R.string.share_with)));
break;
case R.id.action_open_other_app:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
try {
context.startActivity(intent);
} catch (Exception e) {
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
}
break;
case R.id.action_copy_link:
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText(Helper.CLIP_BOARD, url);
@ -717,6 +727,7 @@ public class Status implements Parcelable {
}
});
popup.show();
textView.clearFocus();
BaseActivity.canShowActionMode = false;
}

View File

@ -9,6 +9,10 @@
android:id="@+id/action_share_link"
android:title="@string/share_link"
/>
<item
android:id="@+id/action_open_other_app"
android:title="@string/open_other_app"
/>
<item
android:id="@+id/action_copy_link"
android:title="@string/copy_link"

View File

@ -1193,4 +1193,5 @@
<string name="display_full_link">Display full link</string>
<string name="share_link">Share link</string>
<string name="link_copy">The URL has been copied to the clipboard</string>
<string name="open_other_app">Open with another app</string>
</resources>