diff --git a/android-smsmms/src/main/java/com/android/internal/telephony/IccUtils.java b/android-smsmms/src/main/java/com/android/internal/telephony/IccUtils.java deleted file mode 100755 index b349222d..00000000 --- a/android-smsmms/src/main/java/com/android/internal/telephony/IccUtils.java +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.internal.telephony; - -import android.content.res.Resources; -import android.graphics.Bitmap; -import android.graphics.Color; -import com.klinker.android.logger.Log; - -import java.io.UnsupportedEncodingException; - -/** - * Various methods, useful for dealing with SIM data. - */ -public class IccUtils { - static final String LOG_TAG = "IccUtils"; - - /** - * Many fields in GSM SIM's are stored as nibble-swizzled BCD - *

- * Assumes left-justified field that may be padded right with 0xf - * values. - *

- * Stops on invalid BCD value, returning string so far - */ - public static String - bcdToString(byte[] data, int offset, int length) { - StringBuilder ret = new StringBuilder(length * 2); - - for (int i = offset; i < offset + length; i++) { - int v; - - v = data[i] & 0xf; - if (v > 9) break; - ret.append((char) ('0' + v)); - - v = (data[i] >> 4) & 0xf; - // Some PLMNs have 'f' as high nibble, ignore it - if (v == 0xf) continue; - if (v > 9) break; - ret.append((char) ('0' + v)); - } - - return ret.toString(); - } - - /** - * Decode cdma byte into String. - */ - public static String - cdmaBcdToString(byte[] data, int offset, int length) { - StringBuilder ret = new StringBuilder(length); - - int count = 0; - for (int i = offset; count < length; i++) { - int v; - v = data[i] & 0xf; - if (v > 9) v = 0; - ret.append((char) ('0' + v)); - - if (++count == length) break; - - v = (data[i] >> 4) & 0xf; - if (v > 9) v = 0; - ret.append((char) ('0' + v)); - ++count; - } - return ret.toString(); - } - - /** - * Decodes a GSM-style BCD byte, returning an int ranging from 0-99. - *

- * In GSM land, the least significant BCD digit is stored in the most - * significant nibble. - *

- * Out-of-range digits are treated as 0 for the sake of the time stamp, - * because of this: - *

- * TS 23.040 section 9.2.3.11 - * "if the MS receives a non-integer value in the SCTS, it shall - * assume the digit is set to 0 but shall store the entire field - * exactly as received" - */ - public static int - gsmBcdByteToInt(byte b) { - int ret = 0; - - // treat out-of-range BCD values as 0 - if ((b & 0xf0) <= 0x90) { - ret = (b >> 4) & 0xf; - } - - if ((b & 0x0f) <= 0x09) { - ret += (b & 0xf) * 10; - } - - return ret; - } - - /** - * Decodes a CDMA style BCD byte like {@link gsmBcdByteToInt}, but - * opposite nibble format. The least significant BCD digit - * is in the least significant nibble and the most significant - * is in the most significant nibble. - */ - public static int - cdmaBcdByteToInt(byte b) { - int ret = 0; - - // treat out-of-range BCD values as 0 - if ((b & 0xf0) <= 0x90) { - ret = ((b >> 4) & 0xf) * 10; - } - - if ((b & 0x0f) <= 0x09) { - ret += (b & 0xf); - } - - return ret; - } - - /** - * Decodes a string field that's formatted like the EF[ADN] alpha - * identifier - *

- * From TS 51.011 10.5.1: - * Coding: - * this alpha tagging shall use either - * - the SMS default 7 bit coded alphabet as defined in - * TS 23.038 [12] with bit 8 set to 0. The alpha identifier - * shall be left justified. Unused bytes shall be set to 'FF'; or - * - one of the UCS2 coded options as defined in annex B. - *

- * Annex B from TS 11.11 V8.13.0: - * 1) If the first octet in the alpha string is '80', then the - * remaining octets are 16 bit UCS2 characters ... - * 2) if the first octet in the alpha string is '81', then the - * second octet contains a value indicating the number of - * characters in the string, and the third octet contains an - * 8 bit number which defines bits 15 to 8 of a 16 bit - * base pointer, where bit 16 is set to zero and bits 7 to 1 - * are also set to zero. These sixteen bits constitute a - * base pointer to a "half page" in the UCS2 code space, to be - * used with some or all of the remaining octets in the string. - * The fourth and subsequent octets contain codings as follows: - * If bit 8 of the octet is set to zero, the remaining 7 bits - * of the octet contain a GSM Default Alphabet character, - * whereas if bit 8 of the octet is set to one, then the - * remaining seven bits are an offset value added to the - * 16 bit base pointer defined earlier... - * 3) If the first octet of the alpha string is set to '82', then - * the second octet contains a value indicating the number of - * characters in the string, and the third and fourth octets - * contain a 16 bit number which defines the complete 16 bit - * base pointer to a "half page" in the UCS2 code space... - */ - public static String - adnStringFieldToString(byte[] data, int offset, int length) { - if (length == 0) { - return ""; - } - if (length >= 1) { - if (data[offset] == (byte) 0x80) { - int ucslen = (length - 1) / 2; - String ret = null; - - try { - ret = new String(data, offset + 1, ucslen * 2, "utf-16be"); - } catch (UnsupportedEncodingException ex) { - Log.e(LOG_TAG, "implausible UnsupportedEncodingException", - ex); - } - - if (ret != null) { - // trim off trailing FFFF characters - - ucslen = ret.length(); - while (ucslen > 0 && ret.charAt(ucslen - 1) == '\uFFFF') - ucslen--; - - return ret.substring(0, ucslen); - } - } - } - - boolean isucs2 = false; - char base = '\0'; - int len = 0; - - if (length >= 3 && data[offset] == (byte) 0x81) { - len = data[offset + 1] & 0xFF; - if (len > length - 3) - len = length - 3; - - base = (char) ((data[offset + 2] & 0xFF) << 7); - offset += 3; - isucs2 = true; - } else if (length >= 4 && data[offset] == (byte) 0x82) { - len = data[offset + 1] & 0xFF; - if (len > length - 4) - len = length - 4; - - base = (char) (((data[offset + 2] & 0xFF) << 8) | - (data[offset + 3] & 0xFF)); - offset += 4; - isucs2 = true; - } - - if (isucs2) { - StringBuilder ret = new StringBuilder(); - - while (len > 0) { - // UCS2 subset case - - if (data[offset] < 0) { - ret.append((char) (base + (data[offset] & 0x7F))); - offset++; - len--; - } - - // GSM character set case - - int count = 0; - while (count < len && data[offset + count] >= 0) - count++; - - ret.append(GsmAlphabet.gsm8BitUnpackedToString(data, - offset, count)); - - offset += count; - len -= count; - } - - return ret.toString(); - } - - Resources resource = Resources.getSystem(); - String defaultCharset = ""; - return GsmAlphabet.gsm8BitUnpackedToString(data, offset, length, defaultCharset.trim()); - } - - static int - hexCharToInt(char c) { - if (c >= '0' && c <= '9') return (c - '0'); - if (c >= 'A' && c <= 'F') return (c - 'A' + 10); - if (c >= 'a' && c <= 'f') return (c - 'a' + 10); - - throw new RuntimeException("invalid hex char '" + c + "'"); - } - - /** - * Converts a hex String to a byte array. - * - * @param s A string of hexadecimal characters, must be an even number of - * chars long - * @return byte array representation - * @throws RuntimeException on invalid format - */ - public static byte[] - hexStringToBytes(String s) { - byte[] ret; - - if (s == null) return null; - - int sz = s.length(); - - ret = new byte[sz / 2]; - - for (int i = 0; i < sz; i += 2) { - ret[i / 2] = (byte) ((hexCharToInt(s.charAt(i)) << 4) - | hexCharToInt(s.charAt(i + 1))); - } - - return ret; - } - - - /** - * Converts a byte array into a String of hexadecimal characters. - * - * @param bytes an array of bytes - * @return hex string representation of bytes array - */ - public static String - bytesToHexString(byte[] bytes) { - if (bytes == null) return null; - - StringBuilder ret = new StringBuilder(2 * bytes.length); - - for (int i = 0; i < bytes.length; i++) { - int b; - - b = 0x0f & (bytes[i] >> 4); - - ret.append("0123456789abcdef".charAt(b)); - - b = 0x0f & bytes[i]; - - ret.append("0123456789abcdef".charAt(b)); - } - - return ret.toString(); - } - - - /** - * Convert a TS 24.008 Section 10.5.3.5a Network Name field to a string - * "offset" points to "octet 3", the coding scheme byte - * empty string returned on decode error - */ - public static String - networkNameToString(byte[] data, int offset, int length) { - String ret; - - if ((data[offset] & 0x80) != 0x80 || length < 1) { - return ""; - } - - switch ((data[offset] >>> 4) & 0x7) { - case 0: - // SMS character set - int countSeptets; - int unusedBits = data[offset] & 7; - countSeptets = (((length - 1) * 8) - unusedBits) / 7; - ret = GsmAlphabet.gsm7BitPackedToString(data, offset + 1, countSeptets); - break; - case 1: - // UCS2 - try { - ret = new String(data, - offset + 1, length - 1, "utf-16"); - } catch (UnsupportedEncodingException ex) { - ret = ""; - Log.e(LOG_TAG, "implausible UnsupportedEncodingException", ex); - } - break; - - // unsupported encoding - default: - ret = ""; - break; - } - - // "Add CI" - // "The MS should add the letters for the Country's Initials and - // a separator (e.g. a space) to the text string" - - if ((data[offset] & 0x40) != 0) { - // FIXME(mkf) add country initials here - - } - - return ret; - } - - /** - * Convert a TS 131.102 image instance of code scheme '11' into Bitmap - * - * @param data The raw data - * @param length The length of image body - * @return The bitmap - */ - public static Bitmap parseToBnW(byte[] data, int length) { - int valueIndex = 0; - int width = data[valueIndex++] & 0xFF; - int height = data[valueIndex++] & 0xFF; - int numOfPixels = width * height; - - int[] pixels = new int[numOfPixels]; - - int pixelIndex = 0; - int bitIndex = 7; - byte currentByte = 0x00; - while (pixelIndex < numOfPixels) { - // reassign data and index for every byte (8 bits). - if (pixelIndex % 8 == 0) { - currentByte = data[valueIndex++]; - bitIndex = 7; - } - pixels[pixelIndex++] = bitToRGB((currentByte >> bitIndex--) & 0x01); - } - ; - - if (pixelIndex != numOfPixels) { - Log.e(LOG_TAG, "parse end and size error"); - } - return Bitmap.createBitmap(pixels, width, height, Bitmap.Config.ARGB_8888); - } - - private static int bitToRGB(int bit) { - if (bit == 1) { - return Color.WHITE; - } else { - return Color.BLACK; - } - } - - /** - * a TS 131.102 image instance of code scheme '11' into color Bitmap - * - * @param data The raw data - * @param length the length of image body - * @param transparency with or without transparency - * @return The color bitmap - */ - public static Bitmap parseToRGB(byte[] data, int length, - boolean transparency) { - int valueIndex = 0; - int width = data[valueIndex++] & 0xFF; - int height = data[valueIndex++] & 0xFF; - int bits = data[valueIndex++] & 0xFF; - int colorNumber = data[valueIndex++] & 0xFF; - int clutOffset = ((data[valueIndex++] & 0xFF) << 8) - | (data[valueIndex++] & 0xFF); - - int[] colorIndexArray = getCLUT(data, clutOffset, colorNumber); - if (true == transparency) { - colorIndexArray[colorNumber - 1] = Color.TRANSPARENT; - } - - int[] resultArray = null; - if (0 == (8 % bits)) { - resultArray = mapTo2OrderBitColor(data, valueIndex, - (width * height), colorIndexArray, bits); - } else { - resultArray = mapToNon2OrderBitColor(data, valueIndex, - (width * height), colorIndexArray, bits); - } - - return Bitmap.createBitmap(resultArray, width, height, - Bitmap.Config.RGB_565); - } - - private static int[] mapTo2OrderBitColor(byte[] data, int valueIndex, - int length, int[] colorArray, int bits) { - if (0 != (8 % bits)) { - Log.e(LOG_TAG, "not event number of color"); - return mapToNon2OrderBitColor(data, valueIndex, length, colorArray, - bits); - } - - int mask = 0x01; - switch (bits) { - case 1: - mask = 0x01; - break; - case 2: - mask = 0x03; - break; - case 4: - mask = 0x0F; - break; - case 8: - mask = 0xFF; - break; - } - - int[] resultArray = new int[length]; - int resultIndex = 0; - int run = 8 / bits; - while (resultIndex < length) { - byte tempByte = data[valueIndex++]; - for (int runIndex = 0; runIndex < run; ++runIndex) { - int offset = run - runIndex - 1; - resultArray[resultIndex++] = colorArray[(tempByte >> (offset * bits)) - & mask]; - } - } - return resultArray; - } - - private static int[] mapToNon2OrderBitColor(byte[] data, int valueIndex, - int length, int[] colorArray, int bits) { - if (0 == (8 % bits)) { - Log.e(LOG_TAG, "not odd number of color"); - return mapTo2OrderBitColor(data, valueIndex, length, colorArray, - bits); - } - - int[] resultArray = new int[length]; - // TODO fix me: - return resultArray; - } - - private static int[] getCLUT(byte[] rawData, int offset, int number) { - if (null == rawData) { - return null; - } - - int[] result = new int[number]; - int endIndex = offset + (number * 3); // 1 color use 3 bytes - int valueIndex = offset; - int colorIndex = 0; - int alpha = 0xff << 24; - do { - result[colorIndex++] = alpha - | ((rawData[valueIndex++] & 0xFF) << 16) - | ((rawData[valueIndex++] & 0xFF) << 8) - | ((rawData[valueIndex++] & 0xFF)); - } while (valueIndex < endIndex); - return result; - } -} diff --git a/android-smsmms/src/main/java/com/android/mms/MmsConfig.java b/android-smsmms/src/main/java/com/android/mms/MmsConfig.java index 2b43103b..2cab73f9 100755 --- a/android-smsmms/src/main/java/com/android/mms/MmsConfig.java +++ b/android-smsmms/src/main/java/com/android/mms/MmsConfig.java @@ -33,10 +33,6 @@ public class MmsConfig { public static final String DEFAULT_HTTP_KEY_X_WAP_PROFILE = "x-wap-profile"; public static final String DEFAULT_USER_AGENT = "Android-Mms/2.0"; - private static final String MMS_APP_PACKAGE = "com.android.mms"; - - private static final String SMS_PROMO_DISMISSED_KEY = "sms_promo_dismissed_key"; - private static final int MAX_IMAGE_HEIGHT = 480; private static final int MAX_IMAGE_WIDTH = 640; private static final int MAX_TEXT_LENGTH = 2000; diff --git a/android-smsmms/src/main/java/com/android/mms/service_alt/SendRequest.java b/android-smsmms/src/main/java/com/android/mms/service_alt/SendRequest.java deleted file mode 100755 index 91717f76..00000000 --- a/android-smsmms/src/main/java/com/android/mms/service_alt/SendRequest.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (C) 2015 Jacob Klinker - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.mms.service_alt; - -import android.app.Activity; -import android.app.PendingIntent; -import android.content.ContentValues; -import android.content.Context; -import android.content.Intent; -import android.net.Uri; -import android.os.Binder; -import android.os.Bundle; -import android.provider.Telephony; -import android.telephony.SmsManager; -import android.text.TextUtils; -import com.android.mms.service_alt.exception.MmsHttpException; -import com.google.android.mms.pdu_alt.GenericPdu; -import com.google.android.mms.pdu_alt.PduHeaders; -import com.google.android.mms.pdu_alt.PduParser; -import com.google.android.mms.pdu_alt.PduPersister; -import com.google.android.mms.pdu_alt.SendConf; -import com.google.android.mms.pdu_alt.SendReq; -import com.google.android.mms.util_alt.SqliteWrapper; -import com.klinker.android.logger.Log; - -/** - * Request to send an MMS - */ -public class SendRequest extends MmsRequest { - private static final String TAG = "SendRequest"; - - private final Uri mPduUri; - private byte[] mPduData; - private final String mLocationUrl; - private final PendingIntent mSentIntent; - - public SendRequest(RequestManager manager, int subId, Uri contentUri, String locationUrl, - PendingIntent sentIntent, String creator, Bundle configOverrides) { - super(manager, subId, creator, configOverrides); - mPduUri = contentUri; - mPduData = null; - mLocationUrl = locationUrl; - mSentIntent = sentIntent; - } - - @Override - protected byte[] doHttp(Context context, MmsNetworkManager netMgr, ApnSettings apn) - throws MmsHttpException { - final MmsHttpClient mmsHttpClient = netMgr.getOrCreateHttpClient(); - if (mmsHttpClient == null) { - Log.e(TAG, "MMS network is not ready!"); - throw new MmsHttpException(0/*statusCode*/, "MMS network is not ready"); - } - return mmsHttpClient.execute( - mLocationUrl != null ? mLocationUrl : apn.getMmscUrl(), - mPduData, - MmsHttpClient.METHOD_POST, - apn.isProxySet(), - apn.getProxyAddress(), - apn.getProxyPort(), - mMmsConfig); - } - - @Override - protected PendingIntent getPendingIntent() { - return mSentIntent; - } - - @Override - protected int getQueueType() { - return 0; - } - - @Override - protected Uri persistIfRequired(Context context, int result, byte[] response) { - Log.d(TAG, "SendRequest.persistIfRequired"); - if (mPduData == null) { - Log.e(TAG, "SendRequest.persistIfRequired: empty PDU"); - return null; - } - final long identity = Binder.clearCallingIdentity(); - try { - final boolean supportContentDisposition = mMmsConfig.getSupportMmsContentDisposition(); - // Persist the request PDU first - GenericPdu pdu = (new PduParser(mPduData, supportContentDisposition)).parse(); - if (pdu == null) { - Log.e(TAG, "SendRequest.persistIfRequired: can't parse input PDU"); - return null; - } - if (!(pdu instanceof SendReq)) { - Log.d(TAG, "SendRequest.persistIfRequired: not SendReq"); - return null; - } -// final PduPersister persister = PduPersister.getPduPersister(context); -// final Uri messageUri = persister.persist( -// pdu, -// Telephony.Mms.Sent.CONTENT_URI, -// true/*createThreadId*/, -// true/*groupMmsEnabled*/, -// null/*preOpenedFiles*/); -// if (messageUri == null) { -// Log.e(TAG, "SendRequest.persistIfRequired: can not persist message"); -// return null; -// } - // Update the additional columns based on the send result - final ContentValues values = new ContentValues(); - SendConf sendConf = null; - if (response != null && response.length > 0) { - pdu = (new PduParser(response, supportContentDisposition)).parse(); - if (pdu != null && pdu instanceof SendConf) { - sendConf = (SendConf) pdu; - } - } - if (result != Activity.RESULT_OK - || sendConf == null - || sendConf.getResponseStatus() != PduHeaders.RESPONSE_STATUS_OK) { - // Since we can't persist a message directly into FAILED box, - // we have to update the column after we persist it into SENT box. - // The gap between the state change is tiny so I would not expect - // it to cause any serious problem - // TODO: we should add a "failed" URI for this in MmsProvider? - values.put(Telephony.Mms.MESSAGE_BOX, Telephony.Mms.MESSAGE_BOX_FAILED); - } else { - values.put(Telephony.Mms.MESSAGE_BOX, Telephony.Mms.MESSAGE_BOX_SENT); - } - if (sendConf != null) { - values.put(Telephony.Mms.RESPONSE_STATUS, sendConf.getResponseStatus()); - Log.v(TAG, "response status: " + sendConf.getResponseStatus()); - values.put(Telephony.Mms.MESSAGE_ID, - PduPersister.toIsoString(sendConf.getMessageId())); - } - values.put(Telephony.Mms.DATE, System.currentTimeMillis() / 1000L); - values.put(Telephony.Mms.READ, 1); - values.put(Telephony.Mms.SEEN, 1); - if (!TextUtils.isEmpty(mCreator)) { - values.put(Telephony.Mms.CREATOR, mCreator); - } - if (SubscriptionIdChecker.getInstance(context).canUseSubscriptionId()) { - values.put(Telephony.Mms.SUBSCRIPTION_ID, mSubId); - } - if (SqliteWrapper.update(context, context.getContentResolver(), mPduUri, values, - null/*where*/, null/*selectionArg*/) != 1) { - Log.e(TAG, "SendRequest.persistIfRequired: failed to update message"); - } - return mPduUri; -// } catch (MmsException e) { -// Log.e(TAG, "SendRequest.persistIfRequired: can not persist message", e); - } catch (RuntimeException e) { - Log.e(TAG, "SendRequest.persistIfRequired: unexpected parsing failure", e); - } finally { - Binder.restoreCallingIdentity(identity); - } - return null; - } - - /** - * Read the pdu from the file descriptor and cache pdu bytes in request - * @return true if pdu read successfully - */ - private boolean readPduFromContentUri() { - if (mPduData != null) { - return true; - } - final int bytesTobeRead = mMmsConfig.getMaxMessageSize(); - mPduData = mRequestManager.readPduFromContentUri(mPduUri, bytesTobeRead); - return (mPduData != null); - } - - /** - * Transfer the received response to the caller (for send requests the pdu is small and can - * just include bytes as extra in the "returned" intent). - * - * @param fillIn the intent that will be returned to the caller - * @param response the pdu to transfer - */ - @Override - protected boolean transferResponse(Intent fillIn, byte[] response) { - // SendConf pdus are always small and can be included in the intent - if (response != null) { - fillIn.putExtra(SmsManager.EXTRA_MMS_DATA, response); - } - return true; - } - - /** - * Read the data from the file descriptor if not yet done - * @return whether data successfully read - */ - @Override - protected boolean prepareForHttpRequest() { - return readPduFromContentUri(); - } - - /** - * Try sending via the carrier app - * - * @param context the context - * @param carrierMessagingServicePackage the carrier messaging service sending the MMS - */ - public void trySendingByCarrierApp(Context context, String carrierMessagingServicePackage) { -// final CarrierSendManager carrierSendManger = new CarrierSendManager(); -// final CarrierSendCompleteCallback sendCallback = new CarrierSendCompleteCallback( -// context, carrierSendManger); -// carrierSendManger.sendMms(context, carrierMessagingServicePackage, sendCallback); - } - - @Override - protected void revokeUriPermission(Context context) { - try { - context.revokeUriPermission(mPduUri, Intent.FLAG_GRANT_READ_URI_PERMISSION); - } catch (NullPointerException e) { - Log.e(TAG, "error revoking permissions", e); - } - } -} diff --git a/android-smsmms/src/main/java/com/google/android/mms/APN.java b/android-smsmms/src/main/java/com/google/android/mms/APN.java deleted file mode 100755 index 861a6eca..00000000 --- a/android-smsmms/src/main/java/com/google/android/mms/APN.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.google.android.mms; - -public class APN { - public String MMSCenterUrl = ""; - public String MMSPort = ""; - public String MMSProxy = ""; - - public APN(String MMSCenterUrl, String MMSPort, String MMSProxy) { - this.MMSCenterUrl = MMSCenterUrl; - this.MMSPort = MMSPort; - this.MMSProxy = MMSProxy; - } - - public APN() { - - } -} \ No newline at end of file diff --git a/android-smsmms/src/main/java/com/google/android/mms/APNHelper.java b/android-smsmms/src/main/java/com/google/android/mms/APNHelper.java deleted file mode 100755 index eab68a81..00000000 --- a/android-smsmms/src/main/java/com/google/android/mms/APNHelper.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.google.android.mms; - -import android.content.Context; -import android.database.Cursor; -import android.net.Uri; -import android.text.TextUtils; -import android.widget.Toast; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class APNHelper { - - public APNHelper(final Context context) { - this.context = context; - } - - @SuppressWarnings("unchecked") - public List getMMSApns() { - try { - final Cursor apnCursor = this.context.getContentResolver().query(Uri.withAppendedPath(Uri.parse("content://telephony/carriers"), "current"), null, null, null, null); - if (apnCursor == null) { - return Collections.EMPTY_LIST; - } else { - final List results = new ArrayList(); - if (apnCursor.moveToFirst()) { - do { - final String type = apnCursor.getString(apnCursor.getColumnIndex("type")); - if (!TextUtils.isEmpty(type) && (type.equalsIgnoreCase("*") || type.equalsIgnoreCase("mms"))) { - final String mmsc = apnCursor.getString(apnCursor.getColumnIndex("mmsc")); - final String mmsProxy = apnCursor.getString(apnCursor.getColumnIndex("mmsproxy")); - final String port = apnCursor.getString(apnCursor.getColumnIndex("mmsport")); - final APN apn = new APN(); - apn.MMSCenterUrl = mmsc; - apn.MMSProxy = mmsProxy; - apn.MMSPort = port; - results.add(apn); - - Toast.makeText(context, mmsc + " " + mmsProxy + " " + port, Toast.LENGTH_LONG).show(); - } - } while (apnCursor.moveToNext()); - } - apnCursor.close(); - return results; - } - } catch (Exception e) { - // insignificant permissions - return Collections.EMPTY_LIST; - } - } - - private Context context; -} diff --git a/android-smsmms/src/main/java/com/google/android/mms/util_alt/PduCache.java b/android-smsmms/src/main/java/com/google/android/mms/util_alt/PduCache.java index 7b389763..878f91e7 100755 --- a/android-smsmms/src/main/java/com/google/android/mms/util_alt/PduCache.java +++ b/android-smsmms/src/main/java/com/google/android/mms/util_alt/PduCache.java @@ -27,7 +27,6 @@ import java.util.HashSet; public final class PduCache extends AbstractCache { private static final String TAG = "PduCache"; - private static final boolean DEBUG = false; private static final boolean LOCAL_LOGV = false; private static final int MMS_ALL = 0; diff --git a/android-smsmms/src/main/res/drawable/ic_translate_black_24dp.xml b/android-smsmms/src/main/res/drawable/ic_translate_black_24dp.xml new file mode 100644 index 00000000..f0187727 --- /dev/null +++ b/android-smsmms/src/main/res/drawable/ic_translate_black_24dp.xml @@ -0,0 +1,27 @@ + + + + diff --git a/build.gradle b/build.gradle index 5b569c79..0c9bba2b 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.1.0' + classpath 'com.android.tools.build:gradle:3.1.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "io.realm:realm-gradle-plugin:4.3.1" } diff --git a/data/src/main/java/mapper/CursorToRecipienImpl.kt b/data/src/main/java/mapper/CursorToRecipientImpl.kt similarity index 93% rename from data/src/main/java/mapper/CursorToRecipienImpl.kt rename to data/src/main/java/mapper/CursorToRecipientImpl.kt index 15651e12..08b6258a 100644 --- a/data/src/main/java/mapper/CursorToRecipienImpl.kt +++ b/data/src/main/java/mapper/CursorToRecipientImpl.kt @@ -24,7 +24,7 @@ import android.net.Uri import model.Recipient import javax.inject.Inject -class CursorToRecipienImpl @Inject constructor(private val context: Context) : CursorToRecipient { +class CursorToRecipientImpl @Inject constructor(private val context: Context) : CursorToRecipient { companion object { val URI = Uri.parse("content://mms-sms/canonical-addresses") diff --git a/data/src/main/java/repository/ContactRepositoryImpl.kt b/data/src/main/java/repository/ContactRepositoryImpl.kt index b62fbc32..ca8adf9f 100644 --- a/data/src/main/java/repository/ContactRepositoryImpl.kt +++ b/data/src/main/java/repository/ContactRepositoryImpl.kt @@ -20,6 +20,7 @@ package repository import android.content.Context import android.net.Uri +import android.provider.BaseColumns import android.provider.ContactsContract import io.reactivex.Flowable import io.reactivex.Single @@ -37,11 +38,16 @@ class ContactRepositoryImpl @Inject constructor(val context: Context) : ContactR override fun findContactUri(address: String): Single { return Flowable.just(address) - .map { Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(address)) } - .mapNotNull { uri -> context.contentResolver.query(uri, arrayOf(ContactsContract.PhoneLookup._ID), null, null, null) } + .map { + when { + address.contains('@') -> Uri.withAppendedPath(ContactsContract.CommonDataKinds.Email.CONTENT_FILTER_URI, Uri.encode(address)) + else -> Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(address)) + } + } + .mapNotNull { uri -> context.contentResolver.query(uri, arrayOf(BaseColumns._ID), null, null, null) } .flatMap { cursor -> cursor.asFlowable() } .firstOrError() - .map { cursor -> cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.PhoneLookup._ID)) } + .map { cursor -> cursor.getString(cursor.getColumnIndexOrThrow(BaseColumns._ID)) } .map { id -> Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, id) } } diff --git a/data/src/main/java/repository/MessageRepositoryImpl.kt b/data/src/main/java/repository/MessageRepositoryImpl.kt index 3f950e00..b4989ab9 100644 --- a/data/src/main/java/repository/MessageRepositoryImpl.kt +++ b/data/src/main/java/repository/MessageRepositoryImpl.kt @@ -23,7 +23,6 @@ import android.content.ContentUris import android.content.ContentValues import android.content.Context import android.content.Intent -import android.database.Cursor import android.net.Uri import android.provider.BaseColumns import android.provider.Telephony @@ -47,7 +46,6 @@ import model.Message import model.MmsPart import util.MessageUtils import util.Preferences -import util.extensions.asFlowable import util.extensions.asMaybe import util.extensions.insertOrUpdate import util.extensions.map @@ -327,40 +325,34 @@ class MessageRepositoryImpl @Inject constructor( } override fun markRead(threadId: Long) { - // TODO also need to mark MMS in ContentProvider as Read - val projection = arrayOf(BaseColumns._ID) - val selection = "${Telephony.Sms.THREAD_ID} = $threadId AND (${Telephony.Sms.SEEN} = 0 OR ${Telephony.Sms.READ} = 0)" - val contentResolver = context.contentResolver - contentResolver.query(Telephony.Sms.Inbox.CONTENT_URI, projection, selection, null, null) - ?.asFlowable() ?: Flowable.empty() - .subscribeOn(Schedulers.io()) - .map { cursor -> cursor.getLong(0) } - .map { id -> Uri.withAppendedPath(Telephony.Sms.CONTENT_URI, id.toString()) } - .subscribe { uri -> - val values = ContentValues() - values.put(Telephony.Sms.SEEN, true) - values.put(Telephony.Sms.READ, true) - contentResolver.update(uri, values, null, null) + Realm.getDefaultInstance()?.use { realm -> + val messages = realm.where(Message::class.java) + .equalTo("threadId", threadId) + .beginGroup() + .equalTo("read", false) + .or() + .equalTo("seen", false) + .endGroup() + .findAll() + + realm.executeTransaction { + messages.forEach { message -> + message.seen = true + message.read = true } - - - val realm = Realm.getDefaultInstance() - val messages = realm.where(Message::class.java) - .equalTo("threadId", threadId) - .beginGroup() - .equalTo("read", false) - .or() - .equalTo("seen", false) - .endGroup() - .findAll() - - realm.executeTransaction { - messages.forEach { message -> - message.seen = true - message.read = true } } - realm.close() + + val values = ContentValues() + values.put(Telephony.Sms.SEEN, true) + values.put(Telephony.Sms.READ, true) + + try { + val uri = ContentUris.withAppendedId(Telephony.MmsSms.CONTENT_CONVERSATIONS_URI, threadId) + context.contentResolver.update(uri, values, "${Telephony.Sms.READ} = 0", null) + } catch (exception: Exception) { + + } } override fun sendSmsAndPersist(threadId: Long, address: String, body: String) { diff --git a/data/src/main/java/repository/SyncRepositoryImpl.kt b/data/src/main/java/repository/SyncRepositoryImpl.kt index 15c36637..29a2ad94 100644 --- a/data/src/main/java/repository/SyncRepositoryImpl.kt +++ b/data/src/main/java/repository/SyncRepositoryImpl.kt @@ -23,6 +23,7 @@ import android.content.ContentUris import android.net.Uri import android.provider.Telephony import android.telephony.PhoneNumberUtils +import com.f2prateek.rx.preferences2.RxSharedPreferences import io.realm.Realm import mapper.CursorToContact import mapper.CursorToConversation @@ -48,7 +49,8 @@ class SyncRepositoryImpl @Inject constructor( private val cursorToConversation: CursorToConversation, private val cursorToMessage: CursorToMessage, private val cursorToRecipient: CursorToRecipient, - private val cursorToContact: CursorToContact + private val cursorToContact: CursorToContact, + private val rxPrefs: RxSharedPreferences ) : SyncRepository { sealed class Status { @@ -72,10 +74,10 @@ class SyncRepositoryImpl @Inject constructor( val realm = Realm.getDefaultInstance() realm.beginTransaction() - var persistedData: List? = null + var persistedData: List = listOf() if (fullSync) { - persistedData = realm.where(Conversation::class.java) + persistedData += realm.where(Conversation::class.java) .beginGroup() .equalTo("archived", true) .or() @@ -106,13 +108,19 @@ class SyncRepositoryImpl @Inject constructor( realm.insertOrUpdate(messages) } + // Migrate blocked conversations from 2.7.3 + val oldBlockedSenders = rxPrefs.getStringSet("pref_key_blocked_senders") + persistedData += oldBlockedSenders.get() + .map { threadIdString -> threadIdString.toLong() } + .filter { threadId -> persistedData.none { it.id == threadId } } + .map { threadId -> PersistedData(threadId, false, true) } // Sync conversations cursorToConversation.getConversationsCursor()?.use { conversationCursor -> val conversations = conversationCursor .map { cursor -> cursorToConversation.map(cursor) } - persistedData?.forEach { data -> + persistedData.forEach { data -> val conversation = conversations.firstOrNull { conversation -> conversation.id == data.id } conversation?.archived = data.archived conversation?.blocked = data.blocked @@ -131,6 +139,9 @@ class SyncRepositoryImpl @Inject constructor( realm.commitTransaction() realm.close() + // Only delete this after the sync has successfully completed + oldBlockedSenders.delete() + syncContacts() status = Status.Idle() diff --git a/data/src/main/java/util/Preferences.kt b/data/src/main/java/util/Preferences.kt index e6eabe85..4027c0f6 100644 --- a/data/src/main/java/util/Preferences.kt +++ b/data/src/main/java/util/Preferences.kt @@ -50,8 +50,8 @@ class Preferences @Inject constructor(private val rxPrefs: RxSharedPreferences) val delivery = rxPrefs.getBoolean("delivery", false) val textSize = rxPrefs.getInteger("textSize", TEXT_SIZE_NORMAL) val qkreply = rxPrefs.getBoolean("qkreply", Build.VERSION.SDK_INT < Build.VERSION_CODES.N) + val qkreplyTapDismiss = rxPrefs.getBoolean("qkreplyTapDismiss", true) val unicode = rxPrefs.getBoolean("unicode", false) - val mms = rxPrefs.getBoolean("mms", true) val mmsSize = rxPrefs.getInteger("mmsSize", 100) fun theme(threadId: Long = 0): Preference { diff --git a/data/src/main/java/util/extensions/StringExtensions.kt b/data/src/main/java/util/extensions/StringExtensions.kt new file mode 100644 index 00000000..bb1f8699 --- /dev/null +++ b/data/src/main/java/util/extensions/StringExtensions.kt @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2017 Moez Bhatti + * + * This file is part of QKSMS. + * + * QKSMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * QKSMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with QKSMS. If not, see . + */ +package util.extensions + +import java.text.Normalizer + +/** + * Strip the accents from a string + */ +fun CharSequence.removeAccents() = Normalizer.normalize(this, Normalizer.Form.NFD) + .replace(Regex("[^\\p{ASCII}]"), "") \ No newline at end of file diff --git a/domain/src/main/java/manager/AnalyticsManager.kt b/domain/src/main/java/manager/AnalyticsManager.kt index 9fd2beb7..89ed3935 100644 --- a/domain/src/main/java/manager/AnalyticsManager.kt +++ b/domain/src/main/java/manager/AnalyticsManager.kt @@ -20,7 +20,7 @@ package manager interface AnalyticsManager { - fun track(event: String) + fun track(event: String, vararg properties: Pair) fun setUserProperty(key: String, value: Any) diff --git a/domain/src/main/java/model/Message.kt b/domain/src/main/java/model/Message.kt index b3e3536a..222df3e3 100644 --- a/domain/src/main/java/model/Message.kt +++ b/domain/src/main/java/model/Message.kt @@ -133,7 +133,7 @@ open class Message : RealmObject() { * Cleanses the subject in case it's useless, so that the UI doesn't have to show it */ fun getCleansedSubject(): String { - val uselessSubjects = listOf("no subject") + val uselessSubjects = listOf("no subject", "NoSubject") return if (uselessSubjects.contains(subject)) "" else subject } diff --git a/presentation/build.gradle b/presentation/build.gradle index 7eedb0ba..6cd53a72 100644 --- a/presentation/build.gradle +++ b/presentation/build.gradle @@ -13,8 +13,8 @@ android { applicationId "com.moez.QKSMS" minSdkVersion 21 targetSdkVersion 27 - versionCode 158 - versionName "3.0.4" + versionCode 160 + versionName "3.0.6" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" buildConfigField "String", "AMPLITUDE_API_KEY", "\"${System.getenv("AMPLITUDE_API_KEY")}\"" diff --git a/presentation/src/main/java/common/QKApplication.kt b/presentation/src/main/java/common/QKApplication.kt index b4c4a230..914352c7 100644 --- a/presentation/src/main/java/common/QKApplication.kt +++ b/presentation/src/main/java/common/QKApplication.kt @@ -1,4 +1,6 @@ -package common/* +package common + +/* * Copyright (C) 2017 Moez Bhatti * * This file is part of QKSMS. @@ -23,6 +25,7 @@ import android.support.v4.provider.FontRequest import com.bugsnag.android.Bugsnag import com.moez.QKSMS.BuildConfig import com.moez.QKSMS.R +import common.util.NightModeManager import injection.AppComponentManager import injection.appComponent import io.realm.Realm @@ -39,14 +42,19 @@ class QKApplication : Application() { @Suppress("unused") @Inject lateinit var analyticsManager: AnalyticsManager + @Inject lateinit var nightModeManager: NightModeManager + override fun onCreate() { super.onCreate() Bugsnag.init(this, BuildConfig.BUGSNAG_API_KEY) + Bugsnag.setAppVersion(BuildConfig.VERSION_NAME) AppComponentManager.init(this) appComponent.inject(this) + nightModeManager.updateCurrentTheme() + Realm.init(this) Realm.setDefaultConfiguration(RealmConfiguration.Builder() .compactOnLaunch() diff --git a/presentation/src/main/java/common/base/QkActivity.kt b/presentation/src/main/java/common/base/QkActivity.kt index f0729cd5..bb618130 100644 --- a/presentation/src/main/java/common/base/QkActivity.kt +++ b/presentation/src/main/java/common/base/QkActivity.kt @@ -74,4 +74,8 @@ abstract class QkActivity> : AppCompatActivity() { return result } + protected fun showBackButton(show: Boolean) { + supportActionBar?.setDisplayHomeAsUpEnabled(show) + } + } \ No newline at end of file diff --git a/presentation/src/main/java/common/util/NotificationManagerImpl.kt b/presentation/src/main/java/common/util/NotificationManagerImpl.kt index e5d088e6..86ef4bb0 100644 --- a/presentation/src/main/java/common/util/NotificationManagerImpl.kt +++ b/presentation/src/main/java/common/util/NotificationManagerImpl.kt @@ -27,11 +27,13 @@ import android.content.Intent import android.graphics.Color import android.net.Uri import android.os.Build +import android.os.Parcel import android.support.v4.app.NotificationCompat import android.support.v4.app.NotificationManagerCompat import android.support.v4.app.RemoteInput import android.support.v4.app.TaskStackBuilder import android.telephony.PhoneNumberUtils +import android.widget.RemoteViews import com.moez.QKSMS.R import common.util.extensions.dpToPx import feature.compose.ComposeActivity @@ -95,13 +97,6 @@ class NotificationManagerImpl @Inject constructor( val conversation = messageRepo.getConversation(threadId) ?: return - // If QK Reply is enabled, use the default importance so that we don't have a notification - // card in addition to the popup. Otherwise, use max importance - val importance = when (prefs.qkreply.get()) { - true -> NotificationManagerCompat.IMPORTANCE_DEFAULT - false -> NotificationManagerCompat.IMPORTANCE_MAX - } - val style = NotificationCompat.MessagingStyle("Me") messages.forEach { message -> val name = if (message.isMe()) null else conversation.getTitle() @@ -135,7 +130,7 @@ class NotificationManagerImpl @Inject constructor( val notification = NotificationCompat.Builder(context, getChannelIdForNotification(threadId)) .setCategory(NotificationCompat.CATEGORY_MESSAGE) .setColor(colors.themeForConversation(threadId).blockingFirst()) - .setPriority(importance) + .setPriority(NotificationManagerCompat.IMPORTANCE_MAX) .setLargeIcon(avatar) .setSmallIcon(R.drawable.ic_notification) .setNumber(messages.size) @@ -156,9 +151,17 @@ class NotificationManagerImpl @Inject constructor( if (Build.VERSION.SDK_INT >= 24) { notification.addAction(getReplyAction(conversation.recipients[0]?.address.orEmpty(), threadId)) + } else { + val replyIntent = Intent(context, QkReplyActivity::class.java).putExtra("threadId", threadId) + val replyPI = PendingIntent.getActivity(context, threadId.toInt() + 40000, replyIntent, PendingIntent.FLAG_UPDATE_CURRENT) + val replyAction = NotificationCompat.Action(R.drawable.ic_reply_white_24dp, context.getString(R.string.notification_reply), replyPI) + notification.addAction(replyAction) } if (prefs.qkreply.get()) { + // Needed in order to disable the heads up notification + notification.setCustomHeadsUpContentView(RemoteViews(Parcel.obtain())) + val intent = Intent(context, QkReplyActivity::class.java) .putExtra("threadId", threadId) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) diff --git a/presentation/src/main/java/common/util/extensions/ContextExtensions.kt b/presentation/src/main/java/common/util/extensions/ContextExtensions.kt index 85cb4db4..0f042ef3 100644 --- a/presentation/src/main/java/common/util/extensions/ContextExtensions.kt +++ b/presentation/src/main/java/common/util/extensions/ContextExtensions.kt @@ -18,9 +18,11 @@ */ package common.util.extensions +import android.app.Activity import android.content.Context import android.support.annotation.StringRes import android.support.v4.content.ContextCompat +import android.view.inputmethod.InputMethodManager import android.widget.Toast fun Context.getColorCompat(colorRes: Int): Int { @@ -33,4 +35,13 @@ fun Context.makeToast(@StringRes res: Int, duration: Int = Toast.LENGTH_SHORT) { fun Context.makeToast(text: String, duration: Int = Toast.LENGTH_SHORT) { Toast.makeText(this, text, duration).show() +} + +fun Activity.dismissKeyboard() { + window.currentFocus?.let { focus -> + val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager + imm.hideSoftInputFromWindow(focus.windowToken, 0) + + focus.clearFocus() + } } \ No newline at end of file diff --git a/presentation/src/main/java/common/util/extensions/ViewExtensions.kt b/presentation/src/main/java/common/util/extensions/ViewExtensions.kt index 13ade72b..e0fe0507 100644 --- a/presentation/src/main/java/common/util/extensions/ViewExtensions.kt +++ b/presentation/src/main/java/common/util/extensions/ViewExtensions.kt @@ -20,13 +20,12 @@ package common.util.extensions import android.content.Context import android.content.res.ColorStateList -import android.support.v4.view.ViewPager +import android.graphics.PorterDuff +import android.os.Build import android.view.View -import android.view.ViewGroup import android.view.inputmethod.InputMethodManager import android.widget.EditText import android.widget.ImageView -import io.reactivex.Observable fun EditText.showKeyboard() { requestFocus() @@ -39,21 +38,15 @@ fun ImageView.setTint(color: Int) { } fun View.setBackgroundTint(color: Int) { + + // API 21 doesn't support this + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP_MR1) { + background?.setColorFilter(color, PorterDuff.Mode.SRC_ATOP) + } + backgroundTintList = ColorStateList.valueOf(color) } -fun View.setMargins(left: Int? = null, top: Int? = null, right: Int? = null, bottom: Int? = null) { - val lp = layoutParams as? ViewGroup.MarginLayoutParams ?: return - - lp.setMargins( - left ?: lp.leftMargin, - top ?: lp.topMargin, - right ?: lp.rightMargin, - bottom ?: lp.rightMargin) - - layoutParams = lp -} - fun View.setPadding(left: Int? = null, top: Int? = null, right: Int? = null, bottom: Int? = null) { setPadding(left ?: paddingLeft, top ?: paddingTop, right ?: paddingRight, bottom ?: paddingBottom) } @@ -62,15 +55,3 @@ fun View.setVisible(visible: Boolean, invisible: Int = View.GONE) { visibility = if (visible) View.VISIBLE else invisible } -data class PageScroll(val position: Int, val offset: Float) - -fun ViewPager.pageScrolled(): Observable { - return Observable.create { emitter -> - addOnPageChangeListener(object : ViewPager.SimpleOnPageChangeListener() { - override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) { - super.onPageScrolled(position, positionOffset, positionOffsetPixels) - emitter.onNext(PageScroll(position, positionOffset)) - } - }) - } -} \ No newline at end of file diff --git a/presentation/src/main/java/common/util/filter/ContactFilter.kt b/presentation/src/main/java/common/util/filter/ContactFilter.kt index 122311c4..f108ad6e 100644 --- a/presentation/src/main/java/common/util/filter/ContactFilter.kt +++ b/presentation/src/main/java/common/util/filter/ContactFilter.kt @@ -19,12 +19,13 @@ package common.util.filter import model.Contact +import util.extensions.removeAccents import javax.inject.Inject class ContactFilter @Inject constructor(private val phoneNumberFilter: PhoneNumberFilter) : Filter() { override fun filter(item: Contact, query: CharSequence): Boolean { - return item.name.contains(query, true) || // Name + return item.name.removeAccents().contains(query, true) || // Name item.numbers.map { it.address }.any { address -> phoneNumberFilter.filter(address, query) } // Number } diff --git a/presentation/src/main/java/common/widget/AvatarView.kt b/presentation/src/main/java/common/widget/AvatarView.kt index b3753cb9..f400a389 100644 --- a/presentation/src/main/java/common/widget/AvatarView.kt +++ b/presentation/src/main/java/common/widget/AvatarView.kt @@ -32,6 +32,7 @@ import com.uber.autodispose.kotlin.autoDisposable import common.Navigator import common.util.Colors import common.util.GlideApp +import common.util.extensions.setBackgroundTint import common.util.extensions.setTint import injection.appComponent import kotlinx.android.synthetic.main.avatar_view.view.* @@ -90,15 +91,12 @@ class AvatarView @JvmOverloads constructor(context: Context, attrs: AttributeSet if (!isInEditMode) { colors.themeForConversation(threadId) .autoDisposable(scope()) - .subscribe { color -> background.setTint(color) } + .subscribe { color -> setBackgroundTint(color) } - colors.textPrimaryOnThemeForConversation(threadId).let { observable -> - initial.textColorObservable = observable - - observable - .autoDisposable(scope()) - .subscribe { color -> icon.setTint(color) } - } + colors.textPrimaryOnThemeForConversation(threadId) + .apply { initial.textColorObservable = this } + .autoDisposable(scope()) + .subscribe { color -> icon.setTint(color) } clicks() .autoDisposable(scope()) diff --git a/presentation/src/main/java/feature/blocked/BlockedActivity.kt b/presentation/src/main/java/feature/blocked/BlockedActivity.kt index 5619b8b9..5f009aae 100644 --- a/presentation/src/main/java/feature/blocked/BlockedActivity.kt +++ b/presentation/src/main/java/feature/blocked/BlockedActivity.kt @@ -49,7 +49,7 @@ class BlockedActivity : QkThemedActivity(), BlockedView { super.onCreate(savedInstanceState) setContentView(R.layout.blocked_activity) setTitle(R.string.blocked_title) - supportActionBar?.setDisplayHomeAsUpEnabled(true) + showBackButton(true) viewModel.bindView(this) colors.background diff --git a/presentation/src/main/java/feature/compose/ComposeActivity.kt b/presentation/src/main/java/feature/compose/ComposeActivity.kt index b1a04d20..644229e5 100644 --- a/presentation/src/main/java/feature/compose/ComposeActivity.kt +++ b/presentation/src/main/java/feature/compose/ComposeActivity.kt @@ -24,6 +24,7 @@ import android.graphics.PorterDuff import android.net.Uri import android.os.Bundle import android.support.v7.widget.LinearLayoutManager +import android.support.v7.widget.RecyclerView import android.view.KeyEvent import android.view.Menu import android.view.MenuItem @@ -33,8 +34,10 @@ import com.jakewharton.rxbinding2.widget.textChanges import com.moez.QKSMS.R import com.uber.autodispose.android.lifecycle.scope import com.uber.autodispose.kotlin.autoDisposable +import common.MenuItemAdapter import common.base.QkThemedActivity import common.util.extensions.autoScrollToStart +import common.util.extensions.dpToPx import common.util.extensions.setBackgroundTint import common.util.extensions.setTint import common.util.extensions.setVisible @@ -61,10 +64,9 @@ class ComposeActivity : QkThemedActivity(), ComposeView { override val menuReadyIntent: Observable = menu.map { Unit } override val callIntent: Subject = PublishSubject.create() override val infoIntent: Subject = PublishSubject.create() - override val copyTextIntent: Subject = PublishSubject.create() - override val forwardMessageIntent: Subject = PublishSubject.create() - override val deleteMessageIntent: Subject = PublishSubject.create() override val messageClickIntent: Subject by lazy { messageAdapter.clicks } + override val messageLongClickIntent: Subject by lazy { messageAdapter.longClicks } + override val menuItemIntent: Subject by lazy { menuItemAdapter.menuItemClicks } override val attachmentDeletedIntent: Subject by lazy { attachmentAdapter.attachmentDeleted } override val textChangedIntent by lazy { message.textChanges() } override val attachIntent by lazy { attach.clicks() } @@ -73,6 +75,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView { @Inject lateinit var chipsAdapter: ChipsAdapter @Inject lateinit var contactsAdapter: ContactAdapter @Inject lateinit var messageAdapter: MessagesAdapter + @Inject lateinit var menuItemAdapter: MenuItemAdapter @Inject lateinit var attachmentAdapter: AttachmentAdapter init { @@ -82,7 +85,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.compose_activity) - supportActionBar?.setDisplayHomeAsUpEnabled(true) + showBackButton(true) viewModel.bindView(this) chipsAdapter.view = chips @@ -94,17 +97,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView { val layoutManager = LinearLayoutManager(this).apply { stackFromEnd = true } messageAdapter.autoScrollToStart(messageList) - messageAdapter.longClicks.subscribe { message -> - AlertDialog.Builder(this) - .setItems(R.array.message_options, { _, row -> - when (row) { - 0 -> copyTextIntent.onNext(message) - 1 -> forwardMessageIntent.onNext(message) - 2 -> deleteMessageIntent.onNext(message) - } - }) - .show() - } + messageAdapter.emptyView = messagesEmpty messageList.setHasFixedSize(true) messageList.layoutManager = layoutManager @@ -211,6 +204,23 @@ class ComposeActivity : QkThemedActivity(), ComposeView { message.setText(draft) } + override fun showMenu(menuItems: List) { + val recyclerView = RecyclerView(this) + recyclerView.layoutManager = LinearLayoutManager(this) + recyclerView.adapter = menuItemAdapter + recyclerView.setPadding(0, 8.dpToPx(this), 0, 8.dpToPx(this)) + + val dialog = AlertDialog.Builder(this) + .setView(recyclerView) + .create() + .apply { show() } + + menuItemAdapter.data = menuItems + menuItemAdapter.menuItemClicks + .autoDisposable(scope()) + .subscribe { dialog.dismiss() } + } + override fun onCreateOptionsMenu(menu: Menu?): Boolean { menuInflater.inflate(R.menu.compose, menu) return super.onCreateOptionsMenu(menu) diff --git a/presentation/src/main/java/feature/compose/ComposeView.kt b/presentation/src/main/java/feature/compose/ComposeView.kt index 069ede65..5e2f9beb 100644 --- a/presentation/src/main/java/feature/compose/ComposeView.kt +++ b/presentation/src/main/java/feature/compose/ComposeView.kt @@ -20,11 +20,12 @@ package feature.compose import android.net.Uri import android.view.KeyEvent +import common.MenuItem +import common.base.QkView import io.reactivex.Observable import io.reactivex.subjects.Subject import model.Contact import model.Message -import common.base.QkView interface ComposeView : QkView { @@ -37,15 +38,15 @@ interface ComposeView : QkView { val menuReadyIntent: Observable val callIntent: Subject val infoIntent: Subject - val copyTextIntent: Subject - val forwardMessageIntent: Subject - val deleteMessageIntent: Subject val messageClickIntent: Subject + val messageLongClickIntent: Subject + val menuItemIntent: Subject val attachmentDeletedIntent: Subject val textChangedIntent: Observable val attachIntent: Observable val sendIntent: Observable + fun showMenu(menuItems: List) fun setDraft(draft: String) } \ No newline at end of file diff --git a/presentation/src/main/java/feature/compose/ComposeViewModel.kt b/presentation/src/main/java/feature/compose/ComposeViewModel.kt index a8502fe2..43ca5f0d 100644 --- a/presentation/src/main/java/feature/compose/ComposeViewModel.kt +++ b/presentation/src/main/java/feature/compose/ComposeViewModel.kt @@ -31,6 +31,7 @@ import com.mlsdev.rximagepicker.Sources import com.moez.QKSMS.R import com.uber.autodispose.android.lifecycle.scope import com.uber.autodispose.kotlin.autoDisposable +import common.MenuItem import common.Navigator import common.base.QkViewModel import common.util.ClipboardUtils @@ -60,6 +61,8 @@ import repository.ContactRepository import repository.MessageRepository import util.extensions.asObservable import util.extensions.isImage +import util.extensions.mapNotNull +import util.extensions.removeAccents import java.net.URLDecoder import java.util.* import java.util.concurrent.TimeUnit @@ -86,6 +89,10 @@ class ComposeViewModel(intent: Intent) : QkViewModel( private val conversation: Observable private val messages: Observable> + private val menuCopy by lazy { MenuItem(context.getString(R.string.compose_menu_copy), 0) } + private val menuForward by lazy { MenuItem(context.getString(R.string.compose_menu_forward), 1) } + private val menuDelete by lazy { MenuItem(context.getString(R.string.compose_menu_delete), 2) } + init { appComponent.inject(this) @@ -205,9 +212,14 @@ class ComposeViewModel(intent: Intent) : QkViewModel( // that have already been selected Observables .combineLatest(view.queryChangedIntent, contacts, selectedContacts, { query, contacts, selectedContacts -> + + // Strip the accents from the query. This can be an expensive operation, so + // cache the result instead of doing it for each contact + val normalizedQuery = query.removeAccents() + var filteredContacts = contacts .filterNot { contact -> selectedContacts.contains(contact) } - .filter { contact -> contactFilter.filter(contact, query) } + .filter { contact -> contactFilter.filter(contact, normalizedQuery) } // If the entry is a valid destination, allow it as a recipient if (PhoneNumberUtils.isWellFormedSmsAddress(query.toString())) { @@ -289,20 +301,58 @@ class ComposeViewModel(intent: Intent) : QkViewModel( .autoDisposable(view.scope()) .subscribe { conversation -> navigator.showConversationInfo(conversation.id) } + // Retry sending view.messageClickIntent .filter { message -> message.isFailedMessage() } .doOnNext { message -> retrySending.execute(message) } .autoDisposable(view.scope()) .subscribe() - // Mark the conversation read, if in foreground - Observables.combineLatest(messages, view.activityVisibleIntent, { _, visible -> visible }) - .withLatestFrom(conversation, { visible, conversation -> - if (visible && conversation.isValid) markRead.execute(conversation.id) + // Show menu + view.messageLongClickIntent + .autoDisposable(view.scope()) + .subscribe { view.showMenu(listOf(menuCopy, menuForward, menuDelete)) } + + // Handle long-press menu item click + view.menuItemIntent + .withLatestFrom(view.messageLongClickIntent, { actionId, message -> + when (actionId) { + menuCopy.actionId -> { + ClipboardUtils.copy(context, message.getText()) + context.makeToast(R.string.toast_copied) + } + + menuForward.actionId -> { + val images = message.parts.filter { it.isImage() }.mapNotNull { it.image?.toUri() } + navigator.showCompose(message.body, images) + } + + menuDelete.actionId -> deleteMessage.execute(message.id) + } }) .autoDisposable(view.scope()) .subscribe() + // Save draft when the activity goes into the background + view.activityVisibleIntent + .filter { visible -> !visible } + .withLatestFrom(conversation, { _, conversation -> conversation.id }) + .observeOn(Schedulers.io()) + .withLatestFrom(view.textChangedIntent, { threadId, draft -> + messageRepo.saveDraft(threadId, draft.toString()) + }) + .autoDisposable(view.scope()) + .subscribe() + + // Mark the conversation read, if in foreground + Observables.combineLatest(messages, view.activityVisibleIntent, { _, visible -> visible }) + .filter { visible -> visible } + .withLatestFrom(conversation, { _, conversation -> conversation }) + .mapNotNull { conversation -> conversation.takeIf { it.isValid }?.id } + .debounce(200, TimeUnit.MILLISECONDS) + .autoDisposable(view.scope()) + .subscribe { threadId -> markRead.execute(threadId) } + // Attach a photo view.attachIntent .flatMap { RxImagePicker.with(context).requestImage(Sources.GALLERY) } @@ -360,17 +410,6 @@ class ComposeViewModel(intent: Intent) : QkViewModel( .autoDisposable(view.scope()) .subscribe { remaining -> newState { it.copy(remaining = remaining) } } - // Update the draft whenever the text is changed - view.textChangedIntent - .debounce(100, TimeUnit.MILLISECONDS) - .map { draft -> draft.toString() } - .observeOn(Schedulers.io()) - .withLatestFrom(conversation.map { it.id }, { draft, threadId -> - messageRepo.saveDraft(threadId, draft) - }) - .autoDisposable(view.scope()) - .subscribe() - // Send a message when the send button is clicked, and disable editing mode if it's enabled view.sendIntent .withLatestFrom(view.textChangedIntent, { _, body -> body }) @@ -389,27 +428,6 @@ class ComposeViewModel(intent: Intent) : QkViewModel( }) .autoDisposable(view.scope()) .subscribe() - - // Copy the body of the selected message into the clipboard - view.copyTextIntent - .autoDisposable(view.scope()) - .subscribe { message -> - ClipboardUtils.copy(context, message.getText()) - context.makeToast(R.string.toast_copied) - } - - // Forward the message - view.forwardMessageIntent - .autoDisposable(view.scope()) - .subscribe { message -> - val images = message.parts.filter { it.isImage() }.mapNotNull { it.image?.toUri() } - navigator.showCompose(message.body, images) - } - - // Delete the selected message - view.deleteMessageIntent - .autoDisposable(view.scope()) - .subscribe { message -> deleteMessage.execute(message.id) } } } \ No newline at end of file diff --git a/presentation/src/main/java/feature/compose/MessagesAdapter.kt b/presentation/src/main/java/feature/compose/MessagesAdapter.kt index 0e1a8bf3..61c16507 100644 --- a/presentation/src/main/java/feature/compose/MessagesAdapter.kt +++ b/presentation/src/main/java/feature/compose/MessagesAdapter.kt @@ -19,6 +19,7 @@ package feature.compose import android.content.Context +import android.os.Build import android.support.v7.widget.RecyclerView import android.telephony.PhoneNumberUtils import android.view.LayoutInflater @@ -26,6 +27,7 @@ import android.view.View import android.view.ViewGroup import com.jakewharton.rxbinding2.view.RxView import com.moez.QKSMS.R +import common.base.QkRealmAdapter import common.base.QkViewHolder import common.util.Colors import common.util.DateFormatter @@ -37,7 +39,6 @@ import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import io.reactivex.subjects.PublishSubject import io.reactivex.subjects.Subject -import io.realm.RealmRecyclerViewAdapter import io.realm.RealmResults import kotlinx.android.synthetic.main.message_list_item_in.view.* import model.Conversation @@ -51,7 +52,7 @@ class MessagesAdapter @Inject constructor( private val context: Context, private val colors: Colors, private val dateFormatter: DateFormatter -) : RealmRecyclerViewAdapter(null, true) { +) : QkRealmAdapter() { companion object { private const val VIEW_TYPE_MESSAGE_IN = 0 @@ -224,6 +225,14 @@ class MessagesAdapter @Inject constructor( // setClipToOutline doesn't work unless all of the corners have the same radius, so we have // to use the message_only bubble if (hasImages) view.messageBackground.setBackgroundResource(R.drawable.message_only) + + // If we're on API 21, we need to re-tint the background + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP_MR1) { + view.messageBackground.setBackgroundTint(when (message.isMe()) { + true -> colors.bubble + false -> theme + }.blockingFirst()) + } } private fun canGroup(message: Message, other: Message?): Boolean { diff --git a/presentation/src/main/java/feature/conversationinfo/ConversationInfoActivity.kt b/presentation/src/main/java/feature/conversationinfo/ConversationInfoActivity.kt index 6e021de9..adaac21f 100644 --- a/presentation/src/main/java/feature/conversationinfo/ConversationInfoActivity.kt +++ b/presentation/src/main/java/feature/conversationinfo/ConversationInfoActivity.kt @@ -54,7 +54,7 @@ class ConversationInfoActivity : QkThemedActivity(), override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.conversation_info_activity) - supportActionBar?.setDisplayHomeAsUpEnabled(true) + showBackButton(true) viewModel.bindView(this) setTitle(R.string.info_title) diff --git a/presentation/src/main/java/feature/conversations/ConversationsAdapter.kt b/presentation/src/main/java/feature/conversations/ConversationsAdapter.kt index 78a60758..f9419e22 100644 --- a/presentation/src/main/java/feature/conversations/ConversationsAdapter.kt +++ b/presentation/src/main/java/feature/conversations/ConversationsAdapter.kt @@ -76,7 +76,10 @@ class ConversationsAdapter @Inject constructor( view.avatars.contacts = conversation.recipients view.title.text = conversation.getTitle() view.date.text = dateFormatter.getConversationTimestamp(conversation.date) - view.snippet.text = if (conversation.me) "You: ${conversation.snippet}" else conversation.snippet + view.snippet.text = when(conversation.me) { + true -> context.getString(R.string.main_sender_you, conversation.snippet) + false -> conversation.snippet + } } override fun getItemId(index: Int): Long { diff --git a/presentation/src/main/java/feature/gallery/GalleryActivity.kt b/presentation/src/main/java/feature/gallery/GalleryActivity.kt index 43fe972f..2dd7755e 100644 --- a/presentation/src/main/java/feature/gallery/GalleryActivity.kt +++ b/presentation/src/main/java/feature/gallery/GalleryActivity.kt @@ -44,7 +44,7 @@ class GalleryActivity : QkActivity(), GalleryView { super.onCreate(savedInstanceState) setContentView(R.layout.gallery_activity) postponeEnterTransition() - supportActionBar?.setDisplayHomeAsUpEnabled(true) + showBackButton(true) viewModel.bindView(this) val transition = TransitionSet().apply { diff --git a/presentation/src/main/java/feature/main/MainActivity.kt b/presentation/src/main/java/feature/main/MainActivity.kt index 9919445b..3fd91cd2 100644 --- a/presentation/src/main/java/feature/main/MainActivity.kt +++ b/presentation/src/main/java/feature/main/MainActivity.kt @@ -41,6 +41,7 @@ import common.MenuItemAdapter import common.Navigator import common.base.QkThemedActivity import common.util.extensions.autoScrollToStart +import common.util.extensions.dismissKeyboard import common.util.extensions.dpToPx import common.util.extensions.setBackgroundTint import common.util.extensions.setTint @@ -68,7 +69,11 @@ class MainActivity : QkThemedActivity(), MainView { override val queryChangedIntent by lazy { toolbarSearch.textChanges() } override val queryCancelledIntent: PublishSubject = PublishSubject.create() override val composeIntent by lazy { compose.clicks() } - override val drawerOpenIntent by lazy { drawerLayout.drawerOpen(Gravity.START) } + override val drawerOpenIntent: Observable by lazy { + drawerLayout + .drawerOpen(Gravity.START) + .doOnNext { dismissKeyboard() } + } override val drawerItemIntent: Observable by lazy { Observable.merge(listOf( inbox.clicks().map { DrawerItem.INBOX }, @@ -142,7 +147,7 @@ class MainActivity : QkThemedActivity(), MainView { // Set the FAB compose icon color colors.textPrimaryOnTheme .doOnNext { color -> compose.setTint(color) } - .doOnNext { color -> itemTouchCallback.iconColor = color} + .doOnNext { color -> itemTouchCallback.iconColor = color } .autoDisposable(scope()) .subscribe() @@ -195,7 +200,10 @@ class MainActivity : QkThemedActivity(), MainView { conversationsAdapter.flowable = state.page.data itemTouchHelper.attachToRecyclerView(recyclerView) menuItemAdapter.data = state.page.menu - empty.setText(R.string.inbox_empty_text) + empty.setText(when (state.page.showClearButton) { + true -> R.string.inbox_search_empty_text + false -> R.string.inbox_empty_text + }) compose.setVisible(true) } @@ -250,6 +258,7 @@ class MainActivity : QkThemedActivity(), MainView { } override fun clearSearch() { + dismissKeyboard() toolbarSearch.text = null } diff --git a/presentation/src/main/java/feature/main/MainViewModel.kt b/presentation/src/main/java/feature/main/MainViewModel.kt index 66dd477e..043d9db1 100644 --- a/presentation/src/main/java/feature/main/MainViewModel.kt +++ b/presentation/src/main/java/feature/main/MainViewModel.kt @@ -34,6 +34,7 @@ import injection.appComponent import interactor.DeleteConversation import interactor.MarkAllSeen import interactor.MarkArchived +import interactor.MarkBlocked import interactor.MarkUnarchived import interactor.MigratePreferences import interactor.PartialSync @@ -44,6 +45,7 @@ import io.realm.Realm import model.SyncLog import repository.MessageRepository import util.Preferences +import util.extensions.removeAccents import java.util.concurrent.TimeUnit import javax.inject.Inject @@ -57,17 +59,24 @@ class MainViewModel : QkViewModel(MainState()) { @Inject lateinit var deleteConversation: DeleteConversation @Inject lateinit var markArchived: MarkArchived @Inject lateinit var markUnarchived: MarkUnarchived + @Inject lateinit var markBlocked: MarkBlocked @Inject lateinit var migratePreferences: MigratePreferences @Inject lateinit var partialSync: PartialSync @Inject lateinit var prefs: Preferences - private val menuArchive by lazy { MenuItem(context.getString(R.string.menu_archive), 0) } - private val menuUnarchive by lazy { MenuItem(context.getString(R.string.menu_unarchive), 1) } - private val menuDelete by lazy { MenuItem(context.getString(R.string.menu_delete), 2) } + private val menuArchive by lazy { MenuItem(context.getString(R.string.inbox_menu_archive), 0) } + private val menuUnarchive by lazy { MenuItem(context.getString(R.string.inbox_menu_unarchive), 1) } + private val menuBlock by lazy { MenuItem(context.getString(R.string.inbox_menu_block), 2) } + private val menuDelete by lazy { MenuItem(context.getString(R.string.inbox_menu_delete), 3) } + + private val conversations by lazy { messageRepo.getConversations() } init { appComponent.inject(this) + // Now the conversations can be loaded + conversations + disposables += deleteConversation disposables += markAllSeen disposables += markArchived @@ -86,8 +95,6 @@ class MainViewModel : QkViewModel(MainState()) { .distinctUntilChanged() .subscribe { syncing -> newState { it.copy(syncing = syncing) } } - newState { it.copy(page = Inbox(data = messageRepo.getConversations())) } - // Migrate the preferences from 2.7.3 if necessary migratePreferences.execute(Unit) @@ -110,14 +117,15 @@ class MainViewModel : QkViewModel(MainState()) { super.bindView(view) view.queryChangedIntent - .skip(1) .debounce(200, TimeUnit.MILLISECONDS) + .map { query -> query.removeAccents() } .withLatestFrom(state, { query, state -> if (state.page is Inbox) { - val conversations = state.page.data - ?.map { conversations -> conversations.filter { conversationFilter.filter(it, query) } } + val filteredConversations = if (query.isEmpty()) conversations + else conversations + .map { conversations -> conversations.filter { conversationFilter.filter(it, query) } } - val page = state.page.copy(showClearButton = query.isNotEmpty(), data = conversations) + val page = state.page.copy(showClearButton = query.isNotEmpty(), data = filteredConversations) newState { it.copy(page = page) } } }) @@ -144,7 +152,7 @@ class MainViewModel : QkViewModel(MainState()) { .distinctUntilChanged() .doOnNext { when (it) { - DrawerItem.INBOX -> newState { it.copy(page = Inbox(data = messageRepo.getConversations())) } + DrawerItem.INBOX -> newState { it.copy(page = Inbox()) } DrawerItem.ARCHIVED -> newState { it.copy(page = Archived(messageRepo.getConversations(true))) } DrawerItem.SCHEDULED -> newState { it.copy(page = Scheduled()) } else -> { @@ -164,11 +172,11 @@ class MainViewModel : QkViewModel(MainState()) { .withLatestFrom(state, { _, mainState -> when (mainState.page) { is Inbox -> { - val page = mainState.page.copy(menu = listOf(menuArchive, menuDelete)) + val page = mainState.page.copy(menu = listOf(menuArchive, menuBlock, menuDelete)) newState { it.copy(page = page) } } is Archived -> { - val page = mainState.page.copy(menu = listOf(menuUnarchive, menuDelete)) + val page = mainState.page.copy(menu = listOf(menuUnarchive, menuBlock, menuDelete)) newState { it.copy(page = page) } } } @@ -194,6 +202,7 @@ class MainViewModel : QkViewModel(MainState()) { when (actionId) { menuArchive.actionId -> markArchived.execute(threadId) menuUnarchive.actionId -> markUnarchived.execute(threadId) + menuBlock.actionId -> markBlocked.execute(threadId) menuDelete.actionId -> view.showDeleteDialog() } }) diff --git a/presentation/src/main/java/feature/notificationprefs/NotificationPrefsActivity.kt b/presentation/src/main/java/feature/notificationprefs/NotificationPrefsActivity.kt index 2b545ff8..78ef8c72 100644 --- a/presentation/src/main/java/feature/notificationprefs/NotificationPrefsActivity.kt +++ b/presentation/src/main/java/feature/notificationprefs/NotificationPrefsActivity.kt @@ -27,14 +27,14 @@ import com.jakewharton.rxbinding2.view.clicks import com.moez.QKSMS.R import com.uber.autodispose.android.lifecycle.scope import com.uber.autodispose.kotlin.autoDisposable +import common.MenuItemAdapter +import common.base.QkThemedActivity +import common.widget.PreferenceView import injection.appComponent import io.reactivex.subjects.PublishSubject import io.reactivex.subjects.Subject import kotlinx.android.synthetic.main.notification_prefs_activity.* import kotlinx.android.synthetic.main.settings_switch_widget.view.* -import common.MenuItemAdapter -import common.base.QkThemedActivity -import common.widget.PreferenceView import javax.inject.Inject class NotificationPrefsActivity : QkThemedActivity(), NotificationPrefsView { @@ -54,7 +54,7 @@ class NotificationPrefsActivity : QkThemedActivity() super.onCreate(savedInstanceState) setContentView(R.layout.notification_prefs_activity) setTitle(R.string.title_notification_prefs) - supportActionBar?.setDisplayHomeAsUpEnabled(true) + showBackButton(true) viewModel.bindView(this) nightModeAdapter.setData(R.array.night_modes) diff --git a/presentation/src/main/java/feature/plus/PlusActivity.kt b/presentation/src/main/java/feature/plus/PlusActivity.kt index a711d951..4bfff87b 100644 --- a/presentation/src/main/java/feature/plus/PlusActivity.kt +++ b/presentation/src/main/java/feature/plus/PlusActivity.kt @@ -24,14 +24,14 @@ import com.jakewharton.rxbinding2.view.clicks import com.moez.QKSMS.R import com.uber.autodispose.android.lifecycle.scope import com.uber.autodispose.kotlin.autoDisposable -import injection.appComponent +import common.base.QkThemedActivity import common.util.BillingManager import common.util.FontProvider import common.util.extensions.setBackgroundTint import common.util.extensions.setTint import common.util.extensions.setVisible +import injection.appComponent import kotlinx.android.synthetic.main.qksms_plus_activity.* -import common.base.QkThemedActivity import javax.inject.Inject class PlusActivity : QkThemedActivity(), PlusView { @@ -42,16 +42,21 @@ class PlusActivity : QkThemedActivity(), PlusView { override val upgradeIntent by lazy { upgrade.clicks() } override val upgradeDonateIntent by lazy { upgradeDonate.clicks() } - override fun onCreate(savedInstanceState: Bundle?) { + init { appComponent.inject(this) + } + + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.qksms_plus_activity) setTitle(R.string.title_qksms_plus) - supportActionBar?.setDisplayHomeAsUpEnabled(true) + showBackButton(true) viewModel.bindView(this) - fontProvider.getLato { - val typeface = Typeface.create(it, Typeface.BOLD) + free.setVisible(false) + + fontProvider.getLato { lato -> + val typeface = Typeface.create(lato, Typeface.BOLD) collapsingToolbar.setCollapsedTitleTypeface(typeface) collapsingToolbar.setExpandedTitleTypeface(typeface) } @@ -71,7 +76,7 @@ class PlusActivity : QkThemedActivity(), PlusView { .autoDisposable(scope()) .subscribe { color -> upgradeDonate.setBackgroundTint(color) - thanks.setBackgroundTint(color) + upgraded.setBackgroundTint(color) } colors.theme @@ -87,9 +92,8 @@ class PlusActivity : QkThemedActivity(), PlusView { upgrade.text = getString(R.string.qksms_plus_upgrade, state.upgradePrice, state.currency) upgradeDonate.text = getString(R.string.qksms_plus_upgrade_donate, state.upgradeDonatePrice, state.currency) - upgrade.setVisible(state.currentPlan == BillingManager.UpgradeStatus.REGULAR) - upgradeDonate.setVisible(state.currentPlan == BillingManager.UpgradeStatus.REGULAR) - thanks.setVisible(state.currentPlan != BillingManager.UpgradeStatus.REGULAR) + toUpgrade.setVisible(state.currentPlan == BillingManager.UpgradeStatus.REGULAR) + upgraded.setVisible(state.currentPlan == BillingManager.UpgradeStatus.UPGRADED) } override fun initiatePurchaseFlow(billingManager: BillingManager, sku: String) { diff --git a/presentation/src/main/java/feature/plus/PlusViewModel.kt b/presentation/src/main/java/feature/plus/PlusViewModel.kt index c6a11e8b..77979df2 100644 --- a/presentation/src/main/java/feature/plus/PlusViewModel.kt +++ b/presentation/src/main/java/feature/plus/PlusViewModel.kt @@ -20,15 +20,17 @@ package feature.plus import com.uber.autodispose.android.lifecycle.scope import com.uber.autodispose.kotlin.autoDisposable -import injection.appComponent +import common.base.QkViewModel import common.util.BillingManager +import injection.appComponent import io.reactivex.Observable import io.reactivex.rxkotlin.plusAssign -import common.base.QkViewModel +import manager.AnalyticsManager import javax.inject.Inject class PlusViewModel : QkViewModel(PlusState()) { + @Inject lateinit var analyticsManager: AnalyticsManager @Inject lateinit var billingManager: BillingManager init { @@ -56,6 +58,7 @@ class PlusViewModel : QkViewModel(PlusState()) { Observable.merge( view.upgradeIntent.map { BillingManager.SKU_PLUS }, view.upgradeDonateIntent.map { BillingManager.SKU_PLUS_DONATE }) + .doOnNext { sku -> analyticsManager.track("Clicked Upgrade", Pair("sku", sku)) } .autoDisposable(view.scope()) .subscribe { sku -> view.initiatePurchaseFlow(billingManager, sku) } } diff --git a/presentation/src/main/java/feature/qkreply/QkReplyActivity.kt b/presentation/src/main/java/feature/qkreply/QkReplyActivity.kt index 2f659e6c..cb2d1409 100644 --- a/presentation/src/main/java/feature/qkreply/QkReplyActivity.kt +++ b/presentation/src/main/java/feature/qkreply/QkReplyActivity.kt @@ -41,6 +41,7 @@ import io.reactivex.rxkotlin.Observables import io.reactivex.subjects.PublishSubject import io.reactivex.subjects.Subject import kotlinx.android.synthetic.main.qkreply_activity.* +import util.Preferences import javax.inject.Inject class QkReplyActivity : QkThemedActivity(), QkReplyView { @@ -51,6 +52,7 @@ class QkReplyActivity : QkThemedActivity(), QkReplyView { override val sendIntent by lazy { send.clicks() } @Inject lateinit var adapter: MessagesAdapter + @Inject lateinit var prefs: Preferences init { appComponent.inject(this) @@ -60,15 +62,18 @@ class QkReplyActivity : QkThemedActivity(), QkReplyView { supportRequestWindowFeature(Window.FEATURE_NO_TITLE) super.onCreate(savedInstanceState) - setFinishOnTouchOutside(true) + setFinishOnTouchOutside(prefs.qkreplyTapDismiss.get()) setContentView(R.layout.qkreply_activity) window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) viewModel.bindView(this) colors.composeBackground + .doOnNext { color -> background.setBackgroundTint(color) } + .doOnNext { color -> composeBackground.setBackgroundTint(color) } + .doOnNext { color -> composeBackgroundGradient.setBackgroundTint(color) } .autoDisposable(scope()) - .subscribe { color -> background.setBackgroundTint(color) } + .subscribe() colors.bubble .autoDisposable(scope()) diff --git a/presentation/src/main/java/feature/settings/SettingsActivity.kt b/presentation/src/main/java/feature/settings/SettingsActivity.kt index 739ed26c..4c19eeb1 100644 --- a/presentation/src/main/java/feature/settings/SettingsActivity.kt +++ b/presentation/src/main/java/feature/settings/SettingsActivity.kt @@ -26,12 +26,14 @@ import android.support.design.widget.Snackbar import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.RecyclerView import com.jakewharton.rxbinding2.view.clicks +import com.moez.QKSMS.BuildConfig import com.moez.QKSMS.R import com.uber.autodispose.android.lifecycle.scope import com.uber.autodispose.kotlin.autoDisposable import common.MenuItemAdapter import common.base.QkThemedActivity import common.util.extensions.dpToPx +import common.util.extensions.setBackgroundTint import common.util.extensions.setVisible import common.widget.PreferenceView import injection.appComponent @@ -39,6 +41,7 @@ import io.reactivex.subjects.PublishSubject import io.reactivex.subjects.Subject import kotlinx.android.synthetic.main.settings_activity.* import kotlinx.android.synthetic.main.settings_switch_widget.view.* +import kotlinx.android.synthetic.main.settings_theme_widget.* import util.Preferences import javax.inject.Inject @@ -70,18 +73,23 @@ class SettingsActivity : QkThemedActivity(), SettingsView { private var textSizeDialog: AlertDialog? = null private var mmsSizeDialog: AlertDialog? = null - override fun onCreate(savedInstanceState: Bundle?) { + init { appComponent.inject(this) + } + + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.settings_activity) setTitle(R.string.title_settings) - supportActionBar?.setDisplayHomeAsUpEnabled(true) + showBackButton(true) viewModel.bindView(this) nightModeAdapter.setData(R.array.night_modes) textSizeAdapter.setData(R.array.text_sizes) mmsSizeAdapter.setData(R.array.mms_sizes, R.array.mms_sizes_ids) + version.text = getString(R.string.settings_version, BuildConfig.VERSION_NAME) + colors.background .autoDisposable(scope()) .subscribe { color -> window.decorView.setBackgroundColor(color) } @@ -106,6 +114,7 @@ class SettingsActivity : QkThemedActivity(), SettingsView { else -> R.string.settings_default_sms_summary_false }) + themePreview.setBackgroundTint(state.theme) night.summary = state.nightModeSummary nightStart.setVisible(state.nightModeId == Preferences.NIGHT_MODE_AUTO) nightStart.summary = state.nightStart @@ -118,11 +127,12 @@ class SettingsActivity : QkThemedActivity(), SettingsView { autoEmoji.checkbox.isChecked = state.autoEmojiEnabled delivery.checkbox.isChecked = state.deliveryEnabled qkreply.checkbox.isChecked = state.qkReplyEnabled + qkreplyTapDismiss.setVisible(state.qkReplyEnabled) + qkreplyTapDismiss.checkbox.isChecked = state.qkReplyTapDismiss textSize.summary = state.textSizeSummary unicode.checkbox.isChecked = state.stripUnicodeEnabled - mms.checkbox.isChecked = state.mmsEnabled mmsSize.summary = state.maxMmsSizeSummary mmsSizeAdapter.selectedItem = state.maxMmsSizeId diff --git a/presentation/src/main/java/feature/settings/SettingsState.kt b/presentation/src/main/java/feature/settings/SettingsState.kt index dcb0be82..72511c2f 100644 --- a/presentation/src/main/java/feature/settings/SettingsState.kt +++ b/presentation/src/main/java/feature/settings/SettingsState.kt @@ -25,6 +25,7 @@ data class SettingsState( val syncing: Boolean = false, val isDefaultSmsApp: Boolean = false, + val theme: Int = 0, val nightModeSummary: String = "", val nightModeId: Int = Preferences.NIGHT_MODE_OFF, val nightStart: String = "", @@ -34,10 +35,10 @@ data class SettingsState( val notificationsEnabled: Boolean = true, val deliveryEnabled: Boolean = false, val qkReplyEnabled: Boolean = Build.VERSION.SDK_INT < Build.VERSION_CODES.N, + val qkReplyTapDismiss: Boolean = true, val textSizeSummary: String = "", val splitSmsEnabled: Boolean = false, val stripUnicodeEnabled: Boolean = false, - val mmsEnabled: Boolean = true, val maxMmsSizeSummary: String = "100KB", val maxMmsSizeId: Int = 100 ) \ No newline at end of file diff --git a/presentation/src/main/java/feature/settings/SettingsViewModel.kt b/presentation/src/main/java/feature/settings/SettingsViewModel.kt index c1758a18..3fce36b8 100644 --- a/presentation/src/main/java/feature/settings/SettingsViewModel.kt +++ b/presentation/src/main/java/feature/settings/SettingsViewModel.kt @@ -25,6 +25,7 @@ import com.uber.autodispose.kotlin.autoDisposable import common.Navigator import common.base.QkViewModel import common.util.BillingManager +import common.util.Colors import common.util.DateFormatter import common.util.NightModeManager import injection.appComponent @@ -40,6 +41,7 @@ class SettingsViewModel : QkViewModel(SettingsState @Inject lateinit var context: Context @Inject lateinit var billingManager: BillingManager + @Inject lateinit var colors: Colors @Inject lateinit var dateFormatter: DateFormatter @Inject lateinit var navigator: Navigator @Inject lateinit var nightModeManager: NightModeManager @@ -55,6 +57,9 @@ class SettingsViewModel : QkViewModel(SettingsState newState { it.copy(isDefaultSmsApp = isDefaultSmsApp) } } + disposables += colors.theme + .subscribe { color -> newState { it.copy(theme = color) } } + val nightModeLabels = context.resources.getStringArray(R.array.night_modes) disposables += prefs.nightMode.asObservable() .subscribe { nightMode -> @@ -82,6 +87,9 @@ class SettingsViewModel : QkViewModel(SettingsState disposables += prefs.qkreply.asObservable() .subscribe { enabled -> newState { it.copy(qkReplyEnabled = enabled) } } + disposables += prefs.qkreplyTapDismiss.asObservable() + .subscribe { enabled -> newState { it.copy(qkReplyTapDismiss = enabled) } } + val textSizeLabels = context.resources.getStringArray(R.array.text_sizes) disposables += prefs.textSize.asObservable() .subscribe { textSize -> newState { it.copy(textSizeSummary = textSizeLabels[textSize]) } } @@ -89,9 +97,6 @@ class SettingsViewModel : QkViewModel(SettingsState disposables += prefs.unicode.asObservable() .subscribe { enabled -> newState { it.copy(stripUnicodeEnabled = enabled) } } - disposables += prefs.mms.asObservable() - .subscribe { enabled -> newState { it.copy(mmsEnabled = enabled) } } - val mmsSizeLabels = context.resources.getStringArray(R.array.mms_sizes) val mmsSizeIds = context.resources.getIntArray(R.array.mms_sizes_ids) disposables += prefs.mmsSize.asObservable() @@ -140,12 +145,12 @@ class SettingsViewModel : QkViewModel(SettingsState R.id.qkreply -> prefs.qkreply.set(!prefs.qkreply.get()) + R.id.qkreplyTapDismiss -> prefs.qkreplyTapDismiss.set(!prefs.qkreplyTapDismiss.get()) + R.id.textSize -> view.showTextSizePicker() R.id.unicode -> prefs.unicode.set(!prefs.unicode.get()) - R.id.mms -> prefs.mms.set(!prefs.mms.get()) - R.id.mmsSize -> view.showMmsSizePicker() R.id.sync -> { diff --git a/presentation/src/main/java/feature/themepicker/ThemePickerActivity.kt b/presentation/src/main/java/feature/themepicker/ThemePickerActivity.kt index ec54fdc1..739461af 100644 --- a/presentation/src/main/java/feature/themepicker/ThemePickerActivity.kt +++ b/presentation/src/main/java/feature/themepicker/ThemePickerActivity.kt @@ -56,7 +56,7 @@ class ThemePickerActivity : QkThemedActivity(), ThemePicke super.onCreate(savedInstanceState) setContentView(R.layout.theme_picker_activity) setTitle(R.string.title_theme) - supportActionBar?.setDisplayHomeAsUpEnabled(true) + showBackButton(true) viewModel.bindView(this) pager.offscreenPageLimit = 1 diff --git a/presentation/src/main/java/injection/AppModule.kt b/presentation/src/main/java/injection/AppModule.kt index 132a7097..7c20229b 100644 --- a/presentation/src/main/java/injection/AppModule.kt +++ b/presentation/src/main/java/injection/AppModule.kt @@ -45,7 +45,7 @@ import mapper.CursorToMessage import mapper.CursorToMessageImpl import mapper.CursorToPart import mapper.CursorToPartImpl -import mapper.CursorToRecipienImpl +import mapper.CursorToRecipientImpl import mapper.CursorToRecipient import repository.ContactRepository import repository.ContactRepositoryImpl @@ -114,7 +114,7 @@ class AppModule(private var application: Application) { fun provideCursorToPart(mapper: CursorToPartImpl): CursorToPart = mapper @Provides - fun provideCursorToRecipient(mapper: CursorToRecipienImpl): CursorToRecipient = mapper + fun provideCursorToRecipient(mapper: CursorToRecipientImpl): CursorToRecipient = mapper // Repository diff --git a/presentation/src/main/java/interactor/MigratePreferences.kt b/presentation/src/main/java/interactor/MigratePreferences.kt index e6e7bc53..701e4ee2 100644 --- a/presentation/src/main/java/interactor/MigratePreferences.kt +++ b/presentation/src/main/java/interactor/MigratePreferences.kt @@ -26,6 +26,8 @@ import javax.inject.Inject /** * When upgrading from 2.7.3 to 3.0, migrate the preferences + * + * Blocked conversations will be migrated in SyncManager */ class MigratePreferences @Inject constructor( private val nightModeManager: NightModeManager, @@ -60,6 +62,7 @@ class MigratePreferences @Inject constructor( // Quickreply prefs.qkreply.set(rxPrefs.getBoolean("pref_key_quickreply_enabled", prefs.qkreply.get()).get()) + prefs.qkreplyTapDismiss.set(rxPrefs.getBoolean("pref_key_quickreply_dismiss", prefs.qkreplyTapDismiss.get()).get()) // Font size prefs.textSize.set(rxPrefs.getString("pref_key_font_size", "${prefs.textSize.get()}").get().toInt()) diff --git a/presentation/src/main/res/drawable/ic_color_lens_black_24dp.xml b/presentation/src/main/res/drawable/ic_color_lens_black_24dp.xml new file mode 100644 index 00000000..88343a0c --- /dev/null +++ b/presentation/src/main/res/drawable/ic_color_lens_black_24dp.xml @@ -0,0 +1,27 @@ + + + + diff --git a/presentation/src/main/res/drawable/ic_format_size_black_24dp.xml b/presentation/src/main/res/drawable/ic_format_size_black_24dp.xml new file mode 100644 index 00000000..0d3f3ffa --- /dev/null +++ b/presentation/src/main/res/drawable/ic_format_size_black_24dp.xml @@ -0,0 +1,27 @@ + + + + diff --git a/presentation/src/main/res/drawable/ic_invert_colors_black_24dp.xml b/presentation/src/main/res/drawable/ic_invert_colors_black_24dp.xml index b64ef577..e3f120f8 100644 --- a/presentation/src/main/res/drawable/ic_invert_colors_black_24dp.xml +++ b/presentation/src/main/res/drawable/ic_invert_colors_black_24dp.xml @@ -1,21 +1,3 @@ - + ~ + ~ This file is part of QKSMS. + ~ + ~ QKSMS is free software: you can redistribute it and/or modify + ~ it under the terms of the GNU General Public License as published by + ~ the Free Software Foundation, either version 3 of the License, or + ~ (at your option) any later version. + ~ + ~ QKSMS is distributed in the hope that it will be useful, + ~ but WITHOUT ANY WARRANTY; without even the implied warranty of + ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ~ GNU General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License + ~ along with QKSMS. If not, see . + --> + + + diff --git a/presentation/src/main/res/drawable/ic_sync_black_24dp.xml b/presentation/src/main/res/drawable/ic_sync_black_24dp.xml new file mode 100644 index 00000000..f1cef21a --- /dev/null +++ b/presentation/src/main/res/drawable/ic_sync_black_24dp.xml @@ -0,0 +1,27 @@ + + + + diff --git a/presentation/src/main/res/drawable/rounded_rectangle_bottom_4dp.xml b/presentation/src/main/res/drawable/rounded_rectangle_bottom_4dp.xml new file mode 100755 index 00000000..4c52f25e --- /dev/null +++ b/presentation/src/main/res/drawable/rounded_rectangle_bottom_4dp.xml @@ -0,0 +1,29 @@ + + + + + + + + + + \ No newline at end of file diff --git a/presentation/src/main/res/layout/compose_activity.xml b/presentation/src/main/res/layout/compose_activity.xml index 8bd3caed..b62d8599 100644 --- a/presentation/src/main/res/layout/compose_activity.xml +++ b/presentation/src/main/res/layout/compose_activity.xml @@ -26,31 +26,6 @@ android:orientation="vertical" tools:background="@color/backgroundLight"> - - - - - - - - + + @@ -173,12 +161,11 @@ + + + + + + + + + android:visibility="invisible" /> + + + + - + android:layout_marginBottom="32dp" + android:layout_marginEnd="32dp" + android:layout_marginStart="32dp" + android:orientation="vertical"> - + + + + + + + + + @@ -92,7 +119,8 @@ android:layout_height="24dp" android:src="@drawable/ic_favorite_black_24dp" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + tools:tint="@color/tools_theme" /> - + - + + + + + - - + app:icon="@drawable/ic_color_lens_black_24dp" + app:title="@string/settings_theme_title" + app:widget="@layout/settings_theme_widget" /> + + + app:icon="@drawable/ic_format_size_black_24dp" + app:title="@string/settings_text_size_title" /> + + @@ -138,12 +148,14 @@ android:id="@+id/blocked" android:layout_width="match_parent" android:layout_height="wrap_content" + app:icon="@drawable/ic_block_black_24dp" app:title="@string/settings_blocking_title" /> @@ -152,37 +164,34 @@ android:id="@+id/qkreply" android:layout_width="match_parent" android:layout_height="wrap_content" + app:icon="@drawable/ic_reply_white_24dp" app:summary="@string/settings_qkreply_summary" app:title="@string/settings_qkreply_title" app:widget="@layout/settings_switch_widget" /> + app:summary="@string/settings_qkreply_tap_dismiss_summary" + app:title="@string/settings_qkreply_tap_dismiss_title" + app:widget="@layout/settings_switch_widget" /> - - @@ -190,9 +199,21 @@ android:id="@+id/sync" android:layout_width="match_parent" android:layout_height="wrap_content" + app:icon="@drawable/ic_sync_black_24dp" app:summary="@string/settings_sync_summary" app:title="@string/settings_sync_title" /> + + diff --git a/presentation/src/main/res/layout/settings_theme_widget.xml b/presentation/src/main/res/layout/settings_theme_widget.xml new file mode 100644 index 00000000..88e12545 --- /dev/null +++ b/presentation/src/main/res/layout/settings_theme_widget.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/presentation/src/main/res/values-bn/strings.xml b/presentation/src/main/res/values-bn/strings.xml index 709f729a..ffdd94be 100644 --- a/presentation/src/main/res/values-bn/strings.xml +++ b/presentation/src/main/res/values-bn/strings.xml @@ -35,11 +35,12 @@ Clear কল করুন Details - Archive conversation - Remove from archive - মুছে ফেলুন + Archive conversation + Remove from archive + মুছে ফেলুন Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-cs/strings.xml b/presentation/src/main/res/values-cs/strings.xml index cc40bf64..5f3607ba 100644 --- a/presentation/src/main/res/values-cs/strings.xml +++ b/presentation/src/main/res/values-cs/strings.xml @@ -35,11 +35,12 @@ Vymazat Volat Podrobnosti - Archivovat konverzaci - Odebrat z archivu - Smazat + Archivovat konverzaci + Odebrat z archivu + Smazat Uložit obrázek Optimalizace databáze, to může chvíli trvat… + You: %s Napsat zprávu… Odesílání… Doručeno %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Zde se objeví vaše konverzace + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Potvrdit, že zprávy byly odeslány úspěšně QK odpověď Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Velikost písma Odstranit diakritiku Odstranit diakritiku v odesílaných zprávách SMS - MMS zapnuty Maximální velikost přílohy MMS Synchronizovat zprávy Opětovná synchronizace zpráv s nativním Android SMS databází diff --git a/presentation/src/main/res/values-da/strings.xml b/presentation/src/main/res/values-da/strings.xml index a7e03276..509c8a3f 100644 --- a/presentation/src/main/res/values-da/strings.xml +++ b/presentation/src/main/res/values-da/strings.xml @@ -35,11 +35,12 @@ Ryd Ring op Oplysninger - Arkivér samtale - Fjern fra arkiv - Slett + Arkivér samtale + Fjern fra arkiv + Slett Gem billede Optimerer database, dette kan tage et øjeblik… + You: %s Skriv en besked… Afsender… Leveret %s @@ -52,6 +53,7 @@ QKSMS+ Hjælp og feedback Dine samtaler vil fremgå her + No results Dine arkiverede samtaler vil fremgå her Dine planlagte beskeder vil fremgå her Slet @@ -88,10 +90,11 @@ Bekræft, at SMS\'er er afsendt korrekt QK-besvarelse Popup ved nye sMs\'er + Tap to dismiss + Tap outside of the popup to close it Skriftstørrelse Fjern betoninger Fjern betoninger fra tegn i udgående SMS-beskeder - MMS aktiveret Maksimumstørrelse for MMS-vedhæftning Beskedsynkronisering Gen-synkroniéer beskeder med den indbyggede Android SMS-database diff --git a/presentation/src/main/res/values-de/strings.xml b/presentation/src/main/res/values-de/strings.xml index 8f63c98e..bd166112 100644 --- a/presentation/src/main/res/values-de/strings.xml +++ b/presentation/src/main/res/values-de/strings.xml @@ -35,11 +35,12 @@ Clear Anrufen Details - Archive conversation - Remove from archive - Löschen + Archive conversation + Remove from archive + Löschen Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-es/strings.xml b/presentation/src/main/res/values-es/strings.xml index 240e70a0..027134aa 100644 --- a/presentation/src/main/res/values-es/strings.xml +++ b/presentation/src/main/res/values-es/strings.xml @@ -35,11 +35,12 @@ Clear Llamar Details - Archive conversation - Remove from archive - Eliminar + Archive conversation + Remove from archive + Eliminar Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-fa/strings.xml b/presentation/src/main/res/values-fa/strings.xml index d7b9f9c3..6cead4d2 100644 --- a/presentation/src/main/res/values-fa/strings.xml +++ b/presentation/src/main/res/values-fa/strings.xml @@ -35,11 +35,12 @@ پاک کردن تماس جزئیات - بایگانی مکالمه - حذف از بایگانی - حذف + بایگانی مکالمه + حذف از بایگانی + حذف ذخیره عکس بهینه سازی پایگاه داده، این ممکن است یک دقیقه را… + You: %s نوشتن پیام… فرستادن… رسیده %s @@ -52,6 +53,7 @@ نسخه پیشرفته راهنما & نظرات مکالمات اینجا نمایش داده میشود + No results بایگانی اینجا نمایش داده میشود زمانبندیها اینجا نمایش داده میشود حذف @@ -88,10 +90,11 @@ تأیید ارسال موفق پیام پاسخ برنامه پنجره پیام های جدید + Tap to dismiss + Tap outside of the popup to close it اندازه متن لهجه ها حذف کاراکترهای اضافه پیام ارسالی - MMS فعال MMS حداکثر اندازه پیوست همگام سازی پیام ها همگام سازی پیام ها با پایگاه داده diff --git a/presentation/src/main/res/values-fi/strings.xml b/presentation/src/main/res/values-fi/strings.xml index fa21417a..2f5fb786 100644 --- a/presentation/src/main/res/values-fi/strings.xml +++ b/presentation/src/main/res/values-fi/strings.xml @@ -35,11 +35,12 @@ Clear Soita Details - Archive conversation - Remove from archive - Poista + Archive conversation + Remove from archive + Poista Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-fr/strings.xml b/presentation/src/main/res/values-fr/strings.xml index 5b316cc4..b1b78196 100644 --- a/presentation/src/main/res/values-fr/strings.xml +++ b/presentation/src/main/res/values-fr/strings.xml @@ -35,11 +35,12 @@ Effacer Appeler Détails - Archiver la conversation - Supprimer des archives - Supprimer + Archiver la conversation + Supprimer des archives + Supprimer Sauvegarder l\'image Optimisation de la base de données, cela peut prendre un moment… + You: %s Écrire un message… Envoi… Transmis %s @@ -52,6 +53,7 @@ QKSMS+ Aide & commentaire Vos conversations apparaîtront ici + No results Vos conversations archivées apparaîtront ici Vos messages planifiés apparaîtront ici Supprimer @@ -88,10 +90,11 @@ Demander un accusé de réception pour chaque SMS envoyé Réponse rapide QK Popup pour les nouveaux messages + Tap to dismiss + Tap outside of the popup to close it Taille de la police d\'écriture Enlever les accents Supprimer les accents des caractères lors de l\'envoi de messages SMS - Activer les MMS Taille maximale des pièces jointes MMS Synchroniser les messages Re-synchroniser les messages avec la base de données Android native diff --git a/presentation/src/main/res/values-hi/strings.xml b/presentation/src/main/res/values-hi/strings.xml index 57188850..67d410e5 100644 --- a/presentation/src/main/res/values-hi/strings.xml +++ b/presentation/src/main/res/values-hi/strings.xml @@ -35,11 +35,12 @@ Clear कॉल Details - Archive conversation - Remove from archive - Delete + Archive conversation + Remove from archive + Delete Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-hr/strings.xml b/presentation/src/main/res/values-hr/strings.xml index 77d8f54f..5150f27c 100644 --- a/presentation/src/main/res/values-hr/strings.xml +++ b/presentation/src/main/res/values-hr/strings.xml @@ -35,11 +35,12 @@ Očisti Nazovi Detalji - Arhiviraj razgovor - Ukloni iz arhive - Izbriši + Arhiviraj razgovor + Ukloni iz arhive + Izbriši Save image Optimiziranje baze podataka, ovo može potrajati minutu… + You: %s Napiši poruku… Slanje… Isporučeno %s @@ -52,6 +53,7 @@ QKSMS+ Pomoć i povratne informacije Vaši razgovori će se pojaviti ovdje + No results Vaši arhivirani razgovori će se pojaviti ovdje Vaši zakazani razgovori će se pojaviti ovdje Izbriši @@ -88,10 +90,11 @@ Budite sigurni da su se poruke uspješno poslale QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip naglasci Uklonite naglaske sa znakova u odlaznim SMS porukama - MMS je omogućen Maksimalna veličina MMS privitka Uskladi poruke Ponovno uskladite svoje poruke sa nativnom Android SMS bazom podataka diff --git a/presentation/src/main/res/values-hu/strings.xml b/presentation/src/main/res/values-hu/strings.xml index b0eda17c..7aac78cd 100644 --- a/presentation/src/main/res/values-hu/strings.xml +++ b/presentation/src/main/res/values-hu/strings.xml @@ -35,11 +35,12 @@ Clear Hívás Details - Archive conversation - Remove from archive - Törlés + Archive conversation + Remove from archive + Törlés Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-in/strings.xml b/presentation/src/main/res/values-in/strings.xml index cdde82dc..f8a23864 100644 --- a/presentation/src/main/res/values-in/strings.xml +++ b/presentation/src/main/res/values-in/strings.xml @@ -35,11 +35,12 @@ Clear Panggil Detail - Archive conversation - Buang dari arsip - Hapus + Archive conversation + Buang dari arsip + Hapus Simpan gambar Optimizing database, this might take a minute… + You: %s Tulis pesan… Mengirim… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Bantuan & Umpan balik Percakapan Anda akan ditampilkan di sini + No results Arsip percakapan Anda akan ditampilkan di sini Pesan yang dijadwalkan akan ditampilkan di sini Hapus @@ -88,10 +90,11 @@ Mengkonfirmasi bahwa pesan telah berhasil dikirim Balasan QK Popup untuk pesan baru + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS diaktifkan Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-it/strings.xml b/presentation/src/main/res/values-it/strings.xml index 36ed25b9..ab5be2be 100644 --- a/presentation/src/main/res/values-it/strings.xml +++ b/presentation/src/main/res/values-it/strings.xml @@ -35,11 +35,12 @@ Azzera Chiama Dettagli - Archivio conversazione - Rimuovi dall\'archivio - Elimina + Archivio conversazione + Rimuovi dall\'archivio + Elimina Salva immagine Ottimizzazione del database, questa operazione potrebbe richiedere un minuto… + You: %s Scrivi un messaggio… Invio in corso… %s consegnati @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Le tue conversazioni vengono visualizzate qui + No results Le tue conversazioni vengono archiviati qui Il tuo messaggi pianificati appariranno qui Elimina @@ -88,10 +90,11 @@ Conferma che i messaggi siano stati inviati con successo Risposta QK Popup per i nuovi messaggi + Tap to dismiss + Tap outside of the popup to close it Dimensione carattere Strip accents Rimuovi gli accenti da caratteri nei messaggi SMS in uscita - MMS abilitati Dimensione massima degli allegati MMS Sincronizza i messaggi Risincronizza i tuoi messaggi con il database SMS Android nativo diff --git a/presentation/src/main/res/values-iw/strings.xml b/presentation/src/main/res/values-iw/strings.xml index a9ffebd8..62931969 100644 --- a/presentation/src/main/res/values-iw/strings.xml +++ b/presentation/src/main/res/values-iw/strings.xml @@ -35,11 +35,12 @@ Clear התקשר Details - Archive conversation - Remove from archive - מחק + Archive conversation + Remove from archive + מחק Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-ja/strings.xml b/presentation/src/main/res/values-ja/strings.xml index 98a422fe..6530adc1 100644 --- a/presentation/src/main/res/values-ja/strings.xml +++ b/presentation/src/main/res/values-ja/strings.xml @@ -35,11 +35,12 @@ クリア 通話 詳細 - 会話のアーカイブ - アーカイブから削除 - 削除 + 会話のアーカイブ + アーカイブから削除 + 削除 画像を保存 データベースを最適化します。これは数分かかる場合があります… + You: %s メッセージを書く… 送信中… %s を配信しました @@ -52,6 +53,7 @@ QKSMS+ ヘルプとフィードバック 会話がここに表示されます + No results 保存した会話がここに表示されます スケジュールされたメッセージがここに表示されます 削除 @@ -88,10 +90,11 @@ メッセージが正常に送信されたことを確認します QK 返信 新しいメッセージのポップアップ + Tap to dismiss + Tap outside of the popup to close it Font size アクセントの除去 送信する SMS メッセージの文字からアクセントを削除します - MMS が有効です MMS の最大添付ファイルサイズ メッセージを同期 メッセージをネイティブの Android SMS データベースと再同期します diff --git a/presentation/src/main/res/values-ko/strings.xml b/presentation/src/main/res/values-ko/strings.xml index 9ce35b99..66508eb7 100644 --- a/presentation/src/main/res/values-ko/strings.xml +++ b/presentation/src/main/res/values-ko/strings.xml @@ -35,11 +35,12 @@ 비우기 전화 자세히 - 대화 보관하기 - 보관함에서 제거 - 삭제 + 대화 보관하기 + 보관함에서 제거 + 삭제 Save image 데이터베이스 초기화 중, 시간이 약간 걸립니다... + You: %s 메시지 작성 중... 전송 중... %s 전송됨 @@ -52,6 +53,7 @@ QKSMS+ 도움말 & 피드백 대화가 여기에 나타납니다 + No results 보관된 메시지가 여기 나타납니다 예약된 메시지가 여기 나타납니다 삭제 @@ -88,10 +90,11 @@ 전송 성공을 확인합니다 QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size 스트립 악센트 Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-lt/strings.xml b/presentation/src/main/res/values-lt/strings.xml index c23aa152..dadc59ce 100644 --- a/presentation/src/main/res/values-lt/strings.xml +++ b/presentation/src/main/res/values-lt/strings.xml @@ -35,11 +35,12 @@ Clear Skambinti Details - Archive conversation - Remove from archive - Ištrinti + Archive conversation + Remove from archive + Ištrinti Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-ne/strings.xml b/presentation/src/main/res/values-ne/strings.xml index 1be5b7ef..81cebc50 100644 --- a/presentation/src/main/res/values-ne/strings.xml +++ b/presentation/src/main/res/values-ne/strings.xml @@ -35,11 +35,12 @@ Clear सम्पर्क Details - Archive conversation - Remove from archive - Delete + Archive conversation + Remove from archive + Delete Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-nl/strings.xml b/presentation/src/main/res/values-nl/strings.xml index 359d1834..f34fcef8 100644 --- a/presentation/src/main/res/values-nl/strings.xml +++ b/presentation/src/main/res/values-nl/strings.xml @@ -35,11 +35,12 @@ Annuleren Bel Details - Conversatie archiveren - Verwijderen van archief - Verwijderen + Conversatie archiveren + Verwijderen van archief + Verwijderen Afbeelding opslaan Database aan het optimaliseren. Even geduld… + You: %s Type een bericht… Verzenden… Afgeleverd %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Je conversaties verschijnen hier + No results Je gearchiveerde conversaties verschijnen hier Je geplande berichten verschijnen hier Verwijderen @@ -80,22 +82,23 @@ Notificaties Trillen Geluid - Blocking + Blokkeren Should I Answer? - Automatically filter messages from unsolicited numbers by using the \"Should I Answer\" app + Automatisch filteren van berichten van ongevraagde nummers met behulp van de app \"Should I Answer\" Afleverrapporten Bevestig dat berichten met succes zijn verzonden QK Reply Popup voor nieuwe berichten - Font size + Tap to dismiss + Tap outside of the popup to close it + Tekst grootte Verwijder accenten Verwijder accenten van karakters voor uitgaande berichten - MMS ingeschakeld Max MMS grootte Synchroniseer berichten Hersynchroniseer jouw berichten vanuit de SMS database op je telefoon - Blocking + Blokkeren Jouw geblokkeerde conversaties verschijnen hier Blokkering opheffen Wil je de blokkering voor deze conversatie opheffen? @@ -160,10 +163,10 @@ Automatisch - Small - Normal - Large - Larger + Klein + Normaal + Groot + Groot 100KB diff --git a/presentation/src/main/res/values-no/strings.xml b/presentation/src/main/res/values-no/strings.xml index 9af29b9e..d13b9026 100644 --- a/presentation/src/main/res/values-no/strings.xml +++ b/presentation/src/main/res/values-no/strings.xml @@ -35,11 +35,12 @@ Clear Ring Details - Archive conversation - Remove from archive - Slett + Archive conversation + Remove from archive + Slett Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-pl/strings.xml b/presentation/src/main/res/values-pl/strings.xml index 19dd165a..62237626 100644 --- a/presentation/src/main/res/values-pl/strings.xml +++ b/presentation/src/main/res/values-pl/strings.xml @@ -35,11 +35,12 @@ Clear Zadzwoń Details - Archive conversation - Remove from archive - Usuń + Archive conversation + Remove from archive + Usuń Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-pt-rBR/strings.xml b/presentation/src/main/res/values-pt-rBR/strings.xml index 558cb884..74be6a67 100644 --- a/presentation/src/main/res/values-pt-rBR/strings.xml +++ b/presentation/src/main/res/values-pt-rBR/strings.xml @@ -35,11 +35,12 @@ Limpar Ligar Detalhes - Arquivar conversa - Remover do arquivo - Deletar + Arquivar conversa + Remover do arquivo + Deletar Guardar imagem A otimizar. Por favor aguarde um pouco… + You: %s Escrever uma mensagem… A enviar… %s entregue @@ -52,6 +53,7 @@ QKSMS+ Ajuda e comentários As suas conversas aparecerão aqui + No results As conversas arquivadas aparecerão aqui As mensagens agendadas aparecerão aqui Apagar @@ -88,10 +90,11 @@ Confirma se as mensagens foram enviadas com sucesso QK Reply Alerta para novas mensagens + Tap to dismiss + Tap outside of the popup to close it Tamanho do texto Remover acentos Remover acentos dos caracteres nas mensagens enviadas - MMS ativado Tamanho máximo para anexos MMS Sincronizar mensagens Sincronizar as mensagens com a base de dados nativa do Android diff --git a/presentation/src/main/res/values-pt/strings.xml b/presentation/src/main/res/values-pt/strings.xml index 13e7e9a3..cfbb26e4 100644 --- a/presentation/src/main/res/values-pt/strings.xml +++ b/presentation/src/main/res/values-pt/strings.xml @@ -35,11 +35,12 @@ Limpar Ligar Detalhes - Arquivar conversa - Remover do arquivo - Apagar + Arquivar conversa + Remover do arquivo + Apagar Guardar imagem A otimizar. Por favor aguarde um pouco… + You: %s Escrever uma mensagem… A enviar… %s entregue @@ -52,6 +53,7 @@ QKSMS+ Ajuda e comentários As suas conversas aparecerão aqui + No results As conversas arquivadas aparecerão aqui As mensagens agendadas aparecerão aqui Apagar @@ -88,10 +90,11 @@ Confirma se as mensagens foram enviadas com sucesso QK Reply Alerta para novas mensagens + Tap to dismiss + Tap outside of the popup to close it Tamanho do texto Remover acentos Remover acentos dos caracteres nas mensagens enviadas - MMS ativado Tamanho máximo para anexos MMS Sincronizar mensagens Sincronizar as mensagens com a base de dados nativa do Android diff --git a/presentation/src/main/res/values-ro/strings.xml b/presentation/src/main/res/values-ro/strings.xml index 4d94e641..d2f571c9 100644 --- a/presentation/src/main/res/values-ro/strings.xml +++ b/presentation/src/main/res/values-ro/strings.xml @@ -35,11 +35,12 @@ Clear Apel Details - Archive conversation - Remove from archive - Ştergeţi + Archive conversation + Remove from archive + Ştergeţi Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-ru/strings.xml b/presentation/src/main/res/values-ru/strings.xml index 8a747929..280afa17 100644 --- a/presentation/src/main/res/values-ru/strings.xml +++ b/presentation/src/main/res/values-ru/strings.xml @@ -35,11 +35,12 @@ Очистить Позвонить Подробности - Архивировать переписку - Удалить из архива - Удалить + Архивировать переписку + Удалить из архива + Удалить Сохранить изображение Оптимизация базы данных, это может занять немного времени… + You: %s Написать сообщение… Отправка… Доставлено %s @@ -52,6 +53,7 @@ QKSMS+ Помощь и обратная связь Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Удалить @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS используется Максимальный размер вложения MMS Синхронизация сообщений Повторная синхронизация ваших сообщений с собственной базой данных SMS Android diff --git a/presentation/src/main/res/values-sk/strings.xml b/presentation/src/main/res/values-sk/strings.xml index c73cbf71..e4d7a64e 100644 --- a/presentation/src/main/res/values-sk/strings.xml +++ b/presentation/src/main/res/values-sk/strings.xml @@ -35,11 +35,12 @@ Clear Volať Details - Archive conversation - Remove from archive - Vymazať + Archive conversation + Remove from archive + Vymazať Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-sr/strings.xml b/presentation/src/main/res/values-sr/strings.xml index 6fc76fe2..6b3a3c88 100644 --- a/presentation/src/main/res/values-sr/strings.xml +++ b/presentation/src/main/res/values-sr/strings.xml @@ -35,11 +35,12 @@ Clear Позови Details - Archive conversation - Remove from archive - Избриши + Archive conversation + Remove from archive + Избриши Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-sv/strings.xml b/presentation/src/main/res/values-sv/strings.xml index 4edc7223..543690d4 100644 --- a/presentation/src/main/res/values-sv/strings.xml +++ b/presentation/src/main/res/values-sv/strings.xml @@ -35,11 +35,12 @@ Rensa Ring Details - Arkivera konversationen - Ta bort från arkiv - Ta bort + Arkivera konversationen + Ta bort från arkiv + Ta bort Save image Optimerar databasen, det här kan ta en stund… + You: %s Skriv ett meddelande… Skickar… Levererade %s @@ -52,6 +53,7 @@ QKSMS+ Hjälp & återgivning Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS aktiverat Max MMS attachment size Synkronisera meddelanden Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-tl/strings.xml b/presentation/src/main/res/values-tl/strings.xml index 42e5c766..22f1267f 100644 --- a/presentation/src/main/res/values-tl/strings.xml +++ b/presentation/src/main/res/values-tl/strings.xml @@ -35,11 +35,12 @@ Clear Tawagan Details - Archive conversation - Remove from archive - Burahin + Archive conversation + Remove from archive + Burahin Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-tr/strings.xml b/presentation/src/main/res/values-tr/strings.xml index 0e4224d0..822dd788 100644 --- a/presentation/src/main/res/values-tr/strings.xml +++ b/presentation/src/main/res/values-tr/strings.xml @@ -35,11 +35,12 @@ Clear Ara Details - Archive conversation - Remove from archive - Sil + Archive conversation + Remove from archive + Sil Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-vi/strings.xml b/presentation/src/main/res/values-vi/strings.xml index 17d14f8b..612ee23b 100644 --- a/presentation/src/main/res/values-vi/strings.xml +++ b/presentation/src/main/res/values-vi/strings.xml @@ -35,11 +35,12 @@ Clear Cuộc gọi Details - Archive conversation - Remove from archive - Xóa + Archive conversation + Remove from archive + Xóa Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-zh-rCN/strings.xml b/presentation/src/main/res/values-zh-rCN/strings.xml index d7044408..3673999f 100644 --- a/presentation/src/main/res/values-zh-rCN/strings.xml +++ b/presentation/src/main/res/values-zh-rCN/strings.xml @@ -35,11 +35,12 @@ 清除 致電 详情 - Archive conversation - Remove from archive - 删除 + Archive conversation + Remove from archive + 删除 Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ 帮助及反馈 Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here 删除 @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values-zh/strings.xml b/presentation/src/main/res/values-zh/strings.xml index 63ed3a65..c64e39c6 100644 --- a/presentation/src/main/res/values-zh/strings.xml +++ b/presentation/src/main/res/values-zh/strings.xml @@ -35,11 +35,12 @@ Clear 致電 Details - Archive conversation - Remove from archive - Delete + Archive conversation + Remove from archive + Delete Save image Optimizing database, this might take a minute… + You: %s Write a message… Sending… Delivered %s @@ -52,6 +53,7 @@ QKSMS+ Help & feedback Your conversations will appear here + No results Your archived conversations will appear here Your scheduled messages will appear here Delete @@ -88,10 +90,11 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index c06b0ca2..974f6f4b 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -37,18 +37,10 @@ Clear Call Details - Archive conversation - Remove from archive - Delete Save image Optimizing database, this might take a minute… - - Write a message… - - Sending… - Delivered %s - Failed to send. Tap to try again + You: %s Inbox Archived @@ -59,12 +51,33 @@ Help & feedback Your conversations will appear here + No results + Archive + Unarchive + Block + Delete Your archived conversations will appear here Your scheduled messages will appear here Delete Are you sure you would like to delete this conversation? + + Copy text + Forward + Delete + + + This is the start of your conversation. Say something nice! + Write a message… + Copy text + Forward + Delete + + Sending… + Delivered %s + Failed to send. Tap to try again + Details Notifications Theme @@ -87,7 +100,6 @@ Start time End time Automatic emoji - Convert text like :) to an emoji like 🙂 Notifications Vibration Sound @@ -99,13 +111,15 @@ Confirm that messages were sent successfully QK Reply Popup for new messages + Tap to dismiss + Tap outside of the popup to close it Font size Strip accents Remove accents from characters in outgoing SMS messages - MMS enabled Max MMS attachment size Sync messages Re-sync your messages with the native Android SMS database + Version %s Blocking Your blocked conversations will appear here @@ -118,6 +132,8 @@ Unlock + donate for %1$s %2$s Thank you for supporting QKSMS! You now have access to all QKSMS+ features + QKSMS+ is free for F-Droid users! If you\'d like to support development, feel free to make a donation. + Donate via PayPal Coming soon Premium themes Unlock beautiful theme colors not available on the Material Design palette @@ -170,12 +186,6 @@ Message not sent The message to %s failed to send - - Copy text - Forward - Delete - - Disabled Always on diff --git a/presentation/src/main/res/values/styles.xml b/presentation/src/main/res/values/styles.xml index 17f01638..ea4c77df 100644 --- a/presentation/src/main/res/values/styles.xml +++ b/presentation/src/main/res/values/styles.xml @@ -70,7 +70,7 @@ wrap_content 16dp 24dp - 24dp + 72dp 16dp bold secondary diff --git a/presentation/src/noAnalytics/java/common/util/AnalyticsManagerImpl.kt b/presentation/src/noAnalytics/java/common/util/AnalyticsManagerImpl.kt index 66ab3a6a..ad13b73c 100644 --- a/presentation/src/noAnalytics/java/common/util/AnalyticsManagerImpl.kt +++ b/presentation/src/noAnalytics/java/common/util/AnalyticsManagerImpl.kt @@ -25,7 +25,7 @@ import javax.inject.Singleton @Singleton class AnalyticsManagerImpl @Inject constructor() : AnalyticsManager { - override fun track(event: String) { + override fun track(event: String, vararg properties: Pair) { // Do nothing } diff --git a/presentation/src/withAnalytics/java/common/util/AnalyticsManagerImpl.kt b/presentation/src/withAnalytics/java/common/util/AnalyticsManagerImpl.kt index 9b3dd882..3e3b4c60 100644 --- a/presentation/src/withAnalytics/java/common/util/AnalyticsManagerImpl.kt +++ b/presentation/src/withAnalytics/java/common/util/AnalyticsManagerImpl.kt @@ -32,16 +32,20 @@ import javax.inject.Inject import javax.inject.Singleton @Singleton -class AnalyticsManagerImpl @Inject constructor(context: Context): AnalyticsManager { +class AnalyticsManagerImpl @Inject constructor(context: Context) : AnalyticsManager { private val amplitude: AmplitudeClient = Amplitude.getInstance().initialize(context, BuildConfig.AMPLITUDE_API_KEY) private val mixpanel: MixpanelAPI = MixpanelAPI.getInstance(context, BuildConfig.MIXPANEL_API_KEY) - override fun track(event: String) { - amplitude.logEvent(event) + override fun track(event: String, vararg properties: Pair) { + val propertiesJson = JSONObject(properties + .associateBy { pair -> pair.first } + .mapValues { pair -> pair.value.second }) + + amplitude.logEvent(event, propertiesJson) synchronized(mixpanel, { - mixpanel.track(event) + mixpanel.track(event, propertiesJson) }) }