auto import from //branches/cupcake/...@127101
This commit is contained in:
28
core/java/com/android/internal/gadget/IGadgetService.aidl
Normal file
28
core/java/com/android/internal/gadget/IGadgetService.aidl
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.internal.gadget;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.gadget.GadgetInfo;
|
||||
|
||||
/** {@hide} */
|
||||
interface IGadgetService {
|
||||
int allocateGadgetId(String hostPackage);
|
||||
void deleteGadgetId(int gadgetId);
|
||||
void bindGadgetId(int gadgetId, in ComponentName provider);
|
||||
GadgetInfo getGadgetInfo(int gadgetId);
|
||||
}
|
||||
3
core/java/com/android/internal/gadget/package.html
Normal file
3
core/java/com/android/internal/gadget/package.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<body>
|
||||
{@hide}
|
||||
</body>
|
||||
@@ -116,7 +116,7 @@ public class HandlerCaller {
|
||||
}
|
||||
|
||||
public Message obtainMessageI(int what, int arg1) {
|
||||
return mH.obtainMessage(what, arg1);
|
||||
return mH.obtainMessage(what, arg1, 0);
|
||||
}
|
||||
|
||||
public Message obtainMessageIO(int what, int arg1, Object arg2) {
|
||||
|
||||
@@ -143,7 +143,7 @@ public final class IconMenuItemView extends TextView implements MenuView.ItemVie
|
||||
|
||||
void setCaptionMode(boolean shortcut) {
|
||||
|
||||
mShortcutCaptionMode = shortcut;
|
||||
mShortcutCaptionMode = shortcut && (mItemData.shouldShowShortcut());
|
||||
|
||||
/*
|
||||
* If there is no item model, don't do any of the below (for example,
|
||||
@@ -155,7 +155,7 @@ public final class IconMenuItemView extends TextView implements MenuView.ItemVie
|
||||
|
||||
CharSequence text = mItemData.getTitleForItemView(this);
|
||||
|
||||
if (shortcut) {
|
||||
if (mShortcutCaptionMode) {
|
||||
|
||||
if (mShortcutCaption == null) {
|
||||
mShortcutCaption = mItemData.getShortcutLabel();
|
||||
|
||||
@@ -171,9 +171,13 @@ public class ListMenuItemView extends LinearLayout implements MenuView.ItemView
|
||||
}
|
||||
|
||||
public void setShortcut(boolean showShortcut, char shortcutKey) {
|
||||
mShortcutView.setText(mItemData.getShortcutLabel());
|
||||
final int newVisibility = (showShortcut && mItemData.shouldShowShortcut())
|
||||
? VISIBLE : GONE;
|
||||
|
||||
if (newVisibility == VISIBLE) {
|
||||
mShortcutView.setText(mItemData.getShortcutLabel());
|
||||
}
|
||||
|
||||
final int newVisibility = showShortcut ? VISIBLE : GONE;
|
||||
if (mShortcutView.getVisibility() != newVisibility) {
|
||||
mShortcutView.setVisibility(newVisibility);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
@@ -279,7 +280,8 @@ public class MenuBuilder implements Menu {
|
||||
mVisibleItems = new ArrayList<MenuItemImpl>();
|
||||
mIsVisibleItemsStale = true;
|
||||
|
||||
mShortcutsVisible = true;
|
||||
mShortcutsVisible =
|
||||
(mResources.getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS);
|
||||
}
|
||||
|
||||
public void setCallback(Callback callback) {
|
||||
@@ -687,7 +689,8 @@ public class MenuBuilder implements Menu {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the shortcuts should be visible on menus.
|
||||
* Sets whether the shortcuts should be visible on menus. Devices without hardware
|
||||
* key input will never make shortcuts visible even if this method is passed 'true'.
|
||||
*
|
||||
* @param shortcutsVisible Whether shortcuts should be visible (if true and a
|
||||
* menu item does not have a shortcut defined, that item will
|
||||
@@ -696,9 +699,11 @@ public class MenuBuilder implements Menu {
|
||||
public void setShortcutsVisible(boolean shortcutsVisible) {
|
||||
if (mShortcutsVisible == shortcutsVisible) return;
|
||||
|
||||
mShortcutsVisible = shortcutsVisible;
|
||||
mShortcutsVisible =
|
||||
(mResources.getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS)
|
||||
&& shortcutsVisible;
|
||||
|
||||
refreshShortcuts(shortcutsVisible, isQwertyMode());
|
||||
refreshShortcuts(mShortcutsVisible, isQwertyMode());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -131,6 +131,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
|
||||
mText = (TextView) findViewById(R.id.timepicker_input);
|
||||
mText.setOnFocusChangeListener(this);
|
||||
mText.setFilters(new InputFilter[] { mInputFilter });
|
||||
mText.setRawInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
|
||||
mSlideUpOutAnimation = new TranslateAnimation(
|
||||
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
|
||||
|
||||
Reference in New Issue
Block a user