mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 17:59:39 +02:00
Merge pull request #3454 from deltachat/adb/update-link-generation
remove Util.QrDataToInviteURL()
This commit is contained in:
commit
1f880efb3f
3 changed files with 4 additions and 8 deletions
|
@ -533,7 +533,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||||
private void shareInvite() {
|
private void shareInvite() {
|
||||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
intent.setType("text/plain");
|
intent.setType("text/plain");
|
||||||
String inviteURL = Util.QrDataToInviteURL(DcHelper.getContext(this).getSecurejoinQr(0));
|
String inviteURL = DcHelper.getContext(this).getSecurejoinQr(0);
|
||||||
intent.putExtra(Intent.EXTRA_TEXT, getString(R.string.invite_friends_text, inviteURL));
|
intent.putExtra(Intent.EXTRA_TEXT, getString(R.string.invite_friends_text, inviteURL));
|
||||||
startActivity(Intent.createChooser(intent, getString(R.string.chat_share_with_title)));
|
startActivity(Intent.createChooser(intent, getString(R.string.chat_share_with_title)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ public class QrShowFragment extends Fragment implements DcEventCenter.DcEventDel
|
||||||
try {
|
try {
|
||||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
intent.setType("text/plain");
|
intent.setType("text/plain");
|
||||||
String inviteURL = Util.QrDataToInviteURL(dcContext.getSecurejoinQr(chatId));
|
String inviteURL = dcContext.getSecurejoinQr(chatId);
|
||||||
intent.putExtra(Intent.EXTRA_TEXT, inviteURL);
|
intent.putExtra(Intent.EXTRA_TEXT, inviteURL);
|
||||||
startActivity(Intent.createChooser(intent, getString(R.string.chat_share_with_title)));
|
startActivity(Intent.createChooser(intent, getString(R.string.chat_share_with_title)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -131,7 +131,7 @@ public class QrShowFragment extends Fragment implements DcEventCenter.DcEventDel
|
||||||
}
|
}
|
||||||
|
|
||||||
public void copyQrData() {
|
public void copyQrData() {
|
||||||
String inviteURL = Util.QrDataToInviteURL(dcContext.getSecurejoinQr(chatId));
|
String inviteURL = dcContext.getSecurejoinQr(chatId);
|
||||||
Util.writeTextToClipboard(getActivity(), inviteURL);
|
Util.writeTextToClipboard(getActivity(), inviteURL);
|
||||||
Toast.makeText(getActivity(), getString(R.string.copied_to_clipboard), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), getString(R.string.copied_to_clipboard), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ public class QrShowFragment extends Fragment implements DcEventCenter.DcEventDel
|
||||||
|
|
||||||
public void showInviteLinkDialog() {
|
public void showInviteLinkDialog() {
|
||||||
View view = View.inflate(getActivity(), R.layout.dialog_share_invite_link, null);
|
View view = View.inflate(getActivity(), R.layout.dialog_share_invite_link, null);
|
||||||
String inviteURL = Util.QrDataToInviteURL(dcContext.getSecurejoinQr(chatId));
|
String inviteURL = dcContext.getSecurejoinQr(chatId);
|
||||||
((TextView)view.findViewById(R.id.invite_link)).setText(inviteURL);
|
((TextView)view.findViewById(R.id.invite_link)).setText(inviteURL);
|
||||||
new AlertDialog.Builder(getActivity())
|
new AlertDialog.Builder(getActivity())
|
||||||
.setView(view)
|
.setView(view)
|
||||||
|
|
|
@ -85,10 +85,6 @@ public class Util {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String QrDataToInviteURL(String qrData) {
|
|
||||||
return "https://" + INVITE_DOMAIN + "/#" + qrData.split(":", 2)[1].replaceFirst("#", "&");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CharSequence getBoldedString(String value) {
|
public static CharSequence getBoldedString(String value) {
|
||||||
SpannableString spanned = new SpannableString(value);
|
SpannableString spanned = new SpannableString(value);
|
||||||
spanned.setSpan(new StyleSpan(Typeface.BOLD), 0,
|
spanned.setSpan(new StyleSpan(Typeface.BOLD), 0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue