Пример #1
0
 private void updateAmPmControl()
 {
     if (is24HourView())
     {
         if (mAmPmSpinner != null)
         {
             mAmPmSpinner.setVisibility(android.view.View.GONE);
         }
         else
         {
             mAmPmButton.setVisibility(android.view.View.GONE);
         }
     }
     else
     {
         int index = mIsAm ? java.util.Calendar.AM : java.util.Calendar.PM;
         if (mAmPmSpinner != null)
         {
             mAmPmSpinner.setValue(index);
             mAmPmSpinner.setVisibility(android.view.View.VISIBLE);
         }
         else
         {
             mAmPmButton.setText(java.lang.CharSequenceProxy.Wrap(mAmPmStrings[index]));
             mAmPmButton.setVisibility(android.view.View.VISIBLE);
         }
     }
     sendAccessibilityEvent(android.view.accessibility.AccessibilityEvent.TYPE_VIEW_SELECTED
                            );
 }
Пример #2
0
 public virtual void setTitle(java.lang.CharSequence title)
 {
     mTitle = title;
     mTextButton.setText(mTitle);
     setContentDescription(mTitle);
     updateTextButtonVisibility();
 }
Пример #3
0
 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);
 }
Пример #4
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);
        }