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;
}
}
});
}
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;
}
}
});
}
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);
}
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();
}
});
}
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;
}
}
});
}
Aggregations