Fixes issue #117 - Takes url for GNU social instance

This commit is contained in:
stom79 2017-12-28 18:06:03 +01:00
parent 62e48bb8e7
commit 24a82b5252
1 changed files with 13 additions and 4 deletions

View File

@ -43,6 +43,7 @@ import android.text.SpannableString;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MenuItem;
@ -1162,10 +1163,18 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.shared_via));
String url;
if( status.getReblog() != null)
url = status.getReblog().getUri();
else
url = status.getUri();
if( status.getReblog() != null) {
if( status.getReblog().getUri().startsWith("http"))
url = status.getReblog().getUri();
else
url = status.getReblog().getUrl();
}else {
if( status.getUri().startsWith("http"))
url = status.getUri();
else
url = status.getUrl();
}
sendIntent.putExtra(Intent.EXTRA_TEXT, url);
sendIntent.setType("text/plain");
context.startActivity(Intent.createChooser(sendIntent, context.getString(R.string.share_with)));