Permalink
Browse files

trailing whitespace removal

  • Loading branch information...
1 parent dd97b33 commit 1b053fe3d264ecf9b26879258675b83d9161a58c @gregkh committed Jun 10, 2010
@@ -17,7 +17,7 @@
public class Clock extends Activity {
public static final String MODULE = "GREGKHMainScreen";
-
+
// Display a simple "About" dialog
final void about() {
AlertDialog.Builder ad = new AlertDialog.Builder(Clock.this);
@@ -68,7 +68,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
private Button okButton;
-
+
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -19,7 +19,7 @@
public static final String MODULE = "GREGKHConfigureScreen";
public static int mAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;
private Button okButton;
-
+
// Display a simple "About" dialog
final void about() {
AlertDialog.Builder ad = new AlertDialog.Builder(Configure.this);
@@ -77,7 +77,7 @@ public void onCreate(Bundle savedInstanceState) {
Log.d(MODULE, "onCreate:enter");
super.onCreate(savedInstanceState);
setContentView(R.layout.config);
-
+
// Find the widget id from the intent.
Intent intent = getIntent();
Bundle extras = intent.getExtras();
@@ -10,9 +10,9 @@
import android.widget.RemoteViews;
public class MedAppWidget extends AppWidgetProvider {
-
+
public static final String MODULE = "GREGKHWidget";
-
+
@Override
public void onUpdate(Context context,
AppWidgetManager appWidgetManager,
@@ -21,7 +21,7 @@ public void onUpdate(Context context,
if (appWidgetIds == null) {
appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, MedAppWidget.class));
}
-
+
// Tie clicking on the button to bring up our configure screen
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);
if (views == null)
@@ -34,23 +34,23 @@ public void onUpdate(Context context,
if (pendingIntent == null)
Log.d(MODULE, "buildUpdate:pendingIntent == null");
views.setOnClickPendingIntent(R.id.time, pendingIntent);
-
+
// UpdateService.requestUpdate(appWidgetIds);
context.startService(new Intent(context, UpdateService.class));
Log.d(MODULE, "onUpdate:exit");
}
public static RemoteViews buildUpdate(Context context) {
-
+
Log.d(MODULE, "buildUpdate:enter");
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);
if (views == null)
Log.d(MODULE, "buildUpdate:views == null");
-
+
// ContentResolver resolver = context.getContentResolver();
// Resources res = context.getResources();
// Cursor cursor = null;
-
+
// Tie clicking on the button to bring up our configure screen
Intent intent = new Intent(context, Configure.class);
if (intent == null)
@@ -63,32 +63,32 @@ public static RemoteViews buildUpdate(Context context) {
// Intent result = new Intent();
// result.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
-
+
Log.d(MODULE, "buildUpdate:exit");
return views;
-
+
}
-
+
// final int num_ids = appWidgetIds.length;
// for (int i = 0; i < num_ids; i++) {
-//
+//
// int appWidgetId = appWidgetIds[i];
-//
+//
// Timer timer = new Timer();
// timer.scheduleAtFixedRate(new myTime(context, appWidgetManager), 1, 10000);
-//
+//
// // Create a remote view
// RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_loading);
-
-//
+
+//
// // set the time
//// DateFormat format = SimpleDateFormat.getTimeInstance(SimpleDateFormat.MEDIUM, Locale.getDefault());
//// views.setTextViewText(R.id.loading, format.format(new Date()));
// // TODO update the UI
-//
+//
// appWidgetManager.updateAppWidget(appWidgetId, views);
// }
// }
-
+
}
@@ -21,15 +21,15 @@
public class UpdateService extends Service implements Runnable {
private static final String MODULE = "GREGKHUpdateService";
-
+
private static final long UPDATE_INTERVAL = DateUtils.MINUTE_IN_MILLIS;
-
+
// Our lock for the list of times.
private static Object lock = new Object();
private static boolean thread_running;
-
+
public static final String ACTION_UPDATE_ALL = "com.kroah.clock.UPDATE_ALL";
-
+
@Override
public void onStart(Intent intent, int startId) {
Log.d(MODULE, "onStart:enter");
@@ -50,19 +50,18 @@ public void onStart(Intent intent, int startId) {
}
Log.d(MODULE, "onStart:exit");
}
-
+
public void run() {
Log.d(MODULE, "run:enter");
-
+
AppWidgetManager manager = AppWidgetManager.getInstance(this);
// ContentResolver resolve = getContentResolver();
RemoteViews updateViews = null;
-
+
updateViews = MedAppWidget.buildUpdate(this);
// Draw the updated time
-
// RemoteViews updateViews = new RemoteViews(this.getPackageName(), R.layout.widget_loading);
Date date = new Date();
DateFormat format = SimpleDateFormat.getTimeInstance(SimpleDateFormat.MEDIUM, Locale.getDefault());
@@ -72,25 +71,25 @@ public void run() {
ComponentName thisWidget = new ComponentName(this, MedAppWidget.class);
manager.updateAppWidget(thisWidget, updateViews);
-
+
// Schedule our next update
Time time = new Time();
time.set(System.currentTimeMillis() + UPDATE_INTERVAL);
time.second = 0;
long nextUpdate = time.toMillis(false);
-
+
Intent updateIntent = new Intent(ACTION_UPDATE_ALL);
updateIntent.setClass(this, UpdateService.class);
PendingIntent pendingIntent = PendingIntent.getService(this, 0, updateIntent, 0);
-
+
AlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP, nextUpdate, pendingIntent);
-
+
thread_running = false;
stopSelf();
Log.d(MODULE, "run:exit");
}
-
+
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub

0 comments on commit 1b053fe

Please sign in to comment.