Beispiel #1
0
		public SearchView(android.content.Context context, android.util.AttributeSet attrs
			) : base(context, attrs)
		{
			mShowImeRunnable = new _Runnable_137(this);
			mUpdateDrawableStateRunnable = new _Runnable_148(this);
			mOnClickListener = new _OnClickListener_787(this);
			mTextKeyListener = new _OnKeyListener_836(this);
			mOnEditorActionListener = new _OnEditorActionListener_1059(this);
			mOnItemClickListener = new _OnItemClickListener_1233(this);
			mOnItemSelectedListener = new _OnItemSelectedListener_1244(this);
			mTextWatcher = new _TextWatcher_1530(this);
			android.view.LayoutInflater inflater = (android.view.LayoutInflater)context.getSystemService
				(android.content.Context.LAYOUT_INFLATER_SERVICE);
			inflater.inflate([email protected]_view, this, true);
			mSearchButton = findViewById([email protected]_button);
			mQueryTextView = (android.widget.SearchView.SearchAutoComplete)findViewById([email protected]
				.id.search_src_text);
			mQueryTextView.setSearchView(this);
			mSearchEditFrame = findViewById([email protected]_edit_frame);
			mSearchPlate = findViewById([email protected]_plate);
			mSubmitArea = findViewById([email protected]_area);
			mSubmitButton = findViewById([email protected]_go_btn);
			mCloseButton = (android.widget.ImageView)findViewById([email protected]_close_btn
				);
			mVoiceButton = findViewById([email protected]_voice_btn);
			mSearchHintIcon = (android.widget.ImageView)findViewById([email protected]_mag_icon
				);
			mSearchButton.setOnClickListener(mOnClickListener);
			mCloseButton.setOnClickListener(mOnClickListener);
			mSubmitButton.setOnClickListener(mOnClickListener);
			mVoiceButton.setOnClickListener(mOnClickListener);
			mQueryTextView.setOnClickListener(mOnClickListener);
			mQueryTextView.addTextChangedListener(mTextWatcher);
			mQueryTextView.setOnEditorActionListener(mOnEditorActionListener);
			mQueryTextView.setOnItemClickListener(mOnItemClickListener);
			mQueryTextView.setOnItemSelectedListener(mOnItemSelectedListener);
			mQueryTextView.setOnKeyListener(mTextKeyListener);
			mQueryTextView.setOnFocusChangeListener(new _OnFocusChangeListener_265(this));
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.SearchView, 0, 0);
			setIconifiedByDefault(a.getBoolean([email protected]_iconifiedByDefault
				, true));
			int maxWidth = a.getDimensionPixelSize([email protected]_maxWidth
				, -1);
			if (maxWidth != -1)
			{
				setMaxWidth(maxWidth);
			}
			java.lang.CharSequence queryHint = a.getText([email protected]_queryHint
				);
			if (!android.text.TextUtils.isEmpty(queryHint))
			{
				setQueryHint(queryHint);
			}
			int imeOptions = a.getInt([email protected]_imeOptions, -1
				);
			if (imeOptions != -1)
			{
				setImeOptions(imeOptions);
			}
			int inputType = a.getInt([email protected]_inputType, -1);
			if (inputType != -1)
			{
				setInputType(inputType);
			}
			a.recycle();
			bool focusable = true;
			a = context.obtainStyledAttributes(attrs, [email protected], 0, 
				0);
			focusable = a.getBoolean([email protected]_focusable, focusable);
			a.recycle();
			setFocusable(focusable);
			mVoiceWebSearchIntent = new android.content.Intent(android.speech.RecognizerIntent
				.ACTION_WEB_SEARCH);
			mVoiceWebSearchIntent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
			mVoiceWebSearchIntent.putExtra(android.speech.RecognizerIntent.EXTRA_LANGUAGE_MODEL
				, android.speech.RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
			mVoiceAppSearchIntent = new android.content.Intent(android.speech.RecognizerIntent
				.ACTION_RECOGNIZE_SPEECH);
			mVoiceAppSearchIntent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
			mDropDownAnchor = findViewById(mQueryTextView.getDropDownAnchor());
			if (mDropDownAnchor != null)
			{
				mDropDownAnchor.addOnLayoutChangeListener(new _OnLayoutChangeListener_313(this));
			}
			updateViewsVisibility(mIconifiedByDefault);
			updateQueryHint();
		}
Beispiel #2
0
		public SearchView(android.content.Context context) : this(context, null)
		{
			mShowImeRunnable = new _Runnable_137(this);
			mUpdateDrawableStateRunnable = new _Runnable_148(this);
			mOnClickListener = new _OnClickListener_787(this);
			mTextKeyListener = new _OnKeyListener_836(this);
			mOnEditorActionListener = new _OnEditorActionListener_1059(this);
			mOnItemClickListener = new _OnItemClickListener_1233(this);
			mOnItemSelectedListener = new _OnItemSelectedListener_1244(this);
			mTextWatcher = new _TextWatcher_1530(this);
		}