InputProfilFourthOneActivity.kt
3.98 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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 android.widget.TextView
import androidx.appcompat.app.AlertDialog
import kotlinx.android.synthetic.main.activity_input_profil_fourth_one.*
class InputProfilFourthOneActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_fourth_one)
//보유
//미보유 - 전세 월세 공공주택 무상임대 보장기관 기타
//소유
//주택세대주 주택세대구성원 무주택자 무주택세대주 무주택세대구성원
//그냥 소유 미소유-모두무주택자 2개로 함
// 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()
}
val prof: SharedPreferences=getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilThirdFourActivity::class.java)
startActivity(intent)
}
yesButton.setOnClickListener {
subLinearLayout.visibility=GONE
noButton.isChecked=false
}
noButton.setOnClickListener {
subLinearLayout.visibility=VISIBLE
yesButton.isChecked=false
}
nextButton.setOnClickListener {
if(yesButton.isChecked){
editor.putInt("c14_2",1)
editor.commit()
}
if(noButton.isChecked){
editor.putInt("c14_3",1)
editor.commit()
}
if(jeonsaeButton.isChecked){
editor.putInt("c16_2",1)
editor.commit()
}
if(wolseButton.isChecked){
editor.putInt("c16_3",1)
editor.commit()
}
if(kongkongButton.isChecked){
editor.putInt("c16_4",1)
editor.commit()
}
if(moosangButton.isChecked){
editor.putInt("c16_5",1)
editor.commit()
}
if(bojangButton.isChecked){
editor.putInt("c16_6",1)
editor.commit()
}
if(guitarButton.isChecked){
editor.putInt("c16_7",1)
editor.commit()
}
var intent = Intent(this, InputProfilFourthTwoActivity::class.java)
startActivity(intent)
}
}
}