复制代码 代码如下:
public class Search extends LinearLayout
implements OnClickListener, OnKeyListener, OnLongClickListener, onItemClickListener {
// Speed at which the widget slides up/down, in pixels/ms.
private static final float ANIMATION_VELOCITY = 1.0f;
private static final float WIDGET_TOP_OFFSET = 9;
private final String TAG = "SearchWidget";
private Launcher mLauncher;
private EditText mSearchText;
private ImageButton mVoiceButton;
private ImageButton mClearButton;
private Animation mMorphAnimation;
private Animation mUnmorphAnimation;
// These four are passed to Launcher.startSearch() when the search widget
// has finished morphing. They are instance variables to make it possible to update
// them while the widget is morphing.
private String mInitialQuery;
private boolean mSelectInitialQuery;
private Bundle mAppSearchData;
private boolean mGlobalSearch;
ListView mSearchResultList=null;
LinearLayout mSearchResult=null;
// For voice searching
private Intent mVoiceSearchIntent;
private int mWidgetTopOffset;
private int mAlpha = 0xff;//2011-01-12 add for draw alpha
private ArrayList