Add a menu entry to copy the link of a toot

fixes #390
This commit is contained in:
flyingrub 2017-09-25 20:15:04 +02:00
parent 67f3ce6e4e
commit 4fb9ee99f6
4 changed files with 15 additions and 0 deletions

View File

@ -15,6 +15,9 @@
package com.keylesspalace.tusky.fragment;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
@ -271,6 +274,13 @@ public abstract class SFragment extends BaseFragment implements AdapterItemRemov
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_status_link_to)));
return true;
}
case R.id.status_copy_link: {
ClipboardManager clipboard = (ClipboardManager)
getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText(null, statusUrl);
clipboard.setPrimaryClip(clip);
return true;
}
case R.id.status_mute: {
mute(accountId);
return true;

View File

@ -12,6 +12,8 @@
android:title="@string/status_share_content"/>
</menu>
</item>
<item android:title="@string/action_copy_link"
android:id="@+id/status_copy_link" />
<item android:title="@string/action_mute"
android:id="@+id/status_mute" />
<item android:title="@string/action_block"

View File

@ -97,6 +97,8 @@
<string name="action_undo">Annuler</string>
<string name="action_view_follow_requests">Demandes de follow</string>
<string name="action_view_mutes">Utilisateurs muets</string>
<string name="action_copy_link">Copier le lien</string>
<string name="send_status_link_to">Partager lURL de votre pouet avec…</string>
<string name="send_status_content_to">Partager le pouet avec…</string>

View File

@ -100,6 +100,7 @@
<string name="action_reject">Reject</string>
<string name="action_search">Search</string>
<string name="action_access_saved_toot">Drafts</string>
<string name="action_copy_link">Copy the link</string>
<string name="send_status_link_to">Share toot URL to…</string>
<string name="send_status_content_to">Share toot to…</string>