From 09dff6310dba050b132c5bfd6273066e556c5bb3 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 24 Jan 2020 09:14:52 +0100 Subject: [PATCH] fix button alignment on Andrid <4.4 fixes #3625 --- .../conversations/parser/MessageParser.java | 1 + .../conversations/xml/XmlElementReader.java | 20 ++ .../eu/siacs/conversations/xml/XmlReader.java | 3 +- .../res/layout/activity_enter_name.xml | 20 +- .../res/layout/activity_enter_number.xml | 179 +++++++++--------- src/quicksy/res/layout/activity_verify.xml | 8 +- src/quicksy/res/layout/country_item.xml | 17 +- 7 files changed, 142 insertions(+), 106 deletions(-) create mode 100644 src/main/java/eu/siacs/conversations/xml/XmlElementReader.java diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index ed7f6ad96..a57f0eec8 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -452,6 +452,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece if (conversation.getMucOptions().isSelf(counterpart)) { status = Message.STATUS_SEND_RECEIVED; isCarbon = true; //not really carbon but received from another resource + //TODO this would be the place to change the body after something like mod_pastebin if (mXmppConnectionService.markMessage(conversation, remoteMsgId, status, serverMsgId)) { return; } else if (remoteMsgId == null || Config.IGNORE_ID_REWRITE_IN_MUC) { diff --git a/src/main/java/eu/siacs/conversations/xml/XmlElementReader.java b/src/main/java/eu/siacs/conversations/xml/XmlElementReader.java new file mode 100644 index 000000000..cce6fc163 --- /dev/null +++ b/src/main/java/eu/siacs/conversations/xml/XmlElementReader.java @@ -0,0 +1,20 @@ +package eu.siacs.conversations.xml; + +import com.google.common.io.ByteSource; + +import java.io.IOException; +import java.io.InputStream; + +public class XmlElementReader { + + public static Element read(byte[] bytes) throws IOException { + return read(ByteSource.wrap(bytes).openStream()); + } + + public static Element read(InputStream inputStream) throws IOException { + final XmlReader xmlReader = new XmlReader(); + xmlReader.setInputStream(inputStream); + return xmlReader.readElement(xmlReader.readTag()); + } + +} diff --git a/src/main/java/eu/siacs/conversations/xml/XmlReader.java b/src/main/java/eu/siacs/conversations/xml/XmlReader.java index 1540e5f61..240b92b7a 100644 --- a/src/main/java/eu/siacs/conversations/xml/XmlReader.java +++ b/src/main/java/eu/siacs/conversations/xml/XmlReader.java @@ -87,8 +87,7 @@ public class XmlReader implements Closeable { return null; } - public Element readElement(Tag currentTag) throws XmlPullParserException, - IOException { + public Element readElement(Tag currentTag) throws IOException { Element element = new Element(currentTag.getName()); element.setAttributes(currentTag.getAttributes()); Tag nextTag = this.readTag(); diff --git a/src/quicksy/res/layout/activity_enter_name.xml b/src/quicksy/res/layout/activity_enter_name.xml index a1afe94be..d2b8b60f6 100644 --- a/src/quicksy/res/layout/activity_enter_name.xml +++ b/src/quicksy/res/layout/activity_enter_name.xml @@ -6,7 +6,9 @@ android:layout_height="match_parent" android:orientation="vertical"> - + + android:padding="16dp" + android:text="@string/enter_your_name_instructions" + android:textAppearance="@style/TextAppearance.Conversations.Body1" /> +