InputProfilThirdFourActivity.kt 3.13 KB
package com.example.vip

import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View.GONE
import android.view.View.VISIBLE
import kotlinx.android.synthetic.main.activity_input_profil_third_four.*

class InputProfilThirdFourActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_input_profil_third_four)


        previousButton.setOnClickListener {
            var intent = Intent(this, InputProfilThirdThreeActivity::class.java)
            startActivity(intent)
        }

        val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
        val editor: SharedPreferences.Editor=prof.edit()

        nextButton.setOnClickListener {

            if(yesButton.isChecked){
                editor.putInt("c8_2",1); editor.commit()
            }
            if(jichaeButton.isChecked){editor.putInt("c9_2",1); editor.commit()}
            if(noebyungbyunButton.isChecked){editor.putInt("c9_3",1); editor.commit()}
            if(sigaakButton.isChecked){editor.putInt("c9_4",1); editor.commit()}
            if(chungkaakButton.isChecked){editor.putInt("c9_5",1); editor.commit()}
            if(unuhButton.isChecked){editor.putInt("c9_6",1); editor.commit()}
            if(ahnmyunButton.isChecked){editor.putInt("c9_7",1); editor.commit()}
            if(sinjaangButton.isChecked){editor.putInt("c9_8",1); editor.commit()}
            if(simjaangButton.isChecked){editor.putInt("c9_9",1); editor.commit()}
            if(gaanjaangButton.isChecked){editor.putInt("c9_10",1); editor.commit()}
            if(jaangrooButton.isChecked){editor.putInt("c9_11",1); editor.commit()}
            if(noejungjeungButton.isChecked){editor.putInt("c9_12",1); editor.commit()}
            if(hoheupkiButton.isChecked){editor.putInt("c9_13",1); editor.commit()}
            if(jijukButton.isChecked){editor.putInt("c9_14",1); editor.commit()}
            if(japyeahButton.isChecked){editor.putInt("c9_15",1); editor.commit()}
            if(jeongshinButton.isChecked){editor.putInt("c9_16",1); editor.commit()}

            if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit()}//DB,pref 뻑 주의
            if(imshinButton.isChecked){editor.putInt("c7_2",1); editor.commit()}
            if(nanchiButton.isChecked){editor.putInt("c9_17",1); editor.commit()}
            if(oeButton.isChecked){editor.putInt("c9_18",1); editor.commit()}
            if(yoyaangButton.isChecked){editor.putInt("c9_19",1); editor.commit()}
            if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit()}

            var intent = Intent(this, InputProfilFourthOneActivity::class.java)
            startActivity(intent)
        }

        yesButton.setOnClickListener {
            eightoneLayout.visibility=VISIBLE
            eighttwoLayout.visibility= GONE

        }
        noButton.setOnClickListener {
            eightoneLayout.visibility= GONE
            eighttwoLayout.visibility= VISIBLE
        }


    }
}