Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <android.support.design.widget.TextInputLayout
- android:id="@+id/input_layout_provider"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <android.support.v7.widget.AppCompatCheckBox
- android:id="@+id/input_chk_provider"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:checked="false"
- android:duplicateParentState="false"
- android:text="@string/user_type_provider" />
- </android.support.design.widget.TextInputLayout>
- <Button
- android:id="@+id/btn_signup"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/btn_sing_up"
- android:background="@color/ic_launcher_background"
- android:layout_marginTop="40dp"
- android:textColor="@android:color/white"/>
- <Button
- android:id="@+id/btn_provider"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/btn_provider_dtl"
- android:background="@color/ic_launcher_background"
- android:layout_marginTop="40dp"
- android:textColor="@android:color/white"/>
- checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- if(isChecked) {
- btn1.setVisibility(View.GONE);
- btn2.setVisibility(View.VISIBLE);
- } else {
- btn1.setVisibility(View.VISIBLE);
- btn2.setVisibility(View.GONE);
- }
- });
- CheckBox checkBox = (CheckBox) findViewById(R.id.check1);
- Button yourButton = (Button) findViewById(R.id.btn1);
- checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton button, boolean isChecked) {
- if(isChecked){
- yourButton.setVisibility(View.VISIBLE);
- } else {
- yourButton.setVisibility(View.INVISIBLE);
- }
- }
- });
- View.GONE
- View.VISIBLE
- View.INVISIBLE
Add Comment
Please, Sign In to add comment