Search in sources :

Example 21 with RadioGroup

use of android.widget.RadioGroup in project BGABadgeView-Android by bingoogolapple.

the class MainActivity method testRadioButton.

private void testRadioButton() {
    mHomeBrb.showTextBadge("10");
    mMessageBrb.showTextBadge("1");
    mDiscoverBrb.showTextBadge("...");
    mMeBrb.showDrawableBadge(BitmapFactory.decodeResource(getResources(), R.mipmap.avatar_vip));
    new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            mHomeBrb.showTextBadge("1");
        }
    }, 5000);
    mHomeBrb.setDragDismissDelegage(new BGADragDismissDelegate() {

        @Override
        public void onDismiss(BGABadgeable badgeable) {
            ToastUtil.show("消息单选按钮徽章拖动消失");
        }
    });
    mTabRg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            switch(checkedId) {
                case R.id.brb_main_home:
                    ToastUtil.show("首页");
                    break;
                case R.id.brb_main_message:
                    ToastUtil.show("消息");
                    break;
                case R.id.brb_main_discover:
                    ToastUtil.show("发现");
                    break;
                case R.id.brb_main_me:
                    ToastUtil.show("我");
                    break;
            }
        }
    });
}
Also used : BGADragDismissDelegate(cn.bingoogolapple.badgeview.BGADragDismissDelegate) BGABadgeable(cn.bingoogolapple.badgeview.BGABadgeable) RadioGroup(android.widget.RadioGroup) Handler(android.os.Handler)

Example 22 with RadioGroup

use of android.widget.RadioGroup in project MagicCamera by wuhaoyu1990.

the class ImageActivity method initRadioButtons.

private void initRadioButtons() {
    mRadioGroup = (RadioGroup) findViewById(R.id.image_edit_radiogroup);
    mRadioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            switch(checkedId) {
                case R.id.image_edit_adjust:
                    if (!mFragments[2].isAdded())
                        getFragmentManager().beginTransaction().add(R.id.image_edit_fragment_container, mFragments[2]).show(mFragments[2]).commit();
                    else
                        getFragmentManager().beginTransaction().show(mFragments[2]).commit();
                    mFragmentTag = 2;
                    break;
                case R.id.image_edit_filter:
                    if (!mFragments[3].isAdded())
                        getFragmentManager().beginTransaction().add(R.id.image_edit_fragment_container, mFragments[3]).show(mFragments[3]).commit();
                    else
                        getFragmentManager().beginTransaction().show(mFragments[3]).commit();
                    mFragmentTag = 3;
                    break;
                case R.id.image_edit_frame:
                    if (!mFragments[4].isAdded())
                        getFragmentManager().beginTransaction().add(R.id.image_edit_fragment_container, mFragments[4]).show(mFragments[4]).commit();
                    else
                        getFragmentManager().beginTransaction().show(mFragments[4]).commit();
                    mFragmentTag = 4;
                    break;
                case R.id.image_edit_adds:
                    if (!mFragments[1].isAdded())
                        getFragmentManager().beginTransaction().add(R.id.image_edit_fragment_container, mFragments[1]).show(mFragments[1]).commit();
                    else
                        getFragmentManager().beginTransaction().show(mFragments[1]).commit();
                    mFragmentTag = 1;
                    break;
                case R.id.image_edit_beauty:
                    if (!mFragments[0].isAdded())
                        getFragmentManager().beginTransaction().add(R.id.image_edit_fragment_container, mFragments[0]).show(mFragments[0]).commit();
                    else
                        getFragmentManager().beginTransaction().show(mFragments[0]).commit();
                    mFragmentTag = 0;
                    break;
                default:
                    if (mFragmentTag != -1)
                        getFragmentManager().beginTransaction().hide(mFragments[mFragmentTag]).commit();
                    mFragmentTag = -1;
                    break;
            }
        }
    });
}
Also used : OnCheckedChangeListener(android.widget.RadioGroup.OnCheckedChangeListener) RadioGroup(android.widget.RadioGroup)

Example 23 with RadioGroup

use of android.widget.RadioGroup in project MagicCamera by wuhaoyu1990.

the class ImageEditAdjustView method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mRadioGroup = (RadioGroup) getView().findViewById(R.id.fragment_adjust_radiogroup);
    mRadioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            // TODO Auto-generated method stub
            if (checkedId != -1)
                mLinearLayout.setVisibility(View.VISIBLE);
            switch(checkedId) {
                case R.id.fragment_radio_contrast:
                    type = MagicFilterType.CONTRAST;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(-100, 100, -50, 1);
                    mSeekBar.setValue(contrast);
                    mLabel.setBackgroundResource(R.drawable.selector_image_edit_adjust_contrast);
                    break;
                case R.id.fragment_radio_exposure:
                    type = MagicFilterType.EXPOSURE;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(-100, 100, 0, 1);
                    mSeekBar.setValue(exposure);
                    mLabel.setBackgroundResource(R.drawable.selector_image_edit_adjust_exposure);
                    break;
                case R.id.fragment_radio_saturation:
                    type = MagicFilterType.SATURATION;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(-100, 100, 0, 1);
                    mSeekBar.setValue(saturation);
                    mLabel.setBackgroundResource(R.drawable.selector_image_edit_adjust_saturation);
                    break;
                case R.id.fragment_radio_sharpness:
                    type = MagicFilterType.SHARPEN;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(-100, 100, 0, 1);
                    mSeekBar.setValue(sharpness);
                    mLabel.setBackgroundResource(R.drawable.selector_image_edit_adjust_saturation);
                    break;
                case R.id.fragment_radio_bright:
                    type = MagicFilterType.BRIGHTNESS;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(-100, 100, 0, 1);
                    mSeekBar.setValue(brightness);
                    break;
                case R.id.fragment_radio_hue:
                    type = MagicFilterType.HUE;
                    mSeekBar.reset();
                    mSeekBar.setSeekLength(0, 360, 0, 1);
                    mSeekBar.setValue(hue);
                    break;
                default:
                    break;
            }
        }
    });
    mSeekBar = (TwoLineSeekBar) view.findViewById(R.id.item_seek_bar);
    mSeekBar.setOnSeekChangeListener(mOnSeekChangeListener);
    mVal = (TextView) view.findViewById(R.id.item_val);
    mLabel = (ImageView) view.findViewById(R.id.item_label);
    mLinearLayout = (LinearLayout) view.findViewById(R.id.seek_bar_item_menu);
    mMagicDisplay.setFilter(MagicFilterType.IMAGE_ADJUST);
}
Also used : OnCheckedChangeListener(android.widget.RadioGroup.OnCheckedChangeListener) RadioGroup(android.widget.RadioGroup)

Example 24 with RadioGroup

use of android.widget.RadioGroup in project ride-read-android by Ride-Read.

the class MineEditMessageActivity method onSelectSex.

public void onSelectSex(View v) {
    final AlertDialog alertDialog = new AlertDialog.Builder(this).create();
    alertDialog.show();
    Window window = alertDialog.getWindow();
    View mView = LayoutInflater.from(this).inflate(R.layout.mine_editmsg_selectsex_layout, null);
    RadioGroup group = (RadioGroup) mView.findViewById(R.id.mine_editmsg_sex_radiogroup);
    final RadioButton maleBtn = (RadioButton) mView.findViewById(R.id.mine_editmsg_sex_radiomale);
    final RadioButton femaleBtn = (RadioButton) mView.findViewById(R.id.mine_editmsg_sex_radiofemale);
    String defaultSex = editmsgSex.getText().toString().trim();
    if (defaultSex != null && !defaultSex.isEmpty()) {
        if (defaultSex.equals("男")) {
            maleBtn.setChecked(true);
        } else {
            femaleBtn.setChecked(true);
        }
    }
    window.setContentView(mView);
    maleBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            maleBtn.setChecked(true);
            editmsgSex.setText("男");
            alertDialog.cancel();
        }
    });
    femaleBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            femaleBtn.setChecked(true);
            editmsgSex.setText("女");
            alertDialog.cancel();
        }
    });
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) Window(android.view.Window) RadioGroup(android.widget.RadioGroup) RadioButton(android.widget.RadioButton) ImageView(android.widget.ImageView) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) View(android.view.View) TextView(android.widget.TextView)

Example 25 with RadioGroup

use of android.widget.RadioGroup in project AndroidDevelop by 7449.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    setTabSelect(0);
    RadioGroup radioGroup = (RadioGroup) findViewById(R.id.rg_group);
    radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(RadioGroup radioGroup, int i) {
            switch(i) {
                case R.id.rb_one:
                    setTabSelect(0);
                    break;
                default:
                    setTabSelect(1);
                    break;
            }
        }
    });
}
Also used : RadioGroup(android.widget.RadioGroup)

Aggregations

RadioGroup (android.widget.RadioGroup)62 View (android.view.View)26 TextView (android.widget.TextView)19 RadioButton (android.widget.RadioButton)13 OnCheckedChangeListener (android.widget.RadioGroup.OnCheckedChangeListener)13 Button (android.widget.Button)9 CompoundButton (android.widget.CompoundButton)8 Validator (com.mobsandgeeks.saripaar.Validator)8 CheckBox (android.widget.CheckBox)5 IOException (java.io.IOException)5 RandomAccessFile (java.io.RandomAccessFile)5 Test (org.junit.Test)5 DialogInterface (android.content.DialogInterface)4 Intent (android.content.Intent)4 ImageView (android.widget.ImageView)4 ScrollView (android.widget.ScrollView)4 Paint (android.graphics.Paint)3 AlertDialog (android.support.v7.app.AlertDialog)3 LinearLayout (android.widget.LinearLayout)3 SeekBar (android.widget.SeekBar)3