Include incoming message body in notifications.

1) Refactor the master secret reset logic to properly interact with
   services.

2) Add support for "BigText" and "Inbox" style notifications.

3) Decrypt message bodies when unlocked, display 'encrypted' when
   locked.
This commit is contained in:
Moxie Marlinspike
2013-02-08 11:57:54 -08:00
parent 10865bc75f
commit 0a8c62e0e3
14 changed files with 597 additions and 310 deletions

View File

@@ -16,6 +16,10 @@
*/
package org.thoughtcrime.securesms.util;
import android.graphics.Typeface;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.StyleSpan;
import android.widget.EditText;
import java.util.concurrent.ExecutorService;
@@ -90,6 +94,24 @@ public class Util {
return value == null || value.getText() == null || isEmpty(value.getText().toString());
}
public static CharSequence getBoldedString(String value) {
SpannableString spanned = new SpannableString(value);
spanned.setSpan(new StyleSpan(Typeface.BOLD), 0,
spanned.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return spanned;
}
public static CharSequence getItalicizedString(String value) {
SpannableString spanned = new SpannableString(value);
spanned.setSpan(new StyleSpan(Typeface.ITALIC), 0,
spanned.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return spanned;
}
// public static Bitmap loadScaledBitmap(InputStream src, int targetWidth, int targetHeight) {
// return BitmapFactory.decodeStream(src);
//// BitmapFactory.Options options = new BitmapFactory.Options();