17
17
18
18
package org .addhen .smssync .util ;
19
19
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
+
20
30
import android .annotation .TargetApi ;
21
31
import android .app .NotificationManager ;
22
32
import android .app .PendingIntent ;
39
49
import android .util .Log ;
40
50
import android .widget .Toast ;
41
51
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
-
52
52
import java .io .BufferedWriter ;
53
53
import java .io .File ;
54
54
import java .io .FileInputStream ;
57
57
import java .io .IOException ;
58
58
import java .text .ParseException ;
59
59
import java .text .SimpleDateFormat ;
60
+ import java .util .Collection ;
60
61
import java .util .Date ;
61
62
import java .util .HashMap ;
62
63
import java .util .regex .Matcher ;
@@ -171,7 +172,7 @@ public static String limitString(String value, int length) {
171
172
* @return String
172
173
*/
173
174
public static String formatDate (String dateFormat , String date ,
174
- String toFormat ) {
175
+ String toFormat ) {
175
176
176
177
String formatted = "" ;
177
178
@@ -280,7 +281,7 @@ public static void showNotification(Context context) {
280
281
* @param notificationTitle notification title
281
282
*/
282
283
public static void showFailNotification (Context context , String message ,
283
- String notificationTitle ) {
284
+ String notificationTitle ) {
284
285
285
286
Intent baseIntent = new Intent (context , MainActivity .class );
286
287
baseIntent .addFlags (Intent .FLAG_ACTIVITY_NEW_TASK );
@@ -304,7 +305,7 @@ public static void showFailNotification(Context context, String message,
304
305
* @param ongoing True if you don't want the user to clear the notification
305
306
*/
306
307
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 ) {
308
309
309
310
NotificationManager notificationManager = (NotificationManager ) context
310
311
.getSystemService (Context .NOTIFICATION_SERVICE );
@@ -628,4 +629,8 @@ public void log(String format, Object... args) {
628
629
public void log (String message , Exception ex ) {
629
630
Logger .log (getClass ().getName (), message , ex );
630
631
}
632
+
633
+ public static boolean isEmpty (Collection <?> collection ) {
634
+ return collection == null || collection .isEmpty ();
635
+ }
631
636
}
0 commit comments