Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

v1.16 - no signal image

  • Loading branch information...
commit 074f0c45f3421525dc89e4118432184bfb4ec3c3 1 parent c7d0aaf
Carles Sentis authored
View
4 AndroidManifest.xml
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.codeskraps.lolo"
- android:versionCode="16"
- android:versionName="1.15" >
+ android:versionCode="17"
+ android:versionName="1.16" >
<!-- Remember to update the info code version -->
View
7 README.rdoc
@@ -4,7 +4,7 @@
* <b>Git:</b> https://github.com/091labs/lo-lo
* <b>Author:</b> 091 Labs members
* <b>License:</b> GNU GPL v3
-* <b>Latest Version:</b> 1.15
+* <b>Latest Version:</b> 1.16
* <b>Release Date:</b> 2012
== General Infromation
@@ -21,7 +21,7 @@ and all creative ideas.
== Authors
* <b>Android:</b> Carles Sentis
-* <b>Art design:</b> Darren Kearney
+* <b>Art design:</b> Darren Kearney
* <b>Server:</b> Padraic Harley
== Install
@@ -31,6 +31,9 @@ Install from Google Play
* http://play.google.com/store/apps/details?id=com.codeskraps.lolo
== ChangeLog
+<b>v1.16</b>
+* No signal image if unknown lolo state
+
<b>v1.15</b>
* Release version using Proguard and ZipAlign
View
BIN  res/drawable/_null.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
8 src/com/codeskraps/lolo/Constants.java
@@ -3,11 +3,11 @@
public class Constants {
public static final String LOLO_URL = "http://scruffy.091labs.com/lolo/json/status.json";
-
+
public static final String FORCE_WIDGET_UPDATE = "com.codeskraps.lolo.FORCE_WIDGET_UPDATE";
public static final String BROADCAST_RECEIVER = "com.codeskraps.lolo.BROADCAST_RECEIVER";
public static final String CONFIGURE_ACTION = "android.appwidget.action.APPWIDGET_CONFIGURE";
-
+
public static final String ONCLICK = "lstOnClick";
public static final String EURL = "eURL";
public static final String LAST_SYNC = "sync";
@@ -16,4 +16,8 @@
public static final String INTERVAL = "lstInterval";
public static final String ABOUT = "prefAbout";
public static final String FIRST_LAUNCH = "firstLaunch";
+
+ public static final short LOLO_ON = 0;
+ public static final short LOLO_OFF = 1;
+ public static final short LOLO_NULL = 2;
}
View
19 src/com/codeskraps/lolo/UpdateWidgetReceiver.java
@@ -32,7 +32,7 @@
private static Context context = null;
private static Handler handler;
- private static boolean lolo;
+ private static short lolo;
private Thread downloadThread;
@Override
@@ -41,6 +41,7 @@ public void onReceive(Context context, Intent intent) {
UpdateWidgetReceiver.context = context;
+ lolo = Constants.LOLO_NULL;
handler = new Handler();
if (Utils.isNetworkAvailable(context)) {
@@ -61,7 +62,10 @@ public void onReceive(Context context, Intent intent) {
downloadThread.start();
// new DownloadXmlTask().execute();
- } else if (BuildConfig.DEBUG) Log.d(TAG, "No network connection");
+ } else {
+ if (BuildConfig.DEBUG) Log.d(TAG, "No network connection");
+ handler.post(new MyRunnable());
+ }
}
static private class MyThread extends Thread {
@@ -104,12 +108,19 @@ public void run() {
if (appWidgetIds.length > 0) {
for (int appWidgetId : appWidgetIds) {
- if (lolo) {
+ switch (lolo) {
+ case Constants.LOLO_ON:
remoteViews.setImageViewResource(R.id.imgLolo, R.drawable.open);
Log.d(TAG, "The labs is open");
- } else {
+ break;
+ case Constants.LOLO_OFF:
remoteViews.setImageViewResource(R.id.imgLolo, R.drawable.closed);
Log.d(TAG, "The labs is close");
+ break;
+ case Constants.LOLO_NULL:
+ remoteViews.setImageViewResource(R.id.imgLolo, R.drawable._null);
+ Log.d(TAG, "The labs is null");
+ break;
}
Calendar c = Calendar.getInstance();
View
5 src/com/codeskraps/lolo/Utils.java
@@ -59,7 +59,7 @@ public static boolean isNetworkAvailable(Context context) {
return false;
}
- public static boolean getLolo() throws UnsupportedEncodingException, ClientProtocolException,
+ public static short getLolo() throws UnsupportedEncodingException, ClientProtocolException,
IOException, IllegalArgumentException, NullPointerException, JSONException {
long startTime = System.currentTimeMillis();
if (BuildConfig.DEBUG) Log.d(TAG, "download begining");
@@ -81,9 +81,8 @@ public static boolean getLolo() throws UnsupportedEncodingException, ClientProto
JSONTokener tokener = new JSONTokener(json);
- boolean lolo = false;
JSONObject finalResult = new JSONObject(tokener);
- lolo = finalResult.getBoolean("open");
+ short lolo = finalResult.getBoolean("open") ? Constants.LOLO_ON : Constants.LOLO_OFF;
if (BuildConfig.DEBUG) Log.d(TAG, "lolo: " + lolo);
if (BuildConfig.DEBUG)
Please sign in to comment.
Something went wrong with that request. Please try again.