mirror of
https://github.com/MGislv/NekoX.git
synced 2024-07-04 11:13:36 +00:00
add direct share for url (#768)
This commit is contained in:
parent
55024ce8bb
commit
1c123dedc6
|
@ -25015,8 +25015,19 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
MessageObject finalMessageObject = messageObject;
|
MessageObject finalMessageObject = messageObject;
|
||||||
builder.addItems(
|
builder.addItems(
|
||||||
// TODO: builder.setItems(noforwards ? new CharSequence[] {LocaleController.getString("Open", R.string.Open)} : new CharSequence[]{LocaleController.getString("Open", R.string.Open), LocaleController.getString("Copy", R.string.Copy)}, (dialog, which) -> {
|
// TODO: builder.setItems(noforwards ? new CharSequence[] {LocaleController.getString("Open", R.string.Open)} : new CharSequence[]{LocaleController.getString("Open", R.string.Open), LocaleController.getString("Copy", R.string.Copy)}, (dialog, which) -> {
|
||||||
new String[]{LocaleController.getString("Open", R.string.Open), LocaleController.getString("Copy", R.string.Copy), LocaleController.getString("ShareQRCode", R.string.ShareQRCode)},
|
new String[]{
|
||||||
new int[]{R.drawable.baseline_open_in_browser_24, R.drawable.baseline_content_copy_24, R.drawable.wallet_qr}, (which, text, __) -> {
|
LocaleController.getString("Open", R.string.Open),
|
||||||
|
LocaleController.getString("Copy", R.string.Copy),
|
||||||
|
LocaleController.getString("ShareQRCode", R.string.ShareQRCode),
|
||||||
|
LocaleController.getString("ShareMessages", R.string.ShareMessages)
|
||||||
|
},
|
||||||
|
new int[]{
|
||||||
|
R.drawable.baseline_open_in_browser_24,
|
||||||
|
R.drawable.baseline_content_copy_24,
|
||||||
|
R.drawable.wallet_qr,
|
||||||
|
R.drawable.baseline_share_24
|
||||||
|
},
|
||||||
|
(which, text, __) -> {
|
||||||
if (which == 0) {
|
if (which == 0) {
|
||||||
if (str.startsWith("video?")) {
|
if (str.startsWith("video?")) {
|
||||||
didPressMessageUrl(url, false, finalMessageObject, finalCell);
|
didPressMessageUrl(url, false, finalMessageObject, finalCell);
|
||||||
|
@ -25069,6 +25080,17 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
} else {
|
} else {
|
||||||
undoView.showWithAction(0, UndoView.ACTION_LINK_COPIED, null);
|
undoView.showWithAction(0, UndoView.ACTION_LINK_COPIED, null);
|
||||||
}
|
}
|
||||||
|
} else if (which == 2) {
|
||||||
|
ProxyUtil.showQrDialog(getParentActivity(), str);
|
||||||
|
} else if (which == 3) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
|
intent.setType("text/plain");
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, str);
|
||||||
|
try {
|
||||||
|
getParentActivity().startActivity(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
AlertUtil.showToast(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
|
@ -25084,8 +25106,19 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
builder.addTitle(urlFinal);
|
builder.addTitle(urlFinal);
|
||||||
// TODO: builder.setItems(noforwards ? new CharSequence[] {LocaleController.getString("Open", R.string.Open)} : new CharSequence[]{LocaleController.getString("Open", R.string.Open), LocaleController.getString("Copy", R.string.Copy)}, (dialog, which) -> {
|
// TODO: builder.setItems(noforwards ? new CharSequence[] {LocaleController.getString("Open", R.string.Open)} : new CharSequence[]{LocaleController.getString("Open", R.string.Open), LocaleController.getString("Copy", R.string.Copy)}, (dialog, which) -> {
|
||||||
builder.addItems(
|
builder.addItems(
|
||||||
new String[]{LocaleController.getString("Open", R.string.Open), LocaleController.getString("Copy", R.string.Copy), LocaleController.getString("ShareQRCode", R.string.ShareQRCode)},
|
new String[]{
|
||||||
new int[]{R.drawable.baseline_open_in_browser_24, R.drawable.baseline_content_copy_24, R.drawable.wallet_qr}, (which, text, __) -> {
|
LocaleController.getString("Open", R.string.Open),
|
||||||
|
LocaleController.getString("Copy", R.string.Copy),
|
||||||
|
LocaleController.getString("ShareQRCode", R.string.ShareQRCode),
|
||||||
|
LocaleController.getString("ShareMessages", R.string.ShareMessages)
|
||||||
|
},
|
||||||
|
new int[]{
|
||||||
|
R.drawable.baseline_open_in_browser_24,
|
||||||
|
R.drawable.baseline_content_copy_24,
|
||||||
|
R.drawable.wallet_qr,
|
||||||
|
R.drawable.baseline_share_24
|
||||||
|
},
|
||||||
|
(which, text, __) -> {
|
||||||
if (which == 0) {
|
if (which == 0) {
|
||||||
processExternalUrl(1, urlFinal, false);
|
processExternalUrl(1, urlFinal, false);
|
||||||
} else if (which == 1) {
|
} else if (which == 1) {
|
||||||
|
@ -25107,8 +25140,17 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
} else {
|
} else {
|
||||||
undoView.showWithAction(0, UndoView.ACTION_LINK_COPIED, null);
|
undoView.showWithAction(0, UndoView.ACTION_LINK_COPIED, null);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (which == 2) {
|
||||||
ProxyUtil.showQrDialog(getParentActivity(), urlFinal);
|
ProxyUtil.showQrDialog(getParentActivity(), urlFinal);
|
||||||
|
} else if (which == 3) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
|
intent.setType("text/plain");
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, urlFinal);
|
||||||
|
try {
|
||||||
|
getParentActivity().startActivity(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
AlertUtil.showToast(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user