Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rename some fields and take out the list view.

  • Loading branch information...
commit fd953ddafa3a7eecd90c3d1ab3a03fb53133f72e 1 parent 1374021
@gregkh authored
View
2  AndroidManifest.xml
@@ -12,7 +12,7 @@
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
- android:resource="@xml/widget_med"/>
+ android:resource="@xml/widget"/>
</receiver>
<activity android:name=".Configure">
<intent-filter>
View
5 res/layout/config.xml
@@ -9,11 +9,6 @@
android:layout_height="wrap_content"
android:text="@string/hello"
/>
- <ListView
- android:id="@+id/myListView"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- />
<Button
android:id="@+id/myButton"
android:layout_width="fill_parent"
View
0  res/layout/widget_loading.xml → res/layout/widget.xml
File renamed without changes
View
2  res/xml/widget_med.xml → res/xml/widget.xml
@@ -4,5 +4,5 @@
android:minWidth="72dip"
android:minHeight="72dip"
android:updatePeriodMillis="0"
- android:initialLayout="@layout/widget_loading"
+ android:initialLayout="@layout/widget"
android:configure="com.kroah.clock.Configure" />
View
25 src/com/kroah/clock/Configure.java
@@ -1,16 +1,12 @@
package com.kroah.clock;
-import java.util.ArrayList;
-
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
-import android.widget.ArrayAdapter;
import android.widget.Button;
-import android.widget.ListView;
import android.app.AlertDialog;
import android.appwidget.AppWidgetManager;
import android.content.DialogInterface;
@@ -18,8 +14,6 @@
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
-
-
public class Configure extends Activity {
public static final String MODULE = "GREGKHConfigureScreen";
@@ -46,14 +40,12 @@ public void onCancel(DialogInterface Dialog) {
ad.show();
}
- static final private int MENU_ADD = 0;
static final private int MENU_SETTINGS = 1;
static final private int MENU_ABOUT = 2;
static final private int MENU_EXIT = 3;
/* Creates the menu items */
public boolean onCreateOptionsMenu(Menu menu) {
- menu.add(0, MENU_ADD, 0, "Add").setIcon(R.drawable.menu_add);
menu.add(0, MENU_SETTINGS, 0, "Settings").setIcon(R.drawable.menu_preferences);
menu.add(0, MENU_ABOUT, 0, "About").setIcon(R.drawable.menu_about);
menu.add(0, MENU_EXIT, 0, "Exit").setIcon(R.drawable.menu_close);
@@ -63,10 +55,6 @@ public boolean onCreateOptionsMenu(Menu menu) {
/* Handles item selections */
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
- case MENU_ADD:
- timezone_list.add(0, "timezone foo");
- timezone_adapter.notifyDataSetChanged();
- return true;
case MENU_SETTINGS:
//settings();
return true;
@@ -83,9 +71,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
return false;
}
- private ArrayList<String> timezone_list;
- private ArrayAdapter<String> timezone_adapter;
-
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -113,15 +98,5 @@ public void onClick(View v) {
finish();
}
});
-
-
- ListView myListView = (ListView)findViewById(R.id.myListView);
-
- timezone_list = new ArrayList<String>();
- timezone_adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, timezone_list);
- myListView.setAdapter(timezone_adapter);
-
- timezone_list.add(0, "timezone 1");
- timezone_adapter.notifyDataSetChanged();
}
}
View
2  src/com/kroah/clock/MedAppWidget.java
@@ -28,7 +28,7 @@ public void onUpdate(Context context,
public static RemoteViews buildUpdate(Context context) {
Log.d(MODULE, "building widget update");
- RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_loading);
+ RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);
// ContentResolver resolver = context.getContentResolver();
// Resources res = context.getResources();
View
2  src/com/kroah/clock/UpdateService.java
@@ -32,7 +32,7 @@
@Override
public void onStart(Intent intent, int startId) {
- RemoteViews updateViews = new RemoteViews(this.getPackageName(), R.layout.widget_loading);
+ RemoteViews updateViews = new RemoteViews(this.getPackageName(), R.layout.widget);
Date date = new Date();
DateFormat format = SimpleDateFormat.getTimeInstance(SimpleDateFormat.MEDIUM, Locale.getDefault());
Please sign in to comment.
Something went wrong with that request. Please try again.