draft a device message (#2817)

* draft a device message

* add others

* Update res/values/strings.xml

Co-authored-by: link2xt <link2xt@testrun.org>

* 'implovements in', remove double 'screen reader'

* move 'now' to the end; sounds as 'no' otherwise, and i also think, this is more fluent

* nicer group icon

* add an image showcasing the green checkmark

* more image like?

* split device message, delete old device messages

* add 'sync' to device message

---------

Co-authored-by: link2xt <link2xt@testrun.org>
This commit is contained in:
bjoern
2023-11-06 20:16:14 +01:00
committed by GitHub
parent 4ab47b8b2d
commit 083081fcb4
3 changed files with 23 additions and 7 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

+2 -3
View File
@@ -1100,8 +1100,7 @@
<!-- device messages for updates -->
<string name="update_1_42_common">What\'s new:\n\n💌 one-to-one chats guarantee end-to-end encryption for introduced contacts now\n\n😌 for everyone\'s simplicity, we mark these contacts and chats with green checkmarks\n\n👥 groups are created automatically with guaranteed end-to-end encryption if possible\n\n🔄 Accept/Blocked, Archived, Pinned, Mute is synced across all your devices</string>
<!-- placeholder will be replaced by the URL https://get.delta.chat/#changelogs -->
<string name="update_1_38_android">1.38 is out:\n\n📎 Removed upper size limit of attachments\n\n🗜️ PNG images (screenshots!) are now compressed as well\n\n⌨️ For Devs: Better apps for chats with sendToChat() and importFiles() (What is Webxdc? → https://webxdc.org)\n\n… and more at %1$s</string>
<!-- placeholder will be replaced by the URL https://get.delta.chat/#changelogs -->
<string name="update_1_38_ios">1.38 is out:\n\n🖼🔍 Ever searching for an image and could not remember the chat? Then the \"All Media\" button is yours!\n\n🧹 \"Clear Chat\" from the profiles\n\n📎 Removed upper size limit of attachments\n\n🗜️ PNG images (screenshots!) are now compressed as well\n\n… and more at %1$s</string>
<string name="update_1_42_android">Watch out for more improvements in camera, voice messages, backup-all, screen reader, per-account wallpapers, gallery select-all, webxdc landscape … or read them at %1$s</string>
</resources>
@@ -68,6 +68,10 @@ import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
import org.thoughtcrime.securesms.util.DynamicTheme;
import org.thoughtcrime.securesms.util.Prefs;
import org.thoughtcrime.securesms.util.SendRelayedMessageUtil;
import org.thoughtcrime.securesms.util.Util;
import java.io.FileOutputStream;
import java.io.InputStream;
public class ConversationListActivity extends PassphraseRequiredActionBarActivity
implements ConversationListFragment.ConversationSelectedListener
@@ -96,10 +100,23 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
protected void onCreate(Bundle icicle, boolean ready) {
// update messages - for new messages, do not reuse or modify strings but create new ones.
// it is not needed to keep all past update messages, however, when deleted, also the strings should be deleted.
//DcContext dcContext = DcHelper.getContext(this);
//DcMsg msg = new DcMsg(dcContext, DcMsg.DC_MSG_TEXT);
//msg.setText(getString(R.string.update_1_38_android, "https://get.delta.chat/#changelogs"));
//dcContext.addDeviceMsg("update_1_38c_android", msg);
try {
DcContext dcContext = DcHelper.getContext(this);
final String deviceMsgId = "update_1_42ai_android";
if (!dcContext.wasDeviceMsgEverAdded(deviceMsgId)) {
DcMsg msg = new DcMsg(dcContext, DcMsg.DC_MSG_IMAGE);
InputStream inputStream = getResources().getAssets().open("device-messages/green-checkmark.jpg");
String outputFile = DcHelper.getBlobdirFile(dcContext, "green-checkmark", ".jpg");
Util.copy(inputStream, new FileOutputStream(outputFile));
msg.setFile(outputFile, "image/jpeg");
msg.setText(getString(R.string.update_1_42_common) + "\n\n" + getString(R.string.update_1_42_android, "https://get.delta.chat/#changelogs"));
dcContext.addDeviceMsg(deviceMsgId, msg);
}
} catch(Exception e) {
e.printStackTrace();
}
// create view
setContentView(R.layout.conversation_list_activity);