changed the share button menu to allow for sharing either the link, or the actual content of the post

added values into @string file to accommodate for the change
added the new share submenu into the status_more layout xml
This commit is contained in:
Zachary Epps 2017-04-12 16:21:48 -04:00
commit 52343b6ab2
3 changed files with 31 additions and 6 deletions

View file

@ -182,8 +182,8 @@ public class SFragment extends BaseFragment {
callList.add(call);
}
protected void more(Status status, View view, final AdapterItemRemover adapter,
final int position) {
protected void more(final Status status, View view, final AdapterItemRemover adapter,
final int position) {
final String id = status.getActionableId();
final String accountId = status.getActionableStatus().account.id;
final String accountUsename = status.getActionableStatus().account.username;
@ -201,12 +201,25 @@ public class SFragment extends BaseFragment {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.status_share: {
case R.id.status_share_content: {
StringBuilder sb = new StringBuilder();
sb.append(status.account.username);
sb.append(" - ");
sb.append(status.content.toString());
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, sb.toString());
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_status_content_to)));
return true;
}
case R.id.status_share_link: {
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)));
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_status_link_to)));
return true;
}
case R.id.status_block: {