Add support for resuming compose drafts.

This commit is contained in:
Moxie Marlinspike
2013-02-04 00:13:07 -08:00
parent 209711ae40
commit bf92de394b
5 changed files with 252 additions and 22 deletions

View File

@@ -16,6 +16,8 @@
*/
package org.thoughtcrime.securesms.util;
import android.widget.EditText;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@@ -80,6 +82,14 @@ public class Util {
return executor;
}
public static boolean isEmpty(String value) {
return value == null || value.trim().length() == 0;
}
public static boolean isEmpty(EditText value) {
return value == null || value.getText() == null || isEmpty(value.getText().toString());
}
// public static Bitmap loadScaledBitmap(InputStream src, int targetWidth, int targetHeight) {
// return BitmapFactory.decodeStream(src);
//// BitmapFactory.Options options = new BitmapFactory.Options();