Example #1
0
 protected static int[] arrayRemove(int[] a, int b) {
   if (Sonet.arrayContains(a, b)) {
     int[] c = new int[a.length - 1];
     int i = 0;
     for (int d : a) {
       if (d != b) {
         c[i++] = d;
       }
     }
     return c;
   } else {
     return a;
   }
 }
Example #2
0
 protected static int[] arrayAdd(int[] a, int b) {
   if (!Sonet.arrayContains(a, b)) {
     int cLen = a.length;
     int[] c = new int[cLen];
     for (int i = 0; i < cLen; i++) {
       c[i] = a[i];
     }
     a = new int[cLen + 1];
     for (int i = 0; i < cLen; i++) {
       a[i] = c[i];
     }
     a[cLen] = b;
   }
   return a;
 }
Example #3
0
 protected static int[] getWidgets(Context context, AppWidgetManager awm) {
   int[] widgets = new int[0];
   Class[] clazzes =
       new Class[] {
         SonetWidget_2x2.class,
         SonetWidget_2x3.class,
         SonetWidget_2x4.class,
         SonetWidget_4x2.class,
         SonetWidget_4x3.class,
         SonetWidget_4x4.class
       };
   for (Class clazz : clazzes) {
     widgets =
         Sonet.arrayCat(
             widgets,
             awm.getAppWidgetIds(new ComponentName(context, getPackageClass(context, clazz))));
   }
   return widgets;
 }
Example #4
0
 public static Uri getContentUri(Context context) {
   return Uri.parse("content://" + Sonet.getAuthority(context) + "/status_images");
 }
Example #5
0
 public static Uri getContentUri(Context context) {
   return Uri.parse("content://" + Sonet.getAuthority(context) + "/notifications");
 }
Example #6
0
 public static Uri getContentUri(Context context) {
   return Uri.parse("content://" + Sonet.getAuthority(context) + "/accounts_styles");
 }
Example #7
0
 public static Uri getDistinctContentUri(Context context) {
   return Uri.parse("content://" + Sonet.getAuthority(context) + "/distinct_widgets_settings");
 }
Example #8
0
 public static Uri getContentUri(Context context) {
   return Uri.parse("content://" + Sonet.getAuthority(context) + "/widget_accounts_view");
 }