package com.youra.qlicker.Acitvitys.EER.KYC;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.youra.qlicker.R;

public class KYCRecupActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_kycrecup);

        ImageView btn_back = (ImageView) findViewById(R.id.img_back);
        TextView btn_next = (TextView) findViewById(R.id.btn_next);

        //checkbox
        CheckBox checkboxId = (CheckBox)findViewById(R.id.checkbox_identifiant);
        CheckBox checkboxRes = (CheckBox)findViewById(R.id.checkbox_res);
        CheckBox checkboxFa = (CheckBox)findViewById(R.id.checkbox_sit_fa);
        CheckBox checkboxProf = (CheckBox)findViewById(R.id.checkbox_sit_prof);
        CheckBox checkboxAgenc  = (CheckBox)findViewById(R.id.checkbox_agence);

        //Linerlayout
        LinearLayout ly_id  = (LinearLayout)findViewById(R.id.ly_ident);
        LinearLayout ly_res  = (LinearLayout)findViewById(R.id.ly_res);
        LinearLayout ly_sit_fa  = (LinearLayout)findViewById(R.id.ly_sit_fa);
        LinearLayout ly_sit_prof  = (LinearLayout)findViewById(R.id.ly_sit_prof);
        LinearLayout ly_agenc  = (LinearLayout)findViewById(R.id.ly_agence);


        ///traitement is checked show layout
        checkboxId.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked){
                    ly_id.setVisibility(View.VISIBLE);
                }else {
                    ly_id.setVisibility(View.GONE);
                }
            }
        });
        checkboxRes.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked){
                    ly_res.setVisibility(View.VISIBLE);
                }else {
                    ly_res.setVisibility(View.GONE);
                }
            }
        });
        checkboxFa.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked){
                    ly_sit_fa.setVisibility(View.VISIBLE);
                }else {
                    ly_sit_fa.setVisibility(View.GONE);
                }
            }
        });
        checkboxProf.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked){
                    ly_sit_prof.setVisibility(View.VISIBLE);
                }else {
                    ly_sit_prof.setVisibility(View.GONE);
                }
            }
        });
        checkboxAgenc.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked){
                    ly_agenc.setVisibility(View.VISIBLE);
                }else {
                    ly_agenc.setVisibility(View.GONE);
                }
            }
        });


        /// click btn continuer
        btn_next.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                ///  startActivity(new Intent(KYCRecupActivity.this ,  .class ));
            }
        });
        /// click btn for return previous activity
        btn_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                finish();
            }
        });
    }
}