(share) add share functionality

- get the text shared and put it on the Clipboard
- pass by the same way that past for Download the information
main
torrentcome 8 years ago
parent a6455d1930
commit 5b07e9c26a
  1. 3
      app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java
  2. 6
      app/src/main/java/com/keylesspalace/tusky/util/ParserUtils.java

@ -390,6 +390,9 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
int left = Math.min(start, end);
int right = Math.max(start, end);
textEditor.getText().replace(left, right, text, 0, text.length());
parser.putInClipboardManager(this, text);
textEditor.onPaste();
}
}
}

@ -43,6 +43,12 @@ public class ParserUtils {
return null;
}
public void putInClipboardManager(Context context, String string) {
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("", string);
clipboard.setPrimaryClip(clip);
}
// parse the HTML page
private HeaderInfo parsePageHeaderInfo(String urlStr) throws Exception {
Connection con = Jsoup.connect(urlStr);

Loading…
Cancel
Save