Merge pull request #391 from flyingrub/copy

Add a menu entry to copy the link of a toot
This commit is contained in:
Konrad Pozniak 2017-10-16 23:30:36 +02:00 committed by GitHub
commit 34918884b5
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>