tweak default summaries

- in bubbles, just say "Webxdc",
  the text is replaced by the summary set by the app -
  this is also the reason, why more useful information are not-so-good here,
  it will not be shown often, and that may be irritating.
  in case of the bytesize - we also do not show bytesize stickers etc.,
  users can get it always at message-info.

- for drafts, we say "Tap to open",
  maybe a start-button may be nice as well, however, that is some more work,
  and it is not even clear we want to keep that button in the bubbles.
This commit is contained in:
B. Petersen
2022-01-29 21:45:46 +01:00
committed by bjoern
parent 0e553a6e66
commit d6dd07fd7a
3 changed files with 4 additions and 4 deletions
@@ -466,7 +466,7 @@ public class ConversationItem extends BaseConversationItem
if (documentViewStub.resolved()) documentViewStub.get().setVisibility(View.GONE);
if (stickerStub.resolved()) stickerStub.get().setVisibility(View.GONE);
webxdcViewStub.get().setWebxdc(messageRecord);
webxdcViewStub.get().setWebxdc(messageRecord, "Webxdc");
webxdcViewStub.get().setWebxdcClickListener(new ThumbnailClickListener());
webxdcViewStub.get().setOnLongClickListener(passthroughClickListener);
@@ -55,7 +55,7 @@ public class WebxdcView extends FrameLayout {
this.viewListener = listener;
}
public void setWebxdc(final @NonNull DcMsg dcMsg)
public void setWebxdc(final @NonNull DcMsg dcMsg, String defaultSummary)
{
try {
JSONObject info = dcMsg.getWebxdcInfo();
@@ -76,7 +76,7 @@ public class WebxdcView extends FrameLayout {
// subtitle
String summary = info.optString("summary");
if (summary.isEmpty()) {
summary = Util.getPrettyFileSize(dcMsg.getFilebytes()) + " Webxdc";
summary = defaultSummary;
}
appSubtitle.setText(summary);
} catch (Exception e) {
@@ -309,7 +309,7 @@ public class AttachmentManager {
} else if (slide.hasDocument()) {
if (slide.isWebxdcDocument()) {
DcMsg instance = msg != null ? msg : DcHelper.getContext(context).getMsg(slide.dcMsgId);
webxdcView.setWebxdc(instance);
webxdcView.setWebxdc(instance, context.getString(R.string.videochat_tap_to_open));
webxdcView.setWebxdcClickListener((v, s) -> {
WebxdcActivity.openWebxdcActivity(context, instance);
});