Example #1
0
 public virtual void initForMode(android.view.ActionMode mode)
 {
     if (mClose == null)
     {
         android.view.LayoutInflater inflater = android.view.LayoutInflater.from(mContext);
         mClose = inflater.inflate([email protected]_mode_close_item, this
                                   , false);
         addView(mClose);
     }
     else
     {
         if (mClose.getParent() == null)
         {
             addView(mClose);
         }
     }
     android.view.View closeButton = mClose.findViewById([email protected]_mode_close_button
                                                         );
     closeButton.setOnClickListener(new _OnClickListener_212(mode));
     [email protected] menu = ([email protected]
                                                     )mode.getMenu();
     mActionMenuPresenter = new [email protected](mContext
                                                                                );
     mActionMenuPresenter.setReserveOverflow(true);
     android.view.ViewGroup.LayoutParams layoutParams = new android.view.ViewGroup.LayoutParams
                                                            (android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams
                                                            .MATCH_PARENT);
     if (!mSplitActionBar)
     {
         menu.addMenuPresenter(mActionMenuPresenter);
         mMenuView = ([email protected])mActionMenuPresenter.getMenuView
                         (this);
         mMenuView.setBackgroundDrawable(null);
         addView(mMenuView, layoutParams);
     }
     else
     {
         // Allow full screen width in split mode.
         mActionMenuPresenter.setWidthLimit(getContext().getResources().getDisplayMetrics(
                                                ).widthPixels, true);
         // No limit to the item count; use whatever will fit.
         mActionMenuPresenter.setItemLimit(int.MaxValue);
         // Span the whole width
         layoutParams.width  = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
         layoutParams.height = mContentHeight;
         menu.addMenuPresenter(mActionMenuPresenter);
         mMenuView = ([email protected])mActionMenuPresenter.getMenuView
                         (this);
         mMenuView.setBackgroundDrawable(mSplitBackground);
         mSplitView.addView(mMenuView, layoutParams);
     }
     mAnimateInOnLayout = true;
 }
Example #2
0
 public override void addView(android.view.View child)
 {
     if (child.getLayoutParams() == null)
     {
         android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams
                                                           (0, android.view.ViewGroup.LayoutParams.MATCH_PARENT, 1.0f);
         lp.setMargins(0, 0, 0, 0);
         child.setLayoutParams(lp);
     }
     // Ensure you can navigate to the tab with the keyboard, and you can touch it
     child.setFocusable(true);
     child.setClickable(true);
     base.addView(child);
     // TODO: detect this via geometry with a tabwidget listener rather
     // than potentially interfere with the view's listener
     child.setOnClickListener(new android.widget.TabWidget.TabClickListener(this, getTabCount
                                                                                () - 1));
     child.setOnFocusChangeListener(this);
 }
 public virtual android.view.View getPermissionsView()
 {
     mInflater = (android.view.LayoutInflater)mContext.getSystemService(android.content.Context
                                                                        .LAYOUT_INFLATER_SERVICE);
     mPermsView = (android.widget.LinearLayout)mInflater.inflate([email protected]
                                                                 .app_perms_summary, null);
     mShowMore     = mPermsView.findViewById([email protected]_more);
     mShowMoreIcon = (android.widget.ImageView)mShowMore.findViewById([email protected]
                                                                      .id.show_more_icon);
     mShowMoreText = (android.widget.TextView)mShowMore.findViewById([email protected]
                                                                     .id.show_more_text);
     mDangerousList = (android.widget.LinearLayout)mPermsView.findViewById([email protected]
                                                                           .id.dangerous_perms_list);
     mNonDangerousList = (android.widget.LinearLayout)mPermsView.findViewById([email protected]
                                                                              .id.non_dangerous_perms_list);
     mNoPermsView = mPermsView.findViewById([email protected]_permissions);
     // Set up the LinearLayout that acts like a list item.
     mShowMore.setClickable(true);
     mShowMore.setOnClickListener(this);
     mShowMore.setFocusable(true);
     // Pick up from framework resources instead.
     mDefaultGrpLabel = mContext.getString([email protected][email protected]_permission_group
                                           );
     mPermFormat = mContext.getString([email protected][email protected]_format);
     mNormalIcon = mContext.getResources().getDrawable([email protected]_text_dot
                                                       );
     mDangerousIcon = mContext.getResources().getDrawable([email protected]
                                                          .ic_bullet_key_permission);
     mShowMaxIcon = mContext.getResources().getDrawable([email protected]_close_holo_dark
                                                        );
     mShowMinIcon = mContext.getResources().getDrawable([email protected]_open_holo_dark
                                                        );
     // Set permissions view
     setPermissions(mPermsList);
     return(mPermsView);
 }
Example #4
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();
		}