Merge pull request #391 from flyingrub/copy

Add a menu entry to copy the link of a toot
main
Konrad Pozniak 7 years ago committed by GitHub
commit f183325b26
  1. 10
      app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java
  2. 2
      app/src/main/res/menu/status_more.xml
  3. 2
      app/src/main/res/values-fr/strings.xml
  4. 1
      app/src/main/res/values/strings.xml

@ -15,6 +15,9 @@
package com.keylesspalace.tusky.fragment; package com.keylesspalace.tusky.fragment;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; 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))); startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_status_link_to)));
return true; 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: { case R.id.status_mute: {
mute(accountId); mute(accountId);
return true; return true;

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

@ -97,6 +97,8 @@
<string name="action_undo">Annuler</string> <string name="action_undo">Annuler</string>
<string name="action_view_follow_requests">Demandes de follow</string> <string name="action_view_follow_requests">Demandes de follow</string>
<string name="action_view_mutes">Utilisateurs muets</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 l’URL de votre pouet avec…</string> <string name="send_status_link_to">Partager l’URL de votre pouet avec…</string>
<string name="send_status_content_to">Partager le pouet avec…</string> <string name="send_status_content_to">Partager le pouet avec…</string>

@ -100,6 +100,7 @@
<string name="action_reject">Reject</string> <string name="action_reject">Reject</string>
<string name="action_search">Search</string> <string name="action_search">Search</string>
<string name="action_access_saved_toot">Drafts</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_link_to">Share toot URL to…</string>
<string name="send_status_content_to">Share toot to…</string> <string name="send_status_content_to">Share toot to…</string>

Loading…
Cancel
Save