InputProfilSecondOneActivity.kt
4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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.widget.Button
import android.widget.EditText
import android.widget.RatingBar
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import kotlinx.android.synthetic.main.activity_input_profil_second_one.*
import kotlinx.android.synthetic.main.family_member_dialog.*
import kotlinx.android.synthetic.main.family_member_dialog.view.*
class InputProfilSecondOneActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_second_one)
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
skipButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondOneActivity::class.java)
startActivity(intent)
}
questionButton.setOnClickListener {
val builder = AlertDialog.Builder(this)
val dialogView = layoutInflater.inflate(R.layout.family_member_dialog, null)
//val dialogText = dialogView.findViewById<EditText>(R.id.dialogEt)
//val dialogRatingBar = dialogView.findViewById<RatingBar>(R.id.dialogRb)
dialogView.findViewById<TextView>(R.id.dialogTitle).text="가족구성원이란?"
dialogView.findViewById<TextView>(R.id.dialogContent).text="주민등록상 같은 거주지에 사는 사람"
builder.setView(dialogView)
.setPositiveButton("확인") { dialogInterface, i ->
//mainTv.text = dialogText.text.toString()
//mainRb.rating = dialogRatingBar.rating
/* 확인일 때 main의 View의 값에 dialog View에 있는 값을 적용 */
}
/*
.setNegativeButton("취소") { dialogInterface, i ->
/* 취소일 때 아무 액션이 없으므로 빈칸 */
}
*/
.show()
}
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstFiveActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(baewoojaButton.isChecked){editor.putInt("c10_2",1); editor.commit()}
if(baewoojaboomoButton.isChecked){editor.putInt("c10_3",1); editor.commit()}
if(baewoojajoboomoButton.isChecked){editor.putInt("c10_4",1); editor.commit()}
if(brotherButton.isChecked){editor.putInt("c10_5",1); editor.commit()
editor.putString("with_brothersister","yes")}
if(baewoojabrotherButton.isChecked){editor.putInt("c10_6",1); editor.commit()}
if(donggeoButton.isChecked){editor.putInt("c10_7",1); editor.commit()}
if(fatherButton.isChecked){editor.putInt("c10_8",1); editor.commit()}
if(motherButton.isChecked){editor.putInt("c10_9",1); editor.commit()}
if(grandsonbaewoojaButton.isChecked){editor.putInt("c10_10",1); editor.commit()}
if(grandfatherButton.isChecked){editor.putInt("c10_11",1); editor.commit()}
if(grandmotherButton.isChecked){editor.putInt("c10_12",1); editor.commit()}
if(grandsonButton.isChecked){editor.putInt("c10_13",1); editor.commit()}
if(janyeoButton.isChecked){editor.putInt("c10_14",1); editor.commit()
editor.putString("with_child","yes")}
if(janyeobaewoojaButton.isChecked){editor.putInt("c10_15",1); editor.commit()}
if(nothingButton.isChecked){editor.putInt("c10_18",1); editor.commit()}
if(janyeoButton.isChecked
//prof.getString("with_child","none")=="yes"
){
var intent = Intent(this, InputProfilSecondTwoActivity::class.java)
startActivity(intent)
}else{
var intent = Intent(this, InputProfilThirdOneActivity::class.java)
startActivity(intent)
}
}
}
}