1717
1818package org .addhen .smssync .util ;
1919
20+ import org .addhen .smssync .App ;
21+ import org .addhen .smssync .BuildConfig ;
22+ import org .addhen .smssync .R ;
23+ import org .addhen .smssync .activities .MainActivity ;
24+ import org .addhen .smssync .prefs .Prefs ;
25+ import org .addhen .smssync .receivers .ConnectivityChangedReceiver ;
26+ import org .addhen .smssync .state .LogEvent ;
27+ import org .json .JSONException ;
28+ import org .json .JSONObject ;
29+
2030import android .annotation .TargetApi ;
2131import android .app .NotificationManager ;
2232import android .app .PendingIntent ;
3949import android .util .Log ;
4050import android .widget .Toast ;
4151
42- import org .addhen .smssync .App ;
43- import org .addhen .smssync .BuildConfig ;
44- import org .addhen .smssync .R ;
45- import org .addhen .smssync .activities .MainActivity ;
46- import org .addhen .smssync .prefs .Prefs ;
47- import org .addhen .smssync .receivers .ConnectivityChangedReceiver ;
48- import org .addhen .smssync .state .LogEvent ;
49- import org .json .JSONException ;
50- import org .json .JSONObject ;
51-
5252import java .io .BufferedWriter ;
5353import java .io .File ;
5454import java .io .FileInputStream ;
5757import java .io .IOException ;
5858import java .text .ParseException ;
5959import java .text .SimpleDateFormat ;
60+ import java .util .Collection ;
6061import java .util .Date ;
6162import java .util .HashMap ;
6263import java .util .regex .Matcher ;
@@ -171,7 +172,7 @@ public static String limitString(String value, int length) {
171172 * @return String
172173 */
173174 public static String formatDate (String dateFormat , String date ,
174- String toFormat ) {
175+ String toFormat ) {
175176
176177 String formatted = "" ;
177178
@@ -280,7 +281,7 @@ public static void showNotification(Context context) {
280281 * @param notificationTitle notification title
281282 */
282283 public static void showFailNotification (Context context , String message ,
283- String notificationTitle ) {
284+ String notificationTitle ) {
284285
285286 Intent baseIntent = new Intent (context , MainActivity .class );
286287 baseIntent .addFlags (Intent .FLAG_ACTIVITY_NEW_TASK );
@@ -304,7 +305,7 @@ public static void showFailNotification(Context context, String message,
304305 * @param ongoing True if you don't want the user to clear the notification
305306 */
306307 public static void buildNotification (Context context , int drawable ,
307- String message , String title , PendingIntent intent , boolean ongoing ) {
308+ String message , String title , PendingIntent intent , boolean ongoing ) {
308309
309310 NotificationManager notificationManager = (NotificationManager ) context
310311 .getSystemService (Context .NOTIFICATION_SERVICE );
@@ -628,4 +629,8 @@ public void log(String format, Object... args) {
628629 public void log (String message , Exception ex ) {
629630 Logger .log (getClass ().getName (), message , ex );
630631 }
632+
633+ public static boolean isEmpty (Collection <?> collection ) {
634+ return collection == null || collection .isEmpty ();
635+ }
631636}
0 commit comments