public override android.view.View getView(int position, android.view.View convertView
                                           , android.view.ViewGroup parent)
 {
     android.widget.Button b = (android.widget.Button) this._enclosing.mInflater.inflate
                                   ([email protected]_picker_button, null);
     b.setText(java.lang.CharSequenceProxy.Wrap(this._enclosing.mOptions[position].ToString
                                                    ()));
     b.setOnClickListener(this._enclosing);
     return(b);
 }
示例#2
0
		protected internal override void onFinishInflate()
		{
			mImageButton = (android.widget.ImageButton)findViewById([email protected]
				);
			mTextButton = (android.widget.Button)findViewById([email protected]
				);
			mImageButton.setOnClickListener(this);
			mTextButton.setOnClickListener(this);
			mImageButton.setOnLongClickListener(this);
			setOnClickListener(this);
			setOnLongClickListener(this);
		}
示例#3
0
 protected internal override void onFinishInflate()
 {
     mImageButton = (android.widget.ImageButton)findViewById([email protected]
                                                             );
     mTextButton = (android.widget.Button)findViewById([email protected]
                                                       );
     mImageButton.setOnClickListener(this);
     mTextButton.setOnClickListener(this);
     mImageButton.setOnLongClickListener(this);
     setOnClickListener(this);
     setOnLongClickListener(this);
 }
 protected internal override void onCreate(android.os.Bundle savedInstanceState)
 {
     base.onCreate(savedInstanceState);
     android.view.WindowManagerClass.LayoutParams @params = getWindow().getAttributes(
         );
     @params.token = mView.getApplicationWindowToken();
     @params.type  = android.view.WindowManagerClass.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
     @params.flags = @params.flags | android.view.Window.FEATURE_NO_TITLE;
     setContentView([email protected]_picker);
     android.widget.GridView grid = (android.widget.GridView)findViewById([email protected]
                                                                          .id.characterPicker);
     grid.setAdapter(new android.text.method.CharacterPickerDialog.OptionsAdapter(this
                                                                                  , getContext()));
     grid.setOnItemClickListener(this);
     mCancelButton = (android.widget.Button)findViewById([email protected]
                                                         );
     mCancelButton.setOnClickListener(this);
 }
示例#5
0
		protected internal override void onCreate(android.os.Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			android.view.WindowManagerClass.LayoutParams @params = getWindow().getAttributes(
				);
			@params.token = mView.getApplicationWindowToken();
			@params.type = android.view.WindowManagerClass.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
			@params.flags = @params.flags | android.view.Window.FEATURE_NO_TITLE;
			setContentView([email protected]_picker);
			android.widget.GridView grid = (android.widget.GridView)findViewById([email protected]
				.id.characterPicker);
			grid.setAdapter(new android.text.method.CharacterPickerDialog.OptionsAdapter(this
				, getContext()));
			grid.setOnItemClickListener(this);
			mCancelButton = (android.widget.Button)findViewById([email protected]
				);
			mCancelButton.setOnClickListener(this);
		}
示例#6
0
        private bool setupButtons()
        {
            int BIT_BUTTON_POSITIVE = 1;
            int BIT_BUTTON_NEGATIVE = 2;
            int BIT_BUTTON_NEUTRAL  = 4;
            int whichButtons        = 0;

            mButtonPositive = (android.widget.Button)mWindow.findViewById([email protected]
                                                                          .id.button1);
            mButtonPositive.setOnClickListener(mButtonHandler);
            if (android.text.TextUtils.isEmpty(mButtonPositiveText))
            {
                mButtonPositive.setVisibility(android.view.View.GONE);
            }
            else
            {
                mButtonPositive.setText(mButtonPositiveText);
                mButtonPositive.setVisibility(android.view.View.VISIBLE);
                whichButtons = whichButtons | BIT_BUTTON_POSITIVE;
            }
            mButtonNegative = (android.widget.Button)mWindow.findViewById([email protected]
                                                                          .id.button2);
            mButtonNegative.setOnClickListener(mButtonHandler);
            if (android.text.TextUtils.isEmpty(mButtonNegativeText))
            {
                mButtonNegative.setVisibility(android.view.View.GONE);
            }
            else
            {
                mButtonNegative.setText(mButtonNegativeText);
                mButtonNegative.setVisibility(android.view.View.VISIBLE);
                whichButtons = whichButtons | BIT_BUTTON_NEGATIVE;
            }
            mButtonNeutral = (android.widget.Button)mWindow.findViewById([email protected].
                                                                         id.button3);
            mButtonNeutral.setOnClickListener(mButtonHandler);
            if (android.text.TextUtils.isEmpty(mButtonNeutralText))
            {
                mButtonNeutral.setVisibility(android.view.View.GONE);
            }
            else
            {
                mButtonNeutral.setText(mButtonNeutralText);
                mButtonNeutral.setVisibility(android.view.View.VISIBLE);
                whichButtons = whichButtons | BIT_BUTTON_NEUTRAL;
            }
            if (shouldCenterSingleButton(mContext))
            {
                if (whichButtons == BIT_BUTTON_POSITIVE)
                {
                    centerButton(mButtonPositive);
                }
                else
                {
                    if (whichButtons == BIT_BUTTON_NEGATIVE)
                    {
                        centerButton(mButtonNeutral);
                    }
                    else
                    {
                        if (whichButtons == BIT_BUTTON_NEUTRAL)
                        {
                            centerButton(mButtonNeutral);
                        }
                    }
                }
            }
            return(whichButtons != 0);
        }
示例#7
0
        public TimePicker(android.content.Context context, android.util.AttributeSet attrs
                          , int defStyle) : base(context, attrs, defStyle)
        {
            setCurrentLocale(System.Globalization.CultureInfo.CurrentCulture);
            android.content.res.TypedArray attributesArray = context.obtainStyledAttributes(attrs
                                                                                            , [email protected], defStyle, 0);
            int layoutResourceId = attributesArray.getResourceId([email protected]
                                                                 .TimePicker_layout, [email protected]_picker);

            attributesArray.recycle();
            android.view.LayoutInflater inflater = (android.view.LayoutInflater)context.getSystemService
                                                       (android.content.Context.LAYOUT_INFLATER_SERVICE);
            inflater.inflate(layoutResourceId, this, true);
            mHourSpinner = (android.widget.NumberPicker)findViewById([email protected]
                                                                     );
            mHourSpinner.setOnValueChangedListener(new _OnValueChangeListener_147(this));
            mHourSpinnerInput = (android.widget.EditText)mHourSpinner.findViewById([email protected]
                                                                                   .id.numberpicker_input);
            mHourSpinnerInput.setImeOptions(android.view.inputmethod.EditorInfo.IME_ACTION_NEXT
                                            );
            mDivider = (android.widget.TextView)findViewById([email protected]);
            if (mDivider != null)
            {
                mDivider.setText([email protected][email protected]_picker_separator);
            }
            mMinuteSpinner = (android.widget.NumberPicker)findViewById([email protected]
                                                                       .minute);
            mMinuteSpinner.setMinValue(0);
            mMinuteSpinner.setMaxValue(59);
            mMinuteSpinner.setOnLongPressUpdateInterval(100);
            mMinuteSpinner.setFormatter(android.widget.NumberPicker.TWO_DIGIT_FORMATTER);
            mMinuteSpinner.setOnValueChangedListener(new _OnValueChangeListener_175(this));
            mMinuteSpinnerInput = (android.widget.EditText)mMinuteSpinner.findViewById([email protected]
                                                                                       .id.numberpicker_input);
            mMinuteSpinnerInput.setImeOptions(android.view.inputmethod.EditorInfo.IME_ACTION_NEXT
                                              );
            mAmPmStrings = new java.text.DateFormatSymbols().getAmPmStrings();
            android.view.View amPmView = findViewById([email protected]);
            if (amPmView is android.widget.Button)
            {
                mAmPmSpinner      = null;
                mAmPmSpinnerInput = null;
                mAmPmButton       = (android.widget.Button)amPmView;
                mAmPmButton.setOnClickListener(new _OnClickListener_210(this));
            }
            else
            {
                mAmPmButton  = null;
                mAmPmSpinner = (android.widget.NumberPicker)amPmView;
                mAmPmSpinner.setMinValue(0);
                mAmPmSpinner.setMaxValue(1);
                mAmPmSpinner.setDisplayedValues(mAmPmStrings);
                mAmPmSpinner.setOnValueChangedListener(new _OnValueChangeListener_223(this));
                mAmPmSpinnerInput = (android.widget.EditText)mAmPmSpinner.findViewById([email protected]
                                                                                       .id.numberpicker_input);
                mAmPmSpinnerInput.setImeOptions(android.view.inputmethod.EditorInfo.IME_ACTION_DONE
                                                );
            }
            // update controls to initial state
            updateHourControl();
            updateAmPmControl();
            setOnTimeChangedListener(NO_OP_CHANGE_LISTENER);
            // set to current time
            setCurrentHour(mTempCalendar.get(java.util.Calendar.HOUR_OF_DAY));
            setCurrentMinute(mTempCalendar.get(java.util.Calendar.MINUTE));
            if (!isEnabled())
            {
                setEnabled(false);
            }
            // set the content descriptions
            setContentDescriptions();
        }