Permalink
Browse files

v1.2

  • Loading branch information...
1 parent b7135d2 commit 5f32d88ae54000716ac089ab8e77223fb09fd806 Carles Sentis committed Jul 19, 2012
View
@@ -1,7 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.codeskraps.lolo"
- android:versionCode="2"
- android:versionName="1.1" >
+ android:versionCode="3"
+ android:versionName="1.2" >
+ <!-- Remember to update the info code version -->
<uses-sdk
android:minSdkVersion="7"
@@ -14,10 +15,14 @@
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
- <activity android:name=".PrefsActivity"
+ <activity
+ android:name=".PrefsActivity"
android:theme="@android:style/Theme.Light.NoTitleBar" >
<intent-filter>
+ <action android:name="android.intent.action.MAIN" />
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
View
@@ -1,13 +1,9 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
+<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:background="#222222"
+ android:background="#333333"
android:orientation="horizontal" >
<ImageView
@@ -22,15 +18,15 @@
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="@string/app_name"
- android:textColor="#B39000"
+ android:textColor="#AAAAAA"
android:textSize="25dp"
android:typeface="normal" />
</LinearLayout>
<LinearLayout
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="1dp"
- android:background="#666666"
+ android:background="#FF0000"
android:orientation="horizontal" />
-</LinearLayout>
+</merge>
View
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <include
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ layout="@layout/header" />
+
+ <ListView
+ android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+</LinearLayout>
View
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
-
-
- <Button
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="ok"/>
-</LinearLayout>
View
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
@@ -11,7 +11,24 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center"
android:contentDescription="@string/contentDescription"
- android:src="@drawable/closed"
- android:padding="15dip" />
+ android:padding="15dip"
+ android:src="@drawable/closed" />
-</LinearLayout>
+ <TextView
+ android:id="@+id/txtSync"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignBottom="@id/imgLolo"
+ android:gravity="center_horizontal"
+ android:typeface="monospace"
+ android:shadowColor="#000000"
+ android:shadowDx="1"
+ android:shadowDy="1"
+ android:shadowRadius="1"
+ android:textColor="#FFFFFF" />
+
+<!-- <ProgressBar -->
+<!-- android:id="@+id/prgBar" -->
+<!-- /> -->
+
+</RelativeLayout>
View
@@ -7,24 +7,29 @@
<!-- Preference Activity -->
<string name="prefsCat_General">General</string>
- <string name="prefsOnClick_title">OnClick event</string>
- <string name="prefsOnClick_dialogTitle">Select One</string>
+ <string name="prefsOnClick_title">On touch action</string>
+ <string name="prefsOnClick_dialogTitle">On touch action</string>
+ <string name="prefsOnClick_summary">Choose what should be done when you touch the widget -</string>
<string-array name="OnClick_entries">
- <item>Nothing</item>
+ <item>Do nothing</item>
<item>Update lo-lo status</item>
- <item>Open preference screen</item>
- <item>Open 091 Labs web page</item>
+ <item>Open widget settings</item>
+ <item>Open URL</item>
</string-array>
<string-array name="OnClick_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
+
+ <string name="prefsURL_title">URL</string>
+ <string name="prefsURL_summary">Set a Custom URL -</string>
+ <string name="prefsURL_default">091labs.com</string>
<string name="prefsCat_Info">Information</string>
- <string name="prefsInfo_Title">091 Labs lo-lo v1.1</string>
+ <string name="prefsInfo_Title">091 Labs lo-lo v1.2</string>
<string name="prefsInfo_summary">GNU GPL License v3 - 2012</string>
</resources>
View
@@ -3,12 +3,17 @@
<PreferenceCategory android:title="@string/prefsCat_General" >
<ListPreference
- android:key="lstOnClick"
- android:title="@string/prefsOnClick_title"
+ android:defaultValue="0"
+ android:dialogTitle="@string/prefsOnClick_dialogTitle"
android:entries="@array/OnClick_entries"
android:entryValues="@array/OnClick_values"
- android:defaultValue="0"
- android:dialogTitle="@string/prefsOnClick_dialogTitle" />
+ android:key="lstOnClick"
+ android:title="@string/prefsOnClick_title" />
+
+ <EditTextPreference
+ android:key="eURL"
+ android:title="@string/prefsURL_title"
+ android:defaultValue="@string/prefsURL_default" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/prefsCat_Info" >
<Preference
@@ -15,32 +15,35 @@
public class LoloProvider extends AppWidgetProvider {
private static final String TAG = LoloProvider.class.getSimpleName();
public static final String FORCE_WIDGET_UPDATE = "com.codeskraps.lolo.FORCE_WIDGET_UPDATE";
- private static final String URL = "http://091labs.com";
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
+ Log.d(TAG, "onUpdate");
updateWidget(context);
super.onUpdate(context, appWidgetManager, appWidgetIds);
}
@Override
public void onReceive(Context context, Intent intent) {
+ Log.d(TAG, "onReceive");
final String action = intent.getAction();
if (action.equals(FORCE_WIDGET_UPDATE))
updateWidget(context);
super.onReceive(context, intent);
}
-
+
public void updateWidget(Context context) {
- ComponentName thisWidget = new ComponentName(context, LoloProvider.class);
- AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
- int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
- updateWidget(context, appWidgetManager, appWidgetIds);
- }
+ Log.d(TAG, "updateWidget");
+ ComponentName thisWidget = new ComponentName(context, LoloProvider.class);
+ AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
+ int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
+ updateWidget(context, appWidgetManager, appWidgetIds);
+ }
private void updateWidget(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
+ Log.d(TAG, "updateWidget2");
final int N = appWidgetIds.length;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
@@ -59,6 +62,7 @@ private void updateWidget(Context context, AppWidgetManager appWidgetManager, in
switch (onClick) {
case 0:
intent = new Intent("com.codeskraps.lol.DO_NOTHING");
+ pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
break;
case 1:
pendingIntent = PendingIntent.getService(context, 0, serviceIntent, 0);
@@ -69,7 +73,11 @@ private void updateWidget(Context context, AppWidgetManager appWidgetManager, in
break;
case 3:
intent = new Intent(Intent.ACTION_VIEW);
- intent.setData(Uri.parse(URL));
+ String url = prefs.getString(PrefsActivity.EURL,
+ context.getString(R.string.prefsURL_default));
+ if (!url.startsWith("http://"))
+ url = "http://" + url;
+ intent.setData(Uri.parse(url));
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
break;
}
Oops, something went wrong.

0 comments on commit 5f32d88

Please sign in to comment.