use of android.widget.RadioGroup in project yield-layout by evant.
the class DynamicExampleFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
RadioGroup btnLayoutGroup = (RadioGroup) view.findViewById(R.id.btn_layout_group);
final YieldLayout yieldLayout = (YieldLayout) view.findViewById(R.id.yield_layout);
btnLayoutGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
int layout = checkedId == R.id.btn_layout_1 ? R.layout.dynamic_layout_1 : R.layout.dynamic_layout_2;
yieldLayout.setLayoutResource(layout);
}
});
// listener doesn't get called if on the default option
if (btnLayoutGroup.getCheckedRadioButtonId() == R.id.btn_layout_1) {
yieldLayout.setLayoutResource(R.layout.dynamic_layout_1);
}
}
use of android.widget.RadioGroup in project Transitions-Everywhere by andkulikov.
the class ScenesSample method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_scenes, container, false);
RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.select_scene);
radioGroup.setOnCheckedChangeListener(this);
mSceneRoot = (ViewGroup) view.findViewById(R.id.scene_root);
// A Scene can be instantiated from a live view hierarchy.
mScene1 = new Scene(mSceneRoot, mSceneRoot.findViewById(R.id.container));
// You can also inflate a generate a Scene from a layout resource file.
mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.scene2, getContext());
// Another scene from a layout resource file.
mScene3 = Scene.getSceneForLayout(mSceneRoot, R.layout.scene3, getContext());
// We create a custom TransitionManager for Scene 3, in which ChangeBounds, Fade and
// ChangeImageTransform take place at the same time.
mTransitionManagerForScene3 = TransitionInflater.from(getContext()).inflateTransitionManager(R.anim.scene3_transition_manager, mSceneRoot);
return view;
}
use of android.widget.RadioGroup in project android-saripaar by ragunathjawahar.
the class UnorderedValidateActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_un_ordered_validate);
// UI References
mNameEditText = (EditText) findViewById(R.id.nameEditText);
mAddressEditText = (EditText) findViewById(R.id.addressEditText);
mEmailEditText = (EditText) findViewById(R.id.emailEditText);
mPhoneEditText = (EditText) findViewById(R.id.phoneEditText);
mResultTextView = (TextView) findViewById(R.id.resultTextView);
RadioGroup modeRadioGroup = (RadioGroup) findViewById(R.id.modeRadioGroup);
Button saripaarButton = (Button) findViewById(R.id.saripaarButton);
// Validator
mValidator = new Validator(this);
mValidator.setValidationListener(this);
// Event listeners
modeRadioGroup.setOnCheckedChangeListener(this);
saripaarButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
mValidator.validate();
} catch (IllegalStateException e) {
mResultTextView.setText("CRASH");
}
}
});
}
use of android.widget.RadioGroup in project android-saripaar by ragunathjawahar.
the class UnorderedValidateTillActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_un_ordered_validate_till_before);
// UI References
mNameEditText = (EditText) findViewById(R.id.nameEditText);
mAddressEditText = (EditText) findViewById(R.id.addressEditText);
mEmailEditText = (EditText) findViewById(R.id.emailEditText);
mPhoneEditText = (EditText) findViewById(R.id.phoneEditText);
mResultTextView = (TextView) findViewById(R.id.resultTextView);
RadioGroup modeRadioGroup = (RadioGroup) findViewById(R.id.modeRadioGroup);
// Validator
mValidator = new Validator(this);
mValidator.setValidationListener(this);
// Event listeners
mNameEditText.setOnFocusChangeListener(this);
mAddressEditText.setOnFocusChangeListener(this);
mEmailEditText.setOnFocusChangeListener(this);
mPhoneEditText.setOnFocusChangeListener(this);
modeRadioGroup.setOnCheckedChangeListener(this);
}
use of android.widget.RadioGroup in project android-saripaar by ragunathjawahar.
the class OrderedValidateActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_un_ordered_validate);
// UI References
mNameEditText = (EditText) findViewById(R.id.nameEditText);
mAddressEditText = (EditText) findViewById(R.id.addressEditText);
mEmailEditText = (EditText) findViewById(R.id.emailEditText);
mPhoneEditText = (EditText) findViewById(R.id.phoneEditText);
mResultTextView = (TextView) findViewById(R.id.resultTextView);
RadioGroup modeRadioGroup = (RadioGroup) findViewById(R.id.modeRadioGroup);
Button saripaarButton = (Button) findViewById(R.id.saripaarButton);
// Validator
mValidator = new Validator(this);
mValidator.setValidationListener(this);
// Event listeners
modeRadioGroup.setOnCheckedChangeListener(this);
saripaarButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mValidator.validate();
}
});
}
Aggregations