Showing
3 changed files
with
56 additions
and
1 deletions
1 | package com.example.vip | 1 | package com.example.vip |
2 | 2 | ||
3 | import android.content.Intent | 3 | import android.content.Intent |
4 | +import android.content.Context | ||
5 | +import android.content.SharedPreferences | ||
4 | import androidx.appcompat.app.AppCompatActivity | 6 | import androidx.appcompat.app.AppCompatActivity |
5 | import android.os.Bundle | 7 | import android.os.Bundle |
8 | +import android.widget.EditText | ||
6 | import kotlinx.android.synthetic.main.activity_input_profil_first_four.* | 9 | import kotlinx.android.synthetic.main.activity_input_profil_first_four.* |
10 | +import kotlinx.android.synthetic.main.activity_input_profil_first_four.nextButton | ||
11 | +import kotlinx.android.synthetic.main.activity_input_profil_first_four.previousButton | ||
12 | +import kotlinx.android.synthetic.main.activity_input_profil_first_three.* | ||
7 | 13 | ||
8 | class InputProfilFirstFourActivity : AppCompatActivity() { | 14 | class InputProfilFirstFourActivity : AppCompatActivity() { |
9 | 15 | ||
... | @@ -16,9 +22,43 @@ class InputProfilFirstFourActivity : AppCompatActivity() { | ... | @@ -16,9 +22,43 @@ class InputProfilFirstFourActivity : AppCompatActivity() { |
16 | startActivity(intent) | 22 | startActivity(intent) |
17 | } | 23 | } |
18 | 24 | ||
25 | + val prof: SharedPreferences=getSharedPreferences("profdata", Context.MODE_PRIVATE) | ||
26 | + val editor: SharedPreferences.Editor=prof.edit() | ||
27 | + | ||
19 | nextButton.setOnClickListener { | 28 | nextButton.setOnClickListener { |
20 | var intent = Intent(this, InputProfilFirstFiveActivity::class.java) | 29 | var intent = Intent(this, InputProfilFirstFiveActivity::class.java) |
21 | startActivity(intent) | 30 | startActivity(intent) |
31 | + | ||
32 | + /* | ||
33 | + var birthdateinput=findViewById<EditText>(R.id.editText).text.toString().toInt() | ||
34 | + if ((2019-birthdateinput)<19){ | ||
35 | + editor.putInt("c1_2",1) | ||
36 | + editor.commit() | ||
37 | + //마지막장에 상관없음 추가 | ||
38 | + } | ||
39 | + else if((2019-birthdateinput)<34){ | ||
40 | + editor.putInt("c1_3",1) | ||
41 | + editor.commit() | ||
42 | + } | ||
43 | + else if((2019-birthdateinput)<40){ | ||
44 | + editor.putInt("c1_4",1) | ||
45 | + editor.commit() | ||
46 | + } | ||
47 | + else if((2019-birthdateinput)<49){ | ||
48 | + editor.putInt("c1_5",1) | ||
49 | + editor.commit() | ||
50 | + } | ||
51 | + else if((2019-birthdateinput)<59){ | ||
52 | + editor.putInt("c1_6",1) | ||
53 | + editor.commit() | ||
54 | + } | ||
55 | + else{ | ||
56 | + editor.putInt("c1_7",1) | ||
57 | + editor.commit() | ||
58 | + } | ||
59 | + | ||
60 | + */ | ||
22 | } | 61 | } |
62 | + | ||
23 | } | 63 | } |
24 | } | 64 | } | ... | ... |
... | @@ -8,11 +8,14 @@ import android.os.Bundle | ... | @@ -8,11 +8,14 @@ import android.os.Bundle |
8 | import android.util.Log | 8 | import android.util.Log |
9 | import android.util.MonthDisplayHelper | 9 | import android.util.MonthDisplayHelper |
10 | import android.view.View | 10 | import android.view.View |
11 | +import android.widget.EditText | ||
11 | import android.widget.RadioButton | 12 | import android.widget.RadioButton |
12 | import android.widget.RadioGroup | 13 | import android.widget.RadioGroup |
13 | import android.widget.Toast | 14 | import android.widget.Toast |
14 | import kotlinx.android.synthetic.main.activity_input_profil_first_one.* | 15 | import kotlinx.android.synthetic.main.activity_input_profil_first_one.* |
15 | import kotlinx.android.synthetic.main.activity_input_profil_first_three.* | 16 | import kotlinx.android.synthetic.main.activity_input_profil_first_three.* |
17 | +import kotlinx.android.synthetic.main.activity_input_profil_first_three.nextButton | ||
18 | +import kotlinx.android.synthetic.main.activity_input_profil_first_two.* | ||
16 | 19 | ||
17 | class InputProfilFirstThreeActivity : AppCompatActivity() { | 20 | class InputProfilFirstThreeActivity : AppCompatActivity() { |
18 | 21 | ||
... | @@ -64,10 +67,22 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { | ... | @@ -64,10 +67,22 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { |
64 | var intent = Intent(this, InputProfilFirstTwoActivity::class.java) | 67 | var intent = Intent(this, InputProfilFirstTwoActivity::class.java) |
65 | startActivity(intent) | 68 | startActivity(intent) |
66 | } | 69 | } |
70 | + var id: Int = radio_group.checkedRadioButtonId | ||
71 | + val radio:RadioButton = findViewById(id) | ||
67 | 72 | ||
68 | nextButton.setOnClickListener { | 73 | nextButton.setOnClickListener { |
69 | var intent = Intent(this, InputProfilFirstFourActivity::class.java) | 74 | var intent = Intent(this, InputProfilFirstFourActivity::class.java) |
70 | startActivity(intent) | 75 | startActivity(intent) |
76 | + | ||
77 | + if ((radio.text)=="남성"){ | ||
78 | + editor.putInt("c2_1",1) | ||
79 | + editor.commit() | ||
80 | + //마지막장에 상관없음 추가 | ||
81 | + } | ||
82 | + else{ | ||
83 | + editor.putInt("c2_2",1) | ||
84 | + editor.commit() | ||
85 | + } | ||
71 | } | 86 | } |
72 | } | 87 | } |
73 | 88 | ... | ... |
... | @@ -24,7 +24,7 @@ class InputProfilSecondThreeActivity : AppCompatActivity() { | ... | @@ -24,7 +24,7 @@ class InputProfilSecondThreeActivity : AppCompatActivity() { |
24 | } | 24 | } |
25 | 25 | ||
26 | nextButton.setOnClickListener { | 26 | nextButton.setOnClickListener { |
27 | - var intent = Intent(this, InputProfilSecondThreeActivity::class.java) | 27 | + var intent = Intent(this, InputProfilThirdOneActivity::class.java) |
28 | startActivity(intent) | 28 | startActivity(intent) |
29 | } | 29 | } |
30 | } | 30 | } | ... | ... |
-
Please register or login to post a comment