Search in sources :

Example 36 with RadioGroup

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);
    }
}
Also used : RadioGroup(android.widget.RadioGroup) YieldLayout(me.tatarka.yieldlayout.YieldLayout)

Example 37 with RadioGroup

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;
}
Also used : RadioGroup(android.widget.RadioGroup) Scene(com.transitionseverywhere.Scene) View(android.view.View) Nullable(android.support.annotation.Nullable)

Example 38 with RadioGroup

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");
            }
        }
    });
}
Also used : RadioGroup(android.widget.RadioGroup) Button(android.widget.Button) TextView(android.widget.TextView) View(android.view.View) Validator(com.mobsandgeeks.saripaar.Validator)

Example 39 with RadioGroup

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);
}
Also used : RadioGroup(android.widget.RadioGroup) Validator(com.mobsandgeeks.saripaar.Validator)

Example 40 with RadioGroup

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();
        }
    });
}
Also used : RadioGroup(android.widget.RadioGroup) Button(android.widget.Button) TextView(android.widget.TextView) View(android.view.View) Validator(com.mobsandgeeks.saripaar.Validator)

Aggregations

RadioGroup (android.widget.RadioGroup)70 View (android.view.View)30 TextView (android.widget.TextView)23 RadioButton (android.widget.RadioButton)17 OnCheckedChangeListener (android.widget.RadioGroup.OnCheckedChangeListener)13 Button (android.widget.Button)10 CompoundButton (android.widget.CompoundButton)9 Validator (com.mobsandgeeks.saripaar.Validator)8 DialogInterface (android.content.DialogInterface)7 EditText (android.widget.EditText)7 Intent (android.content.Intent)6 AlertDialog (android.support.v7.app.AlertDialog)6 CheckBox (android.widget.CheckBox)6 LinearLayout (android.widget.LinearLayout)6 ImageView (android.widget.ImageView)5 IOException (java.io.IOException)5 RandomAccessFile (java.io.RandomAccessFile)5 Test (org.junit.Test)5 CardView (android.support.v7.widget.CardView)4 ScrollView (android.widget.ScrollView)4