v0.9.1: bubble for Android 0.7.6 — pictures have the bubble's round corners; no "MMS Sent"
Android: a picture in a chat is clipped to the bubble's 30 dp corner, sent and received. Checked on the Rabbit with the dev app (the sandbox now has a made-up picture each way). Both: voip.ms gives a picture we sent with no words the text "MMS Sent", like the "MMS Received" already dropped; that goes too, from new messages and (once) from ones already stored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -754,6 +754,14 @@ public final class ChatActivity extends BaseActivity {
|
||||
ImageView iv = new ImageView(c);
|
||||
iv.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
iv.setBackgroundColor(0x22FFFFFF);
|
||||
// The picture's corners match the bubble's (30 dp).
|
||||
float corner = Ui.dp(c, 30);
|
||||
iv.setOutlineProvider(new android.view.ViewOutlineProvider() {
|
||||
@Override public void getOutline(View v, android.graphics.Outline o) {
|
||||
o.setRoundRect(0, 0, v.getWidth(), v.getHeight(), corner);
|
||||
}
|
||||
});
|
||||
iv.setClipToOutline(true);
|
||||
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(bw, bh);
|
||||
iv.setLayoutParams(new LinearLayout.LayoutParams(bw, bh));
|
||||
String tag = id + "/" + index;
|
||||
|
||||
@@ -96,6 +96,11 @@ final class Store {
|
||||
db.execSQL("UPDATE messages SET body = '' WHERE media_json IS NOT NULL AND lower(trim(body)) = 'mms received'");
|
||||
set("mms_received_stripped", "1");
|
||||
}
|
||||
// ...and one we sent with no words "MMS Sent".
|
||||
if (get("mms_sent_stripped") == null) {
|
||||
db.execSQL("UPDATE messages SET body = '' WHERE media_json IS NOT NULL AND lower(trim(body)) = 'mms sent'");
|
||||
set("mms_sent_stripped", "1");
|
||||
}
|
||||
if (get("unread_floor") == null) set("unread_floor", String.valueOf(System.currentTimeMillis()));
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ final class VoipMs {
|
||||
for (String u : urls) refs.put(new JSONObject().put("url", u));
|
||||
m.mediaJson = refs.toString();
|
||||
// voip.ms's own stand-in text for a picture with no words, not the sender's.
|
||||
if (m.body.trim().equalsIgnoreCase("MMS Received")) m.body = "";
|
||||
if (m.body.trim().equalsIgnoreCase("MMS Received") || m.body.trim().equalsIgnoreCase("MMS Sent")) m.body = "";
|
||||
} else if (Phone.charCount(m.body) > Phone.SMS_TEXT_LIMIT) {
|
||||
m.kind = "mms";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user