Fix #4 - Toot URLs can be shared

main
Eugen Rochko 8 years ago
parent 636c2f266e
commit 9e82b64423
  1. 9
      app/src/main/java/com/keylesspalace/tusky/SFragment.java
  2. 2
      app/src/main/java/com/keylesspalace/tusky/entity/Account.java
  3. 14
      app/src/main/java/com/keylesspalace/tusky/entity/Status.java
  4. 6
      app/src/main/res/menu/status_more.xml
  5. 2
      app/src/main/res/values/strings.xml

@ -193,6 +193,7 @@ public class SFragment extends Fragment {
final String accountId = status.getActionableStatus().account.id;
final String accountUsename = status.getActionableStatus().account.username;
final Spanned content = status.getActionableStatus().content;
final String statusUrl = status.getActionableStatus().url;
PopupMenu popup = new PopupMenu(getContext(), view);
// Give a different menu depending on whether this is the user's own toot or not.
if (loggedInAccountId == null || !loggedInAccountId.equals(accountId)) {
@ -205,8 +206,12 @@ public class SFragment extends Fragment {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.status_follow: {
follow(accountId);
case R.id.status_share: {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, statusUrl);
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_status_to)));
return true;
}
case R.id.status_block: {

@ -36,6 +36,8 @@ public class Account {
public String header;
public boolean locked;
@SerializedName("followers_count")
public String followersCount;

@ -24,6 +24,20 @@ import java.util.Date;
public class Status {
private Status actionableStatus;
public String url;
@SerializedName("reblogs_count")
public String reblogsCount;
@SerializedName("favourites_count")
public String favouritesCount;
@SerializedName("in_reply_to_id")
public String inReplyToId;
@SerializedName("in_reply_to_account_id")
public String inReplyToAccountId;
public String getActionableId() {
return reblog == null ? id : reblog.id;
}

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/status_follow"
android:title="@string/action_follow" />
<item
android:id="@+id/status_share"
android:title="@string/action_share"/>
<item android:title="@string/action_block"
android:id="@+id/status_block" />
<item android:title="@string/action_report"

@ -156,5 +156,7 @@
<string name="action_photo_pick">Add media</string>
<string name="action_compose_options">Privacy options</string>
<string name="login_success">Welcome back!</string>
<string name="action_share">Share</string>
<string name="send_status_to">Share toot URL to...</string>
</resources>

Loading…
Cancel
Save