summaryrefslogtreecommitdiffstats
path: root/core/java/com/android
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-11 12:11:56 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-11 12:11:56 -0700
commitc39a6e0c51e182338deb8b63d07933b585134929 (patch)
treee55fc5bd38b1eb8fb4851a0fe1cc264a7fe2f245 /core/java/com/android
parentb2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54 (diff)
downloadframeworks_base-c39a6e0c51e182338deb8b63d07933b585134929.zip
frameworks_base-c39a6e0c51e182338deb8b63d07933b585134929.tar.gz
frameworks_base-c39a6e0c51e182338deb8b63d07933b585134929.tar.bz2
auto import from //branches/cupcake/...@137873
Diffstat (limited to 'core/java/com/android')
-rw-r--r--core/java/com/android/internal/appwidget/IAppWidgetHost.aidl (renamed from core/java/com/android/internal/gadget/IGadgetHost.aidl)10
-rw-r--r--core/java/com/android/internal/appwidget/IAppWidgetService.aidl (renamed from core/java/com/android/internal/gadget/IGadgetService.aidl)32
-rw-r--r--core/java/com/android/internal/appwidget/package.html (renamed from core/java/com/android/internal/gadget/package.html)0
-rw-r--r--core/java/com/android/internal/widget/NumberPicker.java37
4 files changed, 41 insertions, 38 deletions
diff --git a/core/java/com/android/internal/gadget/IGadgetHost.aidl b/core/java/com/android/internal/appwidget/IAppWidgetHost.aidl
index e7b5a1e..2ed4773 100644
--- a/core/java/com/android/internal/gadget/IGadgetHost.aidl
+++ b/core/java/com/android/internal/appwidget/IAppWidgetHost.aidl
@@ -14,15 +14,15 @@
* limitations under the License.
*/
-package com.android.internal.gadget;
+package com.android.internal.appwidget;
import android.content.ComponentName;
-import android.gadget.GadgetProviderInfo;
+import android.appwidget.AppWidgetProviderInfo;
import android.widget.RemoteViews;
/** {@hide} */
-oneway interface IGadgetHost {
- void updateGadget(int gadgetId, in RemoteViews views);
- void providerChanged(int gadgetId, in GadgetProviderInfo info);
+oneway interface IAppWidgetHost {
+ void updateAppWidget(int appWidgetId, in RemoteViews views);
+ void providerChanged(int appWidgetId, in AppWidgetProviderInfo info);
}
diff --git a/core/java/com/android/internal/gadget/IGadgetService.aidl b/core/java/com/android/internal/appwidget/IAppWidgetService.aidl
index 9c66b95..496aa1a 100644
--- a/core/java/com/android/internal/gadget/IGadgetService.aidl
+++ b/core/java/com/android/internal/appwidget/IAppWidgetService.aidl
@@ -14,37 +14,37 @@
* limitations under the License.
*/
-package com.android.internal.gadget;
+package com.android.internal.appwidget;
import android.content.ComponentName;
-import android.gadget.GadgetProviderInfo;
-import com.android.internal.gadget.IGadgetHost;
+import android.appwidget.AppWidgetProviderInfo;
+import com.android.internal.appwidget.IAppWidgetHost;
import android.widget.RemoteViews;
/** {@hide} */
-interface IGadgetService {
+interface IAppWidgetService {
//
- // for GadgetHost
+ // for AppWidgetHost
//
- int[] startListening(IGadgetHost host, String packageName, int hostId,
+ int[] startListening(IAppWidgetHost host, String packageName, int hostId,
out List<RemoteViews> updatedViews);
void stopListening(int hostId);
- int allocateGadgetId(String packageName, int hostId);
- void deleteGadgetId(int gadgetId);
+ int allocateAppWidgetId(String packageName, int hostId);
+ void deleteAppWidgetId(int appWidgetId);
void deleteHost(int hostId);
void deleteAllHosts();
- RemoteViews getGadgetViews(int gadgetId);
+ RemoteViews getAppWidgetViews(int appWidgetId);
//
- // for GadgetManager
+ // for AppWidgetManager
//
- void updateGadgetIds(in int[] gadgetIds, in RemoteViews views);
- void updateGadgetProvider(in ComponentName provider, in RemoteViews views);
- List<GadgetProviderInfo> getInstalledProviders();
- GadgetProviderInfo getGadgetInfo(int gadgetId);
- void bindGadgetId(int gadgetId, in ComponentName provider);
- int[] getGadgetIds(in ComponentName provider);
+ void updateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views);
+ void updateAppWidgetProvider(in ComponentName provider, in RemoteViews views);
+ List<AppWidgetProviderInfo> getInstalledProviders();
+ AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId);
+ void bindAppWidgetId(int appWidgetId, in ComponentName provider);
+ int[] getAppWidgetIds(in ComponentName provider);
}
diff --git a/core/java/com/android/internal/gadget/package.html b/core/java/com/android/internal/appwidget/package.html
index db6f78b..db6f78b 100644
--- a/core/java/com/android/internal/gadget/package.html
+++ b/core/java/com/android/internal/appwidget/package.html
diff --git a/core/java/com/android/internal/widget/NumberPicker.java b/core/java/com/android/internal/widget/NumberPicker.java
index 1647c20..2f08c8d 100644
--- a/core/java/com/android/internal/widget/NumberPicker.java
+++ b/core/java/com/android/internal/widget/NumberPicker.java
@@ -30,6 +30,7 @@ import android.view.View.OnFocusChangeListener;
import android.view.View.OnLongClickListener;
import android.widget.TextView;
import android.widget.LinearLayout;
+import android.widget.EditText;
import com.android.internal.R;
@@ -76,7 +77,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
}
};
- private final TextView mText;
+ private final EditText mText;
private final InputFilter mNumberInputFilter;
private String[] mDisplayedValues;
@@ -117,7 +118,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
mDecrementButton.setOnLongClickListener(this);
mDecrementButton.setNumberPicker(this);
- mText = (TextView) findViewById(R.id.timepicker_input);
+ mText = (EditText) findViewById(R.id.timepicker_input);
mText.setOnFocusChangeListener(this);
mText.setFilters(new InputFilter[] {inputFilter});
mText.setRawInputType(InputType.TYPE_CLASS_NUMBER);
@@ -188,11 +189,8 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
}
public void onClick(View v) {
-
- /* The text view may still have focus so clear it's focus which will
- * trigger the on focus changed and any typed values to be pulled.
- */
- mText.clearFocus();
+ validateInput(mText);
+ if (!mText.hasFocus()) mText.requestFocus();
// now perform the increment/decrement
if (R.id.increment == v.getId()) {
@@ -239,6 +237,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
} else {
mText.setText(mDisplayedValues[mCurrent - mStart]);
}
+ mText.setSelection(mText.getText().length());
}
private void validateCurrentView(CharSequence str) {
@@ -257,16 +256,20 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
* has valid values.
*/
if (!hasFocus) {
- String str = String.valueOf(((TextView) v).getText());
- if ("".equals(str)) {
-
- // Restore to the old value as we don't allow empty values
- updateView();
- } else {
-
- // Check the new value and ensure it's in range
- validateCurrentView(str);
- }
+ validateInput(v);
+ }
+ }
+
+ private void validateInput(View v) {
+ String str = String.valueOf(((TextView) v).getText());
+ if ("".equals(str)) {
+
+ // Restore to the old value as we don't allow empty values
+ updateView();
+ } else {
+
+ // Check the new value and ensure it's in range
+ validateCurrentView(str);
}
}