Showing
35 changed files
with
1703 additions
and
3857 deletions
... | @@ -35,7 +35,8 @@ class InfoActivity : AppCompatActivity() { | ... | @@ -35,7 +35,8 @@ class InfoActivity : AppCompatActivity() { |
35 | Toast.LENGTH_SHORT).show() | 35 | Toast.LENGTH_SHORT).show() |
36 | 36 | ||
37 | InfoProfilModify.setOnClickListener { | 37 | InfoProfilModify.setOnClickListener { |
38 | - var intent = Intent(this, SettingActivity::class.java) | 38 | + |
39 | + var intent = Intent(this, InputProfilFirstOneActivity::class.java) | ||
39 | startActivity(intent) | 40 | startActivity(intent) |
40 | } | 41 | } |
41 | 42 | ... | ... |
... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fifth_four.* | ... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fifth_four.* |
19 | class InputProfilFifthFourActivity : AppCompatActivity() { | 19 | class InputProfilFifthFourActivity : AppCompatActivity() { |
20 | 20 | ||
21 | private val firebaseAuth = FirebaseAuth.getInstance() | 21 | private val firebaseAuth = FirebaseAuth.getInstance() |
22 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 22 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
23 | - | ||
24 | private fun sendToken(){ | 23 | private fun sendToken(){ |
25 | FirebaseInstanceId.getInstance().instanceId | 24 | FirebaseInstanceId.getInstance().instanceId |
26 | .addOnCompleteListener(OnCompleteListener { task -> | 25 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -39,9 +38,8 @@ class InputProfilFifthFourActivity : AppCompatActivity() { | ... | @@ -39,9 +38,8 @@ class InputProfilFifthFourActivity : AppCompatActivity() { |
39 | }) | 38 | }) |
40 | } | 39 | } |
41 | 40 | ||
42 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 41 | + private fun writeNewUser(Topic : String) { |
43 | - val user = User(u_token, Policy!!) | 42 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
44 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
45 | } | 43 | } |
46 | 44 | ||
47 | 45 | ||
... | @@ -72,6 +70,7 @@ class InputProfilFifthFourActivity : AppCompatActivity() { | ... | @@ -72,6 +70,7 @@ class InputProfilFifthFourActivity : AppCompatActivity() { |
72 | sendToken() | 70 | sendToken() |
73 | val user=firebaseAuth?.currentUser!!.uid | 71 | val user=firebaseAuth?.currentUser!!.uid |
74 | Log.d("test:", user.toString()) | 72 | Log.d("test:", user.toString()) |
73 | + | ||
75 | val cat_1=listOf("c1_1","c1_2","c1_3") | 74 | val cat_1=listOf("c1_1","c1_2","c1_3") |
76 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 75 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
77 | val cat_3=listOf("c3_1","c3_2","c3_3") | 76 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -89,146 +88,38 @@ class InputProfilFifthFourActivity : AppCompatActivity() { | ... | @@ -89,146 +88,38 @@ class InputProfilFifthFourActivity : AppCompatActivity() { |
89 | val cat_15=listOf("c15_1","c15_2","c15_3") | 88 | val cat_15=listOf("c15_1","c15_2","c15_3") |
90 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 89 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
91 | 90 | ||
92 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 91 | + val cat_list=mutableListOf<String>() |
93 | - //var policy_string="" | 92 | + cat_list.addAll(cat_1) |
94 | - | 93 | + cat_list.addAll(cat_2) |
95 | - var user_cat_1 = mutableListOf("c1_1") | 94 | + cat_list.addAll(cat_3) |
96 | - var user_cat_2 = mutableListOf("c2_1") | 95 | + cat_list.addAll(cat_4) |
97 | - var user_cat_3 = mutableListOf("c3_1") | 96 | + cat_list.addAll(cat_5) |
98 | - var user_cat_4 = mutableListOf("c4_1") | 97 | + cat_list.addAll(cat_6) |
99 | - var user_cat_5 = mutableListOf("c5_1") | 98 | + cat_list.addAll(cat_7) |
100 | - var user_cat_6 = mutableListOf("c6_1") | 99 | + cat_list.addAll(cat_8) |
101 | - var user_cat_7 = mutableListOf("c7_1") | 100 | + cat_list.addAll(cat_9) |
102 | - var user_cat_8 = mutableListOf("c8_1") | 101 | + cat_list.addAll(cat_10) |
103 | - var user_cat_9 = mutableListOf("c9_1") | 102 | + cat_list.addAll(cat_11) |
104 | - var user_cat_10 = mutableListOf("c10_1") | 103 | + cat_list.addAll(cat_12) |
105 | - var user_cat_11 = mutableListOf("c11_1") | 104 | + cat_list.addAll(cat_13) |
106 | - var user_cat_12 = mutableListOf("c12_1") | 105 | + cat_list.addAll(cat_14) |
107 | - var user_cat_13 = mutableListOf("c13_1") | 106 | + cat_list.addAll(cat_15) |
108 | - var user_cat_14 = mutableListOf("c14_1") | 107 | + cat_list.addAll(cat_16) |
109 | - var user_cat_15 = mutableListOf("c15_1") | 108 | + |
110 | - var user_cat_16 = mutableListOf("c16_1") | 109 | + var user_topic="" |
111 | - | 110 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
112 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 111 | + |
113 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 112 | + if(prof.getString("existing_topic","none")!=user_topic){ |
114 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 113 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
115 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 114 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
116 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 115 | + if (!task.isSuccessful) { } // 성공 |
117 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
118 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
119 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
120 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
121 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
122 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
123 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
124 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
125 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
126 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
127 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
128 | - | ||
129 | - var topic = "" | ||
130 | - var user_topic = "" | ||
131 | - | ||
132 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
133 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
134 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
135 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
136 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
137 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
138 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
139 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
140 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
141 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
142 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
143 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
144 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
145 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
146 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
147 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
148 | - | ||
149 | - | ||
150 | - for(c1 in user_cat_1) { | ||
151 | - topic += c1 | ||
152 | - for (c2 in user_cat_2) { | ||
153 | - topic += c2 | ||
154 | - for (c3 in user_cat_3) { | ||
155 | - topic += c3 | ||
156 | - for (c4 in user_cat_4) { | ||
157 | - topic += c4 | ||
158 | - for (c5 in user_cat_5) { | ||
159 | - topic += c5 | ||
160 | - for (c6 in user_cat_6) { | ||
161 | - topic += c6 | ||
162 | - for (c7 in user_cat_7) { | ||
163 | - topic += c7 | ||
164 | - for (c8 in user_cat_8) { | ||
165 | - topic += c8 | ||
166 | - for (c9 in user_cat_9) { | ||
167 | - topic += c9 | ||
168 | - for (c10 in user_cat_10) { | ||
169 | - topic += c10 | ||
170 | - for (c11 in user_cat_11) { | ||
171 | - topic += c11 | ||
172 | - for (c12 in user_cat_12) { | ||
173 | - topic += c12 | ||
174 | - for (c13 in user_cat_13) { | ||
175 | - topic += c13 | ||
176 | - for (c14 in user_cat_14) { | ||
177 | - topic += c14 | ||
178 | - for (c15 in user_cat_15) { | ||
179 | - topic += c15 | ||
180 | - for (c16 in user_cat_16) { | ||
181 | - topic += c16 | ||
182 | - user_topic += (topic + "/") | ||
183 | - // debug | ||
184 | - // Log.d("topic : ", topic) | ||
185 | - | ||
186 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
187 | - if (!task.isSuccessful) { } // 성공 | ||
188 | - } | ||
189 | - /* topic 구독 코드 | ||
190 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
191 | - if (!task.isSuccessful) { } // 성공 | ||
192 | - } | ||
193 | - */ | ||
194 | - | ||
195 | - topic = topic.substring(0, topic.length - c16.length) | ||
196 | - } | ||
197 | - topic = topic.substring(0, topic.length - c15.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c14.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c13.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c12.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c11.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c10.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c9.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c8.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c7.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c6.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c5.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c4.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c3.length) | ||
222 | - } | ||
223 | - topic = topic.substring(0, topic.length - c2.length) | ||
224 | } | 116 | } |
225 | - topic = topic.substring(0, topic.length-c1.length) | 117 | + writeNewUser(user_topic) // db에 쓰기 |
226 | - } | 118 | + editor.putString("existing_topic",user_topic) |
227 | - | 119 | + editor.commit() |
228 | - //Log.d("re:", user_topic) | 120 | + }else{ |
229 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
230 | - | ||
231 | 121 | ||
122 | + } | ||
232 | var intent = Intent(this, SignInActivity::class.java) | 123 | var intent = Intent(this, SignInActivity::class.java) |
233 | startActivity(intent) | 124 | startActivity(intent) |
234 | } | 125 | } |
... | @@ -262,6 +153,8 @@ class InputProfilFifthFourActivity : AppCompatActivity() { | ... | @@ -262,6 +153,8 @@ class InputProfilFifthFourActivity : AppCompatActivity() { |
262 | 153 | ||
263 | nextButton.setOnClickListener { | 154 | nextButton.setOnClickListener { |
264 | 155 | ||
156 | + if((editText1.text.toString()!="")){editor.putString("fifth_four_editText1",editText1.text.toString());editor.putString("fifth_four","done");editor.commit()} | ||
157 | + | ||
265 | editor.putInt("c1_1",1); editor.commit() | 158 | editor.putInt("c1_1",1); editor.commit() |
266 | editor.putInt("c2_1",1); editor.commit() | 159 | editor.putInt("c2_1",1); editor.commit() |
267 | editor.putInt("c3_1",1); editor.commit() | 160 | editor.putInt("c3_1",1); editor.commit() | ... | ... |
... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fifth_one.* | ... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fifth_one.* |
19 | class InputProfilFifthOneActivity : AppCompatActivity() { | 19 | class InputProfilFifthOneActivity : AppCompatActivity() { |
20 | 20 | ||
21 | private val firebaseAuth = FirebaseAuth.getInstance() | 21 | private val firebaseAuth = FirebaseAuth.getInstance() |
22 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 22 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
23 | - | ||
24 | private fun sendToken(){ | 23 | private fun sendToken(){ |
25 | FirebaseInstanceId.getInstance().instanceId | 24 | FirebaseInstanceId.getInstance().instanceId |
26 | .addOnCompleteListener(OnCompleteListener { task -> | 25 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -39,9 +38,8 @@ class InputProfilFifthOneActivity : AppCompatActivity() { | ... | @@ -39,9 +38,8 @@ class InputProfilFifthOneActivity : AppCompatActivity() { |
39 | }) | 38 | }) |
40 | } | 39 | } |
41 | 40 | ||
42 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 41 | + private fun writeNewUser(Topic : String) { |
43 | - val user = User(u_token, Policy!!) | 42 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
44 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
45 | } | 43 | } |
46 | 44 | ||
47 | 45 | ||
... | @@ -71,6 +69,7 @@ class InputProfilFifthOneActivity : AppCompatActivity() { | ... | @@ -71,6 +69,7 @@ class InputProfilFifthOneActivity : AppCompatActivity() { |
71 | sendToken() | 69 | sendToken() |
72 | val user=firebaseAuth?.currentUser!!.uid | 70 | val user=firebaseAuth?.currentUser!!.uid |
73 | Log.d("test:", user.toString()) | 71 | Log.d("test:", user.toString()) |
72 | + | ||
74 | val cat_1=listOf("c1_1","c1_2","c1_3") | 73 | val cat_1=listOf("c1_1","c1_2","c1_3") |
75 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 74 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
76 | val cat_3=listOf("c3_1","c3_2","c3_3") | 75 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -88,146 +87,38 @@ class InputProfilFifthOneActivity : AppCompatActivity() { | ... | @@ -88,146 +87,38 @@ class InputProfilFifthOneActivity : AppCompatActivity() { |
88 | val cat_15=listOf("c15_1","c15_2","c15_3") | 87 | val cat_15=listOf("c15_1","c15_2","c15_3") |
89 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 88 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
90 | 89 | ||
91 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 90 | + val cat_list=mutableListOf<String>() |
92 | - //var policy_string="" | 91 | + cat_list.addAll(cat_1) |
93 | - | 92 | + cat_list.addAll(cat_2) |
94 | - var user_cat_1 = mutableListOf("c1_1") | 93 | + cat_list.addAll(cat_3) |
95 | - var user_cat_2 = mutableListOf("c2_1") | 94 | + cat_list.addAll(cat_4) |
96 | - var user_cat_3 = mutableListOf("c3_1") | 95 | + cat_list.addAll(cat_5) |
97 | - var user_cat_4 = mutableListOf("c4_1") | 96 | + cat_list.addAll(cat_6) |
98 | - var user_cat_5 = mutableListOf("c5_1") | 97 | + cat_list.addAll(cat_7) |
99 | - var user_cat_6 = mutableListOf("c6_1") | 98 | + cat_list.addAll(cat_8) |
100 | - var user_cat_7 = mutableListOf("c7_1") | 99 | + cat_list.addAll(cat_9) |
101 | - var user_cat_8 = mutableListOf("c8_1") | 100 | + cat_list.addAll(cat_10) |
102 | - var user_cat_9 = mutableListOf("c9_1") | 101 | + cat_list.addAll(cat_11) |
103 | - var user_cat_10 = mutableListOf("c10_1") | 102 | + cat_list.addAll(cat_12) |
104 | - var user_cat_11 = mutableListOf("c11_1") | 103 | + cat_list.addAll(cat_13) |
105 | - var user_cat_12 = mutableListOf("c12_1") | 104 | + cat_list.addAll(cat_14) |
106 | - var user_cat_13 = mutableListOf("c13_1") | 105 | + cat_list.addAll(cat_15) |
107 | - var user_cat_14 = mutableListOf("c14_1") | 106 | + cat_list.addAll(cat_16) |
108 | - var user_cat_15 = mutableListOf("c15_1") | 107 | + |
109 | - var user_cat_16 = mutableListOf("c16_1") | 108 | + var user_topic="" |
110 | - | 109 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
111 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 110 | + |
112 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 111 | + if(prof.getString("existing_topic","none")!=user_topic){ |
113 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 112 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
114 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 113 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
115 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 114 | + if (!task.isSuccessful) { } // 성공 |
116 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
117 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
118 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
119 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
120 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
121 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
122 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
123 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
124 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
125 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
126 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
127 | - | ||
128 | - var topic = "" | ||
129 | - var user_topic = "" | ||
130 | - | ||
131 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
132 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
133 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
134 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
135 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
136 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
137 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
138 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
139 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
140 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
141 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
142 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
143 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
144 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
145 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
146 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
147 | - | ||
148 | - | ||
149 | - for(c1 in user_cat_1) { | ||
150 | - topic += c1 | ||
151 | - for (c2 in user_cat_2) { | ||
152 | - topic += c2 | ||
153 | - for (c3 in user_cat_3) { | ||
154 | - topic += c3 | ||
155 | - for (c4 in user_cat_4) { | ||
156 | - topic += c4 | ||
157 | - for (c5 in user_cat_5) { | ||
158 | - topic += c5 | ||
159 | - for (c6 in user_cat_6) { | ||
160 | - topic += c6 | ||
161 | - for (c7 in user_cat_7) { | ||
162 | - topic += c7 | ||
163 | - for (c8 in user_cat_8) { | ||
164 | - topic += c8 | ||
165 | - for (c9 in user_cat_9) { | ||
166 | - topic += c9 | ||
167 | - for (c10 in user_cat_10) { | ||
168 | - topic += c10 | ||
169 | - for (c11 in user_cat_11) { | ||
170 | - topic += c11 | ||
171 | - for (c12 in user_cat_12) { | ||
172 | - topic += c12 | ||
173 | - for (c13 in user_cat_13) { | ||
174 | - topic += c13 | ||
175 | - for (c14 in user_cat_14) { | ||
176 | - topic += c14 | ||
177 | - for (c15 in user_cat_15) { | ||
178 | - topic += c15 | ||
179 | - for (c16 in user_cat_16) { | ||
180 | - topic += c16 | ||
181 | - user_topic += (topic + "/") | ||
182 | - // debug | ||
183 | - // Log.d("topic : ", topic) | ||
184 | - | ||
185 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
186 | - if (!task.isSuccessful) { } // 성공 | ||
187 | - } | ||
188 | - /* topic 구독 코드 | ||
189 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
190 | - if (!task.isSuccessful) { } // 성공 | ||
191 | - } | ||
192 | - */ | ||
193 | - | ||
194 | - topic = topic.substring(0, topic.length - c16.length) | ||
195 | - } | ||
196 | - topic = topic.substring(0, topic.length - c15.length) | ||
197 | - } | ||
198 | - topic = topic.substring(0, topic.length - c14.length) | ||
199 | - } | ||
200 | - topic = topic.substring(0, topic.length - c13.length) | ||
201 | - } | ||
202 | - topic = topic.substring(0, topic.length - c12.length) | ||
203 | - } | ||
204 | - topic = topic.substring(0, topic.length - c11.length) | ||
205 | - } | ||
206 | - topic = topic.substring(0, topic.length - c10.length) | ||
207 | - } | ||
208 | - topic = topic.substring(0, topic.length - c9.length) | ||
209 | - } | ||
210 | - topic = topic.substring(0, topic.length - c8.length) | ||
211 | - } | ||
212 | - topic = topic.substring(0, topic.length - c7.length) | ||
213 | - } | ||
214 | - topic = topic.substring(0, topic.length - c6.length) | ||
215 | - } | ||
216 | - topic = topic.substring(0, topic.length - c5.length) | ||
217 | - } | ||
218 | - topic = topic.substring(0, topic.length - c4.length) | ||
219 | - } | ||
220 | - topic = topic.substring(0, topic.length - c3.length) | ||
221 | - } | ||
222 | - topic = topic.substring(0, topic.length - c2.length) | ||
223 | } | 115 | } |
224 | - topic = topic.substring(0, topic.length-c1.length) | 116 | + writeNewUser(user_topic) // db에 쓰기 |
225 | - } | 117 | + editor.putString("existing_topic",user_topic) |
226 | - | 118 | + editor.commit() |
227 | - //Log.d("re:", user_topic) | 119 | + }else{ |
228 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
229 | - | ||
230 | 120 | ||
121 | + } | ||
231 | var intent = Intent(this, SignInActivity::class.java) | 122 | var intent = Intent(this, SignInActivity::class.java) |
232 | startActivity(intent) | 123 | startActivity(intent) |
233 | } | 124 | } |
... | @@ -261,6 +152,8 @@ class InputProfilFifthOneActivity : AppCompatActivity() { | ... | @@ -261,6 +152,8 @@ class InputProfilFifthOneActivity : AppCompatActivity() { |
261 | } | 152 | } |
262 | 153 | ||
263 | nextButton.setOnClickListener { | 154 | nextButton.setOnClickListener { |
155 | + | ||
156 | + if((editText1.text.toString()!="")&&(editText2.text.toString()!="")){editor.putString("fifth_one_editText1",editText1.text.toString());editor.putString("fifth_one_editText2",editText2.text.toString());editor.commit();editor.putString("fifth_one","done");editor.commit()} | ||
264 | var intent = Intent(this, InputProfilFifthTwoActivity::class.java) | 157 | var intent = Intent(this, InputProfilFifthTwoActivity::class.java) |
265 | startActivity(intent) | 158 | startActivity(intent) |
266 | } | 159 | } | ... | ... |
... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fifth_three.* | ... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fifth_three.* |
19 | class InputProfilFifthThreeActivity : AppCompatActivity() { | 19 | class InputProfilFifthThreeActivity : AppCompatActivity() { |
20 | 20 | ||
21 | private val firebaseAuth = FirebaseAuth.getInstance() | 21 | private val firebaseAuth = FirebaseAuth.getInstance() |
22 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 22 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
23 | - | ||
24 | private fun sendToken(){ | 23 | private fun sendToken(){ |
25 | FirebaseInstanceId.getInstance().instanceId | 24 | FirebaseInstanceId.getInstance().instanceId |
26 | .addOnCompleteListener(OnCompleteListener { task -> | 25 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -39,9 +38,8 @@ class InputProfilFifthThreeActivity : AppCompatActivity() { | ... | @@ -39,9 +38,8 @@ class InputProfilFifthThreeActivity : AppCompatActivity() { |
39 | }) | 38 | }) |
40 | } | 39 | } |
41 | 40 | ||
42 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 41 | + private fun writeNewUser(Topic : String) { |
43 | - val user = User(u_token, Policy!!) | 42 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
44 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
45 | } | 43 | } |
46 | 44 | ||
47 | 45 | ||
... | @@ -71,6 +69,7 @@ class InputProfilFifthThreeActivity : AppCompatActivity() { | ... | @@ -71,6 +69,7 @@ class InputProfilFifthThreeActivity : AppCompatActivity() { |
71 | sendToken() | 69 | sendToken() |
72 | val user=firebaseAuth?.currentUser!!.uid | 70 | val user=firebaseAuth?.currentUser!!.uid |
73 | Log.d("test:", user.toString()) | 71 | Log.d("test:", user.toString()) |
72 | + | ||
74 | val cat_1=listOf("c1_1","c1_2","c1_3") | 73 | val cat_1=listOf("c1_1","c1_2","c1_3") |
75 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 74 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
76 | val cat_3=listOf("c3_1","c3_2","c3_3") | 75 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -88,146 +87,38 @@ class InputProfilFifthThreeActivity : AppCompatActivity() { | ... | @@ -88,146 +87,38 @@ class InputProfilFifthThreeActivity : AppCompatActivity() { |
88 | val cat_15=listOf("c15_1","c15_2","c15_3") | 87 | val cat_15=listOf("c15_1","c15_2","c15_3") |
89 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 88 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
90 | 89 | ||
91 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 90 | + val cat_list=mutableListOf<String>() |
92 | - //var policy_string="" | 91 | + cat_list.addAll(cat_1) |
93 | - | 92 | + cat_list.addAll(cat_2) |
94 | - var user_cat_1 = mutableListOf("c1_1") | 93 | + cat_list.addAll(cat_3) |
95 | - var user_cat_2 = mutableListOf("c2_1") | 94 | + cat_list.addAll(cat_4) |
96 | - var user_cat_3 = mutableListOf("c3_1") | 95 | + cat_list.addAll(cat_5) |
97 | - var user_cat_4 = mutableListOf("c4_1") | 96 | + cat_list.addAll(cat_6) |
98 | - var user_cat_5 = mutableListOf("c5_1") | 97 | + cat_list.addAll(cat_7) |
99 | - var user_cat_6 = mutableListOf("c6_1") | 98 | + cat_list.addAll(cat_8) |
100 | - var user_cat_7 = mutableListOf("c7_1") | 99 | + cat_list.addAll(cat_9) |
101 | - var user_cat_8 = mutableListOf("c8_1") | 100 | + cat_list.addAll(cat_10) |
102 | - var user_cat_9 = mutableListOf("c9_1") | 101 | + cat_list.addAll(cat_11) |
103 | - var user_cat_10 = mutableListOf("c10_1") | 102 | + cat_list.addAll(cat_12) |
104 | - var user_cat_11 = mutableListOf("c11_1") | 103 | + cat_list.addAll(cat_13) |
105 | - var user_cat_12 = mutableListOf("c12_1") | 104 | + cat_list.addAll(cat_14) |
106 | - var user_cat_13 = mutableListOf("c13_1") | 105 | + cat_list.addAll(cat_15) |
107 | - var user_cat_14 = mutableListOf("c14_1") | 106 | + cat_list.addAll(cat_16) |
108 | - var user_cat_15 = mutableListOf("c15_1") | 107 | + |
109 | - var user_cat_16 = mutableListOf("c16_1") | 108 | + var user_topic="" |
110 | - | 109 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
111 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 110 | + |
112 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 111 | + if(prof.getString("existing_topic","none")!=user_topic){ |
113 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 112 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
114 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 113 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
115 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 114 | + if (!task.isSuccessful) { } // 성공 |
116 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
117 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
118 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
119 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
120 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
121 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
122 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
123 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
124 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
125 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
126 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
127 | - | ||
128 | - var topic = "" | ||
129 | - var user_topic = "" | ||
130 | - | ||
131 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
132 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
133 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
134 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
135 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
136 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
137 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
138 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
139 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
140 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
141 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
142 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
143 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
144 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
145 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
146 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
147 | - | ||
148 | - | ||
149 | - for(c1 in user_cat_1) { | ||
150 | - topic += c1 | ||
151 | - for (c2 in user_cat_2) { | ||
152 | - topic += c2 | ||
153 | - for (c3 in user_cat_3) { | ||
154 | - topic += c3 | ||
155 | - for (c4 in user_cat_4) { | ||
156 | - topic += c4 | ||
157 | - for (c5 in user_cat_5) { | ||
158 | - topic += c5 | ||
159 | - for (c6 in user_cat_6) { | ||
160 | - topic += c6 | ||
161 | - for (c7 in user_cat_7) { | ||
162 | - topic += c7 | ||
163 | - for (c8 in user_cat_8) { | ||
164 | - topic += c8 | ||
165 | - for (c9 in user_cat_9) { | ||
166 | - topic += c9 | ||
167 | - for (c10 in user_cat_10) { | ||
168 | - topic += c10 | ||
169 | - for (c11 in user_cat_11) { | ||
170 | - topic += c11 | ||
171 | - for (c12 in user_cat_12) { | ||
172 | - topic += c12 | ||
173 | - for (c13 in user_cat_13) { | ||
174 | - topic += c13 | ||
175 | - for (c14 in user_cat_14) { | ||
176 | - topic += c14 | ||
177 | - for (c15 in user_cat_15) { | ||
178 | - topic += c15 | ||
179 | - for (c16 in user_cat_16) { | ||
180 | - topic += c16 | ||
181 | - user_topic += (topic + "/") | ||
182 | - // debug | ||
183 | - // Log.d("topic : ", topic) | ||
184 | - | ||
185 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
186 | - if (!task.isSuccessful) { } // 성공 | ||
187 | - } | ||
188 | - /* topic 구독 코드 | ||
189 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
190 | - if (!task.isSuccessful) { } // 성공 | ||
191 | - } | ||
192 | - */ | ||
193 | - | ||
194 | - topic = topic.substring(0, topic.length - c16.length) | ||
195 | - } | ||
196 | - topic = topic.substring(0, topic.length - c15.length) | ||
197 | - } | ||
198 | - topic = topic.substring(0, topic.length - c14.length) | ||
199 | - } | ||
200 | - topic = topic.substring(0, topic.length - c13.length) | ||
201 | - } | ||
202 | - topic = topic.substring(0, topic.length - c12.length) | ||
203 | - } | ||
204 | - topic = topic.substring(0, topic.length - c11.length) | ||
205 | - } | ||
206 | - topic = topic.substring(0, topic.length - c10.length) | ||
207 | - } | ||
208 | - topic = topic.substring(0, topic.length - c9.length) | ||
209 | - } | ||
210 | - topic = topic.substring(0, topic.length - c8.length) | ||
211 | - } | ||
212 | - topic = topic.substring(0, topic.length - c7.length) | ||
213 | - } | ||
214 | - topic = topic.substring(0, topic.length - c6.length) | ||
215 | - } | ||
216 | - topic = topic.substring(0, topic.length - c5.length) | ||
217 | - } | ||
218 | - topic = topic.substring(0, topic.length - c4.length) | ||
219 | - } | ||
220 | - topic = topic.substring(0, topic.length - c3.length) | ||
221 | - } | ||
222 | - topic = topic.substring(0, topic.length - c2.length) | ||
223 | } | 115 | } |
224 | - topic = topic.substring(0, topic.length-c1.length) | 116 | + writeNewUser(user_topic) // db에 쓰기 |
225 | - } | 117 | + editor.putString("existing_topic",user_topic) |
226 | - | 118 | + editor.commit() |
227 | - //Log.d("re:", user_topic) | 119 | + }else{ |
228 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
229 | - | ||
230 | 120 | ||
121 | + } | ||
231 | var intent = Intent(this, SignInActivity::class.java) | 122 | var intent = Intent(this, SignInActivity::class.java) |
232 | startActivity(intent) | 123 | startActivity(intent) |
233 | } | 124 | } |
... | @@ -261,6 +152,8 @@ class InputProfilFifthThreeActivity : AppCompatActivity() { | ... | @@ -261,6 +152,8 @@ class InputProfilFifthThreeActivity : AppCompatActivity() { |
261 | } | 152 | } |
262 | 153 | ||
263 | nextButton.setOnClickListener { | 154 | nextButton.setOnClickListener { |
155 | + if((editText1.text.toString()!="")&&(editText2.text.toString()!="")&&(editText3.text.toString()!="")){editor.putString("fifth_three_editText1",editText1.text.toString());editor.putString("fifth_three_editText2",editText2.text.toString());editor.putString("fifth_three_editText3",editText3.text.toString());editor.commit();editor.putString("fifth_three","done");editor.commit()} | ||
156 | + | ||
264 | var intent = Intent(this, InputProfilFifthFourActivity::class.java) | 157 | var intent = Intent(this, InputProfilFifthFourActivity::class.java) |
265 | startActivity(intent) | 158 | startActivity(intent) |
266 | } | 159 | } | ... | ... |
... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fifth_two.* | ... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fifth_two.* |
19 | class InputProfilFifthTwoActivity : AppCompatActivity() { | 19 | class InputProfilFifthTwoActivity : AppCompatActivity() { |
20 | 20 | ||
21 | private val firebaseAuth = FirebaseAuth.getInstance() | 21 | private val firebaseAuth = FirebaseAuth.getInstance() |
22 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 22 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
23 | - | ||
24 | private fun sendToken(){ | 23 | private fun sendToken(){ |
25 | FirebaseInstanceId.getInstance().instanceId | 24 | FirebaseInstanceId.getInstance().instanceId |
26 | .addOnCompleteListener(OnCompleteListener { task -> | 25 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -39,9 +38,8 @@ class InputProfilFifthTwoActivity : AppCompatActivity() { | ... | @@ -39,9 +38,8 @@ class InputProfilFifthTwoActivity : AppCompatActivity() { |
39 | }) | 38 | }) |
40 | } | 39 | } |
41 | 40 | ||
42 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 41 | + private fun writeNewUser(Topic : String) { |
43 | - val user = User(u_token, Policy!!) | 42 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
44 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
45 | } | 43 | } |
46 | 44 | ||
47 | 45 | ||
... | @@ -71,6 +69,7 @@ class InputProfilFifthTwoActivity : AppCompatActivity() { | ... | @@ -71,6 +69,7 @@ class InputProfilFifthTwoActivity : AppCompatActivity() { |
71 | sendToken() | 69 | sendToken() |
72 | val user=firebaseAuth?.currentUser!!.uid | 70 | val user=firebaseAuth?.currentUser!!.uid |
73 | Log.d("test:", user.toString()) | 71 | Log.d("test:", user.toString()) |
72 | + | ||
74 | val cat_1=listOf("c1_1","c1_2","c1_3") | 73 | val cat_1=listOf("c1_1","c1_2","c1_3") |
75 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 74 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
76 | val cat_3=listOf("c3_1","c3_2","c3_3") | 75 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -88,146 +87,38 @@ class InputProfilFifthTwoActivity : AppCompatActivity() { | ... | @@ -88,146 +87,38 @@ class InputProfilFifthTwoActivity : AppCompatActivity() { |
88 | val cat_15=listOf("c15_1","c15_2","c15_3") | 87 | val cat_15=listOf("c15_1","c15_2","c15_3") |
89 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 88 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
90 | 89 | ||
91 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 90 | + val cat_list=mutableListOf<String>() |
92 | - //var policy_string="" | 91 | + cat_list.addAll(cat_1) |
93 | - | 92 | + cat_list.addAll(cat_2) |
94 | - var user_cat_1 = mutableListOf("c1_1") | 93 | + cat_list.addAll(cat_3) |
95 | - var user_cat_2 = mutableListOf("c2_1") | 94 | + cat_list.addAll(cat_4) |
96 | - var user_cat_3 = mutableListOf("c3_1") | 95 | + cat_list.addAll(cat_5) |
97 | - var user_cat_4 = mutableListOf("c4_1") | 96 | + cat_list.addAll(cat_6) |
98 | - var user_cat_5 = mutableListOf("c5_1") | 97 | + cat_list.addAll(cat_7) |
99 | - var user_cat_6 = mutableListOf("c6_1") | 98 | + cat_list.addAll(cat_8) |
100 | - var user_cat_7 = mutableListOf("c7_1") | 99 | + cat_list.addAll(cat_9) |
101 | - var user_cat_8 = mutableListOf("c8_1") | 100 | + cat_list.addAll(cat_10) |
102 | - var user_cat_9 = mutableListOf("c9_1") | 101 | + cat_list.addAll(cat_11) |
103 | - var user_cat_10 = mutableListOf("c10_1") | 102 | + cat_list.addAll(cat_12) |
104 | - var user_cat_11 = mutableListOf("c11_1") | 103 | + cat_list.addAll(cat_13) |
105 | - var user_cat_12 = mutableListOf("c12_1") | 104 | + cat_list.addAll(cat_14) |
106 | - var user_cat_13 = mutableListOf("c13_1") | 105 | + cat_list.addAll(cat_15) |
107 | - var user_cat_14 = mutableListOf("c14_1") | 106 | + cat_list.addAll(cat_16) |
108 | - var user_cat_15 = mutableListOf("c15_1") | 107 | + |
109 | - var user_cat_16 = mutableListOf("c16_1") | 108 | + var user_topic="" |
110 | - | 109 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
111 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 110 | + |
112 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 111 | + if(prof.getString("existing_topic","none")!=user_topic){ |
113 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 112 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
114 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 113 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
115 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 114 | + if (!task.isSuccessful) { } // 성공 |
116 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
117 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
118 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
119 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
120 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
121 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
122 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
123 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
124 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
125 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
126 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
127 | - | ||
128 | - var topic = "" | ||
129 | - var user_topic = "" | ||
130 | - | ||
131 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
132 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
133 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
134 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
135 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
136 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
137 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
138 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
139 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
140 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
141 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
142 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
143 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
144 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
145 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
146 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
147 | - | ||
148 | - | ||
149 | - for(c1 in user_cat_1) { | ||
150 | - topic += c1 | ||
151 | - for (c2 in user_cat_2) { | ||
152 | - topic += c2 | ||
153 | - for (c3 in user_cat_3) { | ||
154 | - topic += c3 | ||
155 | - for (c4 in user_cat_4) { | ||
156 | - topic += c4 | ||
157 | - for (c5 in user_cat_5) { | ||
158 | - topic += c5 | ||
159 | - for (c6 in user_cat_6) { | ||
160 | - topic += c6 | ||
161 | - for (c7 in user_cat_7) { | ||
162 | - topic += c7 | ||
163 | - for (c8 in user_cat_8) { | ||
164 | - topic += c8 | ||
165 | - for (c9 in user_cat_9) { | ||
166 | - topic += c9 | ||
167 | - for (c10 in user_cat_10) { | ||
168 | - topic += c10 | ||
169 | - for (c11 in user_cat_11) { | ||
170 | - topic += c11 | ||
171 | - for (c12 in user_cat_12) { | ||
172 | - topic += c12 | ||
173 | - for (c13 in user_cat_13) { | ||
174 | - topic += c13 | ||
175 | - for (c14 in user_cat_14) { | ||
176 | - topic += c14 | ||
177 | - for (c15 in user_cat_15) { | ||
178 | - topic += c15 | ||
179 | - for (c16 in user_cat_16) { | ||
180 | - topic += c16 | ||
181 | - user_topic += (topic + "/") | ||
182 | - // debug | ||
183 | - // Log.d("topic : ", topic) | ||
184 | - | ||
185 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
186 | - if (!task.isSuccessful) { } // 성공 | ||
187 | - } | ||
188 | - /* topic 구독 코드 | ||
189 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
190 | - if (!task.isSuccessful) { } // 성공 | ||
191 | - } | ||
192 | - */ | ||
193 | - | ||
194 | - topic = topic.substring(0, topic.length - c16.length) | ||
195 | - } | ||
196 | - topic = topic.substring(0, topic.length - c15.length) | ||
197 | - } | ||
198 | - topic = topic.substring(0, topic.length - c14.length) | ||
199 | - } | ||
200 | - topic = topic.substring(0, topic.length - c13.length) | ||
201 | - } | ||
202 | - topic = topic.substring(0, topic.length - c12.length) | ||
203 | - } | ||
204 | - topic = topic.substring(0, topic.length - c11.length) | ||
205 | - } | ||
206 | - topic = topic.substring(0, topic.length - c10.length) | ||
207 | - } | ||
208 | - topic = topic.substring(0, topic.length - c9.length) | ||
209 | - } | ||
210 | - topic = topic.substring(0, topic.length - c8.length) | ||
211 | - } | ||
212 | - topic = topic.substring(0, topic.length - c7.length) | ||
213 | - } | ||
214 | - topic = topic.substring(0, topic.length - c6.length) | ||
215 | - } | ||
216 | - topic = topic.substring(0, topic.length - c5.length) | ||
217 | - } | ||
218 | - topic = topic.substring(0, topic.length - c4.length) | ||
219 | - } | ||
220 | - topic = topic.substring(0, topic.length - c3.length) | ||
221 | - } | ||
222 | - topic = topic.substring(0, topic.length - c2.length) | ||
223 | } | 115 | } |
224 | - topic = topic.substring(0, topic.length-c1.length) | 116 | + writeNewUser(user_topic) // db에 쓰기 |
225 | - } | 117 | + editor.putString("existing_topic",user_topic) |
226 | - | 118 | + editor.commit() |
227 | - //Log.d("re:", user_topic) | 119 | + }else{ |
228 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
229 | - | ||
230 | 120 | ||
121 | + } | ||
231 | var intent = Intent(this, SignInActivity::class.java) | 122 | var intent = Intent(this, SignInActivity::class.java) |
232 | startActivity(intent) | 123 | startActivity(intent) |
233 | } | 124 | } |
... | @@ -261,6 +152,12 @@ class InputProfilFifthTwoActivity : AppCompatActivity() { | ... | @@ -261,6 +152,12 @@ class InputProfilFifthTwoActivity : AppCompatActivity() { |
261 | } | 152 | } |
262 | 153 | ||
263 | nextButton.setOnClickListener { | 154 | nextButton.setOnClickListener { |
155 | + if(jikjaangButton.isChecked&&(editText1.text.toString()!="")){editor.putString("fifth_two_editText1",editText1.text.toString());editor.putString("fifth_two_jikjaangButton","isChecked");editor.putString("fifth_two","done");editor.commit()} | ||
156 | + if(jiyeokButton.isChecked&&(editText1.text.toString()!="")){editor.putString("fifth_two_editText1",editText1.text.toString());editor.putString("fifth_two_jiyeokButton","isChecked");editor.putString("fifth_two","done");editor.commit()} | ||
157 | + if(pibooyaangjikjaangButton.isChecked){editor.putString("fifth_two_pibooyaangjikjaangButton","isChecked");editor.putString("fifth_two","done");editor.commit()} | ||
158 | + if(pibooyaangjiyeokButton.isChecked){editor.putString("fifth_two_pibooyaangjiyeokButton","isChecked");editor.putString("fifth_two","done");editor.commit()} | ||
159 | + if(uieryoButton.isChecked){editor.putString("fifth_two_uieryoButton","isChecked");editor.putString("fifth_two","done");editor.commit()} | ||
160 | + | ||
264 | var intent = Intent(this, InputProfilFifthThreeActivity::class.java) | 161 | var intent = Intent(this, InputProfilFifthThreeActivity::class.java) |
265 | startActivity(intent) | 162 | startActivity(intent) |
266 | } | 163 | } | ... | ... |
... | @@ -16,12 +16,16 @@ import com.google.firebase.database.FirebaseDatabase | ... | @@ -16,12 +16,16 @@ import com.google.firebase.database.FirebaseDatabase |
16 | import com.google.firebase.iid.FirebaseInstanceId | 16 | import com.google.firebase.iid.FirebaseInstanceId |
17 | import com.google.firebase.messaging.FirebaseMessaging | 17 | import com.google.firebase.messaging.FirebaseMessaging |
18 | import kotlinx.android.synthetic.main.activity_input_profil_first_five.* | 18 | import kotlinx.android.synthetic.main.activity_input_profil_first_five.* |
19 | +import kotlinx.android.synthetic.main.activity_input_profil_first_five.nextButton | ||
20 | +import kotlinx.android.synthetic.main.activity_input_profil_first_five.previousButton | ||
21 | +import kotlinx.android.synthetic.main.activity_input_profil_first_five.skipButton | ||
22 | +import kotlinx.android.synthetic.main.activity_input_profil_first_five.toolbar | ||
23 | +import kotlinx.android.synthetic.main.activity_input_profil_second_one.* | ||
19 | 24 | ||
20 | class InputProfilFirstFiveActivity : AppCompatActivity() { | 25 | class InputProfilFirstFiveActivity : AppCompatActivity() { |
21 | 26 | ||
22 | private val firebaseAuth = FirebaseAuth.getInstance() | 27 | private val firebaseAuth = FirebaseAuth.getInstance() |
23 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 28 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
24 | - | ||
25 | private fun sendToken(){ | 29 | private fun sendToken(){ |
26 | FirebaseInstanceId.getInstance().instanceId | 30 | FirebaseInstanceId.getInstance().instanceId |
27 | .addOnCompleteListener(OnCompleteListener { task -> | 31 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -40,9 +44,8 @@ class InputProfilFirstFiveActivity : AppCompatActivity() { | ... | @@ -40,9 +44,8 @@ class InputProfilFirstFiveActivity : AppCompatActivity() { |
40 | }) | 44 | }) |
41 | } | 45 | } |
42 | 46 | ||
43 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 47 | + private fun writeNewUser(Topic : String) { |
44 | - val user = User(u_token, Policy!!) | 48 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
45 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
46 | } | 49 | } |
47 | 50 | ||
48 | 51 | ||
... | @@ -73,6 +76,7 @@ class InputProfilFirstFiveActivity : AppCompatActivity() { | ... | @@ -73,6 +76,7 @@ class InputProfilFirstFiveActivity : AppCompatActivity() { |
73 | sendToken() | 76 | sendToken() |
74 | val user=firebaseAuth?.currentUser!!.uid | 77 | val user=firebaseAuth?.currentUser!!.uid |
75 | Log.d("test:", user.toString()) | 78 | Log.d("test:", user.toString()) |
79 | + | ||
76 | val cat_1=listOf("c1_1","c1_2","c1_3") | 80 | val cat_1=listOf("c1_1","c1_2","c1_3") |
77 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 81 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
78 | val cat_3=listOf("c3_1","c3_2","c3_3") | 82 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -90,172 +94,43 @@ class InputProfilFirstFiveActivity : AppCompatActivity() { | ... | @@ -90,172 +94,43 @@ class InputProfilFirstFiveActivity : AppCompatActivity() { |
90 | val cat_15=listOf("c15_1","c15_2","c15_3") | 94 | val cat_15=listOf("c15_1","c15_2","c15_3") |
91 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 95 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
92 | 96 | ||
93 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 97 | + val cat_list=mutableListOf<String>() |
94 | - //var policy_string="" | 98 | + cat_list.addAll(cat_1) |
95 | - | 99 | + cat_list.addAll(cat_2) |
96 | - var user_cat_1 = mutableListOf("c1_1") | 100 | + cat_list.addAll(cat_3) |
97 | - var user_cat_2 = mutableListOf("c2_1") | 101 | + cat_list.addAll(cat_4) |
98 | - var user_cat_3 = mutableListOf("c3_1") | 102 | + cat_list.addAll(cat_5) |
99 | - var user_cat_4 = mutableListOf("c4_1") | 103 | + cat_list.addAll(cat_6) |
100 | - var user_cat_5 = mutableListOf("c5_1") | 104 | + cat_list.addAll(cat_7) |
101 | - var user_cat_6 = mutableListOf("c6_1") | 105 | + cat_list.addAll(cat_8) |
102 | - var user_cat_7 = mutableListOf("c7_1") | 106 | + cat_list.addAll(cat_9) |
103 | - var user_cat_8 = mutableListOf("c8_1") | 107 | + cat_list.addAll(cat_10) |
104 | - var user_cat_9 = mutableListOf("c9_1") | 108 | + cat_list.addAll(cat_11) |
105 | - var user_cat_10 = mutableListOf("c10_1") | 109 | + cat_list.addAll(cat_12) |
106 | - var user_cat_11 = mutableListOf("c11_1") | 110 | + cat_list.addAll(cat_13) |
107 | - var user_cat_12 = mutableListOf("c12_1") | 111 | + cat_list.addAll(cat_14) |
108 | - var user_cat_13 = mutableListOf("c13_1") | 112 | + cat_list.addAll(cat_15) |
109 | - var user_cat_14 = mutableListOf("c14_1") | 113 | + cat_list.addAll(cat_16) |
110 | - var user_cat_15 = mutableListOf("c15_1") | 114 | + |
111 | - var user_cat_16 = mutableListOf("c16_1") | 115 | + var user_topic="" |
112 | - | 116 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
113 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 117 | + |
114 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 118 | + if(prof.getString("existing_topic","none")!=user_topic){ |
115 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 119 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
116 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 120 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
117 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 121 | + if (!task.isSuccessful) { } // 성공 |
118 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
119 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
120 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
121 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
122 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
123 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
124 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
125 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
126 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
127 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
128 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
129 | - | ||
130 | - var topic = "" | ||
131 | - var user_topic = "" | ||
132 | - | ||
133 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
134 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
135 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
136 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
137 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
138 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
139 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
140 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
141 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
142 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
143 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
144 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
145 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
146 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
147 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
148 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
149 | - | ||
150 | - | ||
151 | - for(c1 in user_cat_1) { | ||
152 | - topic += c1 | ||
153 | - for (c2 in user_cat_2) { | ||
154 | - topic += c2 | ||
155 | - for (c3 in user_cat_3) { | ||
156 | - topic += c3 | ||
157 | - for (c4 in user_cat_4) { | ||
158 | - topic += c4 | ||
159 | - for (c5 in user_cat_5) { | ||
160 | - topic += c5 | ||
161 | - for (c6 in user_cat_6) { | ||
162 | - topic += c6 | ||
163 | - for (c7 in user_cat_7) { | ||
164 | - topic += c7 | ||
165 | - for (c8 in user_cat_8) { | ||
166 | - topic += c8 | ||
167 | - for (c9 in user_cat_9) { | ||
168 | - topic += c9 | ||
169 | - for (c10 in user_cat_10) { | ||
170 | - topic += c10 | ||
171 | - for (c11 in user_cat_11) { | ||
172 | - topic += c11 | ||
173 | - for (c12 in user_cat_12) { | ||
174 | - topic += c12 | ||
175 | - for (c13 in user_cat_13) { | ||
176 | - topic += c13 | ||
177 | - for (c14 in user_cat_14) { | ||
178 | - topic += c14 | ||
179 | - for (c15 in user_cat_15) { | ||
180 | - topic += c15 | ||
181 | - for (c16 in user_cat_16) { | ||
182 | - topic += c16 | ||
183 | - user_topic += (topic + "/") | ||
184 | - // debug | ||
185 | - // Log.d("topic : ", topic) | ||
186 | - | ||
187 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
188 | - if (!task.isSuccessful) { } // 성공 | ||
189 | - } | ||
190 | - /* topic 구독 코드 | ||
191 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
192 | - if (!task.isSuccessful) { } // 성공 | ||
193 | - } | ||
194 | - */ | ||
195 | - | ||
196 | - topic = topic.substring(0, topic.length - c16.length) | ||
197 | - } | ||
198 | - topic = topic.substring(0, topic.length - c15.length) | ||
199 | - } | ||
200 | - topic = topic.substring(0, topic.length - c14.length) | ||
201 | - } | ||
202 | - topic = topic.substring(0, topic.length - c13.length) | ||
203 | - } | ||
204 | - topic = topic.substring(0, topic.length - c12.length) | ||
205 | - } | ||
206 | - topic = topic.substring(0, topic.length - c11.length) | ||
207 | - } | ||
208 | - topic = topic.substring(0, topic.length - c10.length) | ||
209 | - } | ||
210 | - topic = topic.substring(0, topic.length - c9.length) | ||
211 | - } | ||
212 | - topic = topic.substring(0, topic.length - c8.length) | ||
213 | - } | ||
214 | - topic = topic.substring(0, topic.length - c7.length) | ||
215 | - } | ||
216 | - topic = topic.substring(0, topic.length - c6.length) | ||
217 | - } | ||
218 | - topic = topic.substring(0, topic.length - c5.length) | ||
219 | - } | ||
220 | - topic = topic.substring(0, topic.length - c4.length) | ||
221 | - } | ||
222 | - topic = topic.substring(0, topic.length - c3.length) | ||
223 | - } | ||
224 | - topic = topic.substring(0, topic.length - c2.length) | ||
225 | } | 122 | } |
226 | - topic = topic.substring(0, topic.length-c1.length) | 123 | + writeNewUser(user_topic) // db에 쓰기 |
227 | - } | 124 | + editor.putString("existing_topic",user_topic) |
228 | - | 125 | + editor.commit() |
229 | - //Log.d("re:", user_topic) | 126 | + }else{ |
230 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
231 | - | ||
232 | 127 | ||
128 | + } | ||
233 | var intent = Intent(this, SignInActivity::class.java) | 129 | var intent = Intent(this, SignInActivity::class.java) |
234 | startActivity(intent) | 130 | startActivity(intent) |
235 | } | 131 | } |
236 | 132 | ||
237 | - questionButton.setOnClickListener { | ||
238 | - val builder = AlertDialog.Builder(this) | ||
239 | - val dialogView = layoutInflater.inflate(R.layout.dialog_example, null) | ||
240 | - //val dialogText = dialogView.findViewById<EditText>(R.id.dialogEt) | ||
241 | - //val dialogRatingBar = dialogView.findViewById<RatingBar>(R.id.dialogRb) | ||
242 | - dialogView.findViewById<TextView>(R.id.dialogTitle).text="가족구성원이란?" | ||
243 | - dialogView.findViewById<TextView>(R.id.dialogContent).text="주민등록상 같은 거주지에 사는 사람" | ||
244 | - | ||
245 | - builder.setView(dialogView) | ||
246 | - .setPositiveButton("확인") { dialogInterface, i -> | ||
247 | - //mainTv.text = dialogText.text.toString() | ||
248 | - //mainRb.rating = dialogRatingBar.rating | ||
249 | - /* 확인일 때 main의 View의 값에 dialog View에 있는 값을 적용 */ | ||
250 | 133 | ||
251 | - } | ||
252 | - /* | ||
253 | - .setNegativeButton("취소") { dialogInterface, i -> | ||
254 | - /* 취소일 때 아무 액션이 없으므로 빈칸 */ | ||
255 | - } | ||
256 | - */ | ||
257 | - .show() | ||
258 | - } | ||
259 | 134 | ||
260 | inmanButton.setOnClickListener { | 135 | inmanButton.setOnClickListener { |
261 | if(outmanButton.isChecked){ | 136 | if(outmanButton.isChecked){ |
... | @@ -274,10 +149,13 @@ class InputProfilFirstFiveActivity : AppCompatActivity() { | ... | @@ -274,10 +149,13 @@ class InputProfilFirstFiveActivity : AppCompatActivity() { |
274 | } | 149 | } |
275 | 150 | ||
276 | nextButton.setOnClickListener { | 151 | nextButton.setOnClickListener { |
152 | + | ||
153 | + | ||
154 | + | ||
277 | if(inmanButton.isChecked){ | 155 | if(inmanButton.isChecked){ |
278 | - editor.putInt("c1_2",1); editor.commit() | 156 | + editor.putInt("c1_2",1); editor.commit();editor.putString("first_five","done");editor.commit() |
279 | }else if(outmanButton.isChecked){ | 157 | }else if(outmanButton.isChecked){ |
280 | - editor.putInt("c1_3",1); editor.commit() | 158 | + editor.putInt("c1_3",1); editor.commit();editor.putString("first_five","done");editor.commit() |
281 | }else{ | 159 | }else{ |
282 | 160 | ||
283 | } | 161 | } | ... | ... |
... | @@ -22,8 +22,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_first_four.previousB | ... | @@ -22,8 +22,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_first_four.previousB |
22 | class InputProfilFirstFourActivity : AppCompatActivity() { | 22 | class InputProfilFirstFourActivity : AppCompatActivity() { |
23 | 23 | ||
24 | private val firebaseAuth = FirebaseAuth.getInstance() | 24 | private val firebaseAuth = FirebaseAuth.getInstance() |
25 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 25 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
26 | - | ||
27 | private fun sendToken(){ | 26 | private fun sendToken(){ |
28 | FirebaseInstanceId.getInstance().instanceId | 27 | FirebaseInstanceId.getInstance().instanceId |
29 | .addOnCompleteListener(OnCompleteListener { task -> | 28 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -42,9 +41,8 @@ class InputProfilFirstFourActivity : AppCompatActivity() { | ... | @@ -42,9 +41,8 @@ class InputProfilFirstFourActivity : AppCompatActivity() { |
42 | }) | 41 | }) |
43 | } | 42 | } |
44 | 43 | ||
45 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 44 | + private fun writeNewUser(Topic : String) { |
46 | - val user = User(u_token, Policy!!) | 45 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
47 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
48 | } | 46 | } |
49 | 47 | ||
50 | 48 | ||
... | @@ -75,6 +73,7 @@ class InputProfilFirstFourActivity : AppCompatActivity() { | ... | @@ -75,6 +73,7 @@ class InputProfilFirstFourActivity : AppCompatActivity() { |
75 | sendToken() | 73 | sendToken() |
76 | val user=firebaseAuth?.currentUser!!.uid | 74 | val user=firebaseAuth?.currentUser!!.uid |
77 | Log.d("test:", user.toString()) | 75 | Log.d("test:", user.toString()) |
76 | + | ||
78 | val cat_1=listOf("c1_1","c1_2","c1_3") | 77 | val cat_1=listOf("c1_1","c1_2","c1_3") |
79 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 78 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
80 | val cat_3=listOf("c3_1","c3_2","c3_3") | 79 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -92,146 +91,38 @@ class InputProfilFirstFourActivity : AppCompatActivity() { | ... | @@ -92,146 +91,38 @@ class InputProfilFirstFourActivity : AppCompatActivity() { |
92 | val cat_15=listOf("c15_1","c15_2","c15_3") | 91 | val cat_15=listOf("c15_1","c15_2","c15_3") |
93 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 92 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
94 | 93 | ||
95 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 94 | + val cat_list=mutableListOf<String>() |
96 | - //var policy_string="" | 95 | + cat_list.addAll(cat_1) |
97 | - | 96 | + cat_list.addAll(cat_2) |
98 | - var user_cat_1 = mutableListOf("c1_1") | 97 | + cat_list.addAll(cat_3) |
99 | - var user_cat_2 = mutableListOf("c2_1") | 98 | + cat_list.addAll(cat_4) |
100 | - var user_cat_3 = mutableListOf("c3_1") | 99 | + cat_list.addAll(cat_5) |
101 | - var user_cat_4 = mutableListOf("c4_1") | 100 | + cat_list.addAll(cat_6) |
102 | - var user_cat_5 = mutableListOf("c5_1") | 101 | + cat_list.addAll(cat_7) |
103 | - var user_cat_6 = mutableListOf("c6_1") | 102 | + cat_list.addAll(cat_8) |
104 | - var user_cat_7 = mutableListOf("c7_1") | 103 | + cat_list.addAll(cat_9) |
105 | - var user_cat_8 = mutableListOf("c8_1") | 104 | + cat_list.addAll(cat_10) |
106 | - var user_cat_9 = mutableListOf("c9_1") | 105 | + cat_list.addAll(cat_11) |
107 | - var user_cat_10 = mutableListOf("c10_1") | 106 | + cat_list.addAll(cat_12) |
108 | - var user_cat_11 = mutableListOf("c11_1") | 107 | + cat_list.addAll(cat_13) |
109 | - var user_cat_12 = mutableListOf("c12_1") | 108 | + cat_list.addAll(cat_14) |
110 | - var user_cat_13 = mutableListOf("c13_1") | 109 | + cat_list.addAll(cat_15) |
111 | - var user_cat_14 = mutableListOf("c14_1") | 110 | + cat_list.addAll(cat_16) |
112 | - var user_cat_15 = mutableListOf("c15_1") | 111 | + |
113 | - var user_cat_16 = mutableListOf("c16_1") | 112 | + var user_topic="" |
114 | - | 113 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
115 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 114 | + |
116 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 115 | + if(prof.getString("existing_topic","none")!=user_topic){ |
117 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 116 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
118 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 117 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
119 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 118 | + if (!task.isSuccessful) { } // 성공 |
120 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
121 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
122 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
123 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
124 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
125 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
126 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
127 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
128 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
129 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
130 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
131 | - | ||
132 | - var topic = "" | ||
133 | - var user_topic = "" | ||
134 | - | ||
135 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
136 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
137 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
138 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
139 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
140 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
141 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
142 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
143 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
144 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
145 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
146 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
147 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
148 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
149 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
150 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
151 | - | ||
152 | - | ||
153 | - for(c1 in user_cat_1) { | ||
154 | - topic += c1 | ||
155 | - for (c2 in user_cat_2) { | ||
156 | - topic += c2 | ||
157 | - for (c3 in user_cat_3) { | ||
158 | - topic += c3 | ||
159 | - for (c4 in user_cat_4) { | ||
160 | - topic += c4 | ||
161 | - for (c5 in user_cat_5) { | ||
162 | - topic += c5 | ||
163 | - for (c6 in user_cat_6) { | ||
164 | - topic += c6 | ||
165 | - for (c7 in user_cat_7) { | ||
166 | - topic += c7 | ||
167 | - for (c8 in user_cat_8) { | ||
168 | - topic += c8 | ||
169 | - for (c9 in user_cat_9) { | ||
170 | - topic += c9 | ||
171 | - for (c10 in user_cat_10) { | ||
172 | - topic += c10 | ||
173 | - for (c11 in user_cat_11) { | ||
174 | - topic += c11 | ||
175 | - for (c12 in user_cat_12) { | ||
176 | - topic += c12 | ||
177 | - for (c13 in user_cat_13) { | ||
178 | - topic += c13 | ||
179 | - for (c14 in user_cat_14) { | ||
180 | - topic += c14 | ||
181 | - for (c15 in user_cat_15) { | ||
182 | - topic += c15 | ||
183 | - for (c16 in user_cat_16) { | ||
184 | - topic += c16 | ||
185 | - user_topic += (topic + "/") | ||
186 | - // debug | ||
187 | - // Log.d("topic : ", topic) | ||
188 | - | ||
189 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
190 | - if (!task.isSuccessful) { } // 성공 | ||
191 | - } | ||
192 | - /* topic 구독 코드 | ||
193 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
194 | - if (!task.isSuccessful) { } // 성공 | ||
195 | - } | ||
196 | - */ | ||
197 | - | ||
198 | - topic = topic.substring(0, topic.length - c16.length) | ||
199 | - } | ||
200 | - topic = topic.substring(0, topic.length - c15.length) | ||
201 | - } | ||
202 | - topic = topic.substring(0, topic.length - c14.length) | ||
203 | - } | ||
204 | - topic = topic.substring(0, topic.length - c13.length) | ||
205 | - } | ||
206 | - topic = topic.substring(0, topic.length - c12.length) | ||
207 | - } | ||
208 | - topic = topic.substring(0, topic.length - c11.length) | ||
209 | - } | ||
210 | - topic = topic.substring(0, topic.length - c10.length) | ||
211 | - } | ||
212 | - topic = topic.substring(0, topic.length - c9.length) | ||
213 | - } | ||
214 | - topic = topic.substring(0, topic.length - c8.length) | ||
215 | - } | ||
216 | - topic = topic.substring(0, topic.length - c7.length) | ||
217 | - } | ||
218 | - topic = topic.substring(0, topic.length - c6.length) | ||
219 | - } | ||
220 | - topic = topic.substring(0, topic.length - c5.length) | ||
221 | - } | ||
222 | - topic = topic.substring(0, topic.length - c4.length) | ||
223 | - } | ||
224 | - topic = topic.substring(0, topic.length - c3.length) | ||
225 | - } | ||
226 | - topic = topic.substring(0, topic.length - c2.length) | ||
227 | } | 119 | } |
228 | - topic = topic.substring(0, topic.length-c1.length) | 120 | + writeNewUser(user_topic) // db에 쓰기 |
229 | - } | 121 | + editor.putString("existing_topic",user_topic) |
230 | - | 122 | + editor.commit() |
231 | - //Log.d("re:", user_topic) | 123 | + }else{ |
232 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
233 | - | ||
234 | 124 | ||
125 | + } | ||
235 | var intent = Intent(this, SignInActivity::class.java) | 126 | var intent = Intent(this, SignInActivity::class.java) |
236 | startActivity(intent) | 127 | startActivity(intent) |
237 | } | 128 | } |
... | @@ -326,275 +217,279 @@ class InputProfilFirstFourActivity : AppCompatActivity() { | ... | @@ -326,275 +217,279 @@ class InputProfilFirstFourActivity : AppCompatActivity() { |
326 | } | 217 | } |
327 | 218 | ||
328 | nextButton.setOnClickListener { | 219 | nextButton.setOnClickListener { |
329 | - if(doSpinner.selectedItem.toString()=="서울특별시"){ editor.putInt("c11_2",1); editor.commit()} | 220 | + |
330 | - if(doSpinner.selectedItem.toString()=="부산광역시"){ editor.putInt("c11_3",1); editor.commit()} | 221 | + if(doSpinner.selectedItem.toString()=="서울특별시"){ editor.putInt("c11_2",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
331 | - if(doSpinner.selectedItem.toString()=="대구광역시"){ editor.putInt("c11_4",1); editor.commit()} | 222 | + if(doSpinner.selectedItem.toString()=="부산광역시"){ editor.putInt("c11_3",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
332 | - if(doSpinner.selectedItem.toString()=="인천광역시"){ editor.putInt("c11_5",1); editor.commit()} | 223 | + if(doSpinner.selectedItem.toString()=="대구광역시"){ editor.putInt("c11_4",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
333 | - if(doSpinner.selectedItem.toString()=="광주광역시"){ editor.putInt("c11_6",1); editor.commit()} | 224 | + if(doSpinner.selectedItem.toString()=="인천광역시"){ editor.putInt("c11_5",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
334 | - if(doSpinner.selectedItem.toString()=="대전광역시"){ editor.putInt("c11_7",1); editor.commit()} | 225 | + if(doSpinner.selectedItem.toString()=="광주광역시"){ editor.putInt("c11_6",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
335 | - if(doSpinner.selectedItem.toString()=="울산광역시"){ editor.putInt("c11_8",1); editor.commit()} | 226 | + if(doSpinner.selectedItem.toString()=="대전광역시"){ editor.putInt("c11_7",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
336 | - if(doSpinner.selectedItem.toString()=="세종특별자치시"){ editor.putInt("c11_9",1); editor.commit()} | 227 | + if(doSpinner.selectedItem.toString()=="울산광역시"){ editor.putInt("c11_8",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
337 | - if(doSpinner.selectedItem.toString()=="경기도"){ editor.putInt("c11_10",1); editor.commit()} | 228 | + if(doSpinner.selectedItem.toString()=="세종특별자치시"){ editor.putInt("c11_9",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
338 | - if(doSpinner.selectedItem.toString()=="강원도"){ editor.putInt("c11_11",1); editor.commit()} | 229 | + if(doSpinner.selectedItem.toString()=="경기도"){ editor.putInt("c11_10",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
339 | - if(doSpinner.selectedItem.toString()=="충청북도"){ editor.putInt("c11_12",1); editor.commit()} | 230 | + if(doSpinner.selectedItem.toString()=="강원도"){ editor.putInt("c11_11",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
340 | - if(doSpinner.selectedItem.toString()=="충청남도"){ editor.putInt("c11_13",1); editor.commit()} | 231 | + if(doSpinner.selectedItem.toString()=="충청북도"){ editor.putInt("c11_12",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
341 | - if(doSpinner.selectedItem.toString()=="전라북도"){ editor.putInt("c11_14",1); editor.commit()} | 232 | + if(doSpinner.selectedItem.toString()=="충청남도"){ editor.putInt("c11_13",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
342 | - if(doSpinner.selectedItem.toString()=="전라남도"){ editor.putInt("c11_15",1); editor.commit()} | 233 | + if(doSpinner.selectedItem.toString()=="전라북도"){ editor.putInt("c11_14",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
343 | - if(doSpinner.selectedItem.toString()=="경상북도"){ editor.putInt("c11_16",1); editor.commit()} | 234 | + if(doSpinner.selectedItem.toString()=="전라남도"){ editor.putInt("c11_15",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
344 | - if(doSpinner.selectedItem.toString()=="경상남도"){ editor.putInt("c11_17",1); editor.commit()} | 235 | + if(doSpinner.selectedItem.toString()=="경상북도"){ editor.putInt("c11_16",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
345 | - if(doSpinner.selectedItem.toString()=="제주특별자치도"){ editor.putInt("c11_18",1); editor.commit()} | 236 | + if(doSpinner.selectedItem.toString()=="경상남도"){ editor.putInt("c11_17",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
346 | - | 237 | + if(doSpinner.selectedItem.toString()=="제주특별자치도"){ editor.putInt("c11_18",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
347 | - if(gooSpinner.selectedItem=="종로구"){editor.putInt("c12_100",1); editor.commit()} | 238 | + |
348 | - if(gooSpinner.selectedItem=="중구"){editor.putInt("c12_101",1); editor.commit()} | 239 | + if(gooSpinner.selectedItem=="종로구"){editor.putInt("c12_100",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
349 | - if(gooSpinner.selectedItem=="용산구"){editor.putInt("c12_102",1); editor.commit()} | 240 | + if(gooSpinner.selectedItem=="중구"){editor.putInt("c12_101",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
350 | - if(gooSpinner.selectedItem=="성동구"){editor.putInt("c12_103",1); editor.commit()} | 241 | + if(gooSpinner.selectedItem=="용산구"){editor.putInt("c12_102",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
351 | - if(gooSpinner.selectedItem=="광진구"){editor.putInt("c12_104",1); editor.commit()} | 242 | + if(gooSpinner.selectedItem=="성동구"){editor.putInt("c12_103",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
352 | - if(gooSpinner.selectedItem=="동대문구"){editor.putInt("c12_105",1); editor.commit()} | 243 | + if(gooSpinner.selectedItem=="광진구"){editor.putInt("c12_104",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
353 | - if(gooSpinner.selectedItem=="중랑구"){editor.putInt("c12_106",1); editor.commit()} | 244 | + if(gooSpinner.selectedItem=="동대문구"){editor.putInt("c12_105",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
354 | - if(gooSpinner.selectedItem=="성북구"){editor.putInt("c12_107",1); editor.commit()} | 245 | + if(gooSpinner.selectedItem=="중랑구"){editor.putInt("c12_106",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
355 | - if(gooSpinner.selectedItem=="강북구"){editor.putInt("c12_108",1); editor.commit()} | 246 | + if(gooSpinner.selectedItem=="성북구"){editor.putInt("c12_107",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
356 | - if(gooSpinner.selectedItem=="도봉구"){editor.putInt("c12_109",1); editor.commit()} | 247 | + if(gooSpinner.selectedItem=="강북구"){editor.putInt("c12_108",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
357 | - if(gooSpinner.selectedItem=="노원구"){editor.putInt("c12_110",1); editor.commit()} | 248 | + if(gooSpinner.selectedItem=="도봉구"){editor.putInt("c12_109",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
358 | - if(gooSpinner.selectedItem=="은평구"){editor.putInt("c12_111",1); editor.commit()} | 249 | + if(gooSpinner.selectedItem=="노원구"){editor.putInt("c12_110",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
359 | - if(gooSpinner.selectedItem=="서대문구"){editor.putInt("c12_112",1); editor.commit()} | 250 | + if(gooSpinner.selectedItem=="은평구"){editor.putInt("c12_111",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
360 | - if(gooSpinner.selectedItem=="마포구"){editor.putInt("c12_113",1); editor.commit()} | 251 | + if(gooSpinner.selectedItem=="서대문구"){editor.putInt("c12_112",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
361 | - if(gooSpinner.selectedItem=="양천구"){editor.putInt("c12_114",1); editor.commit()} | 252 | + if(gooSpinner.selectedItem=="마포구"){editor.putInt("c12_113",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
362 | - if(gooSpinner.selectedItem=="강서구"){editor.putInt("c12_115",1); editor.commit()} | 253 | + if(gooSpinner.selectedItem=="양천구"){editor.putInt("c12_114",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
363 | - if(gooSpinner.selectedItem=="구로구"){editor.putInt("c12_116",1); editor.commit()} | 254 | + if(gooSpinner.selectedItem=="강서구"){editor.putInt("c12_115",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
364 | - if(gooSpinner.selectedItem=="금천구"){editor.putInt("c12_117",1); editor.commit()} | 255 | + if(gooSpinner.selectedItem=="구로구"){editor.putInt("c12_116",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
365 | - if(gooSpinner.selectedItem=="영등포구"){editor.putInt("c12_118",1); editor.commit()} | 256 | + if(gooSpinner.selectedItem=="금천구"){editor.putInt("c12_117",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
366 | - if(gooSpinner.selectedItem=="동작구"){editor.putInt("c12_119",1); editor.commit()} | 257 | + if(gooSpinner.selectedItem=="영등포구"){editor.putInt("c12_118",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
367 | - if(gooSpinner.selectedItem=="관악구"){editor.putInt("c12_120",1); editor.commit()} | 258 | + if(gooSpinner.selectedItem=="동작구"){editor.putInt("c12_119",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
368 | - if(gooSpinner.selectedItem=="서초구"){editor.putInt("c12_121",1); editor.commit()} | 259 | + if(gooSpinner.selectedItem=="관악구"){editor.putInt("c12_120",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
369 | - if(gooSpinner.selectedItem=="강남구"){editor.putInt("c12_122",1); editor.commit()} | 260 | + if(gooSpinner.selectedItem=="서초구"){editor.putInt("c12_121",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
370 | - if(gooSpinner.selectedItem=="송파구"){editor.putInt("c12_123",1); editor.commit()} | 261 | + if(gooSpinner.selectedItem=="강남구"){editor.putInt("c12_122",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
371 | - if(gooSpinner.selectedItem=="강동구"){editor.putInt("c12_124",1); editor.commit()} | 262 | + if(gooSpinner.selectedItem=="송파구"){editor.putInt("c12_123",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
372 | - if(gooSpinner.selectedItem=="서구"){editor.putInt("c12_125",1); editor.commit()} | 263 | + if(gooSpinner.selectedItem=="강동구"){editor.putInt("c12_124",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
373 | - if(gooSpinner.selectedItem=="동구"){editor.putInt("c12_126",1); editor.commit()} | 264 | + if(gooSpinner.selectedItem=="서구"){editor.putInt("c12_125",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
374 | - if(gooSpinner.selectedItem=="영도구"){editor.putInt("c12_127",1); editor.commit()} | 265 | + if(gooSpinner.selectedItem=="동구"){editor.putInt("c12_126",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
375 | - if(gooSpinner.selectedItem=="부산진구"){editor.putInt("c12_128",1); editor.commit()} | 266 | + if(gooSpinner.selectedItem=="영도구"){editor.putInt("c12_127",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
376 | - if(gooSpinner.selectedItem=="동래구"){editor.putInt("c12_129",1); editor.commit()} | 267 | + if(gooSpinner.selectedItem=="부산진구"){editor.putInt("c12_128",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
377 | - if(gooSpinner.selectedItem=="남구"){editor.putInt("c12_130",1); editor.commit()} | 268 | + if(gooSpinner.selectedItem=="동래구"){editor.putInt("c12_129",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
378 | - if(gooSpinner.selectedItem=="북구"){editor.putInt("c12_131",1); editor.commit()} | 269 | + if(gooSpinner.selectedItem=="남구"){editor.putInt("c12_130",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
379 | - if(gooSpinner.selectedItem=="해운대구"){editor.putInt("c12_132",1); editor.commit()} | 270 | + if(gooSpinner.selectedItem=="북구"){editor.putInt("c12_131",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
380 | - if(gooSpinner.selectedItem=="사하구"){editor.putInt("c12_133",1); editor.commit()} | 271 | + if(gooSpinner.selectedItem=="해운대구"){editor.putInt("c12_132",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
381 | - if(gooSpinner.selectedItem=="금정구"){editor.putInt("c12_134",1); editor.commit()} | 272 | + if(gooSpinner.selectedItem=="사하구"){editor.putInt("c12_133",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
382 | - if(gooSpinner.selectedItem=="연제구"){editor.putInt("c12_135",1); editor.commit()} | 273 | + if(gooSpinner.selectedItem=="금정구"){editor.putInt("c12_134",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
383 | - if(gooSpinner.selectedItem=="수영구"){editor.putInt("c12_136",1); editor.commit()} | 274 | + if(gooSpinner.selectedItem=="연제구"){editor.putInt("c12_135",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
384 | - if(gooSpinner.selectedItem=="사상구"){editor.putInt("c12_137",1); editor.commit()} | 275 | + if(gooSpinner.selectedItem=="수영구"){editor.putInt("c12_136",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
385 | - if(gooSpinner.selectedItem=="기장군"){editor.putInt("c12_138",1); editor.commit()} | 276 | + if(gooSpinner.selectedItem=="사상구"){editor.putInt("c12_137",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
386 | - if(gooSpinner.selectedItem=="수성구"){editor.putInt("c12_139",1); editor.commit()} | 277 | + if(gooSpinner.selectedItem=="기장군"){editor.putInt("c12_138",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
387 | - if(gooSpinner.selectedItem=="달서구"){editor.putInt("c12_140",1); editor.commit()} | 278 | + if(gooSpinner.selectedItem=="수성구"){editor.putInt("c12_139",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
388 | - if(gooSpinner.selectedItem=="달성군"){editor.putInt("c12_141",1); editor.commit()} | 279 | + if(gooSpinner.selectedItem=="달서구"){editor.putInt("c12_140",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
389 | - if(gooSpinner.selectedItem=="중구영종출장소"){editor.putInt("c12_142",1); editor.commit()} | 280 | + if(gooSpinner.selectedItem=="달성군"){editor.putInt("c12_141",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
390 | - if(gooSpinner.selectedItem=="중구용유출장소"){editor.putInt("c12_143",1); editor.commit()} | 281 | + if(gooSpinner.selectedItem=="중구영종출장소"){editor.putInt("c12_142",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
391 | - if(gooSpinner.selectedItem=="미추홀구"){editor.putInt("c12_144",1); editor.commit()} | 282 | + if(gooSpinner.selectedItem=="중구용유출장소"){editor.putInt("c12_143",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
392 | - if(gooSpinner.selectedItem=="연수구"){editor.putInt("c12_145",1); editor.commit()} | 283 | + if(gooSpinner.selectedItem=="미추홀구"){editor.putInt("c12_144",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
393 | - if(gooSpinner.selectedItem=="남동구"){editor.putInt("c12_146",1); editor.commit()} | 284 | + if(gooSpinner.selectedItem=="연수구"){editor.putInt("c12_145",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
394 | - if(gooSpinner.selectedItem=="부평구"){editor.putInt("c12_147",1); editor.commit()} | 285 | + if(gooSpinner.selectedItem=="남동구"){editor.putInt("c12_146",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
395 | - if(gooSpinner.selectedItem=="계양구"){editor.putInt("c12_148",1); editor.commit()} | 286 | + if(gooSpinner.selectedItem=="부평구"){editor.putInt("c12_147",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
396 | - if(gooSpinner.selectedItem=="서구검단출장"){editor.putInt("c12_149",1); editor.commit()} | 287 | + if(gooSpinner.selectedItem=="계양구"){editor.putInt("c12_148",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
397 | - if(gooSpinner.selectedItem=="강화군"){editor.putInt("c12_150",1); editor.commit()} | 288 | + if(gooSpinner.selectedItem=="서구검단출장"){editor.putInt("c12_149",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
398 | - if(gooSpinner.selectedItem=="옹진군"){editor.putInt("c12_151",1); editor.commit()} | 289 | + if(gooSpinner.selectedItem=="강화군"){editor.putInt("c12_150",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
399 | - if(gooSpinner.selectedItem=="광산구"){editor.putInt("c12_152",1); editor.commit()} | 290 | + if(gooSpinner.selectedItem=="옹진군"){editor.putInt("c12_151",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
400 | - if(gooSpinner.selectedItem=="유성구"){editor.putInt("c12_153",1); editor.commit()} | 291 | + if(gooSpinner.selectedItem=="광산구"){editor.putInt("c12_152",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
401 | - if(gooSpinner.selectedItem=="대덕구"){editor.putInt("c12_154",1); editor.commit()} | 292 | + if(gooSpinner.selectedItem=="유성구"){editor.putInt("c12_153",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
402 | - if(gooSpinner.selectedItem=="울주군"){editor.putInt("c12_155",1); editor.commit()} | 293 | + if(gooSpinner.selectedItem=="대덕구"){editor.putInt("c12_154",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
403 | - if(gooSpinner.selectedItem=="수원시"){editor.putInt("c12_156",1); editor.commit()} | 294 | + if(gooSpinner.selectedItem=="울주군"){editor.putInt("c12_155",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
404 | - if(gooSpinner.selectedItem=="수원시 장안구"){editor.putInt("c12_157",1); editor.commit()} | 295 | + if(gooSpinner.selectedItem=="수원시"){editor.putInt("c12_156",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
405 | - if(gooSpinner.selectedItem=="수원시 권선구"){editor.putInt("c12_158",1); editor.commit()} | 296 | + if(gooSpinner.selectedItem=="수원시 장안구"){editor.putInt("c12_157",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
406 | - if(gooSpinner.selectedItem=="수원시 팔달구"){editor.putInt("c12_159",1); editor.commit()} | 297 | + if(gooSpinner.selectedItem=="수원시 권선구"){editor.putInt("c12_158",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
407 | - if(gooSpinner.selectedItem=="수원시 영통구"){editor.putInt("c12_160",1); editor.commit()} | 298 | + if(gooSpinner.selectedItem=="수원시 팔달구"){editor.putInt("c12_159",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
408 | - if(gooSpinner.selectedItem=="성남시"){editor.putInt("c12_161",1); editor.commit()} | 299 | + if(gooSpinner.selectedItem=="수원시 영통구"){editor.putInt("c12_160",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
409 | - if(gooSpinner.selectedItem=="성남시 수정구"){editor.putInt("c12_162",1); editor.commit()} | 300 | + if(gooSpinner.selectedItem=="성남시"){editor.putInt("c12_161",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
410 | - if(gooSpinner.selectedItem=="성남시 중원구"){editor.putInt("c12_163",1); editor.commit()} | 301 | + if(gooSpinner.selectedItem=="성남시 수정구"){editor.putInt("c12_162",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
411 | - if(gooSpinner.selectedItem=="성남시 분당구"){editor.putInt("c12_164",1); editor.commit()} | 302 | + if(gooSpinner.selectedItem=="성남시 중원구"){editor.putInt("c12_163",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
412 | - if(gooSpinner.selectedItem=="의정부시"){editor.putInt("c12_165",1); editor.commit()} | 303 | + if(gooSpinner.selectedItem=="성남시 분당구"){editor.putInt("c12_164",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
413 | - if(gooSpinner.selectedItem=="안양시"){editor.putInt("c12_166",1); editor.commit()} | 304 | + if(gooSpinner.selectedItem=="의정부시"){editor.putInt("c12_165",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
414 | - if(gooSpinner.selectedItem=="안양시 만안구"){editor.putInt("c12_167",1); editor.commit()} | 305 | + if(gooSpinner.selectedItem=="안양시"){editor.putInt("c12_166",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
415 | - if(gooSpinner.selectedItem=="안양시 동안구"){editor.putInt("c12_168",1); editor.commit()} | 306 | + if(gooSpinner.selectedItem=="안양시 만안구"){editor.putInt("c12_167",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
416 | - if(gooSpinner.selectedItem=="부천시"){editor.putInt("c12_169",1); editor.commit()} | 307 | + if(gooSpinner.selectedItem=="안양시 동안구"){editor.putInt("c12_168",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
417 | - if(gooSpinner.selectedItem=="광명시"){editor.putInt("c12_170",1); editor.commit()} | 308 | + if(gooSpinner.selectedItem=="부천시"){editor.putInt("c12_169",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
418 | - if(gooSpinner.selectedItem=="평택시"){editor.putInt("c12_171",1); editor.commit()} | 309 | + if(gooSpinner.selectedItem=="광명시"){editor.putInt("c12_170",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
419 | - if(gooSpinner.selectedItem=="송탄출장소"){editor.putInt("c12_172",1); editor.commit()} | 310 | + if(gooSpinner.selectedItem=="평택시"){editor.putInt("c12_171",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
420 | - if(gooSpinner.selectedItem=="안중출장소"){editor.putInt("c12_173",1); editor.commit()} | 311 | + if(gooSpinner.selectedItem=="송탄출장소"){editor.putInt("c12_172",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
421 | - if(gooSpinner.selectedItem=="동두천시"){editor.putInt("c12_174",1); editor.commit()} | 312 | + if(gooSpinner.selectedItem=="안중출장소"){editor.putInt("c12_173",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
422 | - if(gooSpinner.selectedItem=="안산시"){editor.putInt("c12_175",1); editor.commit()} | 313 | + if(gooSpinner.selectedItem=="동두천시"){editor.putInt("c12_174",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
423 | - if(gooSpinner.selectedItem=="안산시 상록구"){editor.putInt("c12_176",1); editor.commit()} | 314 | + if(gooSpinner.selectedItem=="안산시"){editor.putInt("c12_175",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
424 | - if(gooSpinner.selectedItem=="안산시 단원구"){editor.putInt("c12_177",1); editor.commit()} | 315 | + if(gooSpinner.selectedItem=="안산시 상록구"){editor.putInt("c12_176",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
425 | - if(gooSpinner.selectedItem=="고양시"){editor.putInt("c12_178",1); editor.commit()} | 316 | + if(gooSpinner.selectedItem=="안산시 단원구"){editor.putInt("c12_177",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
426 | - if(gooSpinner.selectedItem=="고양시 덕양구"){editor.putInt("c12_179",1); editor.commit()} | 317 | + if(gooSpinner.selectedItem=="고양시"){editor.putInt("c12_178",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
427 | - if(gooSpinner.selectedItem=="고양시 일산동구"){editor.putInt("c12_180",1); editor.commit()} | 318 | + if(gooSpinner.selectedItem=="고양시 덕양구"){editor.putInt("c12_179",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
428 | - if(gooSpinner.selectedItem=="고양시 일산서구"){editor.putInt("c12_181",1); editor.commit()} | 319 | + if(gooSpinner.selectedItem=="고양시 일산동구"){editor.putInt("c12_180",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
429 | - if(gooSpinner.selectedItem=="과천시"){editor.putInt("c12_182",1); editor.commit()} | 320 | + if(gooSpinner.selectedItem=="고양시 일산서구"){editor.putInt("c12_181",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
430 | - if(gooSpinner.selectedItem=="구리시"){editor.putInt("c12_183",1); editor.commit()} | 321 | + if(gooSpinner.selectedItem=="과천시"){editor.putInt("c12_182",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
431 | - if(gooSpinner.selectedItem=="남양주시"){editor.putInt("c12_184",1); editor.commit()} | 322 | + if(gooSpinner.selectedItem=="구리시"){editor.putInt("c12_183",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
432 | - if(gooSpinner.selectedItem=="풍양출장소"){editor.putInt("c12_185",1); editor.commit()} | 323 | + if(gooSpinner.selectedItem=="남양주시"){editor.putInt("c12_184",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
433 | - if(gooSpinner.selectedItem=="오산시"){editor.putInt("c12_186",1); editor.commit()} | 324 | + if(gooSpinner.selectedItem=="풍양출장소"){editor.putInt("c12_185",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
434 | - if(gooSpinner.selectedItem=="시흥시"){editor.putInt("c12_187",1); editor.commit()} | 325 | + if(gooSpinner.selectedItem=="오산시"){editor.putInt("c12_186",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
435 | - if(gooSpinner.selectedItem=="군포시"){editor.putInt("c12_188",1); editor.commit()} | 326 | + if(gooSpinner.selectedItem=="시흥시"){editor.putInt("c12_187",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
436 | - if(gooSpinner.selectedItem=="의왕시"){editor.putInt("c12_189",1); editor.commit()} | 327 | + if(gooSpinner.selectedItem=="군포시"){editor.putInt("c12_188",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
437 | - if(gooSpinner.selectedItem=="하남시"){editor.putInt("c12_190",1); editor.commit()} | 328 | + if(gooSpinner.selectedItem=="의왕시"){editor.putInt("c12_189",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
438 | - if(gooSpinner.selectedItem=="용인시"){editor.putInt("c12_191",1); editor.commit()} | 329 | + if(gooSpinner.selectedItem=="하남시"){editor.putInt("c12_190",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
439 | - if(gooSpinner.selectedItem=="용인시 처인구"){editor.putInt("c12_192",1); editor.commit()} | 330 | + if(gooSpinner.selectedItem=="용인시"){editor.putInt("c12_191",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
440 | - if(gooSpinner.selectedItem=="용인시 기흥구"){editor.putInt("c12_193",1); editor.commit()} | 331 | + if(gooSpinner.selectedItem=="용인시 처인구"){editor.putInt("c12_192",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
441 | - if(gooSpinner.selectedItem=="용인시 수지구"){editor.putInt("c12_194",1); editor.commit()} | 332 | + if(gooSpinner.selectedItem=="용인시 기흥구"){editor.putInt("c12_193",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
442 | - if(gooSpinner.selectedItem=="파주시"){editor.putInt("c12_195",1); editor.commit()} | 333 | + if(gooSpinner.selectedItem=="용인시 수지구"){editor.putInt("c12_194",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
443 | - if(gooSpinner.selectedItem=="이천시"){editor.putInt("c12_196",1); editor.commit()} | 334 | + if(gooSpinner.selectedItem=="파주시"){editor.putInt("c12_195",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
444 | - if(gooSpinner.selectedItem=="안성시"){editor.putInt("c12_197",1); editor.commit()} | 335 | + if(gooSpinner.selectedItem=="이천시"){editor.putInt("c12_196",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
445 | - if(gooSpinner.selectedItem=="김포시"){editor.putInt("c12_198",1); editor.commit()} | 336 | + if(gooSpinner.selectedItem=="안성시"){editor.putInt("c12_197",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
446 | - if(gooSpinner.selectedItem=="화성시"){editor.putInt("c12_199",1); editor.commit()} | 337 | + if(gooSpinner.selectedItem=="김포시"){editor.putInt("c12_198",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
447 | - if(gooSpinner.selectedItem=="화성시동부출장소"){editor.putInt("c12_200",1); editor.commit()} | 338 | + if(gooSpinner.selectedItem=="화성시"){editor.putInt("c12_199",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
448 | - if(gooSpinner.selectedItem=="화성시동탄출장소"){editor.putInt("c12_201",1); editor.commit()} | 339 | + if(gooSpinner.selectedItem=="화성시동부출장소"){editor.putInt("c12_200",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
449 | - if(gooSpinner.selectedItem=="광주시"){editor.putInt("c12_202",1); editor.commit()} | 340 | + if(gooSpinner.selectedItem=="화성시동탄출장소"){editor.putInt("c12_201",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
450 | - if(gooSpinner.selectedItem=="양주시"){editor.putInt("c12_203",1); editor.commit()} | 341 | + if(gooSpinner.selectedItem=="광주시"){editor.putInt("c12_202",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
451 | - if(gooSpinner.selectedItem=="포천시"){editor.putInt("c12_204",1); editor.commit()} | 342 | + if(gooSpinner.selectedItem=="양주시"){editor.putInt("c12_203",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
452 | - if(gooSpinner.selectedItem=="여주시"){editor.putInt("c12_205",1); editor.commit()} | 343 | + if(gooSpinner.selectedItem=="포천시"){editor.putInt("c12_204",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
453 | - if(gooSpinner.selectedItem=="연천군"){editor.putInt("c12_206",1); editor.commit()} | 344 | + if(gooSpinner.selectedItem=="여주시"){editor.putInt("c12_205",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
454 | - if(gooSpinner.selectedItem=="가평군"){editor.putInt("c12_207",1); editor.commit()} | 345 | + if(gooSpinner.selectedItem=="연천군"){editor.putInt("c12_206",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
455 | - if(gooSpinner.selectedItem=="양평군"){editor.putInt("c12_208",1); editor.commit()} | 346 | + if(gooSpinner.selectedItem=="가평군"){editor.putInt("c12_207",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
456 | - if(gooSpinner.selectedItem=="춘천시"){editor.putInt("c12_209",1); editor.commit()} | 347 | + if(gooSpinner.selectedItem=="양평군"){editor.putInt("c12_208",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
457 | - if(gooSpinner.selectedItem=="원주시"){editor.putInt("c12_210",1); editor.commit()} | 348 | + if(gooSpinner.selectedItem=="춘천시"){editor.putInt("c12_209",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
458 | - if(gooSpinner.selectedItem=="강릉시"){editor.putInt("c12_211",1); editor.commit()} | 349 | + if(gooSpinner.selectedItem=="원주시"){editor.putInt("c12_210",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
459 | - if(gooSpinner.selectedItem=="동해시"){editor.putInt("c12_212",1); editor.commit()} | 350 | + if(gooSpinner.selectedItem=="강릉시"){editor.putInt("c12_211",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
460 | - if(gooSpinner.selectedItem=="태백시"){editor.putInt("c12_213",1); editor.commit()} | 351 | + if(gooSpinner.selectedItem=="동해시"){editor.putInt("c12_212",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
461 | - if(gooSpinner.selectedItem=="속초시"){editor.putInt("c12_214",1); editor.commit()} | 352 | + if(gooSpinner.selectedItem=="태백시"){editor.putInt("c12_213",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
462 | - if(gooSpinner.selectedItem=="삼척시"){editor.putInt("c12_215",1); editor.commit()} | 353 | + if(gooSpinner.selectedItem=="속초시"){editor.putInt("c12_214",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
463 | - if(gooSpinner.selectedItem=="홍천군"){editor.putInt("c12_216",1); editor.commit()} | 354 | + if(gooSpinner.selectedItem=="삼척시"){editor.putInt("c12_215",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
464 | - if(gooSpinner.selectedItem=="횡성군"){editor.putInt("c12_217",1); editor.commit()} | 355 | + if(gooSpinner.selectedItem=="홍천군"){editor.putInt("c12_216",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
465 | - if(gooSpinner.selectedItem=="영월군"){editor.putInt("c12_218",1); editor.commit()} | 356 | + if(gooSpinner.selectedItem=="횡성군"){editor.putInt("c12_217",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
466 | - if(gooSpinner.selectedItem=="평창군"){editor.putInt("c12_219",1); editor.commit()} | 357 | + if(gooSpinner.selectedItem=="영월군"){editor.putInt("c12_218",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
467 | - if(gooSpinner.selectedItem=="정선군"){editor.putInt("c12_220",1); editor.commit()} | 358 | + if(gooSpinner.selectedItem=="평창군"){editor.putInt("c12_219",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
468 | - if(gooSpinner.selectedItem=="철원군"){editor.putInt("c12_221",1); editor.commit()} | 359 | + if(gooSpinner.selectedItem=="정선군"){editor.putInt("c12_220",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
469 | - if(gooSpinner.selectedItem=="화천군"){editor.putInt("c12_222",1); editor.commit()} | 360 | + if(gooSpinner.selectedItem=="철원군"){editor.putInt("c12_221",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
470 | - if(gooSpinner.selectedItem=="양구군"){editor.putInt("c12_223",1); editor.commit()} | 361 | + if(gooSpinner.selectedItem=="화천군"){editor.putInt("c12_222",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
471 | - if(gooSpinner.selectedItem=="인제군"){editor.putInt("c12_224",1); editor.commit()} | 362 | + if(gooSpinner.selectedItem=="양구군"){editor.putInt("c12_223",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
472 | - if(gooSpinner.selectedItem=="고성군"){editor.putInt("c12_225",1); editor.commit()} | 363 | + if(gooSpinner.selectedItem=="인제군"){editor.putInt("c12_224",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
473 | - if(gooSpinner.selectedItem=="양양군"){editor.putInt("c12_226",1); editor.commit()} | 364 | + if(gooSpinner.selectedItem=="고성군"){editor.putInt("c12_225",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
474 | - if(gooSpinner.selectedItem=="청주시"){editor.putInt("c12_227",1); editor.commit()} | 365 | + if(gooSpinner.selectedItem=="양양군"){editor.putInt("c12_226",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
475 | - if(gooSpinner.selectedItem=="청주시 상당구"){editor.putInt("c12_228",1); editor.commit()} | 366 | + if(gooSpinner.selectedItem=="청주시"){editor.putInt("c12_227",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
476 | - if(gooSpinner.selectedItem=="청주시 서원구"){editor.putInt("c12_229",1); editor.commit()} | 367 | + if(gooSpinner.selectedItem=="청주시 상당구"){editor.putInt("c12_228",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
477 | - if(gooSpinner.selectedItem=="청주시 흥덕구"){editor.putInt("c12_230",1); editor.commit()} | 368 | + if(gooSpinner.selectedItem=="청주시 서원구"){editor.putInt("c12_229",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
478 | - if(gooSpinner.selectedItem=="청주시 청원구"){editor.putInt("c12_231",1); editor.commit()} | 369 | + if(gooSpinner.selectedItem=="청주시 흥덕구"){editor.putInt("c12_230",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
479 | - if(gooSpinner.selectedItem=="충주시"){editor.putInt("c12_232",1); editor.commit()} | 370 | + if(gooSpinner.selectedItem=="청주시 청원구"){editor.putInt("c12_231",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
480 | - if(gooSpinner.selectedItem=="제천시"){editor.putInt("c12_233",1); editor.commit()} | 371 | + if(gooSpinner.selectedItem=="충주시"){editor.putInt("c12_232",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
481 | - if(gooSpinner.selectedItem=="보은군"){editor.putInt("c12_234",1); editor.commit()} | 372 | + if(gooSpinner.selectedItem=="제천시"){editor.putInt("c12_233",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
482 | - if(gooSpinner.selectedItem=="옥천군"){editor.putInt("c12_235",1); editor.commit()} | 373 | + if(gooSpinner.selectedItem=="보은군"){editor.putInt("c12_234",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
483 | - if(gooSpinner.selectedItem=="영동군"){editor.putInt("c12_236",1); editor.commit()} | 374 | + if(gooSpinner.selectedItem=="옥천군"){editor.putInt("c12_235",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
484 | - if(gooSpinner.selectedItem=="증평군"){editor.putInt("c12_237",1); editor.commit()} | 375 | + if(gooSpinner.selectedItem=="영동군"){editor.putInt("c12_236",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
485 | - if(gooSpinner.selectedItem=="진천군"){editor.putInt("c12_238",1); editor.commit()} | 376 | + if(gooSpinner.selectedItem=="증평군"){editor.putInt("c12_237",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
486 | - if(gooSpinner.selectedItem=="괴산군"){editor.putInt("c12_239",1); editor.commit()} | 377 | + if(gooSpinner.selectedItem=="진천군"){editor.putInt("c12_238",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
487 | - if(gooSpinner.selectedItem=="음성군"){editor.putInt("c12_240",1); editor.commit()} | 378 | + if(gooSpinner.selectedItem=="괴산군"){editor.putInt("c12_239",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
488 | - if(gooSpinner.selectedItem=="단양군"){editor.putInt("c12_241",1); editor.commit()} | 379 | + if(gooSpinner.selectedItem=="음성군"){editor.putInt("c12_240",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
489 | - if(gooSpinner.selectedItem=="천안시"){editor.putInt("c12_242",1); editor.commit()} | 380 | + if(gooSpinner.selectedItem=="단양군"){editor.putInt("c12_241",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
490 | - if(gooSpinner.selectedItem=="천안시 동남구"){editor.putInt("c12_243",1); editor.commit()} | 381 | + if(gooSpinner.selectedItem=="천안시"){editor.putInt("c12_242",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
491 | - if(gooSpinner.selectedItem=="천안시 서북구"){editor.putInt("c12_244",1); editor.commit()} | 382 | + if(gooSpinner.selectedItem=="천안시 동남구"){editor.putInt("c12_243",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
492 | - if(gooSpinner.selectedItem=="공주시"){editor.putInt("c12_245",1); editor.commit()} | 383 | + if(gooSpinner.selectedItem=="천안시 서북구"){editor.putInt("c12_244",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
493 | - if(gooSpinner.selectedItem=="보령시"){editor.putInt("c12_246",1); editor.commit()} | 384 | + if(gooSpinner.selectedItem=="공주시"){editor.putInt("c12_245",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
494 | - if(gooSpinner.selectedItem=="아산시"){editor.putInt("c12_247",1); editor.commit()} | 385 | + if(gooSpinner.selectedItem=="보령시"){editor.putInt("c12_246",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
495 | - if(gooSpinner.selectedItem=="서산시"){editor.putInt("c12_248",1); editor.commit()} | 386 | + if(gooSpinner.selectedItem=="아산시"){editor.putInt("c12_247",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
496 | - if(gooSpinner.selectedItem=="논산시"){editor.putInt("c12_249",1); editor.commit()} | 387 | + if(gooSpinner.selectedItem=="서산시"){editor.putInt("c12_248",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
497 | - if(gooSpinner.selectedItem=="계룡시"){editor.putInt("c12_250",1); editor.commit()} | 388 | + if(gooSpinner.selectedItem=="논산시"){editor.putInt("c12_249",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
498 | - if(gooSpinner.selectedItem=="당진시"){editor.putInt("c12_251",1); editor.commit()} | 389 | + if(gooSpinner.selectedItem=="계룡시"){editor.putInt("c12_250",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
499 | - if(gooSpinner.selectedItem=="금산군"){editor.putInt("c12_252",1); editor.commit()} | 390 | + if(gooSpinner.selectedItem=="당진시"){editor.putInt("c12_251",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
500 | - if(gooSpinner.selectedItem=="부여군"){editor.putInt("c12_253",1); editor.commit()} | 391 | + if(gooSpinner.selectedItem=="금산군"){editor.putInt("c12_252",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
501 | - if(gooSpinner.selectedItem=="서천군"){editor.putInt("c12_254",1); editor.commit()} | 392 | + if(gooSpinner.selectedItem=="부여군"){editor.putInt("c12_253",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
502 | - if(gooSpinner.selectedItem=="청양군"){editor.putInt("c12_255",1); editor.commit()} | 393 | + if(gooSpinner.selectedItem=="서천군"){editor.putInt("c12_254",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
503 | - if(gooSpinner.selectedItem=="홍성군"){editor.putInt("c12_256",1); editor.commit()} | 394 | + if(gooSpinner.selectedItem=="청양군"){editor.putInt("c12_255",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
504 | - if(gooSpinner.selectedItem=="예산군"){editor.putInt("c12_257",1); editor.commit()} | 395 | + if(gooSpinner.selectedItem=="홍성군"){editor.putInt("c12_256",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
505 | - if(gooSpinner.selectedItem=="태안군"){editor.putInt("c12_258",1); editor.commit()} | 396 | + if(gooSpinner.selectedItem=="예산군"){editor.putInt("c12_257",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
506 | - if(gooSpinner.selectedItem=="전주시"){editor.putInt("c12_259",1); editor.commit()} | 397 | + if(gooSpinner.selectedItem=="태안군"){editor.putInt("c12_258",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
507 | - if(gooSpinner.selectedItem=="전주시 완산구"){editor.putInt("c12_260",1); editor.commit()} | 398 | + if(gooSpinner.selectedItem=="전주시"){editor.putInt("c12_259",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
508 | - if(gooSpinner.selectedItem=="전주시 덕진구"){editor.putInt("c12_261",1); editor.commit()} | 399 | + if(gooSpinner.selectedItem=="전주시 완산구"){editor.putInt("c12_260",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
509 | - if(gooSpinner.selectedItem=="전주시효자출"){editor.putInt("c12_262",1); editor.commit()} | 400 | + if(gooSpinner.selectedItem=="전주시 덕진구"){editor.putInt("c12_261",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
510 | - if(gooSpinner.selectedItem=="군산시"){editor.putInt("c12_263",1); editor.commit()} | 401 | + if(gooSpinner.selectedItem=="전주시효자출"){editor.putInt("c12_262",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
511 | - if(gooSpinner.selectedItem=="익산시"){editor.putInt("c12_264",1); editor.commit()} | 402 | + if(gooSpinner.selectedItem=="군산시"){editor.putInt("c12_263",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
512 | - if(gooSpinner.selectedItem=="익산시함열출"){editor.putInt("c12_265",1); editor.commit()} | 403 | + if(gooSpinner.selectedItem=="익산시"){editor.putInt("c12_264",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
513 | - if(gooSpinner.selectedItem=="정읍시"){editor.putInt("c12_266",1); editor.commit()} | 404 | + if(gooSpinner.selectedItem=="익산시함열출"){editor.putInt("c12_265",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
514 | - if(gooSpinner.selectedItem=="남원시"){editor.putInt("c12_267",1); editor.commit()} | 405 | + if(gooSpinner.selectedItem=="정읍시"){editor.putInt("c12_266",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
515 | - if(gooSpinner.selectedItem=="김제시"){editor.putInt("c12_268",1); editor.commit()} | 406 | + if(gooSpinner.selectedItem=="남원시"){editor.putInt("c12_267",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
516 | - if(gooSpinner.selectedItem=="완주군"){editor.putInt("c12_269",1); editor.commit()} | 407 | + if(gooSpinner.selectedItem=="김제시"){editor.putInt("c12_268",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
517 | - if(gooSpinner.selectedItem=="진안군"){editor.putInt("c12_270",1); editor.commit()} | 408 | + if(gooSpinner.selectedItem=="완주군"){editor.putInt("c12_269",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
518 | - if(gooSpinner.selectedItem=="무주군"){editor.putInt("c12_271",1); editor.commit()} | 409 | + if(gooSpinner.selectedItem=="진안군"){editor.putInt("c12_270",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
519 | - if(gooSpinner.selectedItem=="장수군"){editor.putInt("c12_272",1); editor.commit()} | 410 | + if(gooSpinner.selectedItem=="무주군"){editor.putInt("c12_271",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
520 | - if(gooSpinner.selectedItem=="임실군"){editor.putInt("c12_273",1); editor.commit()} | 411 | + if(gooSpinner.selectedItem=="장수군"){editor.putInt("c12_272",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
521 | - if(gooSpinner.selectedItem=="순창군"){editor.putInt("c12_274",1); editor.commit()} | 412 | + if(gooSpinner.selectedItem=="임실군"){editor.putInt("c12_273",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
522 | - if(gooSpinner.selectedItem=="고창군"){editor.putInt("c12_275",1); editor.commit()} | 413 | + if(gooSpinner.selectedItem=="순창군"){editor.putInt("c12_274",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
523 | - if(gooSpinner.selectedItem=="부안군"){editor.putInt("c12_276",1); editor.commit()} | 414 | + if(gooSpinner.selectedItem=="고창군"){editor.putInt("c12_275",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
524 | - if(gooSpinner.selectedItem=="목포시"){editor.putInt("c12_277",1); editor.commit()} | 415 | + if(gooSpinner.selectedItem=="부안군"){editor.putInt("c12_276",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
525 | - if(gooSpinner.selectedItem=="여수시"){editor.putInt("c12_278",1); editor.commit()} | 416 | + if(gooSpinner.selectedItem=="목포시"){editor.putInt("c12_277",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
526 | - if(gooSpinner.selectedItem=="순천시"){editor.putInt("c12_279",1); editor.commit()} | 417 | + if(gooSpinner.selectedItem=="여수시"){editor.putInt("c12_278",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
527 | - if(gooSpinner.selectedItem=="나주시"){editor.putInt("c12_280",1); editor.commit()} | 418 | + if(gooSpinner.selectedItem=="순천시"){editor.putInt("c12_279",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
528 | - if(gooSpinner.selectedItem=="광양시"){editor.putInt("c12_281",1); editor.commit()} | 419 | + if(gooSpinner.selectedItem=="나주시"){editor.putInt("c12_280",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
529 | - if(gooSpinner.selectedItem=="담양군"){editor.putInt("c12_282",1); editor.commit()} | 420 | + if(gooSpinner.selectedItem=="광양시"){editor.putInt("c12_281",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
530 | - if(gooSpinner.selectedItem=="곡성군"){editor.putInt("c12_283",1); editor.commit()} | 421 | + if(gooSpinner.selectedItem=="담양군"){editor.putInt("c12_282",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
531 | - if(gooSpinner.selectedItem=="구례군"){editor.putInt("c12_284",1); editor.commit()} | 422 | + if(gooSpinner.selectedItem=="곡성군"){editor.putInt("c12_283",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
532 | - if(gooSpinner.selectedItem=="고흥군"){editor.putInt("c12_285",1); editor.commit()} | 423 | + if(gooSpinner.selectedItem=="구례군"){editor.putInt("c12_284",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
533 | - if(gooSpinner.selectedItem=="보성군"){editor.putInt("c12_286",1); editor.commit()} | 424 | + if(gooSpinner.selectedItem=="고흥군"){editor.putInt("c12_285",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
534 | - if(gooSpinner.selectedItem=="화순군"){editor.putInt("c12_287",1); editor.commit()} | 425 | + if(gooSpinner.selectedItem=="보성군"){editor.putInt("c12_286",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
535 | - if(gooSpinner.selectedItem=="장흥군"){editor.putInt("c12_288",1); editor.commit()} | 426 | + if(gooSpinner.selectedItem=="화순군"){editor.putInt("c12_287",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
536 | - if(gooSpinner.selectedItem=="강진군"){editor.putInt("c12_289",1); editor.commit()} | 427 | + if(gooSpinner.selectedItem=="장흥군"){editor.putInt("c12_288",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
537 | - if(gooSpinner.selectedItem=="해남군"){editor.putInt("c12_290",1); editor.commit()} | 428 | + if(gooSpinner.selectedItem=="강진군"){editor.putInt("c12_289",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
538 | - if(gooSpinner.selectedItem=="영암군"){editor.putInt("c12_291",1); editor.commit()} | 429 | + if(gooSpinner.selectedItem=="해남군"){editor.putInt("c12_290",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
539 | - if(gooSpinner.selectedItem=="무안군"){editor.putInt("c12_292",1); editor.commit()} | 430 | + if(gooSpinner.selectedItem=="영암군"){editor.putInt("c12_291",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
540 | - if(gooSpinner.selectedItem=="함평군"){editor.putInt("c12_293",1); editor.commit()} | 431 | + if(gooSpinner.selectedItem=="무안군"){editor.putInt("c12_292",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
541 | - if(gooSpinner.selectedItem=="영광군"){editor.putInt("c12_294",1); editor.commit()} | 432 | + if(gooSpinner.selectedItem=="함평군"){editor.putInt("c12_293",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
542 | - if(gooSpinner.selectedItem=="장성군"){editor.putInt("c12_295",1); editor.commit()} | 433 | + if(gooSpinner.selectedItem=="영광군"){editor.putInt("c12_294",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
543 | - if(gooSpinner.selectedItem=="완도군"){editor.putInt("c12_296",1); editor.commit()} | 434 | + if(gooSpinner.selectedItem=="장성군"){editor.putInt("c12_295",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
544 | - if(gooSpinner.selectedItem=="진도군"){editor.putInt("c12_297",1); editor.commit()} | 435 | + if(gooSpinner.selectedItem=="완도군"){editor.putInt("c12_296",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
545 | - if(gooSpinner.selectedItem=="신안군"){editor.putInt("c12_298",1); editor.commit()} | 436 | + if(gooSpinner.selectedItem=="진도군"){editor.putInt("c12_297",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
546 | - if(gooSpinner.selectedItem=="포항시"){editor.putInt("c12_299",1); editor.commit()} | 437 | + if(gooSpinner.selectedItem=="신안군"){editor.putInt("c12_298",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
547 | - if(gooSpinner.selectedItem=="포항시 남구"){editor.putInt("c12_300",1); editor.commit()} | 438 | + if(gooSpinner.selectedItem=="포항시"){editor.putInt("c12_299",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
548 | - if(gooSpinner.selectedItem=="포항시 북구"){editor.putInt("c12_301",1); editor.commit()} | 439 | + if(gooSpinner.selectedItem=="포항시 남구"){editor.putInt("c12_300",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
549 | - if(gooSpinner.selectedItem=="경주시"){editor.putInt("c12_302",1); editor.commit()} | 440 | + if(gooSpinner.selectedItem=="포항시 북구"){editor.putInt("c12_301",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
550 | - if(gooSpinner.selectedItem=="김천시"){editor.putInt("c12_303",1); editor.commit()} | 441 | + if(gooSpinner.selectedItem=="경주시"){editor.putInt("c12_302",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
551 | - if(gooSpinner.selectedItem=="안동시"){editor.putInt("c12_304",1); editor.commit()} | 442 | + if(gooSpinner.selectedItem=="김천시"){editor.putInt("c12_303",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
552 | - if(gooSpinner.selectedItem=="구미시"){editor.putInt("c12_305",1); editor.commit()} | 443 | + if(gooSpinner.selectedItem=="안동시"){editor.putInt("c12_304",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
553 | - if(gooSpinner.selectedItem=="영주시"){editor.putInt("c12_306",1); editor.commit()} | 444 | + if(gooSpinner.selectedItem=="구미시"){editor.putInt("c12_305",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
554 | - if(gooSpinner.selectedItem=="영천시"){editor.putInt("c12_307",1); editor.commit()} | 445 | + if(gooSpinner.selectedItem=="영주시"){editor.putInt("c12_306",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
555 | - if(gooSpinner.selectedItem=="상주시"){editor.putInt("c12_308",1); editor.commit()} | 446 | + if(gooSpinner.selectedItem=="영천시"){editor.putInt("c12_307",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
556 | - if(gooSpinner.selectedItem=="문경시"){editor.putInt("c12_309",1); editor.commit()} | 447 | + if(gooSpinner.selectedItem=="상주시"){editor.putInt("c12_308",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
557 | - if(gooSpinner.selectedItem=="경산시"){editor.putInt("c12_310",1); editor.commit()} | 448 | + if(gooSpinner.selectedItem=="문경시"){editor.putInt("c12_309",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
558 | - if(gooSpinner.selectedItem=="군위군"){editor.putInt("c12_311",1); editor.commit()} | 449 | + if(gooSpinner.selectedItem=="경산시"){editor.putInt("c12_310",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
559 | - if(gooSpinner.selectedItem=="의성군"){editor.putInt("c12_312",1); editor.commit()} | 450 | + if(gooSpinner.selectedItem=="군위군"){editor.putInt("c12_311",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
560 | - if(gooSpinner.selectedItem=="청송군"){editor.putInt("c12_313",1); editor.commit()} | 451 | + if(gooSpinner.selectedItem=="의성군"){editor.putInt("c12_312",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
561 | - if(gooSpinner.selectedItem=="영양군"){editor.putInt("c12_314",1); editor.commit()} | 452 | + if(gooSpinner.selectedItem=="청송군"){editor.putInt("c12_313",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
562 | - if(gooSpinner.selectedItem=="영덕군"){editor.putInt("c12_315",1); editor.commit()} | 453 | + if(gooSpinner.selectedItem=="영양군"){editor.putInt("c12_314",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
563 | - if(gooSpinner.selectedItem=="청도군"){editor.putInt("c12_316",1); editor.commit()} | 454 | + if(gooSpinner.selectedItem=="영덕군"){editor.putInt("c12_315",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
564 | - if(gooSpinner.selectedItem=="고령군"){editor.putInt("c12_317",1); editor.commit()} | 455 | + if(gooSpinner.selectedItem=="청도군"){editor.putInt("c12_316",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
565 | - if(gooSpinner.selectedItem=="성주군"){editor.putInt("c12_318",1); editor.commit()} | 456 | + if(gooSpinner.selectedItem=="고령군"){editor.putInt("c12_317",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
566 | - if(gooSpinner.selectedItem=="칠곡군"){editor.putInt("c12_319",1); editor.commit()} | 457 | + if(gooSpinner.selectedItem=="성주군"){editor.putInt("c12_318",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
567 | - if(gooSpinner.selectedItem=="예천군"){editor.putInt("c12_320",1); editor.commit()} | 458 | + if(gooSpinner.selectedItem=="칠곡군"){editor.putInt("c12_319",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
568 | - if(gooSpinner.selectedItem=="봉화군"){editor.putInt("c12_321",1); editor.commit()} | 459 | + if(gooSpinner.selectedItem=="예천군"){editor.putInt("c12_320",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
569 | - if(gooSpinner.selectedItem=="울진군"){editor.putInt("c12_322",1); editor.commit()} | 460 | + if(gooSpinner.selectedItem=="봉화군"){editor.putInt("c12_321",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
570 | - if(gooSpinner.selectedItem=="울릉군"){editor.putInt("c12_323",1); editor.commit()} | 461 | + if(gooSpinner.selectedItem=="울진군"){editor.putInt("c12_322",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
571 | - if(gooSpinner.selectedItem=="창원시"){editor.putInt("c12_324",1); editor.commit()} | 462 | + if(gooSpinner.selectedItem=="울릉군"){editor.putInt("c12_323",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
572 | - if(gooSpinner.selectedItem=="창원시 의창구"){editor.putInt("c12_325",1); editor.commit()} | 463 | + if(gooSpinner.selectedItem=="창원시"){editor.putInt("c12_324",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
573 | - if(gooSpinner.selectedItem=="창원시 성산구"){editor.putInt("c12_326",1); editor.commit()} | 464 | + if(gooSpinner.selectedItem=="창원시 의창구"){editor.putInt("c12_325",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
574 | - if(gooSpinner.selectedItem=="창원시 마산합포구"){editor.putInt("c12_327",1); editor.commit()} | 465 | + if(gooSpinner.selectedItem=="창원시 성산구"){editor.putInt("c12_326",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
575 | - if(gooSpinner.selectedItem=="창원시 마산회원구"){editor.putInt("c12_328",1); editor.commit()} | 466 | + if(gooSpinner.selectedItem=="창원시 마산합포구"){editor.putInt("c12_327",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
576 | - if(gooSpinner.selectedItem=="창원시 진해구"){editor.putInt("c12_329",1); editor.commit()} | 467 | + if(gooSpinner.selectedItem=="창원시 마산회원구"){editor.putInt("c12_328",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
577 | - if(gooSpinner.selectedItem=="진주시"){editor.putInt("c12_330",1); editor.commit()} | 468 | + if(gooSpinner.selectedItem=="창원시 진해구"){editor.putInt("c12_329",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
578 | - if(gooSpinner.selectedItem=="통영시"){editor.putInt("c12_331",1); editor.commit()} | 469 | + if(gooSpinner.selectedItem=="진주시"){editor.putInt("c12_330",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
579 | - if(gooSpinner.selectedItem=="사천시"){editor.putInt("c12_332",1); editor.commit()} | 470 | + if(gooSpinner.selectedItem=="통영시"){editor.putInt("c12_331",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
580 | - if(gooSpinner.selectedItem=="사천남양출장"){editor.putInt("c12_333",1); editor.commit()} | 471 | + if(gooSpinner.selectedItem=="사천시"){editor.putInt("c12_332",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
581 | - if(gooSpinner.selectedItem=="김해시"){editor.putInt("c12_334",1); editor.commit()} | 472 | + if(gooSpinner.selectedItem=="사천남양출장"){editor.putInt("c12_333",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
582 | - if(gooSpinner.selectedItem=="장유출장소"){editor.putInt("c12_335",1); editor.commit()} | 473 | + if(gooSpinner.selectedItem=="김해시"){editor.putInt("c12_334",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
583 | - if(gooSpinner.selectedItem=="밀양시"){editor.putInt("c12_336",1); editor.commit()} | 474 | + if(gooSpinner.selectedItem=="장유출장소"){editor.putInt("c12_335",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
584 | - if(gooSpinner.selectedItem=="거제시"){editor.putInt("c12_337",1); editor.commit()} | 475 | + if(gooSpinner.selectedItem=="밀양시"){editor.putInt("c12_336",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
585 | - if(gooSpinner.selectedItem=="양산시"){editor.putInt("c12_338",1); editor.commit()} | 476 | + if(gooSpinner.selectedItem=="거제시"){editor.putInt("c12_337",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
586 | - if(gooSpinner.selectedItem=="양산시웅상출장소"){editor.putInt("c12_339",1); editor.commit()} | 477 | + if(gooSpinner.selectedItem=="양산시"){editor.putInt("c12_338",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
587 | - if(gooSpinner.selectedItem=="의령군"){editor.putInt("c12_340",1); editor.commit()} | 478 | + if(gooSpinner.selectedItem=="양산시웅상출장소"){editor.putInt("c12_339",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
588 | - if(gooSpinner.selectedItem=="함안군"){editor.putInt("c12_341",1); editor.commit()} | 479 | + if(gooSpinner.selectedItem=="의령군"){editor.putInt("c12_340",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
589 | - if(gooSpinner.selectedItem=="창녕군"){editor.putInt("c12_342",1); editor.commit()} | 480 | + if(gooSpinner.selectedItem=="함안군"){editor.putInt("c12_341",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
590 | - if(gooSpinner.selectedItem=="남해군"){editor.putInt("c12_343",1); editor.commit()} | 481 | + if(gooSpinner.selectedItem=="창녕군"){editor.putInt("c12_342",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
591 | - if(gooSpinner.selectedItem=="하동군"){editor.putInt("c12_344",1); editor.commit()} | 482 | + if(gooSpinner.selectedItem=="남해군"){editor.putInt("c12_343",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
592 | - if(gooSpinner.selectedItem=="산청군"){editor.putInt("c12_345",1); editor.commit()} | 483 | + if(gooSpinner.selectedItem=="하동군"){editor.putInt("c12_344",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
593 | - if(gooSpinner.selectedItem=="함양군"){editor.putInt("c12_346",1); editor.commit()} | 484 | + if(gooSpinner.selectedItem=="산청군"){editor.putInt("c12_345",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
594 | - if(gooSpinner.selectedItem=="거창군"){editor.putInt("c12_347",1); editor.commit()} | 485 | + if(gooSpinner.selectedItem=="함양군"){editor.putInt("c12_346",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
595 | - if(gooSpinner.selectedItem=="합천군"){editor.putInt("c12_348",1); editor.commit()} | 486 | + if(gooSpinner.selectedItem=="거창군"){editor.putInt("c12_347",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
596 | - if(gooSpinner.selectedItem=="제주시"){editor.putInt("c12_349",1); editor.commit()} | 487 | + if(gooSpinner.selectedItem=="합천군"){editor.putInt("c12_348",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
597 | - if(gooSpinner.selectedItem=="서귀포시"){editor.putInt("c12_350",1); editor.commit()} | 488 | + if(gooSpinner.selectedItem=="제주시"){editor.putInt("c12_349",1); editor.commit();editor.putString("first_four","done");editor.commit()} |
489 | + if(gooSpinner.selectedItem=="서귀포시"){editor.putInt("c12_350",1); editor.commit();editor.putString("first_four","done");editor.commit()} | ||
490 | + | ||
491 | + | ||
492 | + | ||
598 | 493 | ||
599 | var intent = Intent(this, InputProfilFirstFiveActivity::class.java) | 494 | var intent = Intent(this, InputProfilFirstFiveActivity::class.java) |
600 | startActivity(intent) | 495 | startActivity(intent) | ... | ... |
1 | package com.example.vip | 1 | package com.example.vip |
2 | 2 | ||
3 | +import android.content.Context | ||
3 | import android.content.Intent | 4 | import android.content.Intent |
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 |
6 | import android.widget.Toast | 8 | import android.widget.Toast |
... | @@ -13,7 +15,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_first_one.* | ... | @@ -13,7 +15,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_first_one.* |
13 | class InputProfilFirstOneActivity : AppCompatActivity() { | 15 | class InputProfilFirstOneActivity : AppCompatActivity() { |
14 | 16 | ||
15 | private val firebaseAuth = FirebaseAuth.getInstance() | 17 | private val firebaseAuth = FirebaseAuth.getInstance() |
16 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 18 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
17 | 19 | ||
18 | private fun sendToken(){ | 20 | private fun sendToken(){ |
19 | FirebaseInstanceId.getInstance().instanceId | 21 | FirebaseInstanceId.getInstance().instanceId |
... | @@ -46,13 +48,50 @@ class InputProfilFirstOneActivity : AppCompatActivity() { | ... | @@ -46,13 +48,50 @@ class InputProfilFirstOneActivity : AppCompatActivity() { |
46 | super.onCreate(savedInstanceState) | 48 | super.onCreate(savedInstanceState) |
47 | setContentView(R.layout.activity_input_profil_first_one) | 49 | setContentView(R.layout.activity_input_profil_first_one) |
48 | 50 | ||
51 | + val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE) | ||
52 | + val editor: SharedPreferences.Editor=prof.edit() | ||
49 | 53 | ||
54 | + inputStartButton.setOnClickListener { | ||
50 | 55 | ||
56 | + editor.putInt("c1_1",1); editor.commit() | ||
57 | + editor.putInt("c2_1",1); editor.commit() | ||
58 | + editor.putInt("c3_1",1); editor.commit() | ||
59 | + editor.putInt("c4_1",1); editor.commit() | ||
60 | + editor.putInt("c5_1",1); editor.commit() | ||
61 | + editor.putInt("c6_1",1); editor.commit() | ||
62 | + editor.putInt("c7_1",1); editor.commit() | ||
63 | + editor.putInt("c8_1",1); editor.commit() | ||
64 | + editor.putInt("c9_1",1); editor.commit() | ||
65 | + editor.putInt("c10_1",1); editor.commit() | ||
66 | + editor.putInt("c11_1",1); editor.commit() | ||
67 | + editor.putInt("c12_1",1); editor.commit() | ||
68 | + editor.putInt("c13_1",1); editor.commit() | ||
69 | + editor.putInt("c14_1",1); editor.commit() | ||
70 | + editor.putInt("c15_1",1); editor.commit() | ||
71 | + editor.putInt("c16_1",1); editor.commit() | ||
72 | + | ||
73 | + if(prof.getString("first_two","none")!="done"){var intent = Intent(this, InputProfilFirstTwoActivity::class.java);startActivity(intent)} | ||
74 | + else if(prof.getString("first_three","none")!="done"){var intent = Intent(this, InputProfilFirstThreeActivity::class.java);startActivity(intent)} | ||
75 | + else if(prof.getString("first_four","none")!="done"){var intent = Intent(this, InputProfilFirstFourActivity::class.java);startActivity(intent)} | ||
76 | + else if(prof.getString("first_five","none")!="done"){var intent = Intent(this, InputProfilFirstFiveActivity::class.java);startActivity(intent)} | ||
77 | + else if(prof.getString("first_six","none")!="done"){var intent = Intent(this, InputProfilFirstSixActivity::class.java);startActivity(intent)} | ||
78 | + else if(prof.getString("second_one","none")!="done"){var intent = Intent(this, InputProfilSecondOneActivity::class.java);startActivity(intent)} | ||
79 | + else if(prof.getString("second_two","none")!="done"){var intent = Intent(this, InputProfilSecondTwoActivity::class.java);startActivity(intent)} | ||
80 | + else if(prof.getString("second_three","none")!="done"){var intent = Intent(this, InputProfilSecondThreeActivity::class.java);startActivity(intent)} | ||
81 | + else if(prof.getString("third_one","none")!="done"){var intent = Intent(this, InputProfilThirdOneActivity::class.java);startActivity(intent)} | ||
82 | + else if(prof.getString("third_two","none")!="done"){var intent = Intent(this, InputProfilThirdTwoActivity::class.java);startActivity(intent)} | ||
83 | + else if(prof.getString("third_three","none")!="done"){var intent = Intent(this, InputProfilThirdThreeActivity::class.java);startActivity(intent)} | ||
84 | + else if(prof.getString("third_four","none")!="done"){var intent = Intent(this, InputProfilThirdFourActivity::class.java);startActivity(intent)} | ||
85 | + else if(prof.getString("fourth_one","none")!="done"){var intent = Intent(this, InputProfilFourthOneActivity::class.java);startActivity(intent)} | ||
86 | + else if(prof.getString("fourth_two","none")!="done"){var intent = Intent(this, InputProfilFourthTwoActivity::class.java);startActivity(intent)} | ||
87 | + else if(prof.getString("fourth_three","none")!="done"){var intent = Intent(this, InputProfilFourthThreeActivity::class.java);startActivity(intent)} | ||
88 | + else if(prof.getString("fourth_four","none")!="done"){var intent = Intent(this, InputProfilFourthFourActivity::class.java);startActivity(intent)} | ||
89 | + else if(prof.getString("fourth_five","none")!="done"){var intent = Intent(this, InputProfilFourthFiveActivity::class.java);startActivity(intent)} | ||
90 | + else if(prof.getString("fifth_one","none")!="done"){var intent = Intent(this, InputProfilFifthOneActivity::class.java);startActivity(intent)} | ||
91 | + else if(prof.getString("fifth_two","none")!="done"){var intent = Intent(this, InputProfilFifthTwoActivity::class.java);startActivity(intent)} | ||
92 | + else if(prof.getString("fifth_three","none")!="done"){var intent = Intent(this, InputProfilFifthThreeActivity::class.java);startActivity(intent)} | ||
93 | + else {var intent = Intent(this, InputProfilFifthFourActivity::class.java);startActivity(intent)} | ||
51 | 94 | ||
52 | - | ||
53 | - inputStartButton.setOnClickListener { | ||
54 | - var intent = Intent(this, InputProfilFirstTwoActivity::class.java) | ||
55 | - startActivity(intent) | ||
56 | } | 95 | } |
57 | 96 | ||
58 | } | 97 | } | ... | ... |
... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_first_six.* | ... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_first_six.* |
19 | class InputProfilFirstSixActivity : AppCompatActivity() { | 19 | class InputProfilFirstSixActivity : AppCompatActivity() { |
20 | 20 | ||
21 | private val firebaseAuth = FirebaseAuth.getInstance() | 21 | private val firebaseAuth = FirebaseAuth.getInstance() |
22 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 22 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
23 | - | ||
24 | private fun sendToken(){ | 23 | private fun sendToken(){ |
25 | FirebaseInstanceId.getInstance().instanceId | 24 | FirebaseInstanceId.getInstance().instanceId |
26 | .addOnCompleteListener(OnCompleteListener { task -> | 25 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -39,15 +38,13 @@ class InputProfilFirstSixActivity : AppCompatActivity() { | ... | @@ -39,15 +38,13 @@ class InputProfilFirstSixActivity : AppCompatActivity() { |
39 | }) | 38 | }) |
40 | } | 39 | } |
41 | 40 | ||
42 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 41 | + private fun writeNewUser(Topic : String) { |
43 | - val user = User(u_token, Policy!!) | 42 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
44 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
45 | } | 43 | } |
46 | 44 | ||
47 | 45 | ||
48 | 46 | ||
49 | 47 | ||
50 | - | ||
51 | override fun onCreate(savedInstanceState: Bundle?) { | 48 | override fun onCreate(savedInstanceState: Bundle?) { |
52 | super.onCreate(savedInstanceState) | 49 | super.onCreate(savedInstanceState) |
53 | setContentView(R.layout.activity_input_profil_first_six) | 50 | setContentView(R.layout.activity_input_profil_first_six) |
... | @@ -72,6 +69,7 @@ class InputProfilFirstSixActivity : AppCompatActivity() { | ... | @@ -72,6 +69,7 @@ class InputProfilFirstSixActivity : AppCompatActivity() { |
72 | sendToken() | 69 | sendToken() |
73 | val user=firebaseAuth?.currentUser!!.uid | 70 | val user=firebaseAuth?.currentUser!!.uid |
74 | Log.d("test:", user.toString()) | 71 | Log.d("test:", user.toString()) |
72 | + | ||
75 | val cat_1=listOf("c1_1","c1_2","c1_3") | 73 | val cat_1=listOf("c1_1","c1_2","c1_3") |
76 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 74 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
77 | val cat_3=listOf("c3_1","c3_2","c3_3") | 75 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -89,172 +87,42 @@ class InputProfilFirstSixActivity : AppCompatActivity() { | ... | @@ -89,172 +87,42 @@ class InputProfilFirstSixActivity : AppCompatActivity() { |
89 | val cat_15=listOf("c15_1","c15_2","c15_3") | 87 | val cat_15=listOf("c15_1","c15_2","c15_3") |
90 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 88 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
91 | 89 | ||
92 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 90 | + val cat_list=mutableListOf<String>() |
93 | - //var policy_string="" | 91 | + cat_list.addAll(cat_1) |
94 | - | 92 | + cat_list.addAll(cat_2) |
95 | - var user_cat_1 = mutableListOf("c1_1") | 93 | + cat_list.addAll(cat_3) |
96 | - var user_cat_2 = mutableListOf("c2_1") | 94 | + cat_list.addAll(cat_4) |
97 | - var user_cat_3 = mutableListOf("c3_1") | 95 | + cat_list.addAll(cat_5) |
98 | - var user_cat_4 = mutableListOf("c4_1") | 96 | + cat_list.addAll(cat_6) |
99 | - var user_cat_5 = mutableListOf("c5_1") | 97 | + cat_list.addAll(cat_7) |
100 | - var user_cat_6 = mutableListOf("c6_1") | 98 | + cat_list.addAll(cat_8) |
101 | - var user_cat_7 = mutableListOf("c7_1") | 99 | + cat_list.addAll(cat_9) |
102 | - var user_cat_8 = mutableListOf("c8_1") | 100 | + cat_list.addAll(cat_10) |
103 | - var user_cat_9 = mutableListOf("c9_1") | 101 | + cat_list.addAll(cat_11) |
104 | - var user_cat_10 = mutableListOf("c10_1") | 102 | + cat_list.addAll(cat_12) |
105 | - var user_cat_11 = mutableListOf("c11_1") | 103 | + cat_list.addAll(cat_13) |
106 | - var user_cat_12 = mutableListOf("c12_1") | 104 | + cat_list.addAll(cat_14) |
107 | - var user_cat_13 = mutableListOf("c13_1") | 105 | + cat_list.addAll(cat_15) |
108 | - var user_cat_14 = mutableListOf("c14_1") | 106 | + cat_list.addAll(cat_16) |
109 | - var user_cat_15 = mutableListOf("c15_1") | 107 | + |
110 | - var user_cat_16 = mutableListOf("c16_1") | 108 | + var user_topic="" |
111 | - | 109 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
112 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 110 | + |
113 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 111 | + if(prof.getString("existing_topic","none")!=user_topic){ |
114 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 112 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
115 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 113 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
116 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 114 | + if (!task.isSuccessful) { } // 성공 |
117 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
118 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
119 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
120 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
121 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
122 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
123 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
124 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
125 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
126 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
127 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
128 | - | ||
129 | - var topic = "" | ||
130 | - var user_topic = "" | ||
131 | - | ||
132 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
133 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
134 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
135 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
136 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
137 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
138 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
139 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
140 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
141 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
142 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
143 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
144 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
145 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
146 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
147 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
148 | - | ||
149 | - | ||
150 | - for(c1 in user_cat_1) { | ||
151 | - topic += c1 | ||
152 | - for (c2 in user_cat_2) { | ||
153 | - topic += c2 | ||
154 | - for (c3 in user_cat_3) { | ||
155 | - topic += c3 | ||
156 | - for (c4 in user_cat_4) { | ||
157 | - topic += c4 | ||
158 | - for (c5 in user_cat_5) { | ||
159 | - topic += c5 | ||
160 | - for (c6 in user_cat_6) { | ||
161 | - topic += c6 | ||
162 | - for (c7 in user_cat_7) { | ||
163 | - topic += c7 | ||
164 | - for (c8 in user_cat_8) { | ||
165 | - topic += c8 | ||
166 | - for (c9 in user_cat_9) { | ||
167 | - topic += c9 | ||
168 | - for (c10 in user_cat_10) { | ||
169 | - topic += c10 | ||
170 | - for (c11 in user_cat_11) { | ||
171 | - topic += c11 | ||
172 | - for (c12 in user_cat_12) { | ||
173 | - topic += c12 | ||
174 | - for (c13 in user_cat_13) { | ||
175 | - topic += c13 | ||
176 | - for (c14 in user_cat_14) { | ||
177 | - topic += c14 | ||
178 | - for (c15 in user_cat_15) { | ||
179 | - topic += c15 | ||
180 | - for (c16 in user_cat_16) { | ||
181 | - topic += c16 | ||
182 | - user_topic += (topic + "/") | ||
183 | - // debug | ||
184 | - // Log.d("topic : ", topic) | ||
185 | - | ||
186 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
187 | - if (!task.isSuccessful) { } // 성공 | ||
188 | - } | ||
189 | - /* topic 구독 코드 | ||
190 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
191 | - if (!task.isSuccessful) { } // 성공 | ||
192 | - } | ||
193 | - */ | ||
194 | - | ||
195 | - topic = topic.substring(0, topic.length - c16.length) | ||
196 | - } | ||
197 | - topic = topic.substring(0, topic.length - c15.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c14.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c13.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c12.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c11.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c10.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c9.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c8.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c7.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c6.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c5.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c4.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c3.length) | ||
222 | - } | ||
223 | - topic = topic.substring(0, topic.length - c2.length) | ||
224 | } | 115 | } |
225 | - topic = topic.substring(0, topic.length-c1.length) | 116 | + writeNewUser(user_topic) // db에 쓰기 |
226 | - } | 117 | + editor.putString("existing_topic",user_topic) |
227 | - | 118 | + editor.commit() |
228 | - //Log.d("re:", user_topic) | 119 | + }else{ |
229 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
230 | - | ||
231 | 120 | ||
121 | + } | ||
232 | var intent = Intent(this, SignInActivity::class.java) | 122 | var intent = Intent(this, SignInActivity::class.java) |
233 | startActivity(intent) | 123 | startActivity(intent) |
234 | } | 124 | } |
235 | 125 | ||
236 | - questionButton.setOnClickListener { | ||
237 | - val builder = AlertDialog.Builder(this) | ||
238 | - val dialogView = layoutInflater.inflate(R.layout.dialog_example, null) | ||
239 | - //val dialogText = dialogView.findViewById<EditText>(R.id.dialogEt) | ||
240 | - //val dialogRatingBar = dialogView.findViewById<RatingBar>(R.id.dialogRb) | ||
241 | - dialogView.findViewById<TextView>(R.id.dialogTitle).text="가족구성원이란?" | ||
242 | - dialogView.findViewById<TextView>(R.id.dialogContent).text="주민등록상 같은 거주지에 사는 사람" | ||
243 | - | ||
244 | - builder.setView(dialogView) | ||
245 | - .setPositiveButton("확인") { dialogInterface, i -> | ||
246 | - //mainTv.text = dialogText.text.toString() | ||
247 | - //mainRb.rating = dialogRatingBar.rating | ||
248 | - /* 확인일 때 main의 View의 값에 dialog View에 있는 값을 적용 */ | ||
249 | - | ||
250 | - } | ||
251 | - /* | ||
252 | - .setNegativeButton("취소") { dialogInterface, i -> | ||
253 | - /* 취소일 때 아무 액션이 없으므로 빈칸 */ | ||
254 | - } | ||
255 | - */ | ||
256 | - .show() | ||
257 | - } | ||
258 | 126 | ||
259 | previousButton.setOnClickListener { | 127 | previousButton.setOnClickListener { |
260 | var intent = Intent(this, InputProfilFirstFiveActivity::class.java) | 128 | var intent = Intent(this, InputProfilFirstFiveActivity::class.java) |
... | @@ -262,10 +130,13 @@ class InputProfilFirstSixActivity : AppCompatActivity() { | ... | @@ -262,10 +130,13 @@ class InputProfilFirstSixActivity : AppCompatActivity() { |
262 | } | 130 | } |
263 | 131 | ||
264 | nextButton.setOnClickListener { | 132 | nextButton.setOnClickListener { |
133 | + | ||
134 | + | ||
135 | + | ||
265 | if(gagoojooButton.isChecked){ | 136 | if(gagoojooButton.isChecked){ |
266 | - editor.putInt("c13_2",1); editor.commit() | 137 | + editor.putInt("c13_2",1); editor.commit();editor.putString("first_six","done");editor.commit() |
267 | }else if(gagoowonButton.isChecked){ | 138 | }else if(gagoowonButton.isChecked){ |
268 | - editor.putInt("c13_3",1); editor.commit() | 139 | + editor.putInt("c13_3",1); editor.commit();editor.putString("first_six","done");editor.commit() |
269 | }else{ | 140 | }else{ |
270 | 141 | ||
271 | } | 142 | } | ... | ... |
... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_first_three.nextButt | ... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_first_three.nextButt |
21 | class InputProfilFirstThreeActivity : AppCompatActivity() { | 21 | class InputProfilFirstThreeActivity : AppCompatActivity() { |
22 | 22 | ||
23 | private val firebaseAuth = FirebaseAuth.getInstance() | 23 | private val firebaseAuth = FirebaseAuth.getInstance() |
24 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 24 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
25 | - | ||
26 | private fun sendToken(){ | 25 | private fun sendToken(){ |
27 | FirebaseInstanceId.getInstance().instanceId | 26 | FirebaseInstanceId.getInstance().instanceId |
28 | .addOnCompleteListener(OnCompleteListener { task -> | 27 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -41,15 +40,13 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { | ... | @@ -41,15 +40,13 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { |
41 | }) | 40 | }) |
42 | } | 41 | } |
43 | 42 | ||
44 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 43 | + private fun writeNewUser(Topic : String) { |
45 | - val user = User(u_token, Policy!!) | 44 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
46 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
47 | } | 45 | } |
48 | 46 | ||
49 | 47 | ||
50 | 48 | ||
51 | 49 | ||
52 | - | ||
53 | override fun onCreate(savedInstanceState: Bundle?) { | 50 | override fun onCreate(savedInstanceState: Bundle?) { |
54 | super.onCreate(savedInstanceState) | 51 | super.onCreate(savedInstanceState) |
55 | setContentView(R.layout.activity_input_profil_first_three) | 52 | setContentView(R.layout.activity_input_profil_first_three) |
... | @@ -74,6 +71,7 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { | ... | @@ -74,6 +71,7 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { |
74 | sendToken() | 71 | sendToken() |
75 | val user=firebaseAuth?.currentUser!!.uid | 72 | val user=firebaseAuth?.currentUser!!.uid |
76 | Log.d("test:", user.toString()) | 73 | Log.d("test:", user.toString()) |
74 | + | ||
77 | val cat_1=listOf("c1_1","c1_2","c1_3") | 75 | val cat_1=listOf("c1_1","c1_2","c1_3") |
78 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 76 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
79 | val cat_3=listOf("c3_1","c3_2","c3_3") | 77 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -91,172 +89,46 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { | ... | @@ -91,172 +89,46 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { |
91 | val cat_15=listOf("c15_1","c15_2","c15_3") | 89 | val cat_15=listOf("c15_1","c15_2","c15_3") |
92 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 90 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
93 | 91 | ||
94 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 92 | + val cat_list=mutableListOf<String>() |
95 | - //var policy_string="" | 93 | + cat_list.addAll(cat_1) |
96 | - | 94 | + cat_list.addAll(cat_2) |
97 | - var user_cat_1 = mutableListOf("c1_1") | 95 | + cat_list.addAll(cat_3) |
98 | - var user_cat_2 = mutableListOf("c2_1") | 96 | + cat_list.addAll(cat_4) |
99 | - var user_cat_3 = mutableListOf("c3_1") | 97 | + cat_list.addAll(cat_5) |
100 | - var user_cat_4 = mutableListOf("c4_1") | 98 | + cat_list.addAll(cat_6) |
101 | - var user_cat_5 = mutableListOf("c5_1") | 99 | + cat_list.addAll(cat_7) |
102 | - var user_cat_6 = mutableListOf("c6_1") | 100 | + cat_list.addAll(cat_8) |
103 | - var user_cat_7 = mutableListOf("c7_1") | 101 | + cat_list.addAll(cat_9) |
104 | - var user_cat_8 = mutableListOf("c8_1") | 102 | + cat_list.addAll(cat_10) |
105 | - var user_cat_9 = mutableListOf("c9_1") | 103 | + cat_list.addAll(cat_11) |
106 | - var user_cat_10 = mutableListOf("c10_1") | 104 | + cat_list.addAll(cat_12) |
107 | - var user_cat_11 = mutableListOf("c11_1") | 105 | + cat_list.addAll(cat_13) |
108 | - var user_cat_12 = mutableListOf("c12_1") | 106 | + cat_list.addAll(cat_14) |
109 | - var user_cat_13 = mutableListOf("c13_1") | 107 | + cat_list.addAll(cat_15) |
110 | - var user_cat_14 = mutableListOf("c14_1") | 108 | + cat_list.addAll(cat_16) |
111 | - var user_cat_15 = mutableListOf("c15_1") | 109 | + |
112 | - var user_cat_16 = mutableListOf("c16_1") | 110 | + var user_topic="" |
113 | - | 111 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
114 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 112 | + |
115 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 113 | + //Log.d("usertopic_before",user_topic) |
116 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 114 | + if(prof.getString("existing_topic","none")!=user_topic){ |
117 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 115 | + Log.d("debugaaa",prof.getString("existing_topic","none").toString()) |
118 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 116 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
119 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | 117 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
120 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | 118 | + if (!task.isSuccessful) { } // 성공 |
121 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
122 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
123 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
124 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
125 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
126 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
127 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
128 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
129 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
130 | - | ||
131 | - var topic = "" | ||
132 | - var user_topic = "" | ||
133 | - | ||
134 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
135 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
136 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
137 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
138 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
139 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
140 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
141 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
142 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
143 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
144 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
145 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
146 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
147 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
148 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
149 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
150 | - | ||
151 | - | ||
152 | - for(c1 in user_cat_1) { | ||
153 | - topic += c1 | ||
154 | - for (c2 in user_cat_2) { | ||
155 | - topic += c2 | ||
156 | - for (c3 in user_cat_3) { | ||
157 | - topic += c3 | ||
158 | - for (c4 in user_cat_4) { | ||
159 | - topic += c4 | ||
160 | - for (c5 in user_cat_5) { | ||
161 | - topic += c5 | ||
162 | - for (c6 in user_cat_6) { | ||
163 | - topic += c6 | ||
164 | - for (c7 in user_cat_7) { | ||
165 | - topic += c7 | ||
166 | - for (c8 in user_cat_8) { | ||
167 | - topic += c8 | ||
168 | - for (c9 in user_cat_9) { | ||
169 | - topic += c9 | ||
170 | - for (c10 in user_cat_10) { | ||
171 | - topic += c10 | ||
172 | - for (c11 in user_cat_11) { | ||
173 | - topic += c11 | ||
174 | - for (c12 in user_cat_12) { | ||
175 | - topic += c12 | ||
176 | - for (c13 in user_cat_13) { | ||
177 | - topic += c13 | ||
178 | - for (c14 in user_cat_14) { | ||
179 | - topic += c14 | ||
180 | - for (c15 in user_cat_15) { | ||
181 | - topic += c15 | ||
182 | - for (c16 in user_cat_16) { | ||
183 | - topic += c16 | ||
184 | - user_topic += (topic + "/") | ||
185 | - // debug | ||
186 | - // Log.d("topic : ", topic) | ||
187 | - | ||
188 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
189 | - if (!task.isSuccessful) { } // 성공 | ||
190 | - } | ||
191 | - /* topic 구독 코드 | ||
192 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
193 | - if (!task.isSuccessful) { } // 성공 | ||
194 | - } | ||
195 | - */ | ||
196 | - | ||
197 | - topic = topic.substring(0, topic.length - c16.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c15.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c14.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c13.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c12.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c11.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c10.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c9.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c8.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c7.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c6.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c5.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c4.length) | ||
222 | - } | ||
223 | - topic = topic.substring(0, topic.length - c3.length) | ||
224 | - } | ||
225 | - topic = topic.substring(0, topic.length - c2.length) | ||
226 | } | 119 | } |
227 | - topic = topic.substring(0, topic.length-c1.length) | 120 | + writeNewUser(user_topic) // db에 쓰기 |
228 | - } | 121 | + //Log.d("usertopic_after",user_topic) |
229 | - | 122 | + editor.putString("existing_topic",user_topic) |
230 | - //Log.d("re:", user_topic) | 123 | + editor.commit() |
231 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | 124 | + }else{ |
232 | - | ||
233 | 125 | ||
126 | + } | ||
234 | var intent = Intent(this, SignInActivity::class.java) | 127 | var intent = Intent(this, SignInActivity::class.java) |
235 | startActivity(intent) | 128 | startActivity(intent) |
236 | } | 129 | } |
237 | 130 | ||
238 | - questionButton.setOnClickListener { | ||
239 | - val builder = AlertDialog.Builder(this) | ||
240 | - val dialogView = layoutInflater.inflate(R.layout.dialog_example, null) | ||
241 | - //val dialogText = dialogView.findViewById<EditText>(R.id.dialogEt) | ||
242 | - //val dialogRatingBar = dialogView.findViewById<RatingBar>(R.id.dialogRb) | ||
243 | - dialogView.findViewById<TextView>(R.id.dialogTitle).text="가족구성원이란?" | ||
244 | - dialogView.findViewById<TextView>(R.id.dialogContent).text="주민등록상 같은 거주지에 사는 사람" | ||
245 | - | ||
246 | - builder.setView(dialogView) | ||
247 | - .setPositiveButton("확인") { dialogInterface, i -> | ||
248 | - //mainTv.text = dialogText.text.toString() | ||
249 | - //mainRb.rating = dialogRatingBar.rating | ||
250 | - /* 확인일 때 main의 View의 값에 dialog View에 있는 값을 적용 */ | ||
251 | 131 | ||
252 | - } | ||
253 | - /* | ||
254 | - .setNegativeButton("취소") { dialogInterface, i -> | ||
255 | - /* 취소일 때 아무 액션이 없으므로 빈칸 */ | ||
256 | - } | ||
257 | - */ | ||
258 | - .show() | ||
259 | - } | ||
260 | /* not use this code start | 132 | /* not use this code start |
261 | radio_group.setOnCheckedChangeListener( | 133 | radio_group.setOnCheckedChangeListener( |
262 | RadioGroup.OnCheckedChangeListener { group, checkedId -> | 134 | RadioGroup.OnCheckedChangeListener { group, checkedId -> |
... | @@ -272,17 +144,22 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { | ... | @@ -272,17 +144,22 @@ class InputProfilFirstThreeActivity : AppCompatActivity() { |
272 | } | 144 | } |
273 | 145 | ||
274 | nextButton.setOnClickListener { | 146 | nextButton.setOnClickListener { |
147 | + | ||
275 | var intent = Intent(this, InputProfilFirstFourActivity::class.java) | 148 | var intent = Intent(this, InputProfilFirstFourActivity::class.java) |
276 | startActivity(intent) | 149 | startActivity(intent) |
277 | 150 | ||
278 | if (manButton.isChecked){ | 151 | if (manButton.isChecked){ |
279 | editor.putInt("c3_2",1) | 152 | editor.putInt("c3_2",1) |
280 | editor.commit() | 153 | editor.commit() |
154 | + editor.putString("first_three","done");editor.commit() | ||
155 | + | ||
281 | //마지막장에 상관없음 추가 | 156 | //마지막장에 상관없음 추가 |
282 | } | 157 | } |
283 | else{ | 158 | else{ |
284 | editor.putInt("c3_3",1) | 159 | editor.putInt("c3_3",1) |
285 | editor.commit() | 160 | editor.commit() |
161 | + editor.putString("first_three","done");editor.commit() | ||
162 | + | ||
286 | } | 163 | } |
287 | } | 164 | } |
288 | } | 165 | } | ... | ... |
... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_first_two.nextButton | ... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_first_two.nextButton |
21 | class InputProfilFirstTwoActivity : AppCompatActivity() { | 21 | class InputProfilFirstTwoActivity : AppCompatActivity() { |
22 | 22 | ||
23 | private val firebaseAuth = FirebaseAuth.getInstance() | 23 | private val firebaseAuth = FirebaseAuth.getInstance() |
24 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 24 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
25 | - | ||
26 | private fun sendToken(){ | 25 | private fun sendToken(){ |
27 | FirebaseInstanceId.getInstance().instanceId | 26 | FirebaseInstanceId.getInstance().instanceId |
28 | .addOnCompleteListener(OnCompleteListener { task -> | 27 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -41,9 +40,8 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { | ... | @@ -41,9 +40,8 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { |
41 | }) | 40 | }) |
42 | } | 41 | } |
43 | 42 | ||
44 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 43 | + private fun writeNewUser(Topic : String) { |
45 | - val user = User(u_token, Policy!!) | 44 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
46 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
47 | } | 45 | } |
48 | 46 | ||
49 | override fun onCreate(savedInstanceState: Bundle?) { | 47 | override fun onCreate(savedInstanceState: Bundle?) { |
... | @@ -70,6 +68,7 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { | ... | @@ -70,6 +68,7 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { |
70 | sendToken() | 68 | sendToken() |
71 | val user=firebaseAuth?.currentUser!!.uid | 69 | val user=firebaseAuth?.currentUser!!.uid |
72 | Log.d("test:", user.toString()) | 70 | Log.d("test:", user.toString()) |
71 | + | ||
73 | val cat_1=listOf("c1_1","c1_2","c1_3") | 72 | val cat_1=listOf("c1_1","c1_2","c1_3") |
74 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 73 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
75 | val cat_3=listOf("c3_1","c3_2","c3_3") | 74 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -87,177 +86,55 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { | ... | @@ -87,177 +86,55 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { |
87 | val cat_15=listOf("c15_1","c15_2","c15_3") | 86 | val cat_15=listOf("c15_1","c15_2","c15_3") |
88 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 87 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
89 | 88 | ||
90 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 89 | + val cat_list=mutableListOf<String>() |
91 | - //var policy_string="" | 90 | + cat_list.addAll(cat_1) |
92 | - | 91 | + cat_list.addAll(cat_2) |
93 | - var user_cat_1 = mutableListOf("c1_1") | 92 | + cat_list.addAll(cat_3) |
94 | - var user_cat_2 = mutableListOf("c2_1") | 93 | + cat_list.addAll(cat_4) |
95 | - var user_cat_3 = mutableListOf("c3_1") | 94 | + cat_list.addAll(cat_5) |
96 | - var user_cat_4 = mutableListOf("c4_1") | 95 | + cat_list.addAll(cat_6) |
97 | - var user_cat_5 = mutableListOf("c5_1") | 96 | + cat_list.addAll(cat_7) |
98 | - var user_cat_6 = mutableListOf("c6_1") | 97 | + cat_list.addAll(cat_8) |
99 | - var user_cat_7 = mutableListOf("c7_1") | 98 | + cat_list.addAll(cat_9) |
100 | - var user_cat_8 = mutableListOf("c8_1") | 99 | + cat_list.addAll(cat_10) |
101 | - var user_cat_9 = mutableListOf("c9_1") | 100 | + cat_list.addAll(cat_11) |
102 | - var user_cat_10 = mutableListOf("c10_1") | 101 | + cat_list.addAll(cat_12) |
103 | - var user_cat_11 = mutableListOf("c11_1") | 102 | + cat_list.addAll(cat_13) |
104 | - var user_cat_12 = mutableListOf("c12_1") | 103 | + cat_list.addAll(cat_14) |
105 | - var user_cat_13 = mutableListOf("c13_1") | 104 | + cat_list.addAll(cat_15) |
106 | - var user_cat_14 = mutableListOf("c14_1") | 105 | + cat_list.addAll(cat_16) |
107 | - var user_cat_15 = mutableListOf("c15_1") | 106 | + |
108 | - var user_cat_16 = mutableListOf("c16_1") | 107 | + |
109 | - | 108 | + |
110 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 109 | + var user_topic="" |
111 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 110 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
112 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 111 | + |
113 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 112 | + //Log.d("usertopic_before",user_topic) |
114 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 113 | + if(prof.getString("existing_topic","none")!=user_topic){ |
115 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | 114 | + Log.d("debugaaa",prof.getString("existing_topic","none").toString()) |
116 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | 115 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
117 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | 116 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
118 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | 117 | + if (!task.isSuccessful) { } // 성공 |
119 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
120 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
121 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
122 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
123 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
124 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
125 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
126 | - | ||
127 | - var topic = "" | ||
128 | - var user_topic = "" | ||
129 | - | ||
130 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
131 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
132 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
133 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
134 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
135 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
136 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
137 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
138 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
139 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
140 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
141 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
142 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
143 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
144 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
145 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
146 | - | ||
147 | - | ||
148 | - for(c1 in user_cat_1) { | ||
149 | - topic += c1 | ||
150 | - for (c2 in user_cat_2) { | ||
151 | - topic += c2 | ||
152 | - for (c3 in user_cat_3) { | ||
153 | - topic += c3 | ||
154 | - for (c4 in user_cat_4) { | ||
155 | - topic += c4 | ||
156 | - for (c5 in user_cat_5) { | ||
157 | - topic += c5 | ||
158 | - for (c6 in user_cat_6) { | ||
159 | - topic += c6 | ||
160 | - for (c7 in user_cat_7) { | ||
161 | - topic += c7 | ||
162 | - for (c8 in user_cat_8) { | ||
163 | - topic += c8 | ||
164 | - for (c9 in user_cat_9) { | ||
165 | - topic += c9 | ||
166 | - for (c10 in user_cat_10) { | ||
167 | - topic += c10 | ||
168 | - for (c11 in user_cat_11) { | ||
169 | - topic += c11 | ||
170 | - for (c12 in user_cat_12) { | ||
171 | - topic += c12 | ||
172 | - for (c13 in user_cat_13) { | ||
173 | - topic += c13 | ||
174 | - for (c14 in user_cat_14) { | ||
175 | - topic += c14 | ||
176 | - for (c15 in user_cat_15) { | ||
177 | - topic += c15 | ||
178 | - for (c16 in user_cat_16) { | ||
179 | - topic += c16 | ||
180 | - user_topic += (topic + "/") | ||
181 | - // debug | ||
182 | - // Log.d("topic : ", topic) | ||
183 | - | ||
184 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
185 | - if (!task.isSuccessful) { } // 성공 | ||
186 | - } | ||
187 | - /* topic 구독 코드 | ||
188 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
189 | - if (!task.isSuccessful) { } // 성공 | ||
190 | - } | ||
191 | - */ | ||
192 | - | ||
193 | - topic = topic.substring(0, topic.length - c16.length) | ||
194 | - } | ||
195 | - topic = topic.substring(0, topic.length - c15.length) | ||
196 | - } | ||
197 | - topic = topic.substring(0, topic.length - c14.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c13.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c12.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c11.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c10.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c9.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c8.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c7.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c6.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c5.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c4.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c3.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c2.length) | ||
222 | } | 118 | } |
223 | - topic = topic.substring(0, topic.length-c1.length) | 119 | + writeNewUser(user_topic) // db에 쓰기 |
224 | - } | 120 | + //Log.d("usertopic_after",user_topic) |
121 | + editor.putString("existing_topic",user_topic) | ||
122 | + editor.commit() | ||
123 | + }else{ | ||
225 | 124 | ||
226 | - //Log.d("re:", user_topic) | 125 | + } |
227 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
228 | 126 | ||
229 | 127 | ||
230 | var intent = Intent(this, SignInActivity::class.java) | 128 | var intent = Intent(this, SignInActivity::class.java) |
231 | startActivity(intent) | 129 | startActivity(intent) |
232 | } | 130 | } |
233 | 131 | ||
234 | - questionButton.setOnClickListener { | ||
235 | - val builder = AlertDialog.Builder(this) | ||
236 | - val dialogView = layoutInflater.inflate(R.layout.dialog_example, null) | ||
237 | - //val dialogText = dialogView.findViewById<EditText>(R.id.dialogEt) | ||
238 | - //val dialogRatingBar = dialogView.findViewById<RatingBar>(R.id.dialogRb) | ||
239 | - dialogView.findViewById<TextView>(R.id.dialogTitle).text="가족구성원이란?" | ||
240 | - dialogView.findViewById<TextView>(R.id.dialogContent).text="주민등록상 같은 거주지에 사는 사람" | ||
241 | - | ||
242 | - builder.setView(dialogView) | ||
243 | - .setPositiveButton("확인") { dialogInterface, i -> | ||
244 | - //mainTv.text = dialogText.text.toString() | ||
245 | - //mainRb.rating = dialogRatingBar.rating | ||
246 | - /* 확인일 때 main의 View의 값에 dialog View에 있는 값을 적용 */ | ||
247 | - | ||
248 | - } | ||
249 | - /* | ||
250 | - .setNegativeButton("취소") { dialogInterface, i -> | ||
251 | - /* 취소일 때 아무 액션이 없으므로 빈칸 */ | ||
252 | - } | ||
253 | - */ | ||
254 | - .show() | ||
255 | - } | ||
256 | 132 | ||
257 | //editor.putString("birthdate","none") | 133 | //editor.putString("birthdate","none") |
258 | 134 | ||
259 | 135 | ||
260 | nextButton.setOnClickListener { | 136 | nextButton.setOnClickListener { |
137 | + | ||
261 | var birthdateinput=findViewById<EditText>(R.id.editText).text.toString() | 138 | var birthdateinput=findViewById<EditText>(R.id.editText).text.toString() |
262 | var birthdateint = 0 | 139 | var birthdateint = 0 |
263 | if (birthdateinput == "") { | 140 | if (birthdateinput == "") { |
... | @@ -270,6 +147,9 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { | ... | @@ -270,6 +147,9 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { |
270 | if ((2019-birthdateint)<19){ | 147 | if ((2019-birthdateint)<19){ |
271 | editor.putInt("c1_2",1) | 148 | editor.putInt("c1_2",1) |
272 | editor.commit() | 149 | editor.commit() |
150 | + | ||
151 | + editor.putString("first_two","done");editor.commit() | ||
152 | + | ||
273 | Toast.makeText(baseContext, prof.getInt("c1_2",0).toString(), Toast.LENGTH_SHORT).show() | 153 | Toast.makeText(baseContext, prof.getInt("c1_2",0).toString(), Toast.LENGTH_SHORT).show() |
274 | //마지막장에 상관없음 추가 | 154 | //마지막장에 상관없음 추가 |
275 | FirebaseMessaging.getInstance().subscribeToTopic("c1_2") | 155 | FirebaseMessaging.getInstance().subscribeToTopic("c1_2") |
... | @@ -283,22 +163,32 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { | ... | @@ -283,22 +163,32 @@ class InputProfilFirstTwoActivity : AppCompatActivity() { |
283 | else if((2019-birthdateint)<34){ | 163 | else if((2019-birthdateint)<34){ |
284 | editor.putInt("c1_3",1) | 164 | editor.putInt("c1_3",1) |
285 | editor.commit() | 165 | editor.commit() |
166 | + editor.putString("first_two","done");editor.commit() | ||
167 | + | ||
286 | } | 168 | } |
287 | else if((2019-birthdateint)<40){ | 169 | else if((2019-birthdateint)<40){ |
288 | editor.putInt("c1_4",1) | 170 | editor.putInt("c1_4",1) |
289 | editor.commit() | 171 | editor.commit() |
172 | + editor.putString("first_two","done");editor.commit() | ||
173 | + | ||
290 | } | 174 | } |
291 | else if((2019-birthdateint)<49){ | 175 | else if((2019-birthdateint)<49){ |
292 | editor.putInt("c1_5",1) | 176 | editor.putInt("c1_5",1) |
293 | editor.commit() | 177 | editor.commit() |
178 | + editor.putString("first_two","done");editor.commit() | ||
179 | + | ||
294 | } | 180 | } |
295 | else if((2019-birthdateint)<59){ | 181 | else if((2019-birthdateint)<59){ |
296 | editor.putInt("c1_6",1) | 182 | editor.putInt("c1_6",1) |
297 | editor.commit() | 183 | editor.commit() |
184 | + editor.putString("first_two","done");editor.commit() | ||
185 | + | ||
298 | } | 186 | } |
299 | else{ | 187 | else{ |
300 | editor.putInt("c1_7",1) | 188 | editor.putInt("c1_7",1) |
301 | editor.commit() | 189 | editor.commit() |
190 | + editor.putString("first_two","done");editor.commit() | ||
191 | + | ||
302 | } | 192 | } |
303 | var intent = Intent(this, InputProfilFirstThreeActivity::class.java) | 193 | var intent = Intent(this, InputProfilFirstThreeActivity::class.java) |
304 | startActivity(intent) | 194 | startActivity(intent) | ... | ... |
... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fourth_five.* | ... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fourth_five.* |
19 | class InputProfilFourthFiveActivity : AppCompatActivity() { | 19 | class InputProfilFourthFiveActivity : AppCompatActivity() { |
20 | 20 | ||
21 | private val firebaseAuth = FirebaseAuth.getInstance() | 21 | private val firebaseAuth = FirebaseAuth.getInstance() |
22 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 22 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
23 | - | ||
24 | private fun sendToken(){ | 23 | private fun sendToken(){ |
25 | FirebaseInstanceId.getInstance().instanceId | 24 | FirebaseInstanceId.getInstance().instanceId |
26 | .addOnCompleteListener(OnCompleteListener { task -> | 25 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -39,9 +38,8 @@ class InputProfilFourthFiveActivity : AppCompatActivity() { | ... | @@ -39,9 +38,8 @@ class InputProfilFourthFiveActivity : AppCompatActivity() { |
39 | }) | 38 | }) |
40 | } | 39 | } |
41 | 40 | ||
42 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 41 | + private fun writeNewUser(Topic : String) { |
43 | - val user = User(u_token, Policy!!) | 42 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
44 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
45 | } | 43 | } |
46 | 44 | ||
47 | 45 | ||
... | @@ -69,6 +67,7 @@ class InputProfilFourthFiveActivity : AppCompatActivity() { | ... | @@ -69,6 +67,7 @@ class InputProfilFourthFiveActivity : AppCompatActivity() { |
69 | sendToken() | 67 | sendToken() |
70 | val user=firebaseAuth?.currentUser!!.uid | 68 | val user=firebaseAuth?.currentUser!!.uid |
71 | Log.d("test:", user.toString()) | 69 | Log.d("test:", user.toString()) |
70 | + | ||
72 | val cat_1=listOf("c1_1","c1_2","c1_3") | 71 | val cat_1=listOf("c1_1","c1_2","c1_3") |
73 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 72 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
74 | val cat_3=listOf("c3_1","c3_2","c3_3") | 73 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -86,146 +85,38 @@ class InputProfilFourthFiveActivity : AppCompatActivity() { | ... | @@ -86,146 +85,38 @@ class InputProfilFourthFiveActivity : AppCompatActivity() { |
86 | val cat_15=listOf("c15_1","c15_2","c15_3") | 85 | val cat_15=listOf("c15_1","c15_2","c15_3") |
87 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 86 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
88 | 87 | ||
89 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 88 | + val cat_list=mutableListOf<String>() |
90 | - //var policy_string="" | 89 | + cat_list.addAll(cat_1) |
91 | - | 90 | + cat_list.addAll(cat_2) |
92 | - var user_cat_1 = mutableListOf("c1_1") | 91 | + cat_list.addAll(cat_3) |
93 | - var user_cat_2 = mutableListOf("c2_1") | 92 | + cat_list.addAll(cat_4) |
94 | - var user_cat_3 = mutableListOf("c3_1") | 93 | + cat_list.addAll(cat_5) |
95 | - var user_cat_4 = mutableListOf("c4_1") | 94 | + cat_list.addAll(cat_6) |
96 | - var user_cat_5 = mutableListOf("c5_1") | 95 | + cat_list.addAll(cat_7) |
97 | - var user_cat_6 = mutableListOf("c6_1") | 96 | + cat_list.addAll(cat_8) |
98 | - var user_cat_7 = mutableListOf("c7_1") | 97 | + cat_list.addAll(cat_9) |
99 | - var user_cat_8 = mutableListOf("c8_1") | 98 | + cat_list.addAll(cat_10) |
100 | - var user_cat_9 = mutableListOf("c9_1") | 99 | + cat_list.addAll(cat_11) |
101 | - var user_cat_10 = mutableListOf("c10_1") | 100 | + cat_list.addAll(cat_12) |
102 | - var user_cat_11 = mutableListOf("c11_1") | 101 | + cat_list.addAll(cat_13) |
103 | - var user_cat_12 = mutableListOf("c12_1") | 102 | + cat_list.addAll(cat_14) |
104 | - var user_cat_13 = mutableListOf("c13_1") | 103 | + cat_list.addAll(cat_15) |
105 | - var user_cat_14 = mutableListOf("c14_1") | 104 | + cat_list.addAll(cat_16) |
106 | - var user_cat_15 = mutableListOf("c15_1") | 105 | + |
107 | - var user_cat_16 = mutableListOf("c16_1") | 106 | + var user_topic="" |
108 | - | 107 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
109 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 108 | + |
110 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 109 | + if(prof.getString("existing_topic","none")!=user_topic){ |
111 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 110 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
112 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 111 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
113 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 112 | + if (!task.isSuccessful) { } // 성공 |
114 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
115 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
116 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
117 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
118 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
119 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
120 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
121 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
122 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
123 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
124 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
125 | - | ||
126 | - var topic = "" | ||
127 | - var user_topic = "" | ||
128 | - | ||
129 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
130 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
131 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
132 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
133 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
134 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
135 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
136 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
137 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
138 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
139 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
140 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
141 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
142 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
143 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
144 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
145 | - | ||
146 | - | ||
147 | - for(c1 in user_cat_1) { | ||
148 | - topic += c1 | ||
149 | - for (c2 in user_cat_2) { | ||
150 | - topic += c2 | ||
151 | - for (c3 in user_cat_3) { | ||
152 | - topic += c3 | ||
153 | - for (c4 in user_cat_4) { | ||
154 | - topic += c4 | ||
155 | - for (c5 in user_cat_5) { | ||
156 | - topic += c5 | ||
157 | - for (c6 in user_cat_6) { | ||
158 | - topic += c6 | ||
159 | - for (c7 in user_cat_7) { | ||
160 | - topic += c7 | ||
161 | - for (c8 in user_cat_8) { | ||
162 | - topic += c8 | ||
163 | - for (c9 in user_cat_9) { | ||
164 | - topic += c9 | ||
165 | - for (c10 in user_cat_10) { | ||
166 | - topic += c10 | ||
167 | - for (c11 in user_cat_11) { | ||
168 | - topic += c11 | ||
169 | - for (c12 in user_cat_12) { | ||
170 | - topic += c12 | ||
171 | - for (c13 in user_cat_13) { | ||
172 | - topic += c13 | ||
173 | - for (c14 in user_cat_14) { | ||
174 | - topic += c14 | ||
175 | - for (c15 in user_cat_15) { | ||
176 | - topic += c15 | ||
177 | - for (c16 in user_cat_16) { | ||
178 | - topic += c16 | ||
179 | - user_topic += (topic + "/") | ||
180 | - // debug | ||
181 | - // Log.d("topic : ", topic) | ||
182 | - | ||
183 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
184 | - if (!task.isSuccessful) { } // 성공 | ||
185 | - } | ||
186 | - /* topic 구독 코드 | ||
187 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
188 | - if (!task.isSuccessful) { } // 성공 | ||
189 | - } | ||
190 | - */ | ||
191 | - | ||
192 | - topic = topic.substring(0, topic.length - c16.length) | ||
193 | - } | ||
194 | - topic = topic.substring(0, topic.length - c15.length) | ||
195 | - } | ||
196 | - topic = topic.substring(0, topic.length - c14.length) | ||
197 | - } | ||
198 | - topic = topic.substring(0, topic.length - c13.length) | ||
199 | - } | ||
200 | - topic = topic.substring(0, topic.length - c12.length) | ||
201 | - } | ||
202 | - topic = topic.substring(0, topic.length - c11.length) | ||
203 | - } | ||
204 | - topic = topic.substring(0, topic.length - c10.length) | ||
205 | - } | ||
206 | - topic = topic.substring(0, topic.length - c9.length) | ||
207 | - } | ||
208 | - topic = topic.substring(0, topic.length - c8.length) | ||
209 | - } | ||
210 | - topic = topic.substring(0, topic.length - c7.length) | ||
211 | - } | ||
212 | - topic = topic.substring(0, topic.length - c6.length) | ||
213 | - } | ||
214 | - topic = topic.substring(0, topic.length - c5.length) | ||
215 | - } | ||
216 | - topic = topic.substring(0, topic.length - c4.length) | ||
217 | - } | ||
218 | - topic = topic.substring(0, topic.length - c3.length) | ||
219 | - } | ||
220 | - topic = topic.substring(0, topic.length - c2.length) | ||
221 | } | 113 | } |
222 | - topic = topic.substring(0, topic.length-c1.length) | 114 | + writeNewUser(user_topic) // db에 쓰기 |
223 | - } | 115 | + editor.putString("existing_topic",user_topic) |
224 | - | 116 | + editor.commit() |
225 | - //Log.d("re:", user_topic) | 117 | + }else{ |
226 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
227 | - | ||
228 | 118 | ||
119 | + } | ||
229 | var intent = Intent(this, SignInActivity::class.java) | 120 | var intent = Intent(this, SignInActivity::class.java) |
230 | startActivity(intent) | 121 | startActivity(intent) |
231 | } | 122 | } |
... | @@ -259,11 +150,11 @@ class InputProfilFourthFiveActivity : AppCompatActivity() { | ... | @@ -259,11 +150,11 @@ class InputProfilFourthFiveActivity : AppCompatActivity() { |
259 | } | 150 | } |
260 | 151 | ||
261 | nextButton.setOnClickListener { | 152 | nextButton.setOnClickListener { |
262 | - if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit()} | 153 | + if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit();editor.putString("fourth_five","done");editor.commit()} |
263 | - if(iljaeButton.isChecked){editor.putInt("c8_12",1); editor.commit()} | 154 | + if(iljaeButton.isChecked){editor.putInt("c8_12",1); editor.commit();editor.putString("fourth_five","done");editor.commit()} |
264 | - if(specialpihaeButton.isChecked){editor.putInt("c8_13",1); editor.commit()} | 155 | + if(specialpihaeButton.isChecked){editor.putInt("c8_13",1); editor.commit();editor.putString("fourth_five","done");editor.commit()} |
265 | - if(sanuppihaeButton.isChecked){editor.putInt("c8_14",1); editor.commit()} | 156 | + if(sanuppihaeButton.isChecked){editor.putInt("c8_14",1); editor.commit();editor.putString("fourth_five","done");editor.commit()} |
266 | - if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit()} | 157 | + if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit();editor.putString("fourth_five","done");editor.commit()} |
267 | //기타가 똑같은거 지정 | 158 | //기타가 똑같은거 지정 |
268 | 159 | ||
269 | /* | 160 | /* | ... | ... |
... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fourth_four.* | ... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fourth_four.* |
19 | class InputProfilFourthFourActivity : AppCompatActivity() { | 19 | class InputProfilFourthFourActivity : AppCompatActivity() { |
20 | 20 | ||
21 | private val firebaseAuth = FirebaseAuth.getInstance() | 21 | private val firebaseAuth = FirebaseAuth.getInstance() |
22 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 22 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
23 | - | ||
24 | private fun sendToken(){ | 23 | private fun sendToken(){ |
25 | FirebaseInstanceId.getInstance().instanceId | 24 | FirebaseInstanceId.getInstance().instanceId |
26 | .addOnCompleteListener(OnCompleteListener { task -> | 25 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -39,9 +38,8 @@ class InputProfilFourthFourActivity : AppCompatActivity() { | ... | @@ -39,9 +38,8 @@ class InputProfilFourthFourActivity : AppCompatActivity() { |
39 | }) | 38 | }) |
40 | } | 39 | } |
41 | 40 | ||
42 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 41 | + private fun writeNewUser(Topic : String) { |
43 | - val user = User(u_token, Policy!!) | 42 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
44 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
45 | } | 43 | } |
46 | 44 | ||
47 | 45 | ||
... | @@ -72,6 +70,7 @@ class InputProfilFourthFourActivity : AppCompatActivity() { | ... | @@ -72,6 +70,7 @@ class InputProfilFourthFourActivity : AppCompatActivity() { |
72 | sendToken() | 70 | sendToken() |
73 | val user=firebaseAuth?.currentUser!!.uid | 71 | val user=firebaseAuth?.currentUser!!.uid |
74 | Log.d("test:", user.toString()) | 72 | Log.d("test:", user.toString()) |
73 | + | ||
75 | val cat_1=listOf("c1_1","c1_2","c1_3") | 74 | val cat_1=listOf("c1_1","c1_2","c1_3") |
76 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 75 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
77 | val cat_3=listOf("c3_1","c3_2","c3_3") | 76 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -89,146 +88,38 @@ class InputProfilFourthFourActivity : AppCompatActivity() { | ... | @@ -89,146 +88,38 @@ class InputProfilFourthFourActivity : AppCompatActivity() { |
89 | val cat_15=listOf("c15_1","c15_2","c15_3") | 88 | val cat_15=listOf("c15_1","c15_2","c15_3") |
90 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 89 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
91 | 90 | ||
92 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 91 | + val cat_list=mutableListOf<String>() |
93 | - //var policy_string="" | 92 | + cat_list.addAll(cat_1) |
94 | - | 93 | + cat_list.addAll(cat_2) |
95 | - var user_cat_1 = mutableListOf("c1_1") | 94 | + cat_list.addAll(cat_3) |
96 | - var user_cat_2 = mutableListOf("c2_1") | 95 | + cat_list.addAll(cat_4) |
97 | - var user_cat_3 = mutableListOf("c3_1") | 96 | + cat_list.addAll(cat_5) |
98 | - var user_cat_4 = mutableListOf("c4_1") | 97 | + cat_list.addAll(cat_6) |
99 | - var user_cat_5 = mutableListOf("c5_1") | 98 | + cat_list.addAll(cat_7) |
100 | - var user_cat_6 = mutableListOf("c6_1") | 99 | + cat_list.addAll(cat_8) |
101 | - var user_cat_7 = mutableListOf("c7_1") | 100 | + cat_list.addAll(cat_9) |
102 | - var user_cat_8 = mutableListOf("c8_1") | 101 | + cat_list.addAll(cat_10) |
103 | - var user_cat_9 = mutableListOf("c9_1") | 102 | + cat_list.addAll(cat_11) |
104 | - var user_cat_10 = mutableListOf("c10_1") | 103 | + cat_list.addAll(cat_12) |
105 | - var user_cat_11 = mutableListOf("c11_1") | 104 | + cat_list.addAll(cat_13) |
106 | - var user_cat_12 = mutableListOf("c12_1") | 105 | + cat_list.addAll(cat_14) |
107 | - var user_cat_13 = mutableListOf("c13_1") | 106 | + cat_list.addAll(cat_15) |
108 | - var user_cat_14 = mutableListOf("c14_1") | 107 | + cat_list.addAll(cat_16) |
109 | - var user_cat_15 = mutableListOf("c15_1") | 108 | + |
110 | - var user_cat_16 = mutableListOf("c16_1") | 109 | + var user_topic="" |
111 | - | 110 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
112 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 111 | + |
113 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 112 | + if(prof.getString("existing_topic","none")!=user_topic){ |
114 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 113 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
115 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 114 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
116 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 115 | + if (!task.isSuccessful) { } // 성공 |
117 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
118 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
119 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
120 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
121 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
122 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
123 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
124 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
125 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
126 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
127 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
128 | - | ||
129 | - var topic = "" | ||
130 | - var user_topic = "" | ||
131 | - | ||
132 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
133 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
134 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
135 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
136 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
137 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
138 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
139 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
140 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
141 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
142 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
143 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
144 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
145 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
146 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
147 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
148 | - | ||
149 | - | ||
150 | - for(c1 in user_cat_1) { | ||
151 | - topic += c1 | ||
152 | - for (c2 in user_cat_2) { | ||
153 | - topic += c2 | ||
154 | - for (c3 in user_cat_3) { | ||
155 | - topic += c3 | ||
156 | - for (c4 in user_cat_4) { | ||
157 | - topic += c4 | ||
158 | - for (c5 in user_cat_5) { | ||
159 | - topic += c5 | ||
160 | - for (c6 in user_cat_6) { | ||
161 | - topic += c6 | ||
162 | - for (c7 in user_cat_7) { | ||
163 | - topic += c7 | ||
164 | - for (c8 in user_cat_8) { | ||
165 | - topic += c8 | ||
166 | - for (c9 in user_cat_9) { | ||
167 | - topic += c9 | ||
168 | - for (c10 in user_cat_10) { | ||
169 | - topic += c10 | ||
170 | - for (c11 in user_cat_11) { | ||
171 | - topic += c11 | ||
172 | - for (c12 in user_cat_12) { | ||
173 | - topic += c12 | ||
174 | - for (c13 in user_cat_13) { | ||
175 | - topic += c13 | ||
176 | - for (c14 in user_cat_14) { | ||
177 | - topic += c14 | ||
178 | - for (c15 in user_cat_15) { | ||
179 | - topic += c15 | ||
180 | - for (c16 in user_cat_16) { | ||
181 | - topic += c16 | ||
182 | - user_topic += (topic + "/") | ||
183 | - // debug | ||
184 | - // Log.d("topic : ", topic) | ||
185 | - | ||
186 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
187 | - if (!task.isSuccessful) { } // 성공 | ||
188 | - } | ||
189 | - /* topic 구독 코드 | ||
190 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
191 | - if (!task.isSuccessful) { } // 성공 | ||
192 | - } | ||
193 | - */ | ||
194 | - | ||
195 | - topic = topic.substring(0, topic.length - c16.length) | ||
196 | - } | ||
197 | - topic = topic.substring(0, topic.length - c15.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c14.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c13.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c12.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c11.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c10.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c9.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c8.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c7.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c6.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c5.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c4.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c3.length) | ||
222 | - } | ||
223 | - topic = topic.substring(0, topic.length - c2.length) | ||
224 | } | 116 | } |
225 | - topic = topic.substring(0, topic.length-c1.length) | 117 | + writeNewUser(user_topic) // db에 쓰기 |
226 | - } | 118 | + editor.putString("existing_topic",user_topic) |
227 | - | 119 | + editor.commit() |
228 | - //Log.d("re:", user_topic) | 120 | + }else{ |
229 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
230 | - | ||
231 | 121 | ||
122 | + } | ||
232 | var intent = Intent(this, SignInActivity::class.java) | 123 | var intent = Intent(this, SignInActivity::class.java) |
233 | startActivity(intent) | 124 | startActivity(intent) |
234 | } | 125 | } |
... | @@ -262,16 +153,16 @@ class InputProfilFourthFourActivity : AppCompatActivity() { | ... | @@ -262,16 +153,16 @@ class InputProfilFourthFourActivity : AppCompatActivity() { |
262 | } | 153 | } |
263 | nextButton.setOnClickListener { | 154 | nextButton.setOnClickListener { |
264 | 155 | ||
265 | - if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit()} | 156 | + if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit();editor.putString("fourth_four","done");editor.commit()} |
266 | - if(pokryukButton.isChecked){editor.putInt("c8_9",1); editor.commit()} | 157 | + if(pokryukButton.isChecked){editor.putInt("c8_9",1); editor.commit();editor.putString("fourth_four","done");editor.commit()} |
267 | - if(pihaeButton.isChecked){editor.putInt("c8_9",1); editor.commit()} | 158 | + if(pihaeButton.isChecked){editor.putInt("c8_9",1); editor.commit();editor.putString("fourth_four","done");editor.commit()} |
268 | - if(kachoolButton.isChecked){editor.putInt("c8_9",1); editor.commit()} | 159 | + if(kachoolButton.isChecked){editor.putInt("c8_9",1); editor.commit();editor.putString("fourth_four","done");editor.commit()} |
269 | - if(sagoButton.isChecked){editor.putInt("c8_9",1); editor.commit()} | 160 | + if(sagoButton.isChecked){editor.putInt("c8_9",1); editor.commit();editor.putString("fourth_four","done");editor.commit()} |
270 | - if(ihonButton.isChecked){editor.putInt("c8_15",1); editor.commit()} | 161 | + if(ihonButton.isChecked){editor.putInt("c8_15",1); editor.commit();editor.putString("fourth_four","done");editor.commit()} |
271 | - if(jaehaeButton.isChecked){editor.putInt("c8_9",1); editor.commit()} | 162 | + if(jaehaeButton.isChecked){editor.putInt("c8_9",1); editor.commit();editor.putString("fourth_four","done");editor.commit()} |
272 | - if(hakkyobaakButton.isChecked){editor.putInt("c8_16",1); editor.commit()} | 163 | + if(hakkyobaakButton.isChecked){editor.putInt("c8_16",1); editor.commit();editor.putString("fourth_four","done");editor.commit()} |
273 | - if(siljikButton.isChecked){editor.putInt("c5_9",1); editor.commit()} | 164 | + if(siljikButton.isChecked){editor.putInt("c5_9",1); editor.commit();editor.putString("fourth_four","done");editor.commit()} |
274 | - if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit()} | 165 | + if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit();editor.putString("fourth_four","done");editor.commit()} |
275 | 166 | ||
276 | var intent = Intent(this, InputProfilFourthFiveActivity::class.java) | 167 | var intent = Intent(this, InputProfilFourthFiveActivity::class.java) |
277 | startActivity(intent) | 168 | startActivity(intent) | ... | ... |
... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fourth_one.* | ... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fourth_one.* |
21 | class InputProfilFourthOneActivity : AppCompatActivity() { | 21 | class InputProfilFourthOneActivity : AppCompatActivity() { |
22 | 22 | ||
23 | private val firebaseAuth = FirebaseAuth.getInstance() | 23 | private val firebaseAuth = FirebaseAuth.getInstance() |
24 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 24 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
25 | - | ||
26 | private fun sendToken(){ | 25 | private fun sendToken(){ |
27 | FirebaseInstanceId.getInstance().instanceId | 26 | FirebaseInstanceId.getInstance().instanceId |
28 | .addOnCompleteListener(OnCompleteListener { task -> | 27 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -41,9 +40,8 @@ class InputProfilFourthOneActivity : AppCompatActivity() { | ... | @@ -41,9 +40,8 @@ class InputProfilFourthOneActivity : AppCompatActivity() { |
41 | }) | 40 | }) |
42 | } | 41 | } |
43 | 42 | ||
44 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 43 | + private fun writeNewUser(Topic : String) { |
45 | - val user = User(u_token, Policy!!) | 44 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
46 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
47 | } | 45 | } |
48 | 46 | ||
49 | 47 | ||
... | @@ -74,6 +72,7 @@ class InputProfilFourthOneActivity : AppCompatActivity() { | ... | @@ -74,6 +72,7 @@ class InputProfilFourthOneActivity : AppCompatActivity() { |
74 | sendToken() | 72 | sendToken() |
75 | val user=firebaseAuth?.currentUser!!.uid | 73 | val user=firebaseAuth?.currentUser!!.uid |
76 | Log.d("test:", user.toString()) | 74 | Log.d("test:", user.toString()) |
75 | + | ||
77 | val cat_1=listOf("c1_1","c1_2","c1_3") | 76 | val cat_1=listOf("c1_1","c1_2","c1_3") |
78 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 77 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
79 | val cat_3=listOf("c3_1","c3_2","c3_3") | 78 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -91,146 +90,38 @@ class InputProfilFourthOneActivity : AppCompatActivity() { | ... | @@ -91,146 +90,38 @@ class InputProfilFourthOneActivity : AppCompatActivity() { |
91 | val cat_15=listOf("c15_1","c15_2","c15_3") | 90 | val cat_15=listOf("c15_1","c15_2","c15_3") |
92 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 91 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
93 | 92 | ||
94 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 93 | + val cat_list=mutableListOf<String>() |
95 | - //var policy_string="" | 94 | + cat_list.addAll(cat_1) |
96 | - | 95 | + cat_list.addAll(cat_2) |
97 | - var user_cat_1 = mutableListOf("c1_1") | 96 | + cat_list.addAll(cat_3) |
98 | - var user_cat_2 = mutableListOf("c2_1") | 97 | + cat_list.addAll(cat_4) |
99 | - var user_cat_3 = mutableListOf("c3_1") | 98 | + cat_list.addAll(cat_5) |
100 | - var user_cat_4 = mutableListOf("c4_1") | 99 | + cat_list.addAll(cat_6) |
101 | - var user_cat_5 = mutableListOf("c5_1") | 100 | + cat_list.addAll(cat_7) |
102 | - var user_cat_6 = mutableListOf("c6_1") | 101 | + cat_list.addAll(cat_8) |
103 | - var user_cat_7 = mutableListOf("c7_1") | 102 | + cat_list.addAll(cat_9) |
104 | - var user_cat_8 = mutableListOf("c8_1") | 103 | + cat_list.addAll(cat_10) |
105 | - var user_cat_9 = mutableListOf("c9_1") | 104 | + cat_list.addAll(cat_11) |
106 | - var user_cat_10 = mutableListOf("c10_1") | 105 | + cat_list.addAll(cat_12) |
107 | - var user_cat_11 = mutableListOf("c11_1") | 106 | + cat_list.addAll(cat_13) |
108 | - var user_cat_12 = mutableListOf("c12_1") | 107 | + cat_list.addAll(cat_14) |
109 | - var user_cat_13 = mutableListOf("c13_1") | 108 | + cat_list.addAll(cat_15) |
110 | - var user_cat_14 = mutableListOf("c14_1") | 109 | + cat_list.addAll(cat_16) |
111 | - var user_cat_15 = mutableListOf("c15_1") | 110 | + |
112 | - var user_cat_16 = mutableListOf("c16_1") | 111 | + var user_topic="" |
113 | - | 112 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
114 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 113 | + |
115 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 114 | + if(prof.getString("existing_topic","none")!=user_topic){ |
116 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 115 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
117 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 116 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
118 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 117 | + if (!task.isSuccessful) { } // 성공 |
119 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
120 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
121 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
122 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
123 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
124 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
125 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
126 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
127 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
128 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
129 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
130 | - | ||
131 | - var topic = "" | ||
132 | - var user_topic = "" | ||
133 | - | ||
134 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
135 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
136 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
137 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
138 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
139 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
140 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
141 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
142 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
143 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
144 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
145 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
146 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
147 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
148 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
149 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
150 | - | ||
151 | - | ||
152 | - for(c1 in user_cat_1) { | ||
153 | - topic += c1 | ||
154 | - for (c2 in user_cat_2) { | ||
155 | - topic += c2 | ||
156 | - for (c3 in user_cat_3) { | ||
157 | - topic += c3 | ||
158 | - for (c4 in user_cat_4) { | ||
159 | - topic += c4 | ||
160 | - for (c5 in user_cat_5) { | ||
161 | - topic += c5 | ||
162 | - for (c6 in user_cat_6) { | ||
163 | - topic += c6 | ||
164 | - for (c7 in user_cat_7) { | ||
165 | - topic += c7 | ||
166 | - for (c8 in user_cat_8) { | ||
167 | - topic += c8 | ||
168 | - for (c9 in user_cat_9) { | ||
169 | - topic += c9 | ||
170 | - for (c10 in user_cat_10) { | ||
171 | - topic += c10 | ||
172 | - for (c11 in user_cat_11) { | ||
173 | - topic += c11 | ||
174 | - for (c12 in user_cat_12) { | ||
175 | - topic += c12 | ||
176 | - for (c13 in user_cat_13) { | ||
177 | - topic += c13 | ||
178 | - for (c14 in user_cat_14) { | ||
179 | - topic += c14 | ||
180 | - for (c15 in user_cat_15) { | ||
181 | - topic += c15 | ||
182 | - for (c16 in user_cat_16) { | ||
183 | - topic += c16 | ||
184 | - user_topic += (topic + "/") | ||
185 | - // debug | ||
186 | - // Log.d("topic : ", topic) | ||
187 | - | ||
188 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
189 | - if (!task.isSuccessful) { } // 성공 | ||
190 | - } | ||
191 | - /* topic 구독 코드 | ||
192 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
193 | - if (!task.isSuccessful) { } // 성공 | ||
194 | - } | ||
195 | - */ | ||
196 | - | ||
197 | - topic = topic.substring(0, topic.length - c16.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c15.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c14.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c13.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c12.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c11.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c10.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c9.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c8.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c7.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c6.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c5.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c4.length) | ||
222 | - } | ||
223 | - topic = topic.substring(0, topic.length - c3.length) | ||
224 | - } | ||
225 | - topic = topic.substring(0, topic.length - c2.length) | ||
226 | } | 118 | } |
227 | - topic = topic.substring(0, topic.length-c1.length) | 119 | + writeNewUser(user_topic) // db에 쓰기 |
228 | - } | 120 | + editor.putString("existing_topic",user_topic) |
229 | - | 121 | + editor.commit() |
230 | - //Log.d("re:", user_topic) | 122 | + }else{ |
231 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
232 | - | ||
233 | 123 | ||
124 | + } | ||
234 | var intent = Intent(this, SignInActivity::class.java) | 125 | var intent = Intent(this, SignInActivity::class.java) |
235 | startActivity(intent) | 126 | startActivity(intent) |
236 | } | 127 | } |
... | @@ -265,38 +156,6 @@ class InputProfilFourthOneActivity : AppCompatActivity() { | ... | @@ -265,38 +156,6 @@ class InputProfilFourthOneActivity : AppCompatActivity() { |
265 | 156 | ||
266 | //그냥 소유 미소유-모두무주택자 2개로 함 | 157 | //그냥 소유 미소유-모두무주택자 2개로 함 |
267 | 158 | ||
268 | -// 1. 툴바 사용 설정 | ||
269 | - setSupportActionBar(toolbar) | ||
270 | - | ||
271 | - skipButton.setOnClickListener { | ||
272 | - var intent = Intent(this, InputProfilSecondOneActivity::class.java) | ||
273 | - startActivity(intent) | ||
274 | - } | ||
275 | - | ||
276 | - questionButton.setOnClickListener { | ||
277 | - val builder = AlertDialog.Builder(this) | ||
278 | - val dialogView = layoutInflater.inflate(R.layout.dialog_example, null) | ||
279 | - //val dialogText = dialogView.findViewById<EditText>(R.id.dialogEt) | ||
280 | - //val dialogRatingBar = dialogView.findViewById<RatingBar>(R.id.dialogRb) | ||
281 | - dialogView.findViewById<TextView>(R.id.dialogTitle).text="가족구성원이란?" | ||
282 | - dialogView.findViewById<TextView>(R.id.dialogContent).text="주민등록상 같은 거주지에 사는 사람" | ||
283 | - | ||
284 | - builder.setView(dialogView) | ||
285 | - .setPositiveButton("확인") { dialogInterface, i -> | ||
286 | - //mainTv.text = dialogText.text.toString() | ||
287 | - //mainRb.rating = dialogRatingBar.rating | ||
288 | - /* 확인일 때 main의 View의 값에 dialog View에 있는 값을 적용 */ | ||
289 | - | ||
290 | - } | ||
291 | - /* | ||
292 | - .setNegativeButton("취소") { dialogInterface, i -> | ||
293 | - /* 취소일 때 아무 액션이 없으므로 빈칸 */ | ||
294 | - } | ||
295 | - */ | ||
296 | - | ||
297 | - .show() | ||
298 | - | ||
299 | - } | ||
300 | 159 | ||
301 | 160 | ||
302 | previousButton.setOnClickListener { | 161 | previousButton.setOnClickListener { |
... | @@ -319,34 +178,42 @@ class InputProfilFourthOneActivity : AppCompatActivity() { | ... | @@ -319,34 +178,42 @@ class InputProfilFourthOneActivity : AppCompatActivity() { |
319 | if(yesButton.isChecked){ | 178 | if(yesButton.isChecked){ |
320 | editor.putInt("c14_2",1) | 179 | editor.putInt("c14_2",1) |
321 | editor.commit() | 180 | editor.commit() |
181 | + editor.putString("fourth_one","done");editor.commit() | ||
322 | } | 182 | } |
323 | if(noButton.isChecked){ | 183 | if(noButton.isChecked){ |
324 | editor.putInt("c14_3",1) | 184 | editor.putInt("c14_3",1) |
325 | editor.commit() | 185 | editor.commit() |
186 | + editor.putString("fourth_one","done");editor.commit() | ||
326 | } | 187 | } |
327 | if(jeonsaeButton.isChecked){ | 188 | if(jeonsaeButton.isChecked){ |
328 | editor.putInt("c16_2",1) | 189 | editor.putInt("c16_2",1) |
329 | editor.commit() | 190 | editor.commit() |
191 | + editor.putString("fourth_one","done");editor.commit() | ||
330 | } | 192 | } |
331 | if(wolseButton.isChecked){ | 193 | if(wolseButton.isChecked){ |
332 | editor.putInt("c16_3",1) | 194 | editor.putInt("c16_3",1) |
333 | editor.commit() | 195 | editor.commit() |
196 | + editor.putString("fourth_one","done");editor.commit() | ||
334 | } | 197 | } |
335 | if(kongkongButton.isChecked){ | 198 | if(kongkongButton.isChecked){ |
336 | editor.putInt("c16_4",1) | 199 | editor.putInt("c16_4",1) |
337 | editor.commit() | 200 | editor.commit() |
201 | + editor.putString("fourth_one","done");editor.commit() | ||
338 | } | 202 | } |
339 | if(moosangButton.isChecked){ | 203 | if(moosangButton.isChecked){ |
340 | editor.putInt("c16_5",1) | 204 | editor.putInt("c16_5",1) |
341 | editor.commit() | 205 | editor.commit() |
206 | + editor.putString("fourth_one","done");editor.commit() | ||
342 | } | 207 | } |
343 | if(bojangButton.isChecked){ | 208 | if(bojangButton.isChecked){ |
344 | editor.putInt("c16_6",1) | 209 | editor.putInt("c16_6",1) |
345 | editor.commit() | 210 | editor.commit() |
211 | + editor.putString("fourth_one","done");editor.commit() | ||
346 | } | 212 | } |
347 | if(guitarButton.isChecked){ | 213 | if(guitarButton.isChecked){ |
348 | editor.putInt("c16_7",1) | 214 | editor.putInt("c16_7",1) |
349 | editor.commit() | 215 | editor.commit() |
216 | + editor.putString("fourth_one","done");editor.commit() | ||
350 | } | 217 | } |
351 | 218 | ||
352 | var intent = Intent(this, InputProfilFourthTwoActivity::class.java) | 219 | var intent = Intent(this, InputProfilFourthTwoActivity::class.java) | ... | ... |
... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fourth_three.* | ... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fourth_three.* |
19 | class InputProfilFourthThreeActivity : AppCompatActivity() { | 19 | class InputProfilFourthThreeActivity : AppCompatActivity() { |
20 | 20 | ||
21 | private val firebaseAuth = FirebaseAuth.getInstance() | 21 | private val firebaseAuth = FirebaseAuth.getInstance() |
22 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 22 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
23 | - | ||
24 | private fun sendToken(){ | 23 | private fun sendToken(){ |
25 | FirebaseInstanceId.getInstance().instanceId | 24 | FirebaseInstanceId.getInstance().instanceId |
26 | .addOnCompleteListener(OnCompleteListener { task -> | 25 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -39,9 +38,8 @@ class InputProfilFourthThreeActivity : AppCompatActivity() { | ... | @@ -39,9 +38,8 @@ class InputProfilFourthThreeActivity : AppCompatActivity() { |
39 | }) | 38 | }) |
40 | } | 39 | } |
41 | 40 | ||
42 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 41 | + private fun writeNewUser(Topic : String) { |
43 | - val user = User(u_token, Policy!!) | 42 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
44 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
45 | } | 43 | } |
46 | 44 | ||
47 | 45 | ||
... | @@ -72,6 +70,7 @@ class InputProfilFourthThreeActivity : AppCompatActivity() { | ... | @@ -72,6 +70,7 @@ class InputProfilFourthThreeActivity : AppCompatActivity() { |
72 | sendToken() | 70 | sendToken() |
73 | val user=firebaseAuth?.currentUser!!.uid | 71 | val user=firebaseAuth?.currentUser!!.uid |
74 | Log.d("test:", user.toString()) | 72 | Log.d("test:", user.toString()) |
73 | + | ||
75 | val cat_1=listOf("c1_1","c1_2","c1_3") | 74 | val cat_1=listOf("c1_1","c1_2","c1_3") |
76 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 75 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
77 | val cat_3=listOf("c3_1","c3_2","c3_3") | 76 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -89,146 +88,38 @@ class InputProfilFourthThreeActivity : AppCompatActivity() { | ... | @@ -89,146 +88,38 @@ class InputProfilFourthThreeActivity : AppCompatActivity() { |
89 | val cat_15=listOf("c15_1","c15_2","c15_3") | 88 | val cat_15=listOf("c15_1","c15_2","c15_3") |
90 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 89 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
91 | 90 | ||
92 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 91 | + val cat_list=mutableListOf<String>() |
93 | - //var policy_string="" | 92 | + cat_list.addAll(cat_1) |
94 | - | 93 | + cat_list.addAll(cat_2) |
95 | - var user_cat_1 = mutableListOf("c1_1") | 94 | + cat_list.addAll(cat_3) |
96 | - var user_cat_2 = mutableListOf("c2_1") | 95 | + cat_list.addAll(cat_4) |
97 | - var user_cat_3 = mutableListOf("c3_1") | 96 | + cat_list.addAll(cat_5) |
98 | - var user_cat_4 = mutableListOf("c4_1") | 97 | + cat_list.addAll(cat_6) |
99 | - var user_cat_5 = mutableListOf("c5_1") | 98 | + cat_list.addAll(cat_7) |
100 | - var user_cat_6 = mutableListOf("c6_1") | 99 | + cat_list.addAll(cat_8) |
101 | - var user_cat_7 = mutableListOf("c7_1") | 100 | + cat_list.addAll(cat_9) |
102 | - var user_cat_8 = mutableListOf("c8_1") | 101 | + cat_list.addAll(cat_10) |
103 | - var user_cat_9 = mutableListOf("c9_1") | 102 | + cat_list.addAll(cat_11) |
104 | - var user_cat_10 = mutableListOf("c10_1") | 103 | + cat_list.addAll(cat_12) |
105 | - var user_cat_11 = mutableListOf("c11_1") | 104 | + cat_list.addAll(cat_13) |
106 | - var user_cat_12 = mutableListOf("c12_1") | 105 | + cat_list.addAll(cat_14) |
107 | - var user_cat_13 = mutableListOf("c13_1") | 106 | + cat_list.addAll(cat_15) |
108 | - var user_cat_14 = mutableListOf("c14_1") | 107 | + cat_list.addAll(cat_16) |
109 | - var user_cat_15 = mutableListOf("c15_1") | 108 | + |
110 | - var user_cat_16 = mutableListOf("c16_1") | 109 | + var user_topic="" |
111 | - | 110 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
112 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 111 | + |
113 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 112 | + if(prof.getString("existing_topic","none")!=user_topic){ |
114 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 113 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
115 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 114 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
116 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 115 | + if (!task.isSuccessful) { } // 성공 |
117 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
118 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
119 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
120 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
121 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
122 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
123 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
124 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
125 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
126 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
127 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
128 | - | ||
129 | - var topic = "" | ||
130 | - var user_topic = "" | ||
131 | - | ||
132 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
133 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
134 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
135 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
136 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
137 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
138 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
139 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
140 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
141 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
142 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
143 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
144 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
145 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
146 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
147 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
148 | - | ||
149 | - | ||
150 | - for(c1 in user_cat_1) { | ||
151 | - topic += c1 | ||
152 | - for (c2 in user_cat_2) { | ||
153 | - topic += c2 | ||
154 | - for (c3 in user_cat_3) { | ||
155 | - topic += c3 | ||
156 | - for (c4 in user_cat_4) { | ||
157 | - topic += c4 | ||
158 | - for (c5 in user_cat_5) { | ||
159 | - topic += c5 | ||
160 | - for (c6 in user_cat_6) { | ||
161 | - topic += c6 | ||
162 | - for (c7 in user_cat_7) { | ||
163 | - topic += c7 | ||
164 | - for (c8 in user_cat_8) { | ||
165 | - topic += c8 | ||
166 | - for (c9 in user_cat_9) { | ||
167 | - topic += c9 | ||
168 | - for (c10 in user_cat_10) { | ||
169 | - topic += c10 | ||
170 | - for (c11 in user_cat_11) { | ||
171 | - topic += c11 | ||
172 | - for (c12 in user_cat_12) { | ||
173 | - topic += c12 | ||
174 | - for (c13 in user_cat_13) { | ||
175 | - topic += c13 | ||
176 | - for (c14 in user_cat_14) { | ||
177 | - topic += c14 | ||
178 | - for (c15 in user_cat_15) { | ||
179 | - topic += c15 | ||
180 | - for (c16 in user_cat_16) { | ||
181 | - topic += c16 | ||
182 | - user_topic += (topic + "/") | ||
183 | - // debug | ||
184 | - // Log.d("topic : ", topic) | ||
185 | - | ||
186 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
187 | - if (!task.isSuccessful) { } // 성공 | ||
188 | - } | ||
189 | - /* topic 구독 코드 | ||
190 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
191 | - if (!task.isSuccessful) { } // 성공 | ||
192 | - } | ||
193 | - */ | ||
194 | - | ||
195 | - topic = topic.substring(0, topic.length - c16.length) | ||
196 | - } | ||
197 | - topic = topic.substring(0, topic.length - c15.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c14.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c13.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c12.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c11.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c10.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c9.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c8.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c7.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c6.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c5.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c4.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c3.length) | ||
222 | - } | ||
223 | - topic = topic.substring(0, topic.length - c2.length) | ||
224 | } | 116 | } |
225 | - topic = topic.substring(0, topic.length-c1.length) | 117 | + writeNewUser(user_topic) // db에 쓰기 |
226 | - } | 118 | + editor.putString("existing_topic",user_topic) |
227 | - | 119 | + editor.commit() |
228 | - //Log.d("re:", user_topic) | 120 | + }else{ |
229 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
230 | - | ||
231 | 121 | ||
122 | + } | ||
232 | var intent = Intent(this, SignInActivity::class.java) | 123 | var intent = Intent(this, SignInActivity::class.java) |
233 | startActivity(intent) | 124 | startActivity(intent) |
234 | } | 125 | } |
... | @@ -263,18 +154,18 @@ class InputProfilFourthThreeActivity : AppCompatActivity() { | ... | @@ -263,18 +154,18 @@ class InputProfilFourthThreeActivity : AppCompatActivity() { |
263 | 154 | ||
264 | 155 | ||
265 | nextButton.setOnClickListener { | 156 | nextButton.setOnClickListener { |
266 | - if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit()} | 157 | + if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
267 | - if(jeosodeukButton.isChecked){editor.putInt("c8_3",1); editor.commit()} | 158 | + if(jeosodeukButton.isChecked){editor.putInt("c8_3",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
268 | - if(hanboomoButton.isChecked){editor.putInt("c8_7",1); editor.commit()} | 159 | + if(hanboomoButton.isChecked){editor.putInt("c8_7",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
269 | - if(oegookinButton.isChecked){editor.putInt("c8_5",1); editor.commit()} | 160 | + if(oegookinButton.isChecked){editor.putInt("c8_5",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
270 | - if(damoonhwaButton.isChecked){editor.putInt("c8_4",1); editor.commit()} | 161 | + if(damoonhwaButton.isChecked){editor.putInt("c8_4",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
271 | - if(jaangaeButton.isChecked){editor.putInt("c8_2",1); editor.commit()} | 162 | + if(jaangaeButton.isChecked){editor.putInt("c8_2",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
272 | - if(imshinchoolsanButton.isChecked){editor.putInt("c7_1",1); editor.commit()} | 163 | + if(imshinchoolsanButton.isChecked){editor.putInt("c7_1",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
273 | - if(ipyaangButton.isChecked){editor.putInt("c8_10",1); editor.commit()} | 164 | + if(ipyaangButton.isChecked){editor.putInt("c8_10",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
274 | - if(gaajungButton.isChecked){editor.putInt("c8_11",1); editor.commit()} | 165 | + if(gaajungButton.isChecked){editor.putInt("c8_11",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
275 | - if(bookhanButton.isChecked){editor.putInt("c8_6",1); editor.commit()} | 166 | + if(bookhanButton.isChecked){editor.putInt("c8_6",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
276 | - if(gookgayoogongButton.isChecked){editor.putInt("c8_8",1); editor.commit()} | 167 | + if(gookgayoogongButton.isChecked){editor.putInt("c8_8",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
277 | - if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit()} | 168 | + if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit();editor.putString("fourth_three","done");editor.commit()} |
278 | 169 | ||
279 | var intent = Intent(this, InputProfilFourthFourActivity::class.java) | 170 | var intent = Intent(this, InputProfilFourthFourActivity::class.java) |
280 | startActivity(intent) | 171 | startActivity(intent) | ... | ... |
... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fourth_two.* | ... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_fourth_two.* |
21 | class InputProfilFourthTwoActivity : AppCompatActivity() { | 21 | class InputProfilFourthTwoActivity : AppCompatActivity() { |
22 | 22 | ||
23 | private val firebaseAuth = FirebaseAuth.getInstance() | 23 | private val firebaseAuth = FirebaseAuth.getInstance() |
24 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 24 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
25 | - | ||
26 | private fun sendToken(){ | 25 | private fun sendToken(){ |
27 | FirebaseInstanceId.getInstance().instanceId | 26 | FirebaseInstanceId.getInstance().instanceId |
28 | .addOnCompleteListener(OnCompleteListener { task -> | 27 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -41,15 +40,13 @@ class InputProfilFourthTwoActivity : AppCompatActivity() { | ... | @@ -41,15 +40,13 @@ class InputProfilFourthTwoActivity : AppCompatActivity() { |
41 | }) | 40 | }) |
42 | } | 41 | } |
43 | 42 | ||
44 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 43 | + private fun writeNewUser(Topic : String) { |
45 | - val user = User(u_token, Policy!!) | 44 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
46 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
47 | } | 45 | } |
48 | 46 | ||
49 | 47 | ||
50 | 48 | ||
51 | 49 | ||
52 | - | ||
53 | override fun onCreate(savedInstanceState: Bundle?) { | 50 | override fun onCreate(savedInstanceState: Bundle?) { |
54 | super.onCreate(savedInstanceState) | 51 | super.onCreate(savedInstanceState) |
55 | setContentView(R.layout.activity_input_profil_fourth_two) | 52 | setContentView(R.layout.activity_input_profil_fourth_two) |
... | @@ -74,6 +71,7 @@ class InputProfilFourthTwoActivity : AppCompatActivity() { | ... | @@ -74,6 +71,7 @@ class InputProfilFourthTwoActivity : AppCompatActivity() { |
74 | sendToken() | 71 | sendToken() |
75 | val user=firebaseAuth?.currentUser!!.uid | 72 | val user=firebaseAuth?.currentUser!!.uid |
76 | Log.d("test:", user.toString()) | 73 | Log.d("test:", user.toString()) |
74 | + | ||
77 | val cat_1=listOf("c1_1","c1_2","c1_3") | 75 | val cat_1=listOf("c1_1","c1_2","c1_3") |
78 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 76 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
79 | val cat_3=listOf("c3_1","c3_2","c3_3") | 77 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -91,146 +89,38 @@ class InputProfilFourthTwoActivity : AppCompatActivity() { | ... | @@ -91,146 +89,38 @@ class InputProfilFourthTwoActivity : AppCompatActivity() { |
91 | val cat_15=listOf("c15_1","c15_2","c15_3") | 89 | val cat_15=listOf("c15_1","c15_2","c15_3") |
92 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 90 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
93 | 91 | ||
94 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 92 | + val cat_list=mutableListOf<String>() |
95 | - //var policy_string="" | 93 | + cat_list.addAll(cat_1) |
96 | - | 94 | + cat_list.addAll(cat_2) |
97 | - var user_cat_1 = mutableListOf("c1_1") | 95 | + cat_list.addAll(cat_3) |
98 | - var user_cat_2 = mutableListOf("c2_1") | 96 | + cat_list.addAll(cat_4) |
99 | - var user_cat_3 = mutableListOf("c3_1") | 97 | + cat_list.addAll(cat_5) |
100 | - var user_cat_4 = mutableListOf("c4_1") | 98 | + cat_list.addAll(cat_6) |
101 | - var user_cat_5 = mutableListOf("c5_1") | 99 | + cat_list.addAll(cat_7) |
102 | - var user_cat_6 = mutableListOf("c6_1") | 100 | + cat_list.addAll(cat_8) |
103 | - var user_cat_7 = mutableListOf("c7_1") | 101 | + cat_list.addAll(cat_9) |
104 | - var user_cat_8 = mutableListOf("c8_1") | 102 | + cat_list.addAll(cat_10) |
105 | - var user_cat_9 = mutableListOf("c9_1") | 103 | + cat_list.addAll(cat_11) |
106 | - var user_cat_10 = mutableListOf("c10_1") | 104 | + cat_list.addAll(cat_12) |
107 | - var user_cat_11 = mutableListOf("c11_1") | 105 | + cat_list.addAll(cat_13) |
108 | - var user_cat_12 = mutableListOf("c12_1") | 106 | + cat_list.addAll(cat_14) |
109 | - var user_cat_13 = mutableListOf("c13_1") | 107 | + cat_list.addAll(cat_15) |
110 | - var user_cat_14 = mutableListOf("c14_1") | 108 | + cat_list.addAll(cat_16) |
111 | - var user_cat_15 = mutableListOf("c15_1") | 109 | + |
112 | - var user_cat_16 = mutableListOf("c16_1") | 110 | + var user_topic="" |
113 | - | 111 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
114 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 112 | + |
115 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 113 | + if(prof.getString("existing_topic","none")!=user_topic){ |
116 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 114 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
117 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 115 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
118 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 116 | + if (!task.isSuccessful) { } // 성공 |
119 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
120 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
121 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
122 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
123 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
124 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
125 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
126 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
127 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
128 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
129 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
130 | - | ||
131 | - var topic = "" | ||
132 | - var user_topic = "" | ||
133 | - | ||
134 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
135 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
136 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
137 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
138 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
139 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
140 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
141 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
142 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
143 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
144 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
145 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
146 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
147 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
148 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
149 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
150 | - | ||
151 | - | ||
152 | - for(c1 in user_cat_1) { | ||
153 | - topic += c1 | ||
154 | - for (c2 in user_cat_2) { | ||
155 | - topic += c2 | ||
156 | - for (c3 in user_cat_3) { | ||
157 | - topic += c3 | ||
158 | - for (c4 in user_cat_4) { | ||
159 | - topic += c4 | ||
160 | - for (c5 in user_cat_5) { | ||
161 | - topic += c5 | ||
162 | - for (c6 in user_cat_6) { | ||
163 | - topic += c6 | ||
164 | - for (c7 in user_cat_7) { | ||
165 | - topic += c7 | ||
166 | - for (c8 in user_cat_8) { | ||
167 | - topic += c8 | ||
168 | - for (c9 in user_cat_9) { | ||
169 | - topic += c9 | ||
170 | - for (c10 in user_cat_10) { | ||
171 | - topic += c10 | ||
172 | - for (c11 in user_cat_11) { | ||
173 | - topic += c11 | ||
174 | - for (c12 in user_cat_12) { | ||
175 | - topic += c12 | ||
176 | - for (c13 in user_cat_13) { | ||
177 | - topic += c13 | ||
178 | - for (c14 in user_cat_14) { | ||
179 | - topic += c14 | ||
180 | - for (c15 in user_cat_15) { | ||
181 | - topic += c15 | ||
182 | - for (c16 in user_cat_16) { | ||
183 | - topic += c16 | ||
184 | - user_topic += (topic + "/") | ||
185 | - // debug | ||
186 | - // Log.d("topic : ", topic) | ||
187 | - | ||
188 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
189 | - if (!task.isSuccessful) { } // 성공 | ||
190 | - } | ||
191 | - /* topic 구독 코드 | ||
192 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
193 | - if (!task.isSuccessful) { } // 성공 | ||
194 | - } | ||
195 | - */ | ||
196 | - | ||
197 | - topic = topic.substring(0, topic.length - c16.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c15.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c14.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c13.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c12.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c11.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c10.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c9.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c8.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c7.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c6.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c5.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c4.length) | ||
222 | - } | ||
223 | - topic = topic.substring(0, topic.length - c3.length) | ||
224 | - } | ||
225 | - topic = topic.substring(0, topic.length - c2.length) | ||
226 | } | 117 | } |
227 | - topic = topic.substring(0, topic.length-c1.length) | 118 | + writeNewUser(user_topic) // db에 쓰기 |
228 | - } | 119 | + editor.putString("existing_topic",user_topic) |
229 | - | 120 | + editor.commit() |
230 | - //Log.d("re:", user_topic) | 121 | + }else{ |
231 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
232 | - | ||
233 | 122 | ||
123 | + } | ||
234 | var intent = Intent(this, SignInActivity::class.java) | 124 | var intent = Intent(this, SignInActivity::class.java) |
235 | startActivity(intent) | 125 | startActivity(intent) |
236 | } | 126 | } |
... | @@ -265,14 +155,14 @@ class InputProfilFourthTwoActivity : AppCompatActivity() { | ... | @@ -265,14 +155,14 @@ class InputProfilFourthTwoActivity : AppCompatActivity() { |
265 | 155 | ||
266 | 156 | ||
267 | nextButton.setOnClickListener { | 157 | nextButton.setOnClickListener { |
268 | - if(yesButton.isChecked){editor.putInt("c15_2",1); editor.commit()} | 158 | + if(yesButton.isChecked){editor.putInt("c15_2",1); editor.commit();editor.putString("fourth_two","done");editor.commit()} |
269 | - if(noButton.isChecked){editor.putInt("c15_3",1); editor.commit()} | 159 | + if(noButton.isChecked){editor.putInt("c15_3",1); editor.commit();editor.putString("fourth_two","done");editor.commit()} |
270 | - if(jeonsaeButton.isChecked){editor.putInt("c16_2",1); editor.commit()} | 160 | + if(jeonsaeButton.isChecked){editor.putInt("c16_2",1); editor.commit();editor.putString("fourth_two","done");editor.commit()} |
271 | - if(wolseButton.isChecked){editor.putInt("c16_3",1); editor.commit()} | 161 | + if(wolseButton.isChecked){editor.putInt("c16_3",1); editor.commit();editor.putString("fourth_two","done");editor.commit()} |
272 | - if(kongkongButton.isChecked){editor.putInt("c16_4",1); editor.commit()} | 162 | + if(kongkongButton.isChecked){editor.putInt("c16_4",1); editor.commit();editor.putString("fourth_two","done");editor.commit()} |
273 | - if(moosangButton.isChecked){editor.putInt("c16_5",1); editor.commit()} | 163 | + if(moosangButton.isChecked){editor.putInt("c16_5",1); editor.commit();editor.putString("fourth_two","done");editor.commit()} |
274 | - if(bojangButton.isChecked){editor.putInt("c16_6",1); editor.commit()} | 164 | + if(bojangButton.isChecked){editor.putInt("c16_6",1); editor.commit();editor.putString("fourth_two","done");editor.commit()} |
275 | - if(guitarButton.isChecked){editor.putInt("c16_7",1); editor.commit()} | 165 | + if(guitarButton.isChecked){editor.putInt("c16_7",1); editor.commit();editor.putString("fourth_two","done");editor.commit()} |
276 | 166 | ||
277 | var intent = Intent(this, InputProfilFourthThreeActivity::class.java) | 167 | var intent = Intent(this, InputProfilFourthThreeActivity::class.java) |
278 | startActivity(intent) | 168 | startActivity(intent) | ... | ... |
... | @@ -20,8 +20,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_second_one.* | ... | @@ -20,8 +20,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_second_one.* |
20 | class InputProfilSecondOneActivity : AppCompatActivity() { | 20 | class InputProfilSecondOneActivity : AppCompatActivity() { |
21 | 21 | ||
22 | private val firebaseAuth = FirebaseAuth.getInstance() | 22 | private val firebaseAuth = FirebaseAuth.getInstance() |
23 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 23 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
24 | - | ||
25 | private fun sendToken(){ | 24 | private fun sendToken(){ |
26 | FirebaseInstanceId.getInstance().instanceId | 25 | FirebaseInstanceId.getInstance().instanceId |
27 | .addOnCompleteListener(OnCompleteListener { task -> | 26 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -40,12 +39,10 @@ class InputProfilSecondOneActivity : AppCompatActivity() { | ... | @@ -40,12 +39,10 @@ class InputProfilSecondOneActivity : AppCompatActivity() { |
40 | }) | 39 | }) |
41 | } | 40 | } |
42 | 41 | ||
43 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 42 | + private fun writeNewUser(Topic : String) { |
44 | - val user = User(u_token, Policy!!) | 43 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
45 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
46 | } | 44 | } |
47 | 45 | ||
48 | - | ||
49 | override fun onCreate(savedInstanceState: Bundle?) { | 46 | override fun onCreate(savedInstanceState: Bundle?) { |
50 | super.onCreate(savedInstanceState) | 47 | super.onCreate(savedInstanceState) |
51 | setContentView(R.layout.activity_input_profil_second_one) | 48 | setContentView(R.layout.activity_input_profil_second_one) |
... | @@ -70,6 +67,7 @@ class InputProfilSecondOneActivity : AppCompatActivity() { | ... | @@ -70,6 +67,7 @@ class InputProfilSecondOneActivity : AppCompatActivity() { |
70 | sendToken() | 67 | sendToken() |
71 | val user=firebaseAuth?.currentUser!!.uid | 68 | val user=firebaseAuth?.currentUser!!.uid |
72 | Log.d("test:", user.toString()) | 69 | Log.d("test:", user.toString()) |
70 | + | ||
73 | val cat_1=listOf("c1_1","c1_2","c1_3") | 71 | val cat_1=listOf("c1_1","c1_2","c1_3") |
74 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 72 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
75 | val cat_3=listOf("c3_1","c3_2","c3_3") | 73 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -87,146 +85,38 @@ class InputProfilSecondOneActivity : AppCompatActivity() { | ... | @@ -87,146 +85,38 @@ class InputProfilSecondOneActivity : AppCompatActivity() { |
87 | val cat_15=listOf("c15_1","c15_2","c15_3") | 85 | val cat_15=listOf("c15_1","c15_2","c15_3") |
88 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 86 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
89 | 87 | ||
90 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 88 | + val cat_list=mutableListOf<String>() |
91 | - //var policy_string="" | 89 | + cat_list.addAll(cat_1) |
92 | - | 90 | + cat_list.addAll(cat_2) |
93 | - var user_cat_1 = mutableListOf("c1_1") | 91 | + cat_list.addAll(cat_3) |
94 | - var user_cat_2 = mutableListOf("c2_1") | 92 | + cat_list.addAll(cat_4) |
95 | - var user_cat_3 = mutableListOf("c3_1") | 93 | + cat_list.addAll(cat_5) |
96 | - var user_cat_4 = mutableListOf("c4_1") | 94 | + cat_list.addAll(cat_6) |
97 | - var user_cat_5 = mutableListOf("c5_1") | 95 | + cat_list.addAll(cat_7) |
98 | - var user_cat_6 = mutableListOf("c6_1") | 96 | + cat_list.addAll(cat_8) |
99 | - var user_cat_7 = mutableListOf("c7_1") | 97 | + cat_list.addAll(cat_9) |
100 | - var user_cat_8 = mutableListOf("c8_1") | 98 | + cat_list.addAll(cat_10) |
101 | - var user_cat_9 = mutableListOf("c9_1") | 99 | + cat_list.addAll(cat_11) |
102 | - var user_cat_10 = mutableListOf("c10_1") | 100 | + cat_list.addAll(cat_12) |
103 | - var user_cat_11 = mutableListOf("c11_1") | 101 | + cat_list.addAll(cat_13) |
104 | - var user_cat_12 = mutableListOf("c12_1") | 102 | + cat_list.addAll(cat_14) |
105 | - var user_cat_13 = mutableListOf("c13_1") | 103 | + cat_list.addAll(cat_15) |
106 | - var user_cat_14 = mutableListOf("c14_1") | 104 | + cat_list.addAll(cat_16) |
107 | - var user_cat_15 = mutableListOf("c15_1") | 105 | + |
108 | - var user_cat_16 = mutableListOf("c16_1") | 106 | + var user_topic="" |
109 | - | 107 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
110 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 108 | + |
111 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 109 | + if(prof.getString("existing_topic","none")!=user_topic){ |
112 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 110 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
113 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 111 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
114 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 112 | + if (!task.isSuccessful) { } // 성공 |
115 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
116 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
117 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
118 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
119 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
120 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
121 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
122 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
123 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
124 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
125 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
126 | - | ||
127 | - var topic = "" | ||
128 | - var user_topic = "" | ||
129 | - | ||
130 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
131 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
132 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
133 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
134 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
135 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
136 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
137 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
138 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
139 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
140 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
141 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
142 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
143 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
144 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
145 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
146 | - | ||
147 | - | ||
148 | - for(c1 in user_cat_1) { | ||
149 | - topic += c1 | ||
150 | - for (c2 in user_cat_2) { | ||
151 | - topic += c2 | ||
152 | - for (c3 in user_cat_3) { | ||
153 | - topic += c3 | ||
154 | - for (c4 in user_cat_4) { | ||
155 | - topic += c4 | ||
156 | - for (c5 in user_cat_5) { | ||
157 | - topic += c5 | ||
158 | - for (c6 in user_cat_6) { | ||
159 | - topic += c6 | ||
160 | - for (c7 in user_cat_7) { | ||
161 | - topic += c7 | ||
162 | - for (c8 in user_cat_8) { | ||
163 | - topic += c8 | ||
164 | - for (c9 in user_cat_9) { | ||
165 | - topic += c9 | ||
166 | - for (c10 in user_cat_10) { | ||
167 | - topic += c10 | ||
168 | - for (c11 in user_cat_11) { | ||
169 | - topic += c11 | ||
170 | - for (c12 in user_cat_12) { | ||
171 | - topic += c12 | ||
172 | - for (c13 in user_cat_13) { | ||
173 | - topic += c13 | ||
174 | - for (c14 in user_cat_14) { | ||
175 | - topic += c14 | ||
176 | - for (c15 in user_cat_15) { | ||
177 | - topic += c15 | ||
178 | - for (c16 in user_cat_16) { | ||
179 | - topic += c16 | ||
180 | - user_topic += (topic + "/") | ||
181 | - // debug | ||
182 | - // Log.d("topic : ", topic) | ||
183 | - | ||
184 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
185 | - if (!task.isSuccessful) { } // 성공 | ||
186 | - } | ||
187 | - /* topic 구독 코드 | ||
188 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
189 | - if (!task.isSuccessful) { } // 성공 | ||
190 | - } | ||
191 | - */ | ||
192 | - | ||
193 | - topic = topic.substring(0, topic.length - c16.length) | ||
194 | - } | ||
195 | - topic = topic.substring(0, topic.length - c15.length) | ||
196 | - } | ||
197 | - topic = topic.substring(0, topic.length - c14.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c13.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c12.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c11.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c10.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c9.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c8.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c7.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c6.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c5.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c4.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c3.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c2.length) | ||
222 | } | 113 | } |
223 | - topic = topic.substring(0, topic.length-c1.length) | 114 | + writeNewUser(user_topic) // db에 쓰기 |
224 | - } | 115 | + editor.putString("existing_topic",user_topic) |
225 | - | 116 | + editor.commit() |
226 | - //Log.d("re:", user_topic) | 117 | + }else{ |
227 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
228 | - | ||
229 | 118 | ||
119 | + } | ||
230 | var intent = Intent(this, SignInActivity::class.java) | 120 | var intent = Intent(this, SignInActivity::class.java) |
231 | startActivity(intent) | 121 | startActivity(intent) |
232 | } | 122 | } |
... | @@ -264,23 +154,23 @@ class InputProfilSecondOneActivity : AppCompatActivity() { | ... | @@ -264,23 +154,23 @@ class InputProfilSecondOneActivity : AppCompatActivity() { |
264 | 154 | ||
265 | nextButton.setOnClickListener { | 155 | nextButton.setOnClickListener { |
266 | 156 | ||
267 | - if(baewoojaButton.isChecked){editor.putInt("c10_2",1); editor.commit()} | 157 | + if(baewoojaButton.isChecked){editor.putInt("c10_2",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
268 | - if(baewoojaboomoButton.isChecked){editor.putInt("c10_3",1); editor.commit()} | 158 | + if(baewoojaboomoButton.isChecked){editor.putInt("c10_3",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
269 | - if(baewoojajoboomoButton.isChecked){editor.putInt("c10_4",1); editor.commit()} | 159 | + if(baewoojajoboomoButton.isChecked){editor.putInt("c10_4",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
270 | if(brotherButton.isChecked){editor.putInt("c10_5",1); editor.commit() | 160 | if(brotherButton.isChecked){editor.putInt("c10_5",1); editor.commit() |
271 | - editor.putString("with_brothersister","yes")} | 161 | + editor.putString("with_brothersister","yes");editor.putString("second_one","done");editor.commit()} |
272 | - if(baewoojabrotherButton.isChecked){editor.putInt("c10_6",1); editor.commit()} | 162 | + if(baewoojabrotherButton.isChecked){editor.putInt("c10_6",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
273 | - if(donggeoButton.isChecked){editor.putInt("c10_7",1); editor.commit()} | 163 | + if(donggeoButton.isChecked){editor.putInt("c10_7",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
274 | - if(fatherButton.isChecked){editor.putInt("c10_8",1); editor.commit()} | 164 | + if(fatherButton.isChecked){editor.putInt("c10_8",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
275 | - if(motherButton.isChecked){editor.putInt("c10_9",1); editor.commit()} | 165 | + if(motherButton.isChecked){editor.putInt("c10_9",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
276 | - if(grandsonbaewoojaButton.isChecked){editor.putInt("c10_10",1); editor.commit()} | 166 | + if(grandsonbaewoojaButton.isChecked){editor.putInt("c10_10",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
277 | - if(grandfatherButton.isChecked){editor.putInt("c10_11",1); editor.commit()} | 167 | + if(grandfatherButton.isChecked){editor.putInt("c10_11",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
278 | - if(grandmotherButton.isChecked){editor.putInt("c10_12",1); editor.commit()} | 168 | + if(grandmotherButton.isChecked){editor.putInt("c10_12",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
279 | - if(grandsonButton.isChecked){editor.putInt("c10_13",1); editor.commit()} | 169 | + if(grandsonButton.isChecked){editor.putInt("c10_13",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
280 | if(janyeoButton.isChecked){editor.putInt("c10_14",1); editor.commit() | 170 | if(janyeoButton.isChecked){editor.putInt("c10_14",1); editor.commit() |
281 | - editor.putString("with_child","yes")} | 171 | + editor.putString("with_child","yes");editor.putString("second_one","done");editor.commit()} |
282 | - if(janyeobaewoojaButton.isChecked){editor.putInt("c10_15",1); editor.commit()} | 172 | + if(janyeobaewoojaButton.isChecked){editor.putInt("c10_15",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
283 | - if(nothingButton.isChecked){editor.putInt("c10_18",1); editor.commit()} | 173 | + if(nothingButton.isChecked){editor.putInt("c10_18",1); editor.commit();editor.putString("second_one","done");editor.commit()} |
284 | 174 | ||
285 | if(janyeoButton.isChecked | 175 | if(janyeoButton.isChecked |
286 | //prof.getString("with_child","none")=="yes" | 176 | //prof.getString("with_child","none")=="yes" | ... | ... |
... | @@ -24,8 +24,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_second_three.toolbar | ... | @@ -24,8 +24,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_second_three.toolbar |
24 | class InputProfilSecondThreeActivity : AppCompatActivity() { | 24 | class InputProfilSecondThreeActivity : AppCompatActivity() { |
25 | 25 | ||
26 | private val firebaseAuth = FirebaseAuth.getInstance() | 26 | private val firebaseAuth = FirebaseAuth.getInstance() |
27 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 27 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
28 | - | ||
29 | private fun sendToken(){ | 28 | private fun sendToken(){ |
30 | FirebaseInstanceId.getInstance().instanceId | 29 | FirebaseInstanceId.getInstance().instanceId |
31 | .addOnCompleteListener(OnCompleteListener { task -> | 30 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -44,9 +43,8 @@ class InputProfilSecondThreeActivity : AppCompatActivity() { | ... | @@ -44,9 +43,8 @@ class InputProfilSecondThreeActivity : AppCompatActivity() { |
44 | }) | 43 | }) |
45 | } | 44 | } |
46 | 45 | ||
47 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 46 | + private fun writeNewUser(Topic : String) { |
48 | - val user = User(u_token, Policy!!) | 47 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
49 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
50 | } | 48 | } |
51 | 49 | ||
52 | 50 | ||
... | @@ -71,11 +69,11 @@ class InputProfilSecondThreeActivity : AppCompatActivity() { | ... | @@ -71,11 +69,11 @@ class InputProfilSecondThreeActivity : AppCompatActivity() { |
71 | } | 69 | } |
72 | //pushing code end | 70 | //pushing code end |
73 | 71 | ||
74 | - | ||
75 | skipButton.setOnClickListener { | 72 | skipButton.setOnClickListener { |
76 | sendToken() | 73 | sendToken() |
77 | val user=firebaseAuth?.currentUser!!.uid | 74 | val user=firebaseAuth?.currentUser!!.uid |
78 | Log.d("test:", user.toString()) | 75 | Log.d("test:", user.toString()) |
76 | + | ||
79 | val cat_1=listOf("c1_1","c1_2","c1_3") | 77 | val cat_1=listOf("c1_1","c1_2","c1_3") |
80 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 78 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
81 | val cat_3=listOf("c3_1","c3_2","c3_3") | 79 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -93,156 +91,42 @@ class InputProfilSecondThreeActivity : AppCompatActivity() { | ... | @@ -93,156 +91,42 @@ class InputProfilSecondThreeActivity : AppCompatActivity() { |
93 | val cat_15=listOf("c15_1","c15_2","c15_3") | 91 | val cat_15=listOf("c15_1","c15_2","c15_3") |
94 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 92 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
95 | 93 | ||
96 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 94 | + val cat_list=mutableListOf<String>() |
97 | - //var policy_string="" | 95 | + cat_list.addAll(cat_1) |
98 | - | 96 | + cat_list.addAll(cat_2) |
99 | - var user_cat_1 = mutableListOf("c1_1") | 97 | + cat_list.addAll(cat_3) |
100 | - var user_cat_2 = mutableListOf("c2_1") | 98 | + cat_list.addAll(cat_4) |
101 | - var user_cat_3 = mutableListOf("c3_1") | 99 | + cat_list.addAll(cat_5) |
102 | - var user_cat_4 = mutableListOf("c4_1") | 100 | + cat_list.addAll(cat_6) |
103 | - var user_cat_5 = mutableListOf("c5_1") | 101 | + cat_list.addAll(cat_7) |
104 | - var user_cat_6 = mutableListOf("c6_1") | 102 | + cat_list.addAll(cat_8) |
105 | - var user_cat_7 = mutableListOf("c7_1") | 103 | + cat_list.addAll(cat_9) |
106 | - var user_cat_8 = mutableListOf("c8_1") | 104 | + cat_list.addAll(cat_10) |
107 | - var user_cat_9 = mutableListOf("c9_1") | 105 | + cat_list.addAll(cat_11) |
108 | - var user_cat_10 = mutableListOf("c10_1") | 106 | + cat_list.addAll(cat_12) |
109 | - var user_cat_11 = mutableListOf("c11_1") | 107 | + cat_list.addAll(cat_13) |
110 | - var user_cat_12 = mutableListOf("c12_1") | 108 | + cat_list.addAll(cat_14) |
111 | - var user_cat_13 = mutableListOf("c13_1") | 109 | + cat_list.addAll(cat_15) |
112 | - var user_cat_14 = mutableListOf("c14_1") | 110 | + cat_list.addAll(cat_16) |
113 | - var user_cat_15 = mutableListOf("c15_1") | 111 | + |
114 | - var user_cat_16 = mutableListOf("c16_1") | 112 | + var user_topic="" |
115 | - | 113 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
116 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 114 | + |
117 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 115 | + if(prof.getString("existing_topic","none")!=user_topic){ |
118 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 116 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
119 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 117 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
120 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 118 | + if (!task.isSuccessful) { } // 성공 |
121 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
122 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
123 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
124 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
125 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
126 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
127 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
128 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
129 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
130 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
131 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
132 | - | ||
133 | - var topic = "" | ||
134 | - var user_topic = "" | ||
135 | - | ||
136 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
137 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
138 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
139 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
140 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
141 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
142 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
143 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
144 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
145 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
146 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
147 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
148 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
149 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
150 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
151 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
152 | - | ||
153 | - | ||
154 | - for(c1 in user_cat_1) { | ||
155 | - topic += c1 | ||
156 | - for (c2 in user_cat_2) { | ||
157 | - topic += c2 | ||
158 | - for (c3 in user_cat_3) { | ||
159 | - topic += c3 | ||
160 | - for (c4 in user_cat_4) { | ||
161 | - topic += c4 | ||
162 | - for (c5 in user_cat_5) { | ||
163 | - topic += c5 | ||
164 | - for (c6 in user_cat_6) { | ||
165 | - topic += c6 | ||
166 | - for (c7 in user_cat_7) { | ||
167 | - topic += c7 | ||
168 | - for (c8 in user_cat_8) { | ||
169 | - topic += c8 | ||
170 | - for (c9 in user_cat_9) { | ||
171 | - topic += c9 | ||
172 | - for (c10 in user_cat_10) { | ||
173 | - topic += c10 | ||
174 | - for (c11 in user_cat_11) { | ||
175 | - topic += c11 | ||
176 | - for (c12 in user_cat_12) { | ||
177 | - topic += c12 | ||
178 | - for (c13 in user_cat_13) { | ||
179 | - topic += c13 | ||
180 | - for (c14 in user_cat_14) { | ||
181 | - topic += c14 | ||
182 | - for (c15 in user_cat_15) { | ||
183 | - topic += c15 | ||
184 | - for (c16 in user_cat_16) { | ||
185 | - topic += c16 | ||
186 | - user_topic += (topic + "/") | ||
187 | - // debug | ||
188 | - // Log.d("topic : ", topic) | ||
189 | - | ||
190 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
191 | - if (!task.isSuccessful) { } // 성공 | ||
192 | - } | ||
193 | - /* topic 구독 코드 | ||
194 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
195 | - if (!task.isSuccessful) { } // 성공 | ||
196 | - } | ||
197 | - */ | ||
198 | - | ||
199 | - topic = topic.substring(0, topic.length - c16.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c15.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c14.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c13.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c12.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c11.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c10.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c9.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c8.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c7.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c6.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c5.length) | ||
222 | - } | ||
223 | - topic = topic.substring(0, topic.length - c4.length) | ||
224 | - } | ||
225 | - topic = topic.substring(0, topic.length - c3.length) | ||
226 | - } | ||
227 | - topic = topic.substring(0, topic.length - c2.length) | ||
228 | } | 119 | } |
229 | - topic = topic.substring(0, topic.length-c1.length) | 120 | + writeNewUser(user_topic) // db에 쓰기 |
230 | - } | 121 | + editor.putString("existing_topic",user_topic) |
231 | - | 122 | + editor.commit() |
232 | - //Log.d("re:", user_topic) | 123 | + }else{ |
233 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
234 | - | ||
235 | 124 | ||
125 | + } | ||
236 | var intent = Intent(this, SignInActivity::class.java) | 126 | var intent = Intent(this, SignInActivity::class.java) |
237 | startActivity(intent) | 127 | startActivity(intent) |
238 | } | 128 | } |
239 | 129 | ||
240 | - setSupportActionBar(toolbar) | ||
241 | - | ||
242 | - skipButton.setOnClickListener { | ||
243 | - var intent = Intent(this, InputProfilSecondOneActivity::class.java) | ||
244 | - startActivity(intent) | ||
245 | - } | ||
246 | 130 | ||
247 | previousButton.setOnClickListener { | 131 | previousButton.setOnClickListener { |
248 | var intent = Intent(this, InputProfilSecondTwoActivity::class.java) | 132 | var intent = Intent(this, InputProfilSecondTwoActivity::class.java) |
... | @@ -252,10 +136,10 @@ class InputProfilSecondThreeActivity : AppCompatActivity() { | ... | @@ -252,10 +136,10 @@ class InputProfilSecondThreeActivity : AppCompatActivity() { |
252 | nextButton.setOnClickListener { | 136 | nextButton.setOnClickListener { |
253 | var numOfBS=findViewById<EditText>(R.id.bsNumberEditText).text.toString().toInt() | 137 | var numOfBS=findViewById<EditText>(R.id.bsNumberEditText).text.toString().toInt() |
254 | if(numOfBS>=2){ | 138 | if(numOfBS>=2){ |
255 | - editor.putInt("c10_16",1); editor.commit() | 139 | + editor.putInt("c10_16",1); editor.commit();editor.putString("second_three","done");editor.commit() |
256 | } | 140 | } |
257 | if(numOfBS<2){ | 141 | if(numOfBS<2){ |
258 | - editor.putInt("c10_17",1); editor.commit() | 142 | + editor.putInt("c10_17",1); editor.commit();editor.putString("second_three","done");editor.commit() |
259 | } | 143 | } |
260 | var intent = Intent(this, InputProfilThirdOneActivity::class.java) | 144 | var intent = Intent(this, InputProfilThirdOneActivity::class.java) |
261 | startActivity(intent) | 145 | startActivity(intent) | ... | ... |
... | @@ -24,8 +24,7 @@ import kotlinx.android.synthetic.main.item_child.view.* | ... | @@ -24,8 +24,7 @@ import kotlinx.android.synthetic.main.item_child.view.* |
24 | class InputProfilSecondTwoActivity : AppCompatActivity() { | 24 | class InputProfilSecondTwoActivity : AppCompatActivity() { |
25 | 25 | ||
26 | private val firebaseAuth = FirebaseAuth.getInstance() | 26 | private val firebaseAuth = FirebaseAuth.getInstance() |
27 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 27 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
28 | - | ||
29 | private fun sendToken(){ | 28 | private fun sendToken(){ |
30 | FirebaseInstanceId.getInstance().instanceId | 29 | FirebaseInstanceId.getInstance().instanceId |
31 | .addOnCompleteListener(OnCompleteListener { task -> | 30 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -44,9 +43,8 @@ class InputProfilSecondTwoActivity : AppCompatActivity() { | ... | @@ -44,9 +43,8 @@ class InputProfilSecondTwoActivity : AppCompatActivity() { |
44 | }) | 43 | }) |
45 | } | 44 | } |
46 | 45 | ||
47 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 46 | + private fun writeNewUser(Topic : String) { |
48 | - val user = User(u_token, Policy!!) | 47 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
49 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
50 | } | 48 | } |
51 | 49 | ||
52 | override fun onCreate(savedInstanceState: Bundle?) { | 50 | override fun onCreate(savedInstanceState: Bundle?) { |
... | @@ -73,6 +71,7 @@ class InputProfilSecondTwoActivity : AppCompatActivity() { | ... | @@ -73,6 +71,7 @@ class InputProfilSecondTwoActivity : AppCompatActivity() { |
73 | sendToken() | 71 | sendToken() |
74 | val user=firebaseAuth?.currentUser!!.uid | 72 | val user=firebaseAuth?.currentUser!!.uid |
75 | Log.d("test:", user.toString()) | 73 | Log.d("test:", user.toString()) |
74 | + | ||
76 | val cat_1=listOf("c1_1","c1_2","c1_3") | 75 | val cat_1=listOf("c1_1","c1_2","c1_3") |
77 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 76 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
78 | val cat_3=listOf("c3_1","c3_2","c3_3") | 77 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -90,156 +89,42 @@ class InputProfilSecondTwoActivity : AppCompatActivity() { | ... | @@ -90,156 +89,42 @@ class InputProfilSecondTwoActivity : AppCompatActivity() { |
90 | val cat_15=listOf("c15_1","c15_2","c15_3") | 89 | val cat_15=listOf("c15_1","c15_2","c15_3") |
91 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 90 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
92 | 91 | ||
93 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 92 | + val cat_list=mutableListOf<String>() |
94 | - //var policy_string="" | 93 | + cat_list.addAll(cat_1) |
95 | - | 94 | + cat_list.addAll(cat_2) |
96 | - var user_cat_1 = mutableListOf("c1_1") | 95 | + cat_list.addAll(cat_3) |
97 | - var user_cat_2 = mutableListOf("c2_1") | 96 | + cat_list.addAll(cat_4) |
98 | - var user_cat_3 = mutableListOf("c3_1") | 97 | + cat_list.addAll(cat_5) |
99 | - var user_cat_4 = mutableListOf("c4_1") | 98 | + cat_list.addAll(cat_6) |
100 | - var user_cat_5 = mutableListOf("c5_1") | 99 | + cat_list.addAll(cat_7) |
101 | - var user_cat_6 = mutableListOf("c6_1") | 100 | + cat_list.addAll(cat_8) |
102 | - var user_cat_7 = mutableListOf("c7_1") | 101 | + cat_list.addAll(cat_9) |
103 | - var user_cat_8 = mutableListOf("c8_1") | 102 | + cat_list.addAll(cat_10) |
104 | - var user_cat_9 = mutableListOf("c9_1") | 103 | + cat_list.addAll(cat_11) |
105 | - var user_cat_10 = mutableListOf("c10_1") | 104 | + cat_list.addAll(cat_12) |
106 | - var user_cat_11 = mutableListOf("c11_1") | 105 | + cat_list.addAll(cat_13) |
107 | - var user_cat_12 = mutableListOf("c12_1") | 106 | + cat_list.addAll(cat_14) |
108 | - var user_cat_13 = mutableListOf("c13_1") | 107 | + cat_list.addAll(cat_15) |
109 | - var user_cat_14 = mutableListOf("c14_1") | 108 | + cat_list.addAll(cat_16) |
110 | - var user_cat_15 = mutableListOf("c15_1") | 109 | + |
111 | - var user_cat_16 = mutableListOf("c16_1") | 110 | + var user_topic="" |
112 | - | 111 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
113 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 112 | + |
114 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 113 | + if(prof.getString("existing_topic","none")!=user_topic){ |
115 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 114 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
116 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 115 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
117 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 116 | + if (!task.isSuccessful) { } // 성공 |
118 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
119 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
120 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
121 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
122 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
123 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
124 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
125 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
126 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
127 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
128 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
129 | - | ||
130 | - var topic = "" | ||
131 | - var user_topic = "" | ||
132 | - | ||
133 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
134 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
135 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
136 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
137 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
138 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
139 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
140 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
141 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
142 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
143 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
144 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
145 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
146 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
147 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
148 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
149 | - | ||
150 | - | ||
151 | - for(c1 in user_cat_1) { | ||
152 | - topic += c1 | ||
153 | - for (c2 in user_cat_2) { | ||
154 | - topic += c2 | ||
155 | - for (c3 in user_cat_3) { | ||
156 | - topic += c3 | ||
157 | - for (c4 in user_cat_4) { | ||
158 | - topic += c4 | ||
159 | - for (c5 in user_cat_5) { | ||
160 | - topic += c5 | ||
161 | - for (c6 in user_cat_6) { | ||
162 | - topic += c6 | ||
163 | - for (c7 in user_cat_7) { | ||
164 | - topic += c7 | ||
165 | - for (c8 in user_cat_8) { | ||
166 | - topic += c8 | ||
167 | - for (c9 in user_cat_9) { | ||
168 | - topic += c9 | ||
169 | - for (c10 in user_cat_10) { | ||
170 | - topic += c10 | ||
171 | - for (c11 in user_cat_11) { | ||
172 | - topic += c11 | ||
173 | - for (c12 in user_cat_12) { | ||
174 | - topic += c12 | ||
175 | - for (c13 in user_cat_13) { | ||
176 | - topic += c13 | ||
177 | - for (c14 in user_cat_14) { | ||
178 | - topic += c14 | ||
179 | - for (c15 in user_cat_15) { | ||
180 | - topic += c15 | ||
181 | - for (c16 in user_cat_16) { | ||
182 | - topic += c16 | ||
183 | - user_topic += (topic + "/") | ||
184 | - // debug | ||
185 | - // Log.d("topic : ", topic) | ||
186 | - | ||
187 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
188 | - if (!task.isSuccessful) { } // 성공 | ||
189 | - } | ||
190 | - /* topic 구독 코드 | ||
191 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
192 | - if (!task.isSuccessful) { } // 성공 | ||
193 | - } | ||
194 | - */ | ||
195 | - | ||
196 | - topic = topic.substring(0, topic.length - c16.length) | ||
197 | - } | ||
198 | - topic = topic.substring(0, topic.length - c15.length) | ||
199 | - } | ||
200 | - topic = topic.substring(0, topic.length - c14.length) | ||
201 | - } | ||
202 | - topic = topic.substring(0, topic.length - c13.length) | ||
203 | - } | ||
204 | - topic = topic.substring(0, topic.length - c12.length) | ||
205 | - } | ||
206 | - topic = topic.substring(0, topic.length - c11.length) | ||
207 | - } | ||
208 | - topic = topic.substring(0, topic.length - c10.length) | ||
209 | - } | ||
210 | - topic = topic.substring(0, topic.length - c9.length) | ||
211 | - } | ||
212 | - topic = topic.substring(0, topic.length - c8.length) | ||
213 | - } | ||
214 | - topic = topic.substring(0, topic.length - c7.length) | ||
215 | - } | ||
216 | - topic = topic.substring(0, topic.length - c6.length) | ||
217 | - } | ||
218 | - topic = topic.substring(0, topic.length - c5.length) | ||
219 | - } | ||
220 | - topic = topic.substring(0, topic.length - c4.length) | ||
221 | - } | ||
222 | - topic = topic.substring(0, topic.length - c3.length) | ||
223 | - } | ||
224 | - topic = topic.substring(0, topic.length - c2.length) | ||
225 | } | 117 | } |
226 | - topic = topic.substring(0, topic.length-c1.length) | 118 | + writeNewUser(user_topic) // db에 쓰기 |
227 | - } | 119 | + editor.putString("existing_topic",user_topic) |
228 | - | 120 | + editor.commit() |
229 | - //Log.d("re:", user_topic) | 121 | + }else{ |
230 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
231 | - | ||
232 | 122 | ||
123 | + } | ||
233 | var intent = Intent(this, SignInActivity::class.java) | 124 | var intent = Intent(this, SignInActivity::class.java) |
234 | startActivity(intent) | 125 | startActivity(intent) |
235 | } | 126 | } |
236 | 127 | ||
237 | - | ||
238 | - setSupportActionBar(toolbar) | ||
239 | - skipButton.setOnClickListener { | ||
240 | - var intent = Intent(this, InputProfilSecondOneActivity::class.java) | ||
241 | - startActivity(intent) | ||
242 | - } | ||
243 | previousButton.setOnClickListener { | 128 | previousButton.setOnClickListener { |
244 | var intent = Intent(this, InputProfilSecondOneActivity::class.java) | 129 | var intent = Intent(this, InputProfilSecondOneActivity::class.java) |
245 | startActivity(intent) | 130 | startActivity(intent) |
... | @@ -247,10 +132,10 @@ class InputProfilSecondTwoActivity : AppCompatActivity() { | ... | @@ -247,10 +132,10 @@ class InputProfilSecondTwoActivity : AppCompatActivity() { |
247 | nextButton.setOnClickListener { | 132 | nextButton.setOnClickListener { |
248 | var numOfChild=findViewById<EditText>(R.id.childNumberEditText).text.toString().toInt() | 133 | var numOfChild=findViewById<EditText>(R.id.childNumberEditText).text.toString().toInt() |
249 | if(numOfChild>=3){ | 134 | if(numOfChild>=3){ |
250 | - editor.putInt("c10_16",1); editor.commit() | 135 | + editor.putInt("c10_16",1); editor.commit();editor.putString("second_two","done");editor.commit() |
251 | } | 136 | } |
252 | if(numOfChild<3){ | 137 | if(numOfChild<3){ |
253 | - editor.putInt("c10_17",1); editor.commit() | 138 | + editor.putInt("c10_17",1); editor.commit();editor.putString("second_two","done");editor.commit() |
254 | } | 139 | } |
255 | 140 | ||
256 | 141 | ... | ... |
... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_third_four.* | ... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_third_four.* |
21 | class InputProfilThirdFourActivity : AppCompatActivity() { | 21 | class InputProfilThirdFourActivity : AppCompatActivity() { |
22 | 22 | ||
23 | private val firebaseAuth = FirebaseAuth.getInstance() | 23 | private val firebaseAuth = FirebaseAuth.getInstance() |
24 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 24 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
25 | - | ||
26 | private fun sendToken(){ | 25 | private fun sendToken(){ |
27 | FirebaseInstanceId.getInstance().instanceId | 26 | FirebaseInstanceId.getInstance().instanceId |
28 | .addOnCompleteListener(OnCompleteListener { task -> | 27 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -41,9 +40,8 @@ class InputProfilThirdFourActivity : AppCompatActivity() { | ... | @@ -41,9 +40,8 @@ class InputProfilThirdFourActivity : AppCompatActivity() { |
41 | }) | 40 | }) |
42 | } | 41 | } |
43 | 42 | ||
44 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 43 | + private fun writeNewUser(Topic : String) { |
45 | - val user = User(u_token, Policy!!) | 44 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
46 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
47 | } | 45 | } |
48 | 46 | ||
49 | 47 | ||
... | @@ -74,6 +72,7 @@ class InputProfilThirdFourActivity : AppCompatActivity() { | ... | @@ -74,6 +72,7 @@ class InputProfilThirdFourActivity : AppCompatActivity() { |
74 | sendToken() | 72 | sendToken() |
75 | val user=firebaseAuth?.currentUser!!.uid | 73 | val user=firebaseAuth?.currentUser!!.uid |
76 | Log.d("test:", user.toString()) | 74 | Log.d("test:", user.toString()) |
75 | + | ||
77 | val cat_1=listOf("c1_1","c1_2","c1_3") | 76 | val cat_1=listOf("c1_1","c1_2","c1_3") |
78 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 77 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
79 | val cat_3=listOf("c3_1","c3_2","c3_3") | 78 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -91,146 +90,38 @@ class InputProfilThirdFourActivity : AppCompatActivity() { | ... | @@ -91,146 +90,38 @@ class InputProfilThirdFourActivity : AppCompatActivity() { |
91 | val cat_15=listOf("c15_1","c15_2","c15_3") | 90 | val cat_15=listOf("c15_1","c15_2","c15_3") |
92 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 91 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
93 | 92 | ||
94 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 93 | + val cat_list=mutableListOf<String>() |
95 | - //var policy_string="" | 94 | + cat_list.addAll(cat_1) |
96 | - | 95 | + cat_list.addAll(cat_2) |
97 | - var user_cat_1 = mutableListOf("c1_1") | 96 | + cat_list.addAll(cat_3) |
98 | - var user_cat_2 = mutableListOf("c2_1") | 97 | + cat_list.addAll(cat_4) |
99 | - var user_cat_3 = mutableListOf("c3_1") | 98 | + cat_list.addAll(cat_5) |
100 | - var user_cat_4 = mutableListOf("c4_1") | 99 | + cat_list.addAll(cat_6) |
101 | - var user_cat_5 = mutableListOf("c5_1") | 100 | + cat_list.addAll(cat_7) |
102 | - var user_cat_6 = mutableListOf("c6_1") | 101 | + cat_list.addAll(cat_8) |
103 | - var user_cat_7 = mutableListOf("c7_1") | 102 | + cat_list.addAll(cat_9) |
104 | - var user_cat_8 = mutableListOf("c8_1") | 103 | + cat_list.addAll(cat_10) |
105 | - var user_cat_9 = mutableListOf("c9_1") | 104 | + cat_list.addAll(cat_11) |
106 | - var user_cat_10 = mutableListOf("c10_1") | 105 | + cat_list.addAll(cat_12) |
107 | - var user_cat_11 = mutableListOf("c11_1") | 106 | + cat_list.addAll(cat_13) |
108 | - var user_cat_12 = mutableListOf("c12_1") | 107 | + cat_list.addAll(cat_14) |
109 | - var user_cat_13 = mutableListOf("c13_1") | 108 | + cat_list.addAll(cat_15) |
110 | - var user_cat_14 = mutableListOf("c14_1") | 109 | + cat_list.addAll(cat_16) |
111 | - var user_cat_15 = mutableListOf("c15_1") | 110 | + |
112 | - var user_cat_16 = mutableListOf("c16_1") | 111 | + var user_topic="" |
113 | - | 112 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
114 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 113 | + |
115 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 114 | + if(prof.getString("existing_topic","none")!=user_topic){ |
116 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 115 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
117 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 116 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
118 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 117 | + if (!task.isSuccessful) { } // 성공 |
119 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
120 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
121 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
122 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
123 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
124 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
125 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
126 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
127 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
128 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
129 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
130 | - | ||
131 | - var topic = "" | ||
132 | - var user_topic = "" | ||
133 | - | ||
134 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
135 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
136 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
137 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
138 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
139 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
140 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
141 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
142 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
143 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
144 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
145 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
146 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
147 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
148 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
149 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
150 | - | ||
151 | - | ||
152 | - for(c1 in user_cat_1) { | ||
153 | - topic += c1 | ||
154 | - for (c2 in user_cat_2) { | ||
155 | - topic += c2 | ||
156 | - for (c3 in user_cat_3) { | ||
157 | - topic += c3 | ||
158 | - for (c4 in user_cat_4) { | ||
159 | - topic += c4 | ||
160 | - for (c5 in user_cat_5) { | ||
161 | - topic += c5 | ||
162 | - for (c6 in user_cat_6) { | ||
163 | - topic += c6 | ||
164 | - for (c7 in user_cat_7) { | ||
165 | - topic += c7 | ||
166 | - for (c8 in user_cat_8) { | ||
167 | - topic += c8 | ||
168 | - for (c9 in user_cat_9) { | ||
169 | - topic += c9 | ||
170 | - for (c10 in user_cat_10) { | ||
171 | - topic += c10 | ||
172 | - for (c11 in user_cat_11) { | ||
173 | - topic += c11 | ||
174 | - for (c12 in user_cat_12) { | ||
175 | - topic += c12 | ||
176 | - for (c13 in user_cat_13) { | ||
177 | - topic += c13 | ||
178 | - for (c14 in user_cat_14) { | ||
179 | - topic += c14 | ||
180 | - for (c15 in user_cat_15) { | ||
181 | - topic += c15 | ||
182 | - for (c16 in user_cat_16) { | ||
183 | - topic += c16 | ||
184 | - user_topic += (topic + "/") | ||
185 | - // debug | ||
186 | - // Log.d("topic : ", topic) | ||
187 | - | ||
188 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
189 | - if (!task.isSuccessful) { } // 성공 | ||
190 | - } | ||
191 | - /* topic 구독 코드 | ||
192 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
193 | - if (!task.isSuccessful) { } // 성공 | ||
194 | - } | ||
195 | - */ | ||
196 | - | ||
197 | - topic = topic.substring(0, topic.length - c16.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c15.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c14.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c13.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c12.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c11.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c10.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c9.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c8.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c7.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c6.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c5.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c4.length) | ||
222 | - } | ||
223 | - topic = topic.substring(0, topic.length - c3.length) | ||
224 | - } | ||
225 | - topic = topic.substring(0, topic.length - c2.length) | ||
226 | } | 118 | } |
227 | - topic = topic.substring(0, topic.length-c1.length) | 119 | + writeNewUser(user_topic) // db에 쓰기 |
228 | - } | 120 | + editor.putString("existing_topic",user_topic) |
229 | - | 121 | + editor.commit() |
230 | - //Log.d("re:", user_topic) | 122 | + }else{ |
231 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
232 | - | ||
233 | 123 | ||
124 | + } | ||
234 | var intent = Intent(this, SignInActivity::class.java) | 125 | var intent = Intent(this, SignInActivity::class.java) |
235 | startActivity(intent) | 126 | startActivity(intent) |
236 | } | 127 | } |
... | @@ -268,28 +159,28 @@ class InputProfilThirdFourActivity : AppCompatActivity() { | ... | @@ -268,28 +159,28 @@ class InputProfilThirdFourActivity : AppCompatActivity() { |
268 | if(yesButton.isChecked){ | 159 | if(yesButton.isChecked){ |
269 | editor.putInt("c8_2",1); editor.commit() | 160 | editor.putInt("c8_2",1); editor.commit() |
270 | } | 161 | } |
271 | - if(jichaeButton.isChecked){editor.putInt("c9_2",1); editor.commit()} | 162 | + if(jichaeButton.isChecked){editor.putInt("c9_2",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
272 | - if(noebyungbyunButton.isChecked){editor.putInt("c9_3",1); editor.commit()} | 163 | + if(noebyungbyunButton.isChecked){editor.putInt("c9_3",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
273 | - if(sigaakButton.isChecked){editor.putInt("c9_4",1); editor.commit()} | 164 | + if(sigaakButton.isChecked){editor.putInt("c9_4",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
274 | - if(chungkaakButton.isChecked){editor.putInt("c9_5",1); editor.commit()} | 165 | + if(chungkaakButton.isChecked){editor.putInt("c9_5",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
275 | - if(unuhButton.isChecked){editor.putInt("c9_6",1); editor.commit()} | 166 | + if(unuhButton.isChecked){editor.putInt("c9_6",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
276 | - if(ahnmyunButton.isChecked){editor.putInt("c9_7",1); editor.commit()} | 167 | + if(ahnmyunButton.isChecked){editor.putInt("c9_7",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
277 | - if(sinjaangButton.isChecked){editor.putInt("c9_8",1); editor.commit()} | 168 | + if(sinjaangButton.isChecked){editor.putInt("c9_8",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
278 | - if(simjaangButton.isChecked){editor.putInt("c9_9",1); editor.commit()} | 169 | + if(simjaangButton.isChecked){editor.putInt("c9_9",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
279 | - if(gaanjaangButton.isChecked){editor.putInt("c9_10",1); editor.commit()} | 170 | + if(gaanjaangButton.isChecked){editor.putInt("c9_10",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
280 | - if(jaangrooButton.isChecked){editor.putInt("c9_11",1); editor.commit()} | 171 | + if(jaangrooButton.isChecked){editor.putInt("c9_11",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
281 | - if(noejungjeungButton.isChecked){editor.putInt("c9_12",1); editor.commit()} | 172 | + if(noejungjeungButton.isChecked){editor.putInt("c9_12",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
282 | - if(hoheupkiButton.isChecked){editor.putInt("c9_13",1); editor.commit()} | 173 | + if(hoheupkiButton.isChecked){editor.putInt("c9_13",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
283 | - if(jijukButton.isChecked){editor.putInt("c9_14",1); editor.commit()} | 174 | + if(jijukButton.isChecked){editor.putInt("c9_14",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
284 | - if(japyeahButton.isChecked){editor.putInt("c9_15",1); editor.commit()} | 175 | + if(japyeahButton.isChecked){editor.putInt("c9_15",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
285 | - if(jeongshinButton.isChecked){editor.putInt("c9_16",1); editor.commit()} | 176 | + if(jeongshinButton.isChecked){editor.putInt("c9_16",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
286 | - | 177 | + |
287 | - if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit()}//DB,pref 뻑 주의 | 178 | + if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit();editor.putString("third_four","done");editor.commit()}//DB,pref 뻑 주의 |
288 | - if(imshinButton.isChecked){editor.putInt("c7_2",1); editor.commit()} | 179 | + if(imshinButton.isChecked){editor.putInt("c7_2",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
289 | - if(nanchiButton.isChecked){editor.putInt("c9_17",1); editor.commit()} | 180 | + if(nanchiButton.isChecked){editor.putInt("c9_17",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
290 | - if(oeButton.isChecked){editor.putInt("c9_18",1); editor.commit()} | 181 | + if(oeButton.isChecked){editor.putInt("c9_18",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
291 | - if(yoyaangButton.isChecked){editor.putInt("c9_19",1); editor.commit()} | 182 | + if(yoyaangButton.isChecked){editor.putInt("c9_19",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
292 | - if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit()} | 183 | + if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit();editor.putString("third_four","done");editor.commit()} |
293 | 184 | ||
294 | var intent = Intent(this, InputProfilFourthOneActivity::class.java) | 185 | var intent = Intent(this, InputProfilFourthOneActivity::class.java) |
295 | startActivity(intent) | 186 | startActivity(intent) | ... | ... |
... | @@ -20,8 +20,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_third_one.* | ... | @@ -20,8 +20,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_third_one.* |
20 | class InputProfilThirdOneActivity : AppCompatActivity() { | 20 | class InputProfilThirdOneActivity : AppCompatActivity() { |
21 | 21 | ||
22 | private val firebaseAuth = FirebaseAuth.getInstance() | 22 | private val firebaseAuth = FirebaseAuth.getInstance() |
23 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 23 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
24 | - | ||
25 | private fun sendToken(){ | 24 | private fun sendToken(){ |
26 | FirebaseInstanceId.getInstance().instanceId | 25 | FirebaseInstanceId.getInstance().instanceId |
27 | .addOnCompleteListener(OnCompleteListener { task -> | 26 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -40,15 +39,13 @@ class InputProfilThirdOneActivity : AppCompatActivity() { | ... | @@ -40,15 +39,13 @@ class InputProfilThirdOneActivity : AppCompatActivity() { |
40 | }) | 39 | }) |
41 | } | 40 | } |
42 | 41 | ||
43 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 42 | + private fun writeNewUser(Topic : String) { |
44 | - val user = User(u_token, Policy!!) | 43 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
45 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
46 | } | 44 | } |
47 | 45 | ||
48 | 46 | ||
49 | 47 | ||
50 | 48 | ||
51 | - | ||
52 | override fun onCreate(savedInstanceState: Bundle?) { | 49 | override fun onCreate(savedInstanceState: Bundle?) { |
53 | super.onCreate(savedInstanceState) | 50 | super.onCreate(savedInstanceState) |
54 | setContentView(R.layout.activity_input_profil_third_one) | 51 | setContentView(R.layout.activity_input_profil_third_one) |
... | @@ -73,6 +70,7 @@ class InputProfilThirdOneActivity : AppCompatActivity() { | ... | @@ -73,6 +70,7 @@ class InputProfilThirdOneActivity : AppCompatActivity() { |
73 | sendToken() | 70 | sendToken() |
74 | val user=firebaseAuth?.currentUser!!.uid | 71 | val user=firebaseAuth?.currentUser!!.uid |
75 | Log.d("test:", user.toString()) | 72 | Log.d("test:", user.toString()) |
73 | + | ||
76 | val cat_1=listOf("c1_1","c1_2","c1_3") | 74 | val cat_1=listOf("c1_1","c1_2","c1_3") |
77 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 75 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
78 | val cat_3=listOf("c3_1","c3_2","c3_3") | 76 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -90,146 +88,38 @@ class InputProfilThirdOneActivity : AppCompatActivity() { | ... | @@ -90,146 +88,38 @@ class InputProfilThirdOneActivity : AppCompatActivity() { |
90 | val cat_15=listOf("c15_1","c15_2","c15_3") | 88 | val cat_15=listOf("c15_1","c15_2","c15_3") |
91 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 89 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
92 | 90 | ||
93 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 91 | + val cat_list=mutableListOf<String>() |
94 | - //var policy_string="" | 92 | + cat_list.addAll(cat_1) |
95 | - | 93 | + cat_list.addAll(cat_2) |
96 | - var user_cat_1 = mutableListOf("c1_1") | 94 | + cat_list.addAll(cat_3) |
97 | - var user_cat_2 = mutableListOf("c2_1") | 95 | + cat_list.addAll(cat_4) |
98 | - var user_cat_3 = mutableListOf("c3_1") | 96 | + cat_list.addAll(cat_5) |
99 | - var user_cat_4 = mutableListOf("c4_1") | 97 | + cat_list.addAll(cat_6) |
100 | - var user_cat_5 = mutableListOf("c5_1") | 98 | + cat_list.addAll(cat_7) |
101 | - var user_cat_6 = mutableListOf("c6_1") | 99 | + cat_list.addAll(cat_8) |
102 | - var user_cat_7 = mutableListOf("c7_1") | 100 | + cat_list.addAll(cat_9) |
103 | - var user_cat_8 = mutableListOf("c8_1") | 101 | + cat_list.addAll(cat_10) |
104 | - var user_cat_9 = mutableListOf("c9_1") | 102 | + cat_list.addAll(cat_11) |
105 | - var user_cat_10 = mutableListOf("c10_1") | 103 | + cat_list.addAll(cat_12) |
106 | - var user_cat_11 = mutableListOf("c11_1") | 104 | + cat_list.addAll(cat_13) |
107 | - var user_cat_12 = mutableListOf("c12_1") | 105 | + cat_list.addAll(cat_14) |
108 | - var user_cat_13 = mutableListOf("c13_1") | 106 | + cat_list.addAll(cat_15) |
109 | - var user_cat_14 = mutableListOf("c14_1") | 107 | + cat_list.addAll(cat_16) |
110 | - var user_cat_15 = mutableListOf("c15_1") | 108 | + |
111 | - var user_cat_16 = mutableListOf("c16_1") | 109 | + var user_topic="" |
112 | - | 110 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
113 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 111 | + |
114 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 112 | + if(prof.getString("existing_topic","none")!=user_topic){ |
115 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 113 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
116 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 114 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
117 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 115 | + if (!task.isSuccessful) { } // 성공 |
118 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
119 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
120 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
121 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
122 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
123 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
124 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
125 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
126 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
127 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
128 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
129 | - | ||
130 | - var topic = "" | ||
131 | - var user_topic = "" | ||
132 | - | ||
133 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
134 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
135 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
136 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
137 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
138 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
139 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
140 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
141 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
142 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
143 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
144 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
145 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
146 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
147 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
148 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
149 | - | ||
150 | - | ||
151 | - for(c1 in user_cat_1) { | ||
152 | - topic += c1 | ||
153 | - for (c2 in user_cat_2) { | ||
154 | - topic += c2 | ||
155 | - for (c3 in user_cat_3) { | ||
156 | - topic += c3 | ||
157 | - for (c4 in user_cat_4) { | ||
158 | - topic += c4 | ||
159 | - for (c5 in user_cat_5) { | ||
160 | - topic += c5 | ||
161 | - for (c6 in user_cat_6) { | ||
162 | - topic += c6 | ||
163 | - for (c7 in user_cat_7) { | ||
164 | - topic += c7 | ||
165 | - for (c8 in user_cat_8) { | ||
166 | - topic += c8 | ||
167 | - for (c9 in user_cat_9) { | ||
168 | - topic += c9 | ||
169 | - for (c10 in user_cat_10) { | ||
170 | - topic += c10 | ||
171 | - for (c11 in user_cat_11) { | ||
172 | - topic += c11 | ||
173 | - for (c12 in user_cat_12) { | ||
174 | - topic += c12 | ||
175 | - for (c13 in user_cat_13) { | ||
176 | - topic += c13 | ||
177 | - for (c14 in user_cat_14) { | ||
178 | - topic += c14 | ||
179 | - for (c15 in user_cat_15) { | ||
180 | - topic += c15 | ||
181 | - for (c16 in user_cat_16) { | ||
182 | - topic += c16 | ||
183 | - user_topic += (topic + "/") | ||
184 | - // debug | ||
185 | - // Log.d("topic : ", topic) | ||
186 | - | ||
187 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
188 | - if (!task.isSuccessful) { } // 성공 | ||
189 | - } | ||
190 | - /* topic 구독 코드 | ||
191 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
192 | - if (!task.isSuccessful) { } // 성공 | ||
193 | - } | ||
194 | - */ | ||
195 | - | ||
196 | - topic = topic.substring(0, topic.length - c16.length) | ||
197 | - } | ||
198 | - topic = topic.substring(0, topic.length - c15.length) | ||
199 | - } | ||
200 | - topic = topic.substring(0, topic.length - c14.length) | ||
201 | - } | ||
202 | - topic = topic.substring(0, topic.length - c13.length) | ||
203 | - } | ||
204 | - topic = topic.substring(0, topic.length - c12.length) | ||
205 | - } | ||
206 | - topic = topic.substring(0, topic.length - c11.length) | ||
207 | - } | ||
208 | - topic = topic.substring(0, topic.length - c10.length) | ||
209 | - } | ||
210 | - topic = topic.substring(0, topic.length - c9.length) | ||
211 | - } | ||
212 | - topic = topic.substring(0, topic.length - c8.length) | ||
213 | - } | ||
214 | - topic = topic.substring(0, topic.length - c7.length) | ||
215 | - } | ||
216 | - topic = topic.substring(0, topic.length - c6.length) | ||
217 | - } | ||
218 | - topic = topic.substring(0, topic.length - c5.length) | ||
219 | - } | ||
220 | - topic = topic.substring(0, topic.length - c4.length) | ||
221 | - } | ||
222 | - topic = topic.substring(0, topic.length - c3.length) | ||
223 | - } | ||
224 | - topic = topic.substring(0, topic.length - c2.length) | ||
225 | } | 116 | } |
226 | - topic = topic.substring(0, topic.length-c1.length) | 117 | + writeNewUser(user_topic) // db에 쓰기 |
227 | - } | 118 | + editor.putString("existing_topic",user_topic) |
228 | - | 119 | + editor.commit() |
229 | - //Log.d("re:", user_topic) | 120 | + }else{ |
230 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
231 | - | ||
232 | 121 | ||
122 | + } | ||
233 | var intent = Intent(this, SignInActivity::class.java) | 123 | var intent = Intent(this, SignInActivity::class.java) |
234 | startActivity(intent) | 124 | startActivity(intent) |
235 | } | 125 | } |
... | @@ -322,17 +212,17 @@ class InputProfilThirdOneActivity : AppCompatActivity() { | ... | @@ -322,17 +212,17 @@ class InputProfilThirdOneActivity : AppCompatActivity() { |
322 | 212 | ||
323 | nextButton.setOnClickListener { | 213 | nextButton.setOnClickListener { |
324 | if(elementaryButton.isChecked){ | 214 | if(elementaryButton.isChecked){ |
325 | - editor.putInt("c6_2",1); editor.commit() | 215 | + editor.putInt("c6_2",1); editor.commit();editor.putString("third_one","done");editor.commit() |
326 | }else if(middleButton.isChecked){ | 216 | }else if(middleButton.isChecked){ |
327 | - editor.putInt("c6_3",1); editor.commit() | 217 | + editor.putInt("c6_3",1); editor.commit();editor.putString("third_one","done");editor.commit() |
328 | }else if(highButton.isChecked){ | 218 | }else if(highButton.isChecked){ |
329 | - editor.putInt("c6_4",1); editor.commit() | 219 | + editor.putInt("c6_4",1); editor.commit();editor.putString("third_one","done");editor.commit() |
330 | }else if(universityButton.isChecked){ | 220 | }else if(universityButton.isChecked){ |
331 | - editor.putInt("c6_5",1); editor.commit() | 221 | + editor.putInt("c6_5",1); editor.commit();editor.putString("third_one","done");editor.commit() |
332 | }else if(graduateButton.isChecked){ | 222 | }else if(graduateButton.isChecked){ |
333 | - editor.putInt("c6_6",1); editor.commit() | 223 | + editor.putInt("c6_6",1); editor.commit();editor.putString("third_one","done");editor.commit() |
334 | }else if(nothingButton.isChecked){ | 224 | }else if(nothingButton.isChecked){ |
335 | - editor.putInt("c6_7",1); editor.commit() | 225 | + editor.putInt("c6_7",1); editor.commit();editor.putString("third_one","done");editor.commit() |
336 | }else{ | 226 | }else{ |
337 | 227 | ||
338 | } | 228 | } | ... | ... |
... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_third_three.* | ... | @@ -19,8 +19,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_third_three.* |
19 | class InputProfilThirdThreeActivity : AppCompatActivity() { | 19 | class InputProfilThirdThreeActivity : AppCompatActivity() { |
20 | 20 | ||
21 | private val firebaseAuth = FirebaseAuth.getInstance() | 21 | private val firebaseAuth = FirebaseAuth.getInstance() |
22 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 22 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
23 | - | ||
24 | private fun sendToken(){ | 23 | private fun sendToken(){ |
25 | FirebaseInstanceId.getInstance().instanceId | 24 | FirebaseInstanceId.getInstance().instanceId |
26 | .addOnCompleteListener(OnCompleteListener { task -> | 25 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -39,9 +38,8 @@ class InputProfilThirdThreeActivity : AppCompatActivity() { | ... | @@ -39,9 +38,8 @@ class InputProfilThirdThreeActivity : AppCompatActivity() { |
39 | }) | 38 | }) |
40 | } | 39 | } |
41 | 40 | ||
42 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 41 | + private fun writeNewUser(Topic : String) { |
43 | - val user = User(u_token, Policy!!) | 42 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
44 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
45 | } | 43 | } |
46 | 44 | ||
47 | 45 | ||
... | @@ -71,6 +69,7 @@ class InputProfilThirdThreeActivity : AppCompatActivity() { | ... | @@ -71,6 +69,7 @@ class InputProfilThirdThreeActivity : AppCompatActivity() { |
71 | sendToken() | 69 | sendToken() |
72 | val user=firebaseAuth?.currentUser!!.uid | 70 | val user=firebaseAuth?.currentUser!!.uid |
73 | Log.d("test:", user.toString()) | 71 | Log.d("test:", user.toString()) |
72 | + | ||
74 | val cat_1=listOf("c1_1","c1_2","c1_3") | 73 | val cat_1=listOf("c1_1","c1_2","c1_3") |
75 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 74 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
76 | val cat_3=listOf("c3_1","c3_2","c3_3") | 75 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -88,146 +87,38 @@ class InputProfilThirdThreeActivity : AppCompatActivity() { | ... | @@ -88,146 +87,38 @@ class InputProfilThirdThreeActivity : AppCompatActivity() { |
88 | val cat_15=listOf("c15_1","c15_2","c15_3") | 87 | val cat_15=listOf("c15_1","c15_2","c15_3") |
89 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 88 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
90 | 89 | ||
91 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 90 | + val cat_list=mutableListOf<String>() |
92 | - //var policy_string="" | 91 | + cat_list.addAll(cat_1) |
93 | - | 92 | + cat_list.addAll(cat_2) |
94 | - var user_cat_1 = mutableListOf("c1_1") | 93 | + cat_list.addAll(cat_3) |
95 | - var user_cat_2 = mutableListOf("c2_1") | 94 | + cat_list.addAll(cat_4) |
96 | - var user_cat_3 = mutableListOf("c3_1") | 95 | + cat_list.addAll(cat_5) |
97 | - var user_cat_4 = mutableListOf("c4_1") | 96 | + cat_list.addAll(cat_6) |
98 | - var user_cat_5 = mutableListOf("c5_1") | 97 | + cat_list.addAll(cat_7) |
99 | - var user_cat_6 = mutableListOf("c6_1") | 98 | + cat_list.addAll(cat_8) |
100 | - var user_cat_7 = mutableListOf("c7_1") | 99 | + cat_list.addAll(cat_9) |
101 | - var user_cat_8 = mutableListOf("c8_1") | 100 | + cat_list.addAll(cat_10) |
102 | - var user_cat_9 = mutableListOf("c9_1") | 101 | + cat_list.addAll(cat_11) |
103 | - var user_cat_10 = mutableListOf("c10_1") | 102 | + cat_list.addAll(cat_12) |
104 | - var user_cat_11 = mutableListOf("c11_1") | 103 | + cat_list.addAll(cat_13) |
105 | - var user_cat_12 = mutableListOf("c12_1") | 104 | + cat_list.addAll(cat_14) |
106 | - var user_cat_13 = mutableListOf("c13_1") | 105 | + cat_list.addAll(cat_15) |
107 | - var user_cat_14 = mutableListOf("c14_1") | 106 | + cat_list.addAll(cat_16) |
108 | - var user_cat_15 = mutableListOf("c15_1") | 107 | + |
109 | - var user_cat_16 = mutableListOf("c16_1") | 108 | + var user_topic="" |
110 | - | 109 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
111 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 110 | + |
112 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 111 | + if(prof.getString("existing_topic","none")!=user_topic){ |
113 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 112 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
114 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 113 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
115 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 114 | + if (!task.isSuccessful) { } // 성공 |
116 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
117 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
118 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
119 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
120 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
121 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
122 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
123 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
124 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
125 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
126 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
127 | - | ||
128 | - var topic = "" | ||
129 | - var user_topic = "" | ||
130 | - | ||
131 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
132 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
133 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
134 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
135 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
136 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
137 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
138 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
139 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
140 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
141 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
142 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
143 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
144 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
145 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
146 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
147 | - | ||
148 | - | ||
149 | - for(c1 in user_cat_1) { | ||
150 | - topic += c1 | ||
151 | - for (c2 in user_cat_2) { | ||
152 | - topic += c2 | ||
153 | - for (c3 in user_cat_3) { | ||
154 | - topic += c3 | ||
155 | - for (c4 in user_cat_4) { | ||
156 | - topic += c4 | ||
157 | - for (c5 in user_cat_5) { | ||
158 | - topic += c5 | ||
159 | - for (c6 in user_cat_6) { | ||
160 | - topic += c6 | ||
161 | - for (c7 in user_cat_7) { | ||
162 | - topic += c7 | ||
163 | - for (c8 in user_cat_8) { | ||
164 | - topic += c8 | ||
165 | - for (c9 in user_cat_9) { | ||
166 | - topic += c9 | ||
167 | - for (c10 in user_cat_10) { | ||
168 | - topic += c10 | ||
169 | - for (c11 in user_cat_11) { | ||
170 | - topic += c11 | ||
171 | - for (c12 in user_cat_12) { | ||
172 | - topic += c12 | ||
173 | - for (c13 in user_cat_13) { | ||
174 | - topic += c13 | ||
175 | - for (c14 in user_cat_14) { | ||
176 | - topic += c14 | ||
177 | - for (c15 in user_cat_15) { | ||
178 | - topic += c15 | ||
179 | - for (c16 in user_cat_16) { | ||
180 | - topic += c16 | ||
181 | - user_topic += (topic + "/") | ||
182 | - // debug | ||
183 | - // Log.d("topic : ", topic) | ||
184 | - | ||
185 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
186 | - if (!task.isSuccessful) { } // 성공 | ||
187 | - } | ||
188 | - /* topic 구독 코드 | ||
189 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
190 | - if (!task.isSuccessful) { } // 성공 | ||
191 | - } | ||
192 | - */ | ||
193 | - | ||
194 | - topic = topic.substring(0, topic.length - c16.length) | ||
195 | - } | ||
196 | - topic = topic.substring(0, topic.length - c15.length) | ||
197 | - } | ||
198 | - topic = topic.substring(0, topic.length - c14.length) | ||
199 | - } | ||
200 | - topic = topic.substring(0, topic.length - c13.length) | ||
201 | - } | ||
202 | - topic = topic.substring(0, topic.length - c12.length) | ||
203 | - } | ||
204 | - topic = topic.substring(0, topic.length - c11.length) | ||
205 | - } | ||
206 | - topic = topic.substring(0, topic.length - c10.length) | ||
207 | - } | ||
208 | - topic = topic.substring(0, topic.length - c9.length) | ||
209 | - } | ||
210 | - topic = topic.substring(0, topic.length - c8.length) | ||
211 | - } | ||
212 | - topic = topic.substring(0, topic.length - c7.length) | ||
213 | - } | ||
214 | - topic = topic.substring(0, topic.length - c6.length) | ||
215 | - } | ||
216 | - topic = topic.substring(0, topic.length - c5.length) | ||
217 | - } | ||
218 | - topic = topic.substring(0, topic.length - c4.length) | ||
219 | - } | ||
220 | - topic = topic.substring(0, topic.length - c3.length) | ||
221 | - } | ||
222 | - topic = topic.substring(0, topic.length - c2.length) | ||
223 | } | 115 | } |
224 | - topic = topic.substring(0, topic.length-c1.length) | 116 | + writeNewUser(user_topic) // db에 쓰기 |
225 | - } | 117 | + editor.putString("existing_topic",user_topic) |
226 | - | 118 | + editor.commit() |
227 | - //Log.d("re:", user_topic) | 119 | + }else{ |
228 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
229 | - | ||
230 | 120 | ||
121 | + } | ||
231 | var intent = Intent(this, SignInActivity::class.java) | 122 | var intent = Intent(this, SignInActivity::class.java) |
232 | startActivity(intent) | 123 | startActivity(intent) |
233 | } | 124 | } |
... | @@ -255,10 +146,6 @@ class InputProfilThirdThreeActivity : AppCompatActivity() { | ... | @@ -255,10 +146,6 @@ class InputProfilThirdThreeActivity : AppCompatActivity() { |
255 | .show() | 146 | .show() |
256 | } | 147 | } |
257 | 148 | ||
258 | - skipButton.setOnClickListener { | ||
259 | - var intent = Intent(this, InputProfilSecondOneActivity::class.java) | ||
260 | - startActivity(intent) | ||
261 | - } | ||
262 | 149 | ||
263 | previousButton.setOnClickListener { | 150 | previousButton.setOnClickListener { |
264 | var intent = Intent(this, InputProfilThirdTwoActivity::class.java) | 151 | var intent = Intent(this, InputProfilThirdTwoActivity::class.java) |
... | @@ -266,16 +153,16 @@ class InputProfilThirdThreeActivity : AppCompatActivity() { | ... | @@ -266,16 +153,16 @@ class InputProfilThirdThreeActivity : AppCompatActivity() { |
266 | } | 153 | } |
267 | 154 | ||
268 | nextButton.setOnClickListener { | 155 | nextButton.setOnClickListener { |
269 | - if(nothingButton.isChecked){ editor.putInt("c4_11",1); editor.commit()} | 156 | + if(nothingButton.isChecked){ editor.putInt("c4_11",1); editor.commit();editor.putString("third_three","done");editor.commit()} |
270 | - if(mipilButton.isChecked){ editor.putInt("c4_2",1); editor.commit()} | 157 | + if(mipilButton.isChecked){ editor.putInt("c4_2",1); editor.commit();editor.putString("third_three","done");editor.commit()} |
271 | - if(myunjaeButton.isChecked){ editor.putInt("c4_3",1); editor.commit()} | 158 | + if(myunjaeButton.isChecked){ editor.putInt("c4_3",1); editor.commit();editor.putString("third_three","done");editor.commit()} |
272 | - if(jobsoldierButton.isChecked){ editor.putInt("c4_4",1); editor.commit()} | 159 | + if(jobsoldierButton.isChecked){ editor.putInt("c4_4",1); editor.commit();editor.putString("third_three","done");editor.commit()} |
273 | - if(bokmoojoongButton.isChecked){ editor.putInt("c4_5",1); editor.commit()} | 160 | + if(bokmoojoongButton.isChecked){ editor.putInt("c4_5",1); editor.commit();editor.putString("third_three","done");editor.commit()} |
274 | - if(mangijedaeButton.isChecked){ editor.putInt("c4_6",1); editor.commit()} | 161 | + if(mangijedaeButton.isChecked){ editor.putInt("c4_6",1); editor.commit();editor.putString("third_three","done");editor.commit()} |
275 | - if(specialmanryoButton.isChecked){ editor.putInt("c4_7",1); editor.commit()} | 162 | + if(specialmanryoButton.isChecked){ editor.putInt("c4_7",1); editor.commit();editor.putString("third_three","done");editor.commit()} |
276 | - if(specialbokmoosanupButton.isChecked){ editor.putInt("c4_8",1); editor.commit()} | 163 | + if(specialbokmoosanupButton.isChecked){ editor.putInt("c4_8",1); editor.commit();editor.putString("third_three","done");editor.commit()} |
277 | - if(specialbokmoojeonmoonButton.isChecked){ editor.putInt("c4_9",1); editor.commit()} | 164 | + if(specialbokmoojeonmoonButton.isChecked){ editor.putInt("c4_9",1); editor.commit();editor.putString("third_three","done");editor.commit()} |
278 | - if(jedaeguitarButton.isChecked){ editor.putInt("c4_10",1); editor.commit()} | 165 | + if(jedaeguitarButton.isChecked){ editor.putInt("c4_10",1); editor.commit();editor.putString("third_three","done");editor.commit()} |
279 | 166 | ||
280 | var intent = Intent(this, InputProfilThirdFourActivity::class.java) | 167 | var intent = Intent(this, InputProfilThirdFourActivity::class.java) |
281 | startActivity(intent) | 168 | startActivity(intent) | ... | ... |
... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_third_two.* | ... | @@ -21,8 +21,7 @@ import kotlinx.android.synthetic.main.activity_input_profil_third_two.* |
21 | class InputProfilThirdTwoActivity : AppCompatActivity() { | 21 | class InputProfilThirdTwoActivity : AppCompatActivity() { |
22 | 22 | ||
23 | private val firebaseAuth = FirebaseAuth.getInstance() | 23 | private val firebaseAuth = FirebaseAuth.getInstance() |
24 | - val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference | 24 | + val user_db = FirebaseDatabase.getInstance("https://wello-topic.firebaseio.com/").reference |
25 | - | ||
26 | private fun sendToken(){ | 25 | private fun sendToken(){ |
27 | FirebaseInstanceId.getInstance().instanceId | 26 | FirebaseInstanceId.getInstance().instanceId |
28 | .addOnCompleteListener(OnCompleteListener { task -> | 27 | .addOnCompleteListener(OnCompleteListener { task -> |
... | @@ -41,9 +40,8 @@ class InputProfilThirdTwoActivity : AppCompatActivity() { | ... | @@ -41,9 +40,8 @@ class InputProfilThirdTwoActivity : AppCompatActivity() { |
41 | }) | 40 | }) |
42 | } | 41 | } |
43 | 42 | ||
44 | - private fun writeNewUser(u_id: String, u_token: String, Policy: String?) { | 43 | + private fun writeNewUser(Topic : String) { |
45 | - val user = User(u_token, Policy!!) | 44 | + user_db.child(Topic).setValue(1)/// .setValue(user) |
46 | - user_db.child(u_id).setValue(user)/// .setValue(user) | ||
47 | } | 45 | } |
48 | 46 | ||
49 | 47 | ||
... | @@ -74,6 +72,7 @@ class InputProfilThirdTwoActivity : AppCompatActivity() { | ... | @@ -74,6 +72,7 @@ class InputProfilThirdTwoActivity : AppCompatActivity() { |
74 | sendToken() | 72 | sendToken() |
75 | val user=firebaseAuth?.currentUser!!.uid | 73 | val user=firebaseAuth?.currentUser!!.uid |
76 | Log.d("test:", user.toString()) | 74 | Log.d("test:", user.toString()) |
75 | + | ||
77 | val cat_1=listOf("c1_1","c1_2","c1_3") | 76 | val cat_1=listOf("c1_1","c1_2","c1_3") |
78 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") | 77 | val cat_2=listOf("c2_1","c2_2","c2_3","c2_4","c2_5","c2_6","c2_7") |
79 | val cat_3=listOf("c3_1","c3_2","c3_3") | 78 | val cat_3=listOf("c3_1","c3_2","c3_3") |
... | @@ -91,146 +90,38 @@ class InputProfilThirdTwoActivity : AppCompatActivity() { | ... | @@ -91,146 +90,38 @@ class InputProfilThirdTwoActivity : AppCompatActivity() { |
91 | val cat_15=listOf("c15_1","c15_2","c15_3") | 90 | val cat_15=listOf("c15_1","c15_2","c15_3") |
92 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") | 91 | val cat_16=listOf("c16_1","c16_2","c16_3","c16_4","c16_5","c16_6","c16_7") |
93 | 92 | ||
94 | - //val policy_string_list= listOf("c1_1c2_1c3_1c4_1c5_1c6_1c7_1c8_1c9_1c10_1c11_1c12_1c13_1c14_1c15_1c16_1") | 93 | + val cat_list=mutableListOf<String>() |
95 | - //var policy_string="" | 94 | + cat_list.addAll(cat_1) |
96 | - | 95 | + cat_list.addAll(cat_2) |
97 | - var user_cat_1 = mutableListOf("c1_1") | 96 | + cat_list.addAll(cat_3) |
98 | - var user_cat_2 = mutableListOf("c2_1") | 97 | + cat_list.addAll(cat_4) |
99 | - var user_cat_3 = mutableListOf("c3_1") | 98 | + cat_list.addAll(cat_5) |
100 | - var user_cat_4 = mutableListOf("c4_1") | 99 | + cat_list.addAll(cat_6) |
101 | - var user_cat_5 = mutableListOf("c5_1") | 100 | + cat_list.addAll(cat_7) |
102 | - var user_cat_6 = mutableListOf("c6_1") | 101 | + cat_list.addAll(cat_8) |
103 | - var user_cat_7 = mutableListOf("c7_1") | 102 | + cat_list.addAll(cat_9) |
104 | - var user_cat_8 = mutableListOf("c8_1") | 103 | + cat_list.addAll(cat_10) |
105 | - var user_cat_9 = mutableListOf("c9_1") | 104 | + cat_list.addAll(cat_11) |
106 | - var user_cat_10 = mutableListOf("c10_1") | 105 | + cat_list.addAll(cat_12) |
107 | - var user_cat_11 = mutableListOf("c11_1") | 106 | + cat_list.addAll(cat_13) |
108 | - var user_cat_12 = mutableListOf("c12_1") | 107 | + cat_list.addAll(cat_14) |
109 | - var user_cat_13 = mutableListOf("c13_1") | 108 | + cat_list.addAll(cat_15) |
110 | - var user_cat_14 = mutableListOf("c14_1") | 109 | + cat_list.addAll(cat_16) |
111 | - var user_cat_15 = mutableListOf("c15_1") | 110 | + |
112 | - var user_cat_16 = mutableListOf("c16_1") | 111 | + var user_topic="" |
113 | - | 112 | + for(item in cat_list){if(prof.getInt(item,3)==1){user_topic=user_topic+item}} |
114 | - for(item in cat_1){if(prof.getInt(item,3)==1){user_cat_1.add(item)}} | 113 | + |
115 | - for(item in cat_2){if(prof.getInt(item,3)==1){user_cat_2.add(item)}} | 114 | + if(prof.getString("existing_topic","none")!=user_topic){ |
116 | - for(item in cat_3){if(prof.getInt(item,3)==1){user_cat_3.add(item)}} | 115 | + FirebaseMessaging.getInstance().unsubscribeFromTopic(prof.getString("existing_topic","none").toString()) |
117 | - for(item in cat_4){if(prof.getInt(item,3)==1){user_cat_4.add(item)}} | 116 | + FirebaseMessaging.getInstance().subscribeToTopic(user_topic).addOnCompleteListener { task -> |
118 | - for(item in cat_5){if(prof.getInt(item,3)==1){user_cat_5.add(item)}} | 117 | + if (!task.isSuccessful) { } // 성공 |
119 | - for(item in cat_6){if(prof.getInt(item,3)==1){user_cat_6.add(item)}} | ||
120 | - for(item in cat_7){if(prof.getInt(item,3)==1){user_cat_7.add(item)}} | ||
121 | - for(item in cat_8){if(prof.getInt(item,3)==1){user_cat_8.add(item)}} | ||
122 | - for(item in cat_9){if(prof.getInt(item,3)==1){user_cat_9.add(item)}} | ||
123 | - for(item in cat_10){if(prof.getInt(item,3)==1){user_cat_10.add(item)}} | ||
124 | - for(item in cat_11){if(prof.getInt(item,3)==1){user_cat_11.add(item)}} | ||
125 | - for(item in cat_12){if(prof.getInt(item,3)==1){user_cat_12.add(item)}} | ||
126 | - for(item in cat_13){if(prof.getInt(item,3)==1){user_cat_13.add(item)}} | ||
127 | - for(item in cat_14){if(prof.getInt(item,3)==1){user_cat_14.add(item)}} | ||
128 | - for(item in cat_15){if(prof.getInt(item,3)==1){user_cat_15.add(item)}} | ||
129 | - for(item in cat_16){if(prof.getInt(item,3)==1){user_cat_16.add(item)}} | ||
130 | - | ||
131 | - var topic = "" | ||
132 | - var user_topic = "" | ||
133 | - | ||
134 | - Log.d("hell gate1 : ", user_cat_1.toString()) | ||
135 | - Log.d("hell gate2 : ", user_cat_2.toString()) | ||
136 | - Log.d("hell gate3 : ", user_cat_3.toString()) | ||
137 | - Log.d("hell gate4 : ", user_cat_4.toString()) | ||
138 | - Log.d("hell gate5 : ", user_cat_5.toString()) | ||
139 | - Log.d("hell gate6 : ", user_cat_6.toString()) | ||
140 | - Log.d("hell gate7 : ", user_cat_7.toString()) | ||
141 | - Log.d("hell gate8 : ", user_cat_8.toString()) | ||
142 | - Log.d("hell gate9 : ", user_cat_9.toString()) | ||
143 | - Log.d("hell gate10 : ", user_cat_10.toString()) | ||
144 | - Log.d("hell gate11 : ", user_cat_11.toString()) | ||
145 | - Log.d("hell gate12 : ", user_cat_12.toString()) | ||
146 | - Log.d("hell gate13 : ", user_cat_13.toString()) | ||
147 | - Log.d("hell gate14 : ", user_cat_14.toString()) | ||
148 | - Log.d("hell gate15 : ", user_cat_15.toString()) | ||
149 | - Log.d("hell gate16 : ", user_cat_16.toString()) | ||
150 | - | ||
151 | - | ||
152 | - for(c1 in user_cat_1) { | ||
153 | - topic += c1 | ||
154 | - for (c2 in user_cat_2) { | ||
155 | - topic += c2 | ||
156 | - for (c3 in user_cat_3) { | ||
157 | - topic += c3 | ||
158 | - for (c4 in user_cat_4) { | ||
159 | - topic += c4 | ||
160 | - for (c5 in user_cat_5) { | ||
161 | - topic += c5 | ||
162 | - for (c6 in user_cat_6) { | ||
163 | - topic += c6 | ||
164 | - for (c7 in user_cat_7) { | ||
165 | - topic += c7 | ||
166 | - for (c8 in user_cat_8) { | ||
167 | - topic += c8 | ||
168 | - for (c9 in user_cat_9) { | ||
169 | - topic += c9 | ||
170 | - for (c10 in user_cat_10) { | ||
171 | - topic += c10 | ||
172 | - for (c11 in user_cat_11) { | ||
173 | - topic += c11 | ||
174 | - for (c12 in user_cat_12) { | ||
175 | - topic += c12 | ||
176 | - for (c13 in user_cat_13) { | ||
177 | - topic += c13 | ||
178 | - for (c14 in user_cat_14) { | ||
179 | - topic += c14 | ||
180 | - for (c15 in user_cat_15) { | ||
181 | - topic += c15 | ||
182 | - for (c16 in user_cat_16) { | ||
183 | - topic += c16 | ||
184 | - user_topic += (topic + "/") | ||
185 | - // debug | ||
186 | - // Log.d("topic : ", topic) | ||
187 | - | ||
188 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
189 | - if (!task.isSuccessful) { } // 성공 | ||
190 | - } | ||
191 | - /* topic 구독 코드 | ||
192 | - FirebaseMessaging.getInstance().subscribeToTopic(topic).addOnCompleteListener { task -> | ||
193 | - if (!task.isSuccessful) { } // 성공 | ||
194 | - } | ||
195 | - */ | ||
196 | - | ||
197 | - topic = topic.substring(0, topic.length - c16.length) | ||
198 | - } | ||
199 | - topic = topic.substring(0, topic.length - c15.length) | ||
200 | - } | ||
201 | - topic = topic.substring(0, topic.length - c14.length) | ||
202 | - } | ||
203 | - topic = topic.substring(0, topic.length - c13.length) | ||
204 | - } | ||
205 | - topic = topic.substring(0, topic.length - c12.length) | ||
206 | - } | ||
207 | - topic = topic.substring(0, topic.length - c11.length) | ||
208 | - } | ||
209 | - topic = topic.substring(0, topic.length - c10.length) | ||
210 | - } | ||
211 | - topic = topic.substring(0, topic.length - c9.length) | ||
212 | - } | ||
213 | - topic = topic.substring(0, topic.length - c8.length) | ||
214 | - } | ||
215 | - topic = topic.substring(0, topic.length - c7.length) | ||
216 | - } | ||
217 | - topic = topic.substring(0, topic.length - c6.length) | ||
218 | - } | ||
219 | - topic = topic.substring(0, topic.length - c5.length) | ||
220 | - } | ||
221 | - topic = topic.substring(0, topic.length - c4.length) | ||
222 | - } | ||
223 | - topic = topic.substring(0, topic.length - c3.length) | ||
224 | - } | ||
225 | - topic = topic.substring(0, topic.length - c2.length) | ||
226 | } | 118 | } |
227 | - topic = topic.substring(0, topic.length-c1.length) | 119 | + writeNewUser(user_topic) // db에 쓰기 |
228 | - } | 120 | + editor.putString("existing_topic",user_topic) |
229 | - | 121 | + editor.commit() |
230 | - //Log.d("re:", user_topic) | 122 | + }else{ |
231 | - writeNewUser(user, "null", user_topic) // db에 쓰기 | ||
232 | - | ||
233 | 123 | ||
124 | + } | ||
234 | var intent = Intent(this, SignInActivity::class.java) | 125 | var intent = Intent(this, SignInActivity::class.java) |
235 | startActivity(intent) | 126 | startActivity(intent) |
236 | } | 127 | } |
... | @@ -258,10 +149,6 @@ class InputProfilThirdTwoActivity : AppCompatActivity() { | ... | @@ -258,10 +149,6 @@ class InputProfilThirdTwoActivity : AppCompatActivity() { |
258 | .show() | 149 | .show() |
259 | } | 150 | } |
260 | 151 | ||
261 | - skipButton.setOnClickListener { | ||
262 | - var intent = Intent(this, InputProfilSecondOneActivity::class.java) | ||
263 | - startActivity(intent) | ||
264 | - } | ||
265 | 152 | ||
266 | previousButton.setOnClickListener { | 153 | previousButton.setOnClickListener { |
267 | var intent = Intent(this, InputProfilThirdOneActivity::class.java) | 154 | var intent = Intent(this, InputProfilThirdOneActivity::class.java) |
... | @@ -269,11 +156,11 @@ class InputProfilThirdTwoActivity : AppCompatActivity() { | ... | @@ -269,11 +156,11 @@ class InputProfilThirdTwoActivity : AppCompatActivity() { |
269 | } | 156 | } |
270 | 157 | ||
271 | nextButton.setOnClickListener { | 158 | nextButton.setOnClickListener { |
272 | - if(companyButton.isChecked){ editor.putInt("c5_6",1); editor.commit()} | 159 | + if(companyButton.isChecked){ editor.putInt("c5_6",1); editor.commit();editor.putString("third_two","done");editor.commit()} |
273 | - if(workerButton.isChecked){ editor.putInt("c5_7",1); editor.commit()} | 160 | + if(workerButton.isChecked){ editor.putInt("c5_7",1); editor.commit();editor.putString("third_two","done");editor.commit()} |
274 | - if(entireButton.isChecked){ editor.putInt("c5_9",1); editor.commit()} | 161 | + if(entireButton.isChecked){ editor.putInt("c5_9",1); editor.commit();editor.putString("third_two","done");editor.commit()} |
275 | - if(startupButton.isChecked){ editor.putInt("c5_5",1); editor.commit()} | 162 | + if(startupButton.isChecked){ editor.putInt("c5_5",1); editor.commit();editor.putString("third_two","done");editor.commit()} |
276 | - if(seekButton.isChecked){ editor.putInt("c5_5",1); editor.commit()} | 163 | + if(seekButton.isChecked){ editor.putInt("c5_5",1); editor.commit();editor.putString("third_two","done");editor.commit()} |
277 | //창업예정자랑 취준생이랑 같은 카테고리 맞음???? | 164 | //창업예정자랑 취준생이랑 같은 카테고리 맞음???? |
278 | 165 | ||
279 | var intent = Intent(this, InputProfilThirdThreeActivity::class.java) | 166 | var intent = Intent(this, InputProfilThirdThreeActivity::class.java) | ... | ... |
... | @@ -31,6 +31,8 @@ class MainActivity : AppCompatActivity() { | ... | @@ -31,6 +31,8 @@ class MainActivity : AppCompatActivity() { |
31 | super.onCreate(savedInstanceState) | 31 | super.onCreate(savedInstanceState) |
32 | setContentView(R.layout.activity_main) | 32 | setContentView(R.layout.activity_main) |
33 | 33 | ||
34 | + | ||
35 | + | ||
34 | emailSigninBtn.setOnClickListener{ | 36 | emailSigninBtn.setOnClickListener{ |
35 | loginEmail() | 37 | loginEmail() |
36 | } | 38 | } |
... | @@ -49,8 +51,6 @@ class MainActivity : AppCompatActivity() { | ... | @@ -49,8 +51,6 @@ class MainActivity : AppCompatActivity() { |
49 | 51 | ||
50 | } | 52 | } |
51 | 53 | ||
52 | - | ||
53 | - | ||
54 | private fun loginEmail(){ | 54 | private fun loginEmail(){ |
55 | firebaseAuth!!.signInWithEmailAndPassword(edit_email.text.toString(), edit_password.text.toString()) | 55 | firebaseAuth!!.signInWithEmailAndPassword(edit_email.text.toString(), edit_password.text.toString()) |
56 | .addOnCompleteListener(this) { | 56 | .addOnCompleteListener(this) { |
... | @@ -59,7 +59,28 @@ class MainActivity : AppCompatActivity() { | ... | @@ -59,7 +59,28 @@ class MainActivity : AppCompatActivity() { |
59 | Toast.makeText(this, "signInWithEmail success.",Toast.LENGTH_SHORT).show() | 59 | Toast.makeText(this, "signInWithEmail success.",Toast.LENGTH_SHORT).show() |
60 | val user = firebaseAuth?.currentUser | 60 | val user = firebaseAuth?.currentUser |
61 | 61 | ||
62 | + val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE) | ||
63 | + val editor: SharedPreferences.Editor=prof.edit() | ||
64 | + | ||
65 | + | ||
62 | if (user!=null){ | 66 | if (user!=null){ |
67 | + editor.putInt("c1_1",1); editor.commit() | ||
68 | + editor.putInt("c2_1",1); editor.commit() | ||
69 | + editor.putInt("c3_1",1); editor.commit() | ||
70 | + editor.putInt("c4_1",1); editor.commit() | ||
71 | + editor.putInt("c5_1",1); editor.commit() | ||
72 | + editor.putInt("c6_1",1); editor.commit() | ||
73 | + editor.putInt("c7_1",1); editor.commit() | ||
74 | + editor.putInt("c8_1",1); editor.commit() | ||
75 | + editor.putInt("c9_1",1); editor.commit() | ||
76 | + editor.putInt("c10_1",1); editor.commit() | ||
77 | + editor.putInt("c11_1",1); editor.commit() | ||
78 | + editor.putInt("c12_1",1); editor.commit() | ||
79 | + editor.putInt("c13_1",1); editor.commit() | ||
80 | + editor.putInt("c14_1",1); editor.commit() | ||
81 | + editor.putInt("c15_1",1); editor.commit() | ||
82 | + editor.putInt("c16_1",1); editor.commit() | ||
83 | + | ||
63 | var intent = Intent(this, SignInActivity::class.java) | 84 | var intent = Intent(this, SignInActivity::class.java) |
64 | startActivity(intent) | 85 | startActivity(intent) |
65 | 86 | ... | ... |

596 Bytes
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <shape android:shape="rectangle"> | ||
4 | + <solid android:color="#29ABE2"/> | ||
5 | + | ||
6 | + <stroke android:width="0dp" | ||
7 | + android:color="#29ABE2" | ||
8 | + /> | ||
9 | + <padding android:left="0dp" | ||
10 | + android:top="0dp" | ||
11 | + android:right="0dp" | ||
12 | + android:bottom="0dp" | ||
13 | + /> | ||
14 | + | ||
15 | + <corners android:bottomRightRadius="0dp" android:bottomLeftRadius="0dp" | ||
16 | + android:topLeftRadius="0dp" android:topRightRadius="0dp"/> | ||
17 | + | ||
18 | + </shape> | ||
19 | +</selector> | ||
20 | + |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <shape android:shape="rectangle"> | ||
4 | + <solid android:color="#F4F4F4"/> | ||
5 | + | ||
6 | + <stroke android:width="0dp" | ||
7 | + android:color="#F4F4F4" | ||
8 | + /> | ||
9 | + <padding android:left="0dp" | ||
10 | + android:top="0dp" | ||
11 | + android:right="0dp" | ||
12 | + android:bottom="0dp" | ||
13 | + /> | ||
14 | + | ||
15 | + <corners android:bottomRightRadius="0dp" android:bottomLeftRadius="0dp" | ||
16 | + android:topLeftRadius="0dp" android:topRightRadius="0dp"/> | ||
17 | + </shape> | ||
18 | +</selector> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<layer-list | ||
3 | + xmlns:android="http://schemas.android.com/apk/res/android"> | ||
4 | + | ||
5 | + <item> | ||
6 | + <shape android:shape="rectangle"> | ||
7 | + <solid android:color="#F4F4F4"/> | ||
8 | + | ||
9 | + <stroke android:width="0dp" | ||
10 | + android:color="#F4F4F4" | ||
11 | + /> | ||
12 | + <padding android:left="0dp" | ||
13 | + android:top="0dp" | ||
14 | + android:right="0dp" | ||
15 | + android:bottom="0dp" | ||
16 | + /> | ||
17 | + | ||
18 | + <corners android:bottomRightRadius="0dp" android:bottomLeftRadius="0dp" | ||
19 | + android:topLeftRadius="0dp" android:topRightRadius="0dp"/> | ||
20 | + | ||
21 | + </shape> | ||
22 | + </item> | ||
23 | + | ||
24 | + <item> | ||
25 | + <shape android:shape="rectangle"> | ||
26 | + <solid android:color="#29ABE2"/> | ||
27 | + | ||
28 | + <stroke android:width="0dp" | ||
29 | + android:color="#29ABE2" | ||
30 | + /> | ||
31 | + <padding android:left="0dp" | ||
32 | + android:top="0dp" | ||
33 | + android:right="0dp" | ||
34 | + android:bottom="0dp" | ||
35 | + /> | ||
36 | + | ||
37 | + <corners android:bottomRightRadius="25dp" android:bottomLeftRadius="0dp" | ||
38 | + android:topLeftRadius="0dp" android:topRightRadius="25dp"/> | ||
39 | + | ||
40 | + </shape> | ||
41 | + </item> | ||
42 | +</layer-list> |
... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | - tools:context=".InputProfilFourthFiveActivity"> | 7 | + tools:context=".InputProfilFirstFiveActivity"> |
8 | 8 | ||
9 | <LinearLayout | 9 | <LinearLayout |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | android:layout_width="fill_parent" | 16 | android:layout_width="fill_parent" |
17 | android:layout_height="wrap_content" | 17 | android:layout_height="wrap_content" |
18 | android:layout_marginBottom="11dp" | 18 | android:layout_marginBottom="11dp" |
19 | - android:background="#FFF" | 19 | + android:background="#0000001A" |
20 | android:elevation="5dp" | 20 | android:elevation="5dp" |
21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | 21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" |
22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> | 22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> |
... | @@ -31,31 +31,35 @@ | ... | @@ -31,31 +31,35 @@ |
31 | android:layout_width="10dp" | 31 | android:layout_width="10dp" |
32 | android:layout_height="match_parent" | 32 | android:layout_height="match_parent" |
33 | android:layout_weight="1.5" | 33 | android:layout_weight="1.5" |
34 | - android:background="#FFFFFF" | 34 | + android:background="#00000000" |
35 | android:text="나가기" | 35 | android:text="나가기" |
36 | android:textColor="#29ABE2" | 36 | android:textColor="#29ABE2" |
37 | android:textSize="16dp" /> | 37 | android:textSize="16dp" /> |
38 | + | ||
38 | <LinearLayout | 39 | <LinearLayout |
39 | android:layout_width="10dp" | 40 | android:layout_width="10dp" |
40 | android:layout_height="match_parent" | 41 | android:layout_height="match_parent" |
41 | - android:orientation="horizontal" | 42 | + android:layout_weight="1" |
42 | - android:layout_weight="1"/> | 43 | + android:orientation="horizontal" /> |
44 | + | ||
43 | <ImageView | 45 | <ImageView |
44 | android:layout_width="77dp" | 46 | android:layout_width="77dp" |
45 | android:layout_height="44dp" | 47 | android:layout_height="44dp" |
46 | android:layout_gravity="center" | 48 | android:layout_gravity="center" |
47 | android:layout_weight="1" | 49 | android:layout_weight="1" |
48 | android:src="@drawable/toolbar_logo" /> | 50 | android:src="@drawable/toolbar_logo" /> |
51 | + | ||
49 | <LinearLayout | 52 | <LinearLayout |
50 | android:layout_width="10dp" | 53 | android:layout_width="10dp" |
51 | android:layout_height="match_parent" | 54 | android:layout_height="match_parent" |
52 | - android:orientation="horizontal" | 55 | + android:layout_weight="1" |
53 | - android:layout_weight="1"/> | 56 | + android:orientation="horizontal" /> |
57 | + | ||
54 | <LinearLayout | 58 | <LinearLayout |
55 | android:layout_width="10dp" | 59 | android:layout_width="10dp" |
56 | android:layout_height="match_parent" | 60 | android:layout_height="match_parent" |
57 | - android:orientation="horizontal" | 61 | + android:layout_weight="1.5" |
58 | - android:layout_weight="1.5"/> | 62 | + android:orientation="horizontal" /> |
59 | 63 | ||
60 | </LinearLayout> | 64 | </LinearLayout> |
61 | 65 | ||
... | @@ -74,9 +78,10 @@ | ... | @@ -74,9 +78,10 @@ |
74 | android:layout_height="match_parent" | 78 | android:layout_height="match_parent" |
75 | android:layout_gravity="center" | 79 | android:layout_gravity="center" |
76 | android:layout_weight="1" | 80 | android:layout_weight="1" |
77 | - android:background="#1E90FF" | 81 | + android:background="@drawable/profile_stage" |
78 | android:gravity="center" | 82 | android:gravity="center" |
79 | - android:text="1" /> | 83 | + android:text="1" |
84 | + android:textColor="#FFFFFF" /> | ||
80 | 85 | ||
81 | <TextView | 86 | <TextView |
82 | android:id="@+id/stageTextView2" | 87 | android:id="@+id/stageTextView2" |
... | @@ -84,9 +89,10 @@ | ... | @@ -84,9 +89,10 @@ |
84 | android:layout_height="match_parent" | 89 | android:layout_height="match_parent" |
85 | android:layout_gravity="center" | 90 | android:layout_gravity="center" |
86 | android:layout_weight="1" | 91 | android:layout_weight="1" |
87 | - android:background="#1E90FF" | 92 | + android:background="#F4F4F4" |
88 | android:gravity="center" | 93 | android:gravity="center" |
89 | - android:text="2" /> | 94 | + android:text="2" |
95 | + android:textColor="#DDDDDD" /> | ||
90 | 96 | ||
91 | <TextView | 97 | <TextView |
92 | android:id="@+id/stageTextView3" | 98 | android:id="@+id/stageTextView3" |
... | @@ -94,9 +100,10 @@ | ... | @@ -94,9 +100,10 @@ |
94 | android:layout_height="match_parent" | 100 | android:layout_height="match_parent" |
95 | android:layout_gravity="center" | 101 | android:layout_gravity="center" |
96 | android:layout_weight="1" | 102 | android:layout_weight="1" |
97 | - android:background="#1E90FF" | 103 | + android:background="#F4F4F4" |
98 | android:gravity="center" | 104 | android:gravity="center" |
99 | - android:text="3" /> | 105 | + android:text="3" |
106 | + android:textColor="#DDDDDD" /> | ||
100 | 107 | ||
101 | <TextView | 108 | <TextView |
102 | android:id="@+id/stageTextView4" | 109 | android:id="@+id/stageTextView4" |
... | @@ -104,9 +111,10 @@ | ... | @@ -104,9 +111,10 @@ |
104 | android:layout_height="match_parent" | 111 | android:layout_height="match_parent" |
105 | android:layout_gravity="center" | 112 | android:layout_gravity="center" |
106 | android:layout_weight="1" | 113 | android:layout_weight="1" |
107 | - android:background="#1E90FF" | 114 | + android:background="#F4F4F4" |
108 | android:gravity="center" | 115 | android:gravity="center" |
109 | - android:text="4" /> | 116 | + android:text="4" |
117 | + android:textColor="#DDDDDD" /> | ||
110 | 118 | ||
111 | <TextView | 119 | <TextView |
112 | android:id="@+id/stageTextView5" | 120 | android:id="@+id/stageTextView5" |
... | @@ -114,8 +122,10 @@ | ... | @@ -114,8 +122,10 @@ |
114 | android:layout_height="match_parent" | 122 | android:layout_height="match_parent" |
115 | android:layout_gravity="center" | 123 | android:layout_gravity="center" |
116 | android:layout_weight="1" | 124 | android:layout_weight="1" |
125 | + android:background="#F4F4F4" | ||
117 | android:gravity="center" | 126 | android:gravity="center" |
118 | - android:text="5" /> | 127 | + android:text="5" |
128 | + android:textColor="#DDDDDD" /> | ||
119 | 129 | ||
120 | </LinearLayout> | 130 | </LinearLayout> |
121 | 131 | ||
... | @@ -129,35 +139,32 @@ | ... | @@ -129,35 +139,32 @@ |
129 | android:layout_width="match_parent" | 139 | android:layout_width="match_parent" |
130 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
131 | android:layout_weight="1" | 141 | android:layout_weight="1" |
142 | + android:gravity="center" | ||
132 | android:orientation="vertical"> | 143 | android:orientation="vertical"> |
133 | 144 | ||
134 | <LinearLayout | 145 | <LinearLayout |
135 | - android:layout_width="match_parent" | 146 | + android:layout_width="wrap_content" |
136 | android:layout_height="wrap_content" | 147 | android:layout_height="wrap_content" |
137 | android:orientation="vertical"> | 148 | android:orientation="vertical"> |
138 | 149 | ||
139 | - <RelativeLayout | 150 | + <TextView |
140 | - android:layout_width="match_parent" | 151 | + android:id="@+id/textView10" |
141 | - android:layout_height="match_parent"> | 152 | + android:layout_width="wrap_content" |
153 | + android:layout_height="wrap_content" | ||
154 | + android:text="(*필수항목)" | ||
155 | + android:textColor="#29ABE2" | ||
156 | + android:textSize="13dp" /> | ||
157 | + | ||
158 | + <TextView | ||
159 | + android:id="@+id/explainTextView" | ||
160 | + android:layout_width="wrap_content" | ||
161 | + android:layout_height="wrap_content" | ||
162 | + android:layout_gravity="center" | ||
163 | + android:gravity="center" | ||
164 | + android:text="4. 자신의 내/외국민 여부를 \n 선택해주세요." | ||
165 | + android:textColor="#4A4A4A" | ||
166 | + android:textSize="20dp" /> | ||
142 | 167 | ||
143 | - <TextView | ||
144 | - android:id="@+id/explainTextView" | ||
145 | - android:layout_width="match_parent" | ||
146 | - android:layout_height="wrap_content" | ||
147 | - android:layout_gravity="center" | ||
148 | - android:gravity="center" | ||
149 | - android:text="4. 내/외국인 여부를 선택해주세요." /> | ||
150 | - <Button | ||
151 | - android:id="@+id/questionButton" | ||
152 | - android:layout_width="30dp" | ||
153 | - android:layout_height="30dp" | ||
154 | - android:layout_gravity="center" | ||
155 | - android:layout_toRightOf="@id/explainTextView" | ||
156 | - android:backgroundTint="#1E90FF" | ||
157 | - android:gravity="center" | ||
158 | - android:text=" ? " | ||
159 | - android:textSize="8sp" /> | ||
160 | - </RelativeLayout> | ||
161 | </LinearLayout> | 168 | </LinearLayout> |
162 | 169 | ||
163 | <LinearLayout | 170 | <LinearLayout |
... | @@ -174,29 +181,40 @@ | ... | @@ -174,29 +181,40 @@ |
174 | 181 | ||
175 | <LinearLayout | 182 | <LinearLayout |
176 | android:layout_width="match_parent" | 183 | android:layout_width="match_parent" |
177 | - android:layout_height="wrap_content" | 184 | + android:layout_height="match_parent" |
185 | + android:layout_gravity="center" | ||
186 | + android:layout_margin="30dp" | ||
187 | + android:gravity="center" | ||
178 | android:orientation="vertical"> | 188 | android:orientation="vertical"> |
189 | + | ||
179 | <ToggleButton | 190 | <ToggleButton |
180 | android:id="@+id/inmanButton" | 191 | android:id="@+id/inmanButton" |
181 | - android:layout_width="match_parent" | 192 | + android:layout_width="300dp" |
182 | android:layout_height="wrap_content" | 193 | android:layout_height="wrap_content" |
183 | - android:background="@drawable/profil_selector" | 194 | + android:layout_margin="10dp" |
195 | + android:layout_weight="1" | ||
196 | + android:background="@drawable/button_selector" | ||
184 | android:text="내국인" | 197 | android:text="내국인" |
198 | + android:textColor="#757575" | ||
185 | android:textOff="내국인" | 199 | android:textOff="내국인" |
186 | - android:textOn="내국인" /> | 200 | + android:textOn="내국인" |
201 | + android:textSize="20dp" /> | ||
187 | 202 | ||
188 | <ToggleButton | 203 | <ToggleButton |
189 | android:id="@+id/outmanButton" | 204 | android:id="@+id/outmanButton" |
190 | - android:layout_width="match_parent" | 205 | + android:layout_width="300dp" |
191 | android:layout_height="wrap_content" | 206 | android:layout_height="wrap_content" |
192 | - android:background="@drawable/profil_selector" | 207 | + android:layout_margin="10dp" |
208 | + android:layout_weight="1" | ||
209 | + android:background="@drawable/button_selector" | ||
193 | android:text="외국인" | 210 | android:text="외국인" |
211 | + android:textColor="#757575" | ||
194 | android:textOff="외국인" | 212 | android:textOff="외국인" |
195 | - android:textOn="외국인" /> | 213 | + android:textOn="외국인" |
196 | - | 214 | + android:textSize="20dp" /> |
197 | - </LinearLayout> | ||
198 | 215 | ||
199 | 216 | ||
217 | + </LinearLayout> | ||
200 | </ScrollView> | 218 | </ScrollView> |
201 | 219 | ||
202 | <LinearLayout | 220 | <LinearLayout |
... | @@ -215,14 +233,18 @@ | ... | @@ -215,14 +233,18 @@ |
215 | android:layout_width="10dp" | 233 | android:layout_width="10dp" |
216 | android:layout_height="wrap_content" | 234 | android:layout_height="wrap_content" |
217 | android:layout_weight="1" | 235 | android:layout_weight="1" |
218 | - android:text="이전 단계로" /> | 236 | + android:background="#F4F4F4" |
237 | + android:text="이전 단계로" | ||
238 | + android:textColor="#757575" /> | ||
219 | 239 | ||
220 | <Button | 240 | <Button |
221 | android:id="@+id/nextButton" | 241 | android:id="@+id/nextButton" |
222 | android:layout_width="10dp" | 242 | android:layout_width="10dp" |
223 | android:layout_height="wrap_content" | 243 | android:layout_height="wrap_content" |
224 | android:layout_weight="1" | 244 | android:layout_weight="1" |
225 | - android:text="다음 단계로" /> | 245 | + android:background="#29ABE2" |
246 | + android:text="다음 단계로" | ||
247 | + android:textColor="#FFFFFF" /> | ||
226 | </LinearLayout> | 248 | </LinearLayout> |
227 | </LinearLayout> | 249 | </LinearLayout> |
228 | </LinearLayout> | 250 | </LinearLayout> | ... | ... |
... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | - tools:context=".InputProfilFourthFiveActivity"> | 7 | + tools:context=".InputProfilFirstFourActivity"> |
8 | 8 | ||
9 | <LinearLayout | 9 | <LinearLayout |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | android:layout_width="fill_parent" | 16 | android:layout_width="fill_parent" |
17 | android:layout_height="wrap_content" | 17 | android:layout_height="wrap_content" |
18 | android:layout_marginBottom="11dp" | 18 | android:layout_marginBottom="11dp" |
19 | - android:background="#FFF" | 19 | + android:background="#0000001A" |
20 | android:elevation="5dp" | 20 | android:elevation="5dp" |
21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | 21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" |
22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> | 22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> |
... | @@ -31,31 +31,35 @@ | ... | @@ -31,31 +31,35 @@ |
31 | android:layout_width="10dp" | 31 | android:layout_width="10dp" |
32 | android:layout_height="match_parent" | 32 | android:layout_height="match_parent" |
33 | android:layout_weight="1.5" | 33 | android:layout_weight="1.5" |
34 | - android:background="#FFFFFF" | 34 | + android:background="#00000000" |
35 | android:text="나가기" | 35 | android:text="나가기" |
36 | android:textColor="#29ABE2" | 36 | android:textColor="#29ABE2" |
37 | android:textSize="16dp" /> | 37 | android:textSize="16dp" /> |
38 | + | ||
38 | <LinearLayout | 39 | <LinearLayout |
39 | android:layout_width="10dp" | 40 | android:layout_width="10dp" |
40 | android:layout_height="match_parent" | 41 | android:layout_height="match_parent" |
41 | - android:orientation="horizontal" | 42 | + android:layout_weight="1" |
42 | - android:layout_weight="1"/> | 43 | + android:orientation="horizontal" /> |
44 | + | ||
43 | <ImageView | 45 | <ImageView |
44 | android:layout_width="77dp" | 46 | android:layout_width="77dp" |
45 | android:layout_height="44dp" | 47 | android:layout_height="44dp" |
46 | android:layout_gravity="center" | 48 | android:layout_gravity="center" |
47 | android:layout_weight="1" | 49 | android:layout_weight="1" |
48 | android:src="@drawable/toolbar_logo" /> | 50 | android:src="@drawable/toolbar_logo" /> |
51 | + | ||
49 | <LinearLayout | 52 | <LinearLayout |
50 | android:layout_width="10dp" | 53 | android:layout_width="10dp" |
51 | android:layout_height="match_parent" | 54 | android:layout_height="match_parent" |
52 | - android:orientation="horizontal" | 55 | + android:layout_weight="1" |
53 | - android:layout_weight="1"/> | 56 | + android:orientation="horizontal" /> |
57 | + | ||
54 | <LinearLayout | 58 | <LinearLayout |
55 | android:layout_width="10dp" | 59 | android:layout_width="10dp" |
56 | android:layout_height="match_parent" | 60 | android:layout_height="match_parent" |
57 | - android:orientation="horizontal" | 61 | + android:layout_weight="1.5" |
58 | - android:layout_weight="1.5"/> | 62 | + android:orientation="horizontal" /> |
59 | 63 | ||
60 | </LinearLayout> | 64 | </LinearLayout> |
61 | 65 | ||
... | @@ -74,9 +78,10 @@ | ... | @@ -74,9 +78,10 @@ |
74 | android:layout_height="match_parent" | 78 | android:layout_height="match_parent" |
75 | android:layout_gravity="center" | 79 | android:layout_gravity="center" |
76 | android:layout_weight="1" | 80 | android:layout_weight="1" |
77 | - android:background="#1E90FF" | 81 | + android:background="@drawable/profile_stage" |
78 | android:gravity="center" | 82 | android:gravity="center" |
79 | - android:text="1" /> | 83 | + android:text="1" |
84 | + android:textColor="#FFFFFF" /> | ||
80 | 85 | ||
81 | <TextView | 86 | <TextView |
82 | android:id="@+id/stageTextView2" | 87 | android:id="@+id/stageTextView2" |
... | @@ -84,9 +89,10 @@ | ... | @@ -84,9 +89,10 @@ |
84 | android:layout_height="match_parent" | 89 | android:layout_height="match_parent" |
85 | android:layout_gravity="center" | 90 | android:layout_gravity="center" |
86 | android:layout_weight="1" | 91 | android:layout_weight="1" |
87 | - android:background="#1E90FF" | 92 | + android:background="#F4F4F4" |
88 | android:gravity="center" | 93 | android:gravity="center" |
89 | - android:text="2" /> | 94 | + android:text="2" |
95 | + android:textColor="#DDDDDD" /> | ||
90 | 96 | ||
91 | <TextView | 97 | <TextView |
92 | android:id="@+id/stageTextView3" | 98 | android:id="@+id/stageTextView3" |
... | @@ -94,9 +100,10 @@ | ... | @@ -94,9 +100,10 @@ |
94 | android:layout_height="match_parent" | 100 | android:layout_height="match_parent" |
95 | android:layout_gravity="center" | 101 | android:layout_gravity="center" |
96 | android:layout_weight="1" | 102 | android:layout_weight="1" |
97 | - android:background="#1E90FF" | 103 | + android:background="#F4F4F4" |
98 | android:gravity="center" | 104 | android:gravity="center" |
99 | - android:text="3" /> | 105 | + android:text="3" |
106 | + android:textColor="#DDDDDD" /> | ||
100 | 107 | ||
101 | <TextView | 108 | <TextView |
102 | android:id="@+id/stageTextView4" | 109 | android:id="@+id/stageTextView4" |
... | @@ -104,9 +111,10 @@ | ... | @@ -104,9 +111,10 @@ |
104 | android:layout_height="match_parent" | 111 | android:layout_height="match_parent" |
105 | android:layout_gravity="center" | 112 | android:layout_gravity="center" |
106 | android:layout_weight="1" | 113 | android:layout_weight="1" |
107 | - android:background="#1E90FF" | 114 | + android:background="#F4F4F4" |
108 | android:gravity="center" | 115 | android:gravity="center" |
109 | - android:text="4" /> | 116 | + android:text="4" |
117 | + android:textColor="#DDDDDD" /> | ||
110 | 118 | ||
111 | <TextView | 119 | <TextView |
112 | android:id="@+id/stageTextView5" | 120 | android:id="@+id/stageTextView5" |
... | @@ -114,8 +122,10 @@ | ... | @@ -114,8 +122,10 @@ |
114 | android:layout_height="match_parent" | 122 | android:layout_height="match_parent" |
115 | android:layout_gravity="center" | 123 | android:layout_gravity="center" |
116 | android:layout_weight="1" | 124 | android:layout_weight="1" |
125 | + android:background="#F4F4F4" | ||
117 | android:gravity="center" | 126 | android:gravity="center" |
118 | - android:text="5" /> | 127 | + android:text="5" |
128 | + android:textColor="#DDDDDD" /> | ||
119 | 129 | ||
120 | </LinearLayout> | 130 | </LinearLayout> |
121 | 131 | ||
... | @@ -129,37 +139,32 @@ | ... | @@ -129,37 +139,32 @@ |
129 | android:layout_width="match_parent" | 139 | android:layout_width="match_parent" |
130 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
131 | android:layout_weight="1" | 141 | android:layout_weight="1" |
142 | + android:gravity="center" | ||
132 | android:orientation="vertical"> | 143 | android:orientation="vertical"> |
133 | 144 | ||
134 | <LinearLayout | 145 | <LinearLayout |
135 | - android:layout_width="match_parent" | 146 | + android:layout_width="wrap_content" |
136 | android:layout_height="wrap_content" | 147 | android:layout_height="wrap_content" |
137 | android:orientation="vertical"> | 148 | android:orientation="vertical"> |
138 | 149 | ||
139 | - <RelativeLayout | 150 | + <TextView |
140 | - android:layout_width="match_parent" | 151 | + android:id="@+id/textView10" |
141 | - android:layout_height="match_parent"> | 152 | + android:layout_width="wrap_content" |
153 | + android:layout_height="wrap_content" | ||
154 | + android:text="(*필수항목)" | ||
155 | + android:textColor="#29ABE2" | ||
156 | + android:textSize="13dp" /> | ||
157 | + | ||
158 | + <TextView | ||
159 | + android:id="@+id/explainTextView" | ||
160 | + android:layout_width="wrap_content" | ||
161 | + android:layout_height="wrap_content" | ||
162 | + android:layout_gravity="center" | ||
163 | + android:gravity="center" | ||
164 | + android:text="3. 자신의 주민등록상의 \n 거주지를 선택해주세요." | ||
165 | + android:textColor="#4A4A4A" | ||
166 | + android:textSize="20dp" /> | ||
142 | 167 | ||
143 | - <TextView | ||
144 | - android:id="@+id/explainTextView" | ||
145 | - android:layout_width="wrap_content" | ||
146 | - android:layout_height="wrap_content" | ||
147 | - android:layout_centerInParent="true" | ||
148 | - android:layout_gravity="center" | ||
149 | - android:gravity="center" | ||
150 | - android:text="3. 자신의 주민등록상 거주지를 선택해주세요." /> | ||
151 | - | ||
152 | - <Button | ||
153 | - android:id="@+id/questionButton" | ||
154 | - android:layout_width="30dp" | ||
155 | - android:layout_height="30dp" | ||
156 | - android:layout_gravity="center" | ||
157 | - android:layout_toRightOf="@id/explainTextView" | ||
158 | - android:backgroundTint="#1E90FF" | ||
159 | - android:gravity="center" | ||
160 | - android:text=" ? " | ||
161 | - android:textSize="8sp" /> | ||
162 | - </RelativeLayout> | ||
163 | </LinearLayout> | 168 | </LinearLayout> |
164 | 169 | ||
165 | <LinearLayout | 170 | <LinearLayout |
... | @@ -179,27 +184,27 @@ | ... | @@ -179,27 +184,27 @@ |
179 | android:layout_height="wrap_content" | 184 | android:layout_height="wrap_content" |
180 | android:orientation="vertical"> | 185 | android:orientation="vertical"> |
181 | 186 | ||
182 | - <TextView | 187 | + <TextView |
183 | - android:id="@+id/doTextView" | 188 | + android:id="@+id/doTextView" |
184 | - android:layout_width="match_parent" | 189 | + android:layout_width="match_parent" |
185 | - android:layout_height="wrap_content" | 190 | + android:layout_height="wrap_content" |
186 | - android:text="시/도" /> | 191 | + android:text="시/도" /> |
187 | 192 | ||
188 | - <Spinner | 193 | + <Spinner |
189 | - android:id="@+id/doSpinner" | 194 | + android:id="@+id/doSpinner" |
190 | - android:layout_width="fill_parent" | 195 | + android:layout_width="fill_parent" |
191 | - android:layout_height="wrap_content" /> | 196 | + android:layout_height="wrap_content" /> |
192 | 197 | ||
193 | - <TextView | 198 | + <TextView |
194 | - android:id="@+id/cityTextView" | 199 | + android:id="@+id/cityTextView" |
195 | - android:layout_width="match_parent" | 200 | + android:layout_width="match_parent" |
196 | - android:layout_height="wrap_content" | 201 | + android:layout_height="wrap_content" |
197 | - android:text="시/군/구" /> | 202 | + android:text="시/군/구" /> |
198 | 203 | ||
199 | - <Spinner | 204 | + <Spinner |
200 | - android:id="@+id/gooSpinner" | 205 | + android:id="@+id/gooSpinner" |
201 | - android:layout_width="fill_parent" | 206 | + android:layout_width="fill_parent" |
202 | - android:layout_height="wrap_content" /> | 207 | + android:layout_height="wrap_content" /> |
203 | </LinearLayout> | 208 | </LinearLayout> |
204 | </ScrollView> | 209 | </ScrollView> |
205 | 210 | ||
... | @@ -219,14 +224,18 @@ | ... | @@ -219,14 +224,18 @@ |
219 | android:layout_width="10dp" | 224 | android:layout_width="10dp" |
220 | android:layout_height="wrap_content" | 225 | android:layout_height="wrap_content" |
221 | android:layout_weight="1" | 226 | android:layout_weight="1" |
222 | - android:text="이전 단계로" /> | 227 | + android:background="#F4F4F4" |
228 | + android:text="이전 단계로" | ||
229 | + android:textColor="#757575" /> | ||
223 | 230 | ||
224 | <Button | 231 | <Button |
225 | android:id="@+id/nextButton" | 232 | android:id="@+id/nextButton" |
226 | android:layout_width="10dp" | 233 | android:layout_width="10dp" |
227 | android:layout_height="wrap_content" | 234 | android:layout_height="wrap_content" |
228 | android:layout_weight="1" | 235 | android:layout_weight="1" |
229 | - android:text="다음 단계로" /> | 236 | + android:background="#29ABE2" |
237 | + android:text="다음 단계로" | ||
238 | + android:textColor="#FFFFFF" /> | ||
230 | </LinearLayout> | 239 | </LinearLayout> |
231 | </LinearLayout> | 240 | </LinearLayout> |
232 | </LinearLayout> | 241 | </LinearLayout> | ... | ... |
... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | - tools:context=".InputProfilFourthFiveActivity"> | 7 | + tools:context=".InputProfilFirstSixActivity"> |
8 | 8 | ||
9 | <LinearLayout | 9 | <LinearLayout |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | android:layout_width="fill_parent" | 16 | android:layout_width="fill_parent" |
17 | android:layout_height="wrap_content" | 17 | android:layout_height="wrap_content" |
18 | android:layout_marginBottom="11dp" | 18 | android:layout_marginBottom="11dp" |
19 | - android:background="#FFF" | 19 | + android:background="#0000001A" |
20 | android:elevation="5dp" | 20 | android:elevation="5dp" |
21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | 21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" |
22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> | 22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> |
... | @@ -31,31 +31,35 @@ | ... | @@ -31,31 +31,35 @@ |
31 | android:layout_width="10dp" | 31 | android:layout_width="10dp" |
32 | android:layout_height="match_parent" | 32 | android:layout_height="match_parent" |
33 | android:layout_weight="1.5" | 33 | android:layout_weight="1.5" |
34 | - android:background="#FFFFFF" | 34 | + android:background="#00000000" |
35 | android:text="나가기" | 35 | android:text="나가기" |
36 | android:textColor="#29ABE2" | 36 | android:textColor="#29ABE2" |
37 | android:textSize="16dp" /> | 37 | android:textSize="16dp" /> |
38 | + | ||
38 | <LinearLayout | 39 | <LinearLayout |
39 | android:layout_width="10dp" | 40 | android:layout_width="10dp" |
40 | android:layout_height="match_parent" | 41 | android:layout_height="match_parent" |
41 | - android:orientation="horizontal" | 42 | + android:layout_weight="1" |
42 | - android:layout_weight="1"/> | 43 | + android:orientation="horizontal" /> |
44 | + | ||
43 | <ImageView | 45 | <ImageView |
44 | android:layout_width="77dp" | 46 | android:layout_width="77dp" |
45 | android:layout_height="44dp" | 47 | android:layout_height="44dp" |
46 | android:layout_gravity="center" | 48 | android:layout_gravity="center" |
47 | android:layout_weight="1" | 49 | android:layout_weight="1" |
48 | android:src="@drawable/toolbar_logo" /> | 50 | android:src="@drawable/toolbar_logo" /> |
51 | + | ||
49 | <LinearLayout | 52 | <LinearLayout |
50 | android:layout_width="10dp" | 53 | android:layout_width="10dp" |
51 | android:layout_height="match_parent" | 54 | android:layout_height="match_parent" |
52 | - android:orientation="horizontal" | 55 | + android:layout_weight="1" |
53 | - android:layout_weight="1"/> | 56 | + android:orientation="horizontal" /> |
57 | + | ||
54 | <LinearLayout | 58 | <LinearLayout |
55 | android:layout_width="10dp" | 59 | android:layout_width="10dp" |
56 | android:layout_height="match_parent" | 60 | android:layout_height="match_parent" |
57 | - android:orientation="horizontal" | 61 | + android:layout_weight="1.5" |
58 | - android:layout_weight="1.5"/> | 62 | + android:orientation="horizontal" /> |
59 | 63 | ||
60 | </LinearLayout> | 64 | </LinearLayout> |
61 | 65 | ||
... | @@ -74,9 +78,10 @@ | ... | @@ -74,9 +78,10 @@ |
74 | android:layout_height="match_parent" | 78 | android:layout_height="match_parent" |
75 | android:layout_gravity="center" | 79 | android:layout_gravity="center" |
76 | android:layout_weight="1" | 80 | android:layout_weight="1" |
77 | - android:background="#1E90FF" | 81 | + android:background="@drawable/profile_stage" |
78 | android:gravity="center" | 82 | android:gravity="center" |
79 | - android:text="1" /> | 83 | + android:text="1" |
84 | + android:textColor="#FFFFFF" /> | ||
80 | 85 | ||
81 | <TextView | 86 | <TextView |
82 | android:id="@+id/stageTextView2" | 87 | android:id="@+id/stageTextView2" |
... | @@ -84,9 +89,10 @@ | ... | @@ -84,9 +89,10 @@ |
84 | android:layout_height="match_parent" | 89 | android:layout_height="match_parent" |
85 | android:layout_gravity="center" | 90 | android:layout_gravity="center" |
86 | android:layout_weight="1" | 91 | android:layout_weight="1" |
87 | - android:background="#1E90FF" | 92 | + android:background="#F4F4F4" |
88 | android:gravity="center" | 93 | android:gravity="center" |
89 | - android:text="2" /> | 94 | + android:text="2" |
95 | + android:textColor="#DDDDDD" /> | ||
90 | 96 | ||
91 | <TextView | 97 | <TextView |
92 | android:id="@+id/stageTextView3" | 98 | android:id="@+id/stageTextView3" |
... | @@ -94,9 +100,10 @@ | ... | @@ -94,9 +100,10 @@ |
94 | android:layout_height="match_parent" | 100 | android:layout_height="match_parent" |
95 | android:layout_gravity="center" | 101 | android:layout_gravity="center" |
96 | android:layout_weight="1" | 102 | android:layout_weight="1" |
97 | - android:background="#1E90FF" | 103 | + android:background="#F4F4F4" |
98 | android:gravity="center" | 104 | android:gravity="center" |
99 | - android:text="3" /> | 105 | + android:text="3" |
106 | + android:textColor="#DDDDDD" /> | ||
100 | 107 | ||
101 | <TextView | 108 | <TextView |
102 | android:id="@+id/stageTextView4" | 109 | android:id="@+id/stageTextView4" |
... | @@ -104,9 +111,10 @@ | ... | @@ -104,9 +111,10 @@ |
104 | android:layout_height="match_parent" | 111 | android:layout_height="match_parent" |
105 | android:layout_gravity="center" | 112 | android:layout_gravity="center" |
106 | android:layout_weight="1" | 113 | android:layout_weight="1" |
107 | - android:background="#1E90FF" | 114 | + android:background="#F4F4F4" |
108 | android:gravity="center" | 115 | android:gravity="center" |
109 | - android:text="4" /> | 116 | + android:text="4" |
117 | + android:textColor="#DDDDDD" /> | ||
110 | 118 | ||
111 | <TextView | 119 | <TextView |
112 | android:id="@+id/stageTextView5" | 120 | android:id="@+id/stageTextView5" |
... | @@ -114,8 +122,10 @@ | ... | @@ -114,8 +122,10 @@ |
114 | android:layout_height="match_parent" | 122 | android:layout_height="match_parent" |
115 | android:layout_gravity="center" | 123 | android:layout_gravity="center" |
116 | android:layout_weight="1" | 124 | android:layout_weight="1" |
125 | + android:background="#F4F4F4" | ||
117 | android:gravity="center" | 126 | android:gravity="center" |
118 | - android:text="5" /> | 127 | + android:text="5" |
128 | + android:textColor="#DDDDDD" /> | ||
119 | 129 | ||
120 | </LinearLayout> | 130 | </LinearLayout> |
121 | 131 | ||
... | @@ -129,35 +139,32 @@ | ... | @@ -129,35 +139,32 @@ |
129 | android:layout_width="match_parent" | 139 | android:layout_width="match_parent" |
130 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
131 | android:layout_weight="1" | 141 | android:layout_weight="1" |
142 | + android:gravity="center" | ||
132 | android:orientation="vertical"> | 143 | android:orientation="vertical"> |
133 | 144 | ||
134 | <LinearLayout | 145 | <LinearLayout |
135 | - android:layout_width="match_parent" | 146 | + android:layout_width="wrap_content" |
136 | android:layout_height="wrap_content" | 147 | android:layout_height="wrap_content" |
137 | android:orientation="vertical"> | 148 | android:orientation="vertical"> |
138 | 149 | ||
139 | - <RelativeLayout | 150 | + <TextView |
140 | - android:layout_width="match_parent" | 151 | + android:id="@+id/textView10" |
141 | - android:layout_height="match_parent"> | 152 | + android:layout_width="wrap_content" |
153 | + android:layout_height="wrap_content" | ||
154 | + android:text="(*필수항목)" | ||
155 | + android:textColor="#29ABE2" | ||
156 | + android:textSize="13dp" /> | ||
157 | + | ||
158 | + <TextView | ||
159 | + android:id="@+id/explainTextView" | ||
160 | + android:layout_width="wrap_content" | ||
161 | + android:layout_height="wrap_content" | ||
162 | + android:layout_gravity="center" | ||
163 | + android:gravity="center" | ||
164 | + android:text="5. 자신의 가구주 여부를 선택해주세요." | ||
165 | + android:textColor="#4A4A4A" | ||
166 | + android:textSize="20dp" /> | ||
142 | 167 | ||
143 | - <TextView | ||
144 | - android:id="@+id/explainTextView" | ||
145 | - android:layout_width="match_parent" | ||
146 | - android:layout_height="wrap_content" | ||
147 | - android:layout_gravity="center" | ||
148 | - android:gravity="center" | ||
149 | - android:text="5. 가구주 여부를 선택해 주세요" /> | ||
150 | - <Button | ||
151 | - android:id="@+id/questionButton" | ||
152 | - android:layout_width="30dp" | ||
153 | - android:layout_height="30dp" | ||
154 | - android:layout_gravity="center" | ||
155 | - android:layout_toRightOf="@id/explainTextView" | ||
156 | - android:backgroundTint="#1E90FF" | ||
157 | - android:gravity="center" | ||
158 | - android:text=" ? " | ||
159 | - android:textSize="8sp" /> | ||
160 | - </RelativeLayout> | ||
161 | </LinearLayout> | 168 | </LinearLayout> |
162 | 169 | ||
163 | <LinearLayout | 170 | <LinearLayout |
... | @@ -174,26 +181,38 @@ | ... | @@ -174,26 +181,38 @@ |
174 | 181 | ||
175 | <LinearLayout | 182 | <LinearLayout |
176 | android:layout_width="match_parent" | 183 | android:layout_width="match_parent" |
177 | - android:layout_height="wrap_content" | 184 | + android:layout_height="match_parent" |
185 | + android:layout_gravity="center" | ||
186 | + android:layout_margin="30dp" | ||
187 | + android:gravity="center" | ||
178 | android:orientation="vertical"> | 188 | android:orientation="vertical"> |
179 | 189 | ||
180 | <ToggleButton | 190 | <ToggleButton |
181 | android:id="@+id/gagoojooButton" | 191 | android:id="@+id/gagoojooButton" |
182 | - android:layout_width="match_parent" | 192 | + android:layout_width="300dp" |
183 | android:layout_height="wrap_content" | 193 | android:layout_height="wrap_content" |
184 | - android:background="@drawable/profil_selector" | 194 | + android:layout_margin="10dp" |
195 | + android:layout_weight="1" | ||
196 | + android:background="@drawable/button_selector" | ||
185 | android:text="가구주" | 197 | android:text="가구주" |
198 | + android:textColor="#757575" | ||
186 | android:textOff="가구주" | 199 | android:textOff="가구주" |
187 | - android:textOn="가구주" /> | 200 | + android:textOn="가구주" |
201 | + android:textSize="20dp" /> | ||
188 | 202 | ||
189 | <ToggleButton | 203 | <ToggleButton |
190 | android:id="@+id/gagoowonButton" | 204 | android:id="@+id/gagoowonButton" |
191 | - android:layout_width="match_parent" | 205 | + android:layout_width="300dp" |
192 | android:layout_height="wrap_content" | 206 | android:layout_height="wrap_content" |
193 | - android:background="@drawable/profil_selector" | 207 | + android:layout_margin="10dp" |
208 | + android:layout_weight="1" | ||
209 | + android:background="@drawable/button_selector" | ||
194 | android:text="가구원" | 210 | android:text="가구원" |
211 | + android:textColor="#757575" | ||
195 | android:textOff="가구원" | 212 | android:textOff="가구원" |
196 | - android:textOn="가구원" /> | 213 | + android:textOn="가구원" |
214 | + android:textSize="20dp" /> | ||
215 | + | ||
197 | 216 | ||
198 | </LinearLayout> | 217 | </LinearLayout> |
199 | </ScrollView> | 218 | </ScrollView> |
... | @@ -214,14 +233,18 @@ | ... | @@ -214,14 +233,18 @@ |
214 | android:layout_width="10dp" | 233 | android:layout_width="10dp" |
215 | android:layout_height="wrap_content" | 234 | android:layout_height="wrap_content" |
216 | android:layout_weight="1" | 235 | android:layout_weight="1" |
217 | - android:text="이전 단계로" /> | 236 | + android:background="#F4F4F4" |
237 | + android:text="이전 단계로" | ||
238 | + android:textColor="#757575" /> | ||
218 | 239 | ||
219 | <Button | 240 | <Button |
220 | android:id="@+id/nextButton" | 241 | android:id="@+id/nextButton" |
221 | android:layout_width="10dp" | 242 | android:layout_width="10dp" |
222 | android:layout_height="wrap_content" | 243 | android:layout_height="wrap_content" |
223 | android:layout_weight="1" | 244 | android:layout_weight="1" |
224 | - android:text="다음 단계로" /> | 245 | + android:background="#29ABE2" |
246 | + android:text="다음 단계로" | ||
247 | + android:textColor="#FFFFFF" /> | ||
225 | </LinearLayout> | 248 | </LinearLayout> |
226 | </LinearLayout> | 249 | </LinearLayout> |
227 | </LinearLayout> | 250 | </LinearLayout> | ... | ... |
... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | - tools:context=".InputProfilFourthFiveActivity"> | 7 | + tools:context=".InputProfilFirstThreeActivity"> |
8 | 8 | ||
9 | <LinearLayout | 9 | <LinearLayout |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | android:layout_width="fill_parent" | 16 | android:layout_width="fill_parent" |
17 | android:layout_height="wrap_content" | 17 | android:layout_height="wrap_content" |
18 | android:layout_marginBottom="11dp" | 18 | android:layout_marginBottom="11dp" |
19 | - android:background="#FFF" | 19 | + android:background="#0000001A" |
20 | android:elevation="5dp" | 20 | android:elevation="5dp" |
21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | 21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" |
22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> | 22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> |
... | @@ -31,31 +31,35 @@ | ... | @@ -31,31 +31,35 @@ |
31 | android:layout_width="10dp" | 31 | android:layout_width="10dp" |
32 | android:layout_height="match_parent" | 32 | android:layout_height="match_parent" |
33 | android:layout_weight="1.5" | 33 | android:layout_weight="1.5" |
34 | - android:background="#FFFFFF" | 34 | + android:background="#00000000" |
35 | android:text="나가기" | 35 | android:text="나가기" |
36 | android:textColor="#29ABE2" | 36 | android:textColor="#29ABE2" |
37 | android:textSize="16dp" /> | 37 | android:textSize="16dp" /> |
38 | + | ||
38 | <LinearLayout | 39 | <LinearLayout |
39 | android:layout_width="10dp" | 40 | android:layout_width="10dp" |
40 | android:layout_height="match_parent" | 41 | android:layout_height="match_parent" |
41 | - android:orientation="horizontal" | 42 | + android:layout_weight="1" |
42 | - android:layout_weight="1"/> | 43 | + android:orientation="horizontal" /> |
44 | + | ||
43 | <ImageView | 45 | <ImageView |
44 | android:layout_width="77dp" | 46 | android:layout_width="77dp" |
45 | android:layout_height="44dp" | 47 | android:layout_height="44dp" |
46 | android:layout_gravity="center" | 48 | android:layout_gravity="center" |
47 | android:layout_weight="1" | 49 | android:layout_weight="1" |
48 | android:src="@drawable/toolbar_logo" /> | 50 | android:src="@drawable/toolbar_logo" /> |
51 | + | ||
49 | <LinearLayout | 52 | <LinearLayout |
50 | android:layout_width="10dp" | 53 | android:layout_width="10dp" |
51 | android:layout_height="match_parent" | 54 | android:layout_height="match_parent" |
52 | - android:orientation="horizontal" | 55 | + android:layout_weight="1" |
53 | - android:layout_weight="1"/> | 56 | + android:orientation="horizontal" /> |
57 | + | ||
54 | <LinearLayout | 58 | <LinearLayout |
55 | android:layout_width="10dp" | 59 | android:layout_width="10dp" |
56 | android:layout_height="match_parent" | 60 | android:layout_height="match_parent" |
57 | - android:orientation="horizontal" | 61 | + android:layout_weight="1.5" |
58 | - android:layout_weight="1.5"/> | 62 | + android:orientation="horizontal" /> |
59 | 63 | ||
60 | </LinearLayout> | 64 | </LinearLayout> |
61 | 65 | ||
... | @@ -74,9 +78,10 @@ | ... | @@ -74,9 +78,10 @@ |
74 | android:layout_height="match_parent" | 78 | android:layout_height="match_parent" |
75 | android:layout_gravity="center" | 79 | android:layout_gravity="center" |
76 | android:layout_weight="1" | 80 | android:layout_weight="1" |
77 | - android:background="#1E90FF" | 81 | + android:background="@drawable/profile_stage" |
78 | android:gravity="center" | 82 | android:gravity="center" |
79 | - android:text="1" /> | 83 | + android:text="1" |
84 | + android:textColor="#FFFFFF" /> | ||
80 | 85 | ||
81 | <TextView | 86 | <TextView |
82 | android:id="@+id/stageTextView2" | 87 | android:id="@+id/stageTextView2" |
... | @@ -84,9 +89,10 @@ | ... | @@ -84,9 +89,10 @@ |
84 | android:layout_height="match_parent" | 89 | android:layout_height="match_parent" |
85 | android:layout_gravity="center" | 90 | android:layout_gravity="center" |
86 | android:layout_weight="1" | 91 | android:layout_weight="1" |
87 | - android:background="#1E90FF" | 92 | + android:background="#F4F4F4" |
88 | android:gravity="center" | 93 | android:gravity="center" |
89 | - android:text="2" /> | 94 | + android:text="2" |
95 | + android:textColor="#DDDDDD" /> | ||
90 | 96 | ||
91 | <TextView | 97 | <TextView |
92 | android:id="@+id/stageTextView3" | 98 | android:id="@+id/stageTextView3" |
... | @@ -94,9 +100,10 @@ | ... | @@ -94,9 +100,10 @@ |
94 | android:layout_height="match_parent" | 100 | android:layout_height="match_parent" |
95 | android:layout_gravity="center" | 101 | android:layout_gravity="center" |
96 | android:layout_weight="1" | 102 | android:layout_weight="1" |
97 | - android:background="#1E90FF" | 103 | + android:background="#F4F4F4" |
98 | android:gravity="center" | 104 | android:gravity="center" |
99 | - android:text="3" /> | 105 | + android:text="3" |
106 | + android:textColor="#DDDDDD" /> | ||
100 | 107 | ||
101 | <TextView | 108 | <TextView |
102 | android:id="@+id/stageTextView4" | 109 | android:id="@+id/stageTextView4" |
... | @@ -104,9 +111,10 @@ | ... | @@ -104,9 +111,10 @@ |
104 | android:layout_height="match_parent" | 111 | android:layout_height="match_parent" |
105 | android:layout_gravity="center" | 112 | android:layout_gravity="center" |
106 | android:layout_weight="1" | 113 | android:layout_weight="1" |
107 | - android:background="#1E90FF" | 114 | + android:background="#F4F4F4" |
108 | android:gravity="center" | 115 | android:gravity="center" |
109 | - android:text="4" /> | 116 | + android:text="4" |
117 | + android:textColor="#DDDDDD" /> | ||
110 | 118 | ||
111 | <TextView | 119 | <TextView |
112 | android:id="@+id/stageTextView5" | 120 | android:id="@+id/stageTextView5" |
... | @@ -114,8 +122,10 @@ | ... | @@ -114,8 +122,10 @@ |
114 | android:layout_height="match_parent" | 122 | android:layout_height="match_parent" |
115 | android:layout_gravity="center" | 123 | android:layout_gravity="center" |
116 | android:layout_weight="1" | 124 | android:layout_weight="1" |
125 | + android:background="#F4F4F4" | ||
117 | android:gravity="center" | 126 | android:gravity="center" |
118 | - android:text="5" /> | 127 | + android:text="5" |
128 | + android:textColor="#DDDDDD" /> | ||
119 | 129 | ||
120 | </LinearLayout> | 130 | </LinearLayout> |
121 | 131 | ||
... | @@ -129,35 +139,32 @@ | ... | @@ -129,35 +139,32 @@ |
129 | android:layout_width="match_parent" | 139 | android:layout_width="match_parent" |
130 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
131 | android:layout_weight="1" | 141 | android:layout_weight="1" |
142 | + android:gravity="center" | ||
132 | android:orientation="vertical"> | 143 | android:orientation="vertical"> |
133 | 144 | ||
134 | <LinearLayout | 145 | <LinearLayout |
135 | - android:layout_width="match_parent" | 146 | + android:layout_width="wrap_content" |
136 | android:layout_height="wrap_content" | 147 | android:layout_height="wrap_content" |
137 | android:orientation="vertical"> | 148 | android:orientation="vertical"> |
138 | 149 | ||
139 | - <RelativeLayout | 150 | + <TextView |
140 | - android:layout_width="match_parent" | 151 | + android:id="@+id/textView10" |
141 | - android:layout_height="match_parent"> | 152 | + android:layout_width="wrap_content" |
153 | + android:layout_height="wrap_content" | ||
154 | + android:text="(*필수항목)" | ||
155 | + android:textColor="#29ABE2" | ||
156 | + android:textSize="13dp" /> | ||
157 | + | ||
158 | + <TextView | ||
159 | + android:id="@+id/explainTextView" | ||
160 | + android:layout_width="wrap_content" | ||
161 | + android:layout_height="wrap_content" | ||
162 | + android:layout_gravity="center" | ||
163 | + android:gravity="center" | ||
164 | + android:text="2. 성별을 선택해주세요." | ||
165 | + android:textColor="#4A4A4A" | ||
166 | + android:textSize="20dp" /> | ||
142 | 167 | ||
143 | - <TextView | ||
144 | - android:id="@+id/explainTextView" | ||
145 | - android:layout_width="match_parent" | ||
146 | - android:layout_height="wrap_content" | ||
147 | - android:layout_gravity="center" | ||
148 | - android:gravity="center" | ||
149 | - android:text="2. 성별을 선택해 주세요." /> | ||
150 | - <Button | ||
151 | - android:id="@+id/questionButton" | ||
152 | - android:layout_width="30dp" | ||
153 | - android:layout_height="30dp" | ||
154 | - android:layout_gravity="center" | ||
155 | - android:layout_toRightOf="@id/explainTextView" | ||
156 | - android:backgroundTint="#1E90FF" | ||
157 | - android:gravity="center" | ||
158 | - android:text=" ? " | ||
159 | - android:textSize="8sp" /> | ||
160 | - </RelativeLayout> | ||
161 | </LinearLayout> | 168 | </LinearLayout> |
162 | 169 | ||
163 | <LinearLayout | 170 | <LinearLayout |
... | @@ -174,53 +181,40 @@ | ... | @@ -174,53 +181,40 @@ |
174 | 181 | ||
175 | <LinearLayout | 182 | <LinearLayout |
176 | android:layout_width="match_parent" | 183 | android:layout_width="match_parent" |
177 | - android:layout_height="wrap_content" | 184 | + android:layout_height="match_parent" |
185 | + android:layout_gravity="center" | ||
186 | + android:layout_margin="30dp" | ||
187 | + android:gravity="center" | ||
178 | android:orientation="vertical"> | 188 | android:orientation="vertical"> |
179 | 189 | ||
180 | - <LinearLayout | 190 | + <ToggleButton |
181 | - android:layout_width="match_parent" | 191 | + android:id="@+id/manButton" |
182 | - android:layout_height="match_parent" | 192 | + android:layout_width="300dp" |
183 | - android:layout_gravity="center" | 193 | + android:layout_height="wrap_content" |
184 | - android:gravity="center" | 194 | + android:layout_margin="10dp" |
185 | - android:orientation="vertical"> | 195 | + android:layout_weight="1" |
186 | - | 196 | + android:background="@drawable/button_selector" |
187 | - <LinearLayout | 197 | + android:text="남자" |
188 | - android:layout_width="match_parent" | 198 | + android:textColor="#757575" |
189 | - android:layout_height="match_parent" | 199 | + android:textOff="남자" |
190 | - android:orientation="horizontal"> | 200 | + android:textOn="남자" |
191 | - | 201 | + android:textSize="20dp" /> |
192 | - <ToggleButton | 202 | + |
193 | - android:id="@+id/manButton" | 203 | + <ToggleButton |
194 | - android:layout_width="300dp" | 204 | + android:id="@+id/womanButton" |
195 | - android:layout_height="wrap_content" | 205 | + android:layout_width="300dp" |
196 | - android:layout_weight="1" | 206 | + android:layout_height="wrap_content" |
197 | - android:background="@drawable/profil_selector" | 207 | + android:layout_margin="10dp" |
198 | - android:text="남자" | 208 | + android:layout_weight="1" |
199 | - android:textOff="남자" | 209 | + android:background="@drawable/button_selector" |
200 | - android:textOn="남자" /> | 210 | + android:text="여자" |
201 | - | 211 | + android:textColor="#757575" |
202 | - </LinearLayout> | 212 | + android:textOff="여자" |
203 | - | 213 | + android:textOn="여자" |
204 | - | 214 | + android:textSize="20dp" /> |
205 | - <LinearLayout | 215 | + |
206 | - android:layout_width="match_parent" | ||
207 | - android:layout_height="match_parent" | ||
208 | - android:orientation="horizontal"> | ||
209 | - | ||
210 | - <ToggleButton | ||
211 | - android:id="@+id/womanButton" | ||
212 | - android:layout_width="300dp" | ||
213 | - android:layout_height="wrap_content" | ||
214 | - android:layout_weight="1" | ||
215 | - android:background="@drawable/profil_selector" | ||
216 | - android:text="여자" | ||
217 | - android:textOff="여자" | ||
218 | - android:textOn="여자" /> | ||
219 | - </LinearLayout> | ||
220 | - | ||
221 | - </LinearLayout> | ||
222 | - </LinearLayout> | ||
223 | 216 | ||
217 | + </LinearLayout> | ||
224 | </ScrollView> | 218 | </ScrollView> |
225 | 219 | ||
226 | <LinearLayout | 220 | <LinearLayout |
... | @@ -239,14 +233,18 @@ | ... | @@ -239,14 +233,18 @@ |
239 | android:layout_width="10dp" | 233 | android:layout_width="10dp" |
240 | android:layout_height="wrap_content" | 234 | android:layout_height="wrap_content" |
241 | android:layout_weight="1" | 235 | android:layout_weight="1" |
242 | - android:text="이전 단계로" /> | 236 | + android:background="#F4F4F4" |
237 | + android:text="이전 단계로" | ||
238 | + android:textColor="#757575" /> | ||
243 | 239 | ||
244 | <Button | 240 | <Button |
245 | android:id="@+id/nextButton" | 241 | android:id="@+id/nextButton" |
246 | android:layout_width="10dp" | 242 | android:layout_width="10dp" |
247 | android:layout_height="wrap_content" | 243 | android:layout_height="wrap_content" |
248 | android:layout_weight="1" | 244 | android:layout_weight="1" |
249 | - android:text="다음 단계로" /> | 245 | + android:background="#29ABE2" |
246 | + android:text="다음 단계로" | ||
247 | + android:textColor="#FFFFFF" /> | ||
250 | </LinearLayout> | 248 | </LinearLayout> |
251 | </LinearLayout> | 249 | </LinearLayout> |
252 | </LinearLayout> | 250 | </LinearLayout> | ... | ... |
... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | - tools:context=".InputProfilFourthFiveActivity"> | 7 | + tools:context=".InputProfilFirstTwoActivity"> |
8 | 8 | ||
9 | <LinearLayout | 9 | <LinearLayout |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | android:layout_width="fill_parent" | 16 | android:layout_width="fill_parent" |
17 | android:layout_height="wrap_content" | 17 | android:layout_height="wrap_content" |
18 | android:layout_marginBottom="11dp" | 18 | android:layout_marginBottom="11dp" |
19 | - android:background="#FFF" | 19 | + android:background="#0000001A" |
20 | android:elevation="5dp" | 20 | android:elevation="5dp" |
21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | 21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" |
22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> | 22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> |
... | @@ -31,31 +31,35 @@ | ... | @@ -31,31 +31,35 @@ |
31 | android:layout_width="10dp" | 31 | android:layout_width="10dp" |
32 | android:layout_height="match_parent" | 32 | android:layout_height="match_parent" |
33 | android:layout_weight="1.5" | 33 | android:layout_weight="1.5" |
34 | - android:background="#FFFFFF" | 34 | + android:background="#00000000" |
35 | android:text="나가기" | 35 | android:text="나가기" |
36 | android:textColor="#29ABE2" | 36 | android:textColor="#29ABE2" |
37 | android:textSize="16dp" /> | 37 | android:textSize="16dp" /> |
38 | + | ||
38 | <LinearLayout | 39 | <LinearLayout |
39 | android:layout_width="10dp" | 40 | android:layout_width="10dp" |
40 | android:layout_height="match_parent" | 41 | android:layout_height="match_parent" |
41 | - android:orientation="horizontal" | 42 | + android:layout_weight="1" |
42 | - android:layout_weight="1"/> | 43 | + android:orientation="horizontal" /> |
44 | + | ||
43 | <ImageView | 45 | <ImageView |
44 | android:layout_width="77dp" | 46 | android:layout_width="77dp" |
45 | android:layout_height="44dp" | 47 | android:layout_height="44dp" |
46 | android:layout_gravity="center" | 48 | android:layout_gravity="center" |
47 | android:layout_weight="1" | 49 | android:layout_weight="1" |
48 | android:src="@drawable/toolbar_logo" /> | 50 | android:src="@drawable/toolbar_logo" /> |
51 | + | ||
49 | <LinearLayout | 52 | <LinearLayout |
50 | android:layout_width="10dp" | 53 | android:layout_width="10dp" |
51 | android:layout_height="match_parent" | 54 | android:layout_height="match_parent" |
52 | - android:orientation="horizontal" | 55 | + android:layout_weight="1" |
53 | - android:layout_weight="1"/> | 56 | + android:orientation="horizontal" /> |
57 | + | ||
54 | <LinearLayout | 58 | <LinearLayout |
55 | android:layout_width="10dp" | 59 | android:layout_width="10dp" |
56 | android:layout_height="match_parent" | 60 | android:layout_height="match_parent" |
57 | - android:orientation="horizontal" | 61 | + android:layout_weight="1.5" |
58 | - android:layout_weight="1.5"/> | 62 | + android:orientation="horizontal" /> |
59 | 63 | ||
60 | </LinearLayout> | 64 | </LinearLayout> |
61 | 65 | ||
... | @@ -74,9 +78,10 @@ | ... | @@ -74,9 +78,10 @@ |
74 | android:layout_height="match_parent" | 78 | android:layout_height="match_parent" |
75 | android:layout_gravity="center" | 79 | android:layout_gravity="center" |
76 | android:layout_weight="1" | 80 | android:layout_weight="1" |
77 | - android:background="#1E90FF" | 81 | + android:background="@drawable/profile_stage" |
78 | android:gravity="center" | 82 | android:gravity="center" |
79 | - android:text="1" /> | 83 | + android:text="1" |
84 | + android:textColor="#FFFFFF" /> | ||
80 | 85 | ||
81 | <TextView | 86 | <TextView |
82 | android:id="@+id/stageTextView2" | 87 | android:id="@+id/stageTextView2" |
... | @@ -84,9 +89,10 @@ | ... | @@ -84,9 +89,10 @@ |
84 | android:layout_height="match_parent" | 89 | android:layout_height="match_parent" |
85 | android:layout_gravity="center" | 90 | android:layout_gravity="center" |
86 | android:layout_weight="1" | 91 | android:layout_weight="1" |
87 | - android:background="#1E90FF" | 92 | + android:background="#F4F4F4" |
88 | android:gravity="center" | 93 | android:gravity="center" |
89 | - android:text="2" /> | 94 | + android:text="2" |
95 | + android:textColor="#DDDDDD" /> | ||
90 | 96 | ||
91 | <TextView | 97 | <TextView |
92 | android:id="@+id/stageTextView3" | 98 | android:id="@+id/stageTextView3" |
... | @@ -94,9 +100,10 @@ | ... | @@ -94,9 +100,10 @@ |
94 | android:layout_height="match_parent" | 100 | android:layout_height="match_parent" |
95 | android:layout_gravity="center" | 101 | android:layout_gravity="center" |
96 | android:layout_weight="1" | 102 | android:layout_weight="1" |
97 | - android:background="#1E90FF" | 103 | + android:background="#F4F4F4" |
98 | android:gravity="center" | 104 | android:gravity="center" |
99 | - android:text="3" /> | 105 | + android:text="3" |
106 | + android:textColor="#DDDDDD" /> | ||
100 | 107 | ||
101 | <TextView | 108 | <TextView |
102 | android:id="@+id/stageTextView4" | 109 | android:id="@+id/stageTextView4" |
... | @@ -104,9 +111,10 @@ | ... | @@ -104,9 +111,10 @@ |
104 | android:layout_height="match_parent" | 111 | android:layout_height="match_parent" |
105 | android:layout_gravity="center" | 112 | android:layout_gravity="center" |
106 | android:layout_weight="1" | 113 | android:layout_weight="1" |
107 | - android:background="#1E90FF" | 114 | + android:background="#F4F4F4" |
108 | android:gravity="center" | 115 | android:gravity="center" |
109 | - android:text="4" /> | 116 | + android:text="4" |
117 | + android:textColor="#DDDDDD" /> | ||
110 | 118 | ||
111 | <TextView | 119 | <TextView |
112 | android:id="@+id/stageTextView5" | 120 | android:id="@+id/stageTextView5" |
... | @@ -114,8 +122,10 @@ | ... | @@ -114,8 +122,10 @@ |
114 | android:layout_height="match_parent" | 122 | android:layout_height="match_parent" |
115 | android:layout_gravity="center" | 123 | android:layout_gravity="center" |
116 | android:layout_weight="1" | 124 | android:layout_weight="1" |
125 | + android:background="#F4F4F4" | ||
117 | android:gravity="center" | 126 | android:gravity="center" |
118 | - android:text="5" /> | 127 | + android:text="5" |
128 | + android:textColor="#DDDDDD" /> | ||
119 | 129 | ||
120 | </LinearLayout> | 130 | </LinearLayout> |
121 | 131 | ||
... | @@ -129,36 +139,32 @@ | ... | @@ -129,36 +139,32 @@ |
129 | android:layout_width="match_parent" | 139 | android:layout_width="match_parent" |
130 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
131 | android:layout_weight="1" | 141 | android:layout_weight="1" |
142 | + android:gravity="center" | ||
132 | android:orientation="vertical"> | 143 | android:orientation="vertical"> |
133 | 144 | ||
134 | <LinearLayout | 145 | <LinearLayout |
135 | - android:layout_width="match_parent" | 146 | + android:layout_width="wrap_content" |
136 | android:layout_height="wrap_content" | 147 | android:layout_height="wrap_content" |
137 | android:orientation="vertical"> | 148 | android:orientation="vertical"> |
138 | 149 | ||
139 | - <RelativeLayout | 150 | + <TextView |
140 | - android:layout_width="match_parent" | 151 | + android:id="@+id/textView10" |
141 | - android:layout_height="match_parent"> | 152 | + android:layout_width="wrap_content" |
153 | + android:layout_height="wrap_content" | ||
154 | + android:text="(*필수항목)" | ||
155 | + android:textColor="#29ABE2" | ||
156 | + android:textSize="13dp" /> | ||
142 | 157 | ||
143 | - <TextView | 158 | + <TextView |
144 | - android:id="@+id/explainTextView" | 159 | + android:id="@+id/explainTextView" |
145 | - android:layout_width="match_parent" | 160 | + android:layout_width="wrap_content" |
146 | - android:layout_height="wrap_content" | 161 | + android:layout_height="wrap_content" |
147 | - android:layout_gravity="center" | 162 | + android:layout_gravity="center" |
148 | - android:gravity="center" | 163 | + android:gravity="center" |
149 | - android:text="1. 생년월일을 입력해 주세요." /> | 164 | + android:text="1. 생년월일을 입력해 주세요." |
165 | + android:textColor="#4A4A4A" | ||
166 | + android:textSize="20dp" /> | ||
150 | 167 | ||
151 | - <Button | ||
152 | - android:id="@+id/questionButton" | ||
153 | - android:layout_width="30dp" | ||
154 | - android:layout_height="30dp" | ||
155 | - android:layout_gravity="center" | ||
156 | - android:layout_toRightOf="@id/explainTextView" | ||
157 | - android:backgroundTint="#1E90FF" | ||
158 | - android:gravity="center" | ||
159 | - android:text=" ? " | ||
160 | - android:textSize="8sp" /> | ||
161 | - </RelativeLayout> | ||
162 | </LinearLayout> | 168 | </LinearLayout> |
163 | 169 | ||
164 | <LinearLayout | 170 | <LinearLayout |
... | @@ -176,16 +182,17 @@ | ... | @@ -176,16 +182,17 @@ |
176 | <LinearLayout | 182 | <LinearLayout |
177 | android:layout_width="match_parent" | 183 | android:layout_width="match_parent" |
178 | android:layout_height="wrap_content" | 184 | android:layout_height="wrap_content" |
179 | - android:orientation="vertical" > | 185 | + android:orientation="vertical"> |
180 | 186 | ||
181 | <EditText | 187 | <EditText |
182 | android:id="@+id/editText" | 188 | android:id="@+id/editText" |
183 | - android:layout_width="match_parent" | 189 | + android:layout_width="wrap_content" |
184 | android:layout_height="wrap_content" | 190 | android:layout_height="wrap_content" |
185 | android:layout_gravity="center" | 191 | android:layout_gravity="center" |
186 | android:ems="10" | 192 | android:ems="10" |
187 | android:gravity="center" | 193 | android:gravity="center" |
188 | - android:inputType="date" /> | 194 | + android:inputType="date" |
195 | + android:theme="@style/EditTheme" /> | ||
189 | 196 | ||
190 | 197 | ||
191 | </LinearLayout> | 198 | </LinearLayout> |
... | @@ -207,14 +214,18 @@ | ... | @@ -207,14 +214,18 @@ |
207 | android:layout_width="10dp" | 214 | android:layout_width="10dp" |
208 | android:layout_height="wrap_content" | 215 | android:layout_height="wrap_content" |
209 | android:layout_weight="1" | 216 | android:layout_weight="1" |
210 | - android:text="이전 단계로" /> | 217 | + android:background="#F4F4F4" |
218 | + android:text="이전 단계로" | ||
219 | + android:textColor="#757575" /> | ||
211 | 220 | ||
212 | <Button | 221 | <Button |
213 | android:id="@+id/nextButton" | 222 | android:id="@+id/nextButton" |
214 | android:layout_width="10dp" | 223 | android:layout_width="10dp" |
215 | android:layout_height="wrap_content" | 224 | android:layout_height="wrap_content" |
216 | android:layout_weight="1" | 225 | android:layout_weight="1" |
217 | - android:text="다음 단계로" /> | 226 | + android:background="#29ABE2" |
227 | + android:text="다음 단계로" | ||
228 | + android:textColor="#FFFFFF" /> | ||
218 | </LinearLayout> | 229 | </LinearLayout> |
219 | </LinearLayout> | 230 | </LinearLayout> |
220 | </LinearLayout> | 231 | </LinearLayout> | ... | ... |
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | android:layout_width="fill_parent" | 16 | android:layout_width="fill_parent" |
17 | android:layout_height="wrap_content" | 17 | android:layout_height="wrap_content" |
18 | android:layout_marginBottom="11dp" | 18 | android:layout_marginBottom="11dp" |
19 | - android:background="#FFF" | 19 | + android:background="#0000001A" |
20 | android:elevation="5dp" | 20 | android:elevation="5dp" |
21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | 21 | android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" |
22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> | 22 | app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> |
... | @@ -31,31 +31,35 @@ | ... | @@ -31,31 +31,35 @@ |
31 | android:layout_width="10dp" | 31 | android:layout_width="10dp" |
32 | android:layout_height="match_parent" | 32 | android:layout_height="match_parent" |
33 | android:layout_weight="1.5" | 33 | android:layout_weight="1.5" |
34 | - android:background="#FFFFFF" | 34 | + android:background="#00000000" |
35 | android:text="나가기" | 35 | android:text="나가기" |
36 | android:textColor="#29ABE2" | 36 | android:textColor="#29ABE2" |
37 | android:textSize="16dp" /> | 37 | android:textSize="16dp" /> |
38 | + | ||
38 | <LinearLayout | 39 | <LinearLayout |
39 | android:layout_width="10dp" | 40 | android:layout_width="10dp" |
40 | android:layout_height="match_parent" | 41 | android:layout_height="match_parent" |
41 | - android:orientation="horizontal" | 42 | + android:layout_weight="1" |
42 | - android:layout_weight="1"/> | 43 | + android:orientation="horizontal" /> |
44 | + | ||
43 | <ImageView | 45 | <ImageView |
44 | android:layout_width="77dp" | 46 | android:layout_width="77dp" |
45 | android:layout_height="44dp" | 47 | android:layout_height="44dp" |
46 | android:layout_gravity="center" | 48 | android:layout_gravity="center" |
47 | android:layout_weight="1" | 49 | android:layout_weight="1" |
48 | android:src="@drawable/toolbar_logo" /> | 50 | android:src="@drawable/toolbar_logo" /> |
51 | + | ||
49 | <LinearLayout | 52 | <LinearLayout |
50 | android:layout_width="10dp" | 53 | android:layout_width="10dp" |
51 | android:layout_height="match_parent" | 54 | android:layout_height="match_parent" |
52 | - android:orientation="horizontal" | 55 | + android:layout_weight="1" |
53 | - android:layout_weight="1"/> | 56 | + android:orientation="horizontal" /> |
57 | + | ||
54 | <LinearLayout | 58 | <LinearLayout |
55 | android:layout_width="10dp" | 59 | android:layout_width="10dp" |
56 | android:layout_height="match_parent" | 60 | android:layout_height="match_parent" |
57 | - android:orientation="horizontal" | 61 | + android:layout_weight="1.5" |
58 | - android:layout_weight="1.5"/> | 62 | + android:orientation="horizontal" /> |
59 | 63 | ||
60 | </LinearLayout> | 64 | </LinearLayout> |
61 | 65 | ||
... | @@ -74,9 +78,10 @@ | ... | @@ -74,9 +78,10 @@ |
74 | android:layout_height="match_parent" | 78 | android:layout_height="match_parent" |
75 | android:layout_gravity="center" | 79 | android:layout_gravity="center" |
76 | android:layout_weight="1" | 80 | android:layout_weight="1" |
77 | - android:background="#1E90FF" | 81 | + android:background="@drawable/profile_stage" |
78 | android:gravity="center" | 82 | android:gravity="center" |
79 | - android:text="1" /> | 83 | + android:text="1" |
84 | + android:textColor="#FFFFFF" /> | ||
80 | 85 | ||
81 | <TextView | 86 | <TextView |
82 | android:id="@+id/stageTextView2" | 87 | android:id="@+id/stageTextView2" |
... | @@ -84,9 +89,10 @@ | ... | @@ -84,9 +89,10 @@ |
84 | android:layout_height="match_parent" | 89 | android:layout_height="match_parent" |
85 | android:layout_gravity="center" | 90 | android:layout_gravity="center" |
86 | android:layout_weight="1" | 91 | android:layout_weight="1" |
87 | - android:background="#1E90FF" | 92 | + android:background="#F4F4F4" |
88 | android:gravity="center" | 93 | android:gravity="center" |
89 | - android:text="2" /> | 94 | + android:text="2" |
95 | + android:textColor="#DDDDDD" /> | ||
90 | 96 | ||
91 | <TextView | 97 | <TextView |
92 | android:id="@+id/stageTextView3" | 98 | android:id="@+id/stageTextView3" |
... | @@ -94,8 +100,10 @@ | ... | @@ -94,8 +100,10 @@ |
94 | android:layout_height="match_parent" | 100 | android:layout_height="match_parent" |
95 | android:layout_gravity="center" | 101 | android:layout_gravity="center" |
96 | android:layout_weight="1" | 102 | android:layout_weight="1" |
103 | + android:background="#F4F4F4" | ||
97 | android:gravity="center" | 104 | android:gravity="center" |
98 | - android:text="3" /> | 105 | + android:text="3" |
106 | + android:textColor="#DDDDDD" /> | ||
99 | 107 | ||
100 | <TextView | 108 | <TextView |
101 | android:id="@+id/stageTextView4" | 109 | android:id="@+id/stageTextView4" |
... | @@ -103,8 +111,10 @@ | ... | @@ -103,8 +111,10 @@ |
103 | android:layout_height="match_parent" | 111 | android:layout_height="match_parent" |
104 | android:layout_gravity="center" | 112 | android:layout_gravity="center" |
105 | android:layout_weight="1" | 113 | android:layout_weight="1" |
114 | + android:background="#F4F4F4" | ||
106 | android:gravity="center" | 115 | android:gravity="center" |
107 | - android:text="4" /> | 116 | + android:text="4" |
117 | + android:textColor="#DDDDDD" /> | ||
108 | 118 | ||
109 | <TextView | 119 | <TextView |
110 | android:id="@+id/stageTextView5" | 120 | android:id="@+id/stageTextView5" |
... | @@ -112,8 +122,10 @@ | ... | @@ -112,8 +122,10 @@ |
112 | android:layout_height="match_parent" | 122 | android:layout_height="match_parent" |
113 | android:layout_gravity="center" | 123 | android:layout_gravity="center" |
114 | android:layout_weight="1" | 124 | android:layout_weight="1" |
125 | + android:background="#F4F4F4" | ||
115 | android:gravity="center" | 126 | android:gravity="center" |
116 | - android:text="5" /> | 127 | + android:text="5" |
128 | + android:textColor="#DDDDDD" /> | ||
117 | 129 | ||
118 | </LinearLayout> | 130 | </LinearLayout> |
119 | 131 | ||
... | @@ -127,37 +139,31 @@ | ... | @@ -127,37 +139,31 @@ |
127 | android:layout_width="match_parent" | 139 | android:layout_width="match_parent" |
128 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
129 | android:layout_weight="1" | 141 | android:layout_weight="1" |
142 | + android:gravity="center" | ||
130 | android:orientation="vertical"> | 143 | android:orientation="vertical"> |
131 | 144 | ||
132 | <LinearLayout | 145 | <LinearLayout |
133 | - android:layout_width="match_parent" | 146 | + android:layout_width="wrap_content" |
134 | android:layout_height="wrap_content" | 147 | android:layout_height="wrap_content" |
135 | - android:orientation="vertical"> | 148 | + android:orientation="horizontal"> |
136 | 149 | ||
137 | - <RelativeLayout | 150 | + <TextView |
138 | - android:layout_width="match_parent" | 151 | + android:id="@+id/explainTextView" |
139 | - android:layout_height="match_parent"> | 152 | + android:layout_width="wrap_content" |
153 | + android:layout_height="wrap_content" | ||
154 | + android:layout_gravity="center" | ||
155 | + android:gravity="center" | ||
156 | + android:text="6. 자신의 가구 구성원을 \n 모두 선택해주세요." | ||
157 | + android:textColor="#4A4A4A" | ||
158 | + android:textSize="20dp" /> | ||
140 | 159 | ||
141 | - <TextView | 160 | + <Button |
142 | - android:id="@+id/explainTextView" | 161 | + android:id="@+id/questionButton" |
143 | - android:layout_width="wrap_content" | 162 | + android:layout_width="20dp" |
144 | - android:layout_height="wrap_content" | 163 | + android:layout_height="20dp" |
145 | - android:layout_centerInParent="true" | 164 | + android:layout_gravity="bottom" |
146 | - android:layout_gravity="center" | 165 | + android:background="@drawable/question_mark_image" /> |
147 | - android:gravity="center" | ||
148 | - android:text="1. 가구 구성원을 모두 선택해 주세요." /> | ||
149 | 166 | ||
150 | - <Button | ||
151 | - android:id="@+id/questionButton" | ||
152 | - android:layout_width="30dp" | ||
153 | - android:layout_height="30dp" | ||
154 | - android:layout_gravity="center" | ||
155 | - android:layout_toRightOf="@id/explainTextView" | ||
156 | - android:backgroundTint="#1E90FF" | ||
157 | - android:gravity="center" | ||
158 | - android:text=" ? " | ||
159 | - android:textSize="8sp" /> | ||
160 | - </RelativeLayout> | ||
161 | </LinearLayout> | 167 | </LinearLayout> |
162 | 168 | ||
163 | <LinearLayout | 169 | <LinearLayout |
... | @@ -387,14 +393,18 @@ | ... | @@ -387,14 +393,18 @@ |
387 | android:layout_width="10dp" | 393 | android:layout_width="10dp" |
388 | android:layout_height="wrap_content" | 394 | android:layout_height="wrap_content" |
389 | android:layout_weight="1" | 395 | android:layout_weight="1" |
390 | - android:text="이전 단계로" /> | 396 | + android:background="#F4F4F4" |
397 | + android:text="이전 단계로" | ||
398 | + android:textColor="#757575" /> | ||
391 | 399 | ||
392 | <Button | 400 | <Button |
393 | android:id="@+id/nextButton" | 401 | android:id="@+id/nextButton" |
394 | android:layout_width="10dp" | 402 | android:layout_width="10dp" |
395 | android:layout_height="wrap_content" | 403 | android:layout_height="wrap_content" |
396 | android:layout_weight="1" | 404 | android:layout_weight="1" |
397 | - android:text="다음 단계로" /> | 405 | + android:background="#29ABE2" |
406 | + android:text="다음 단계로" | ||
407 | + android:textColor="#FFFFFF" /> | ||
398 | </LinearLayout> | 408 | </LinearLayout> |
399 | </LinearLayout> | 409 | </LinearLayout> |
400 | </LinearLayout> | 410 | </LinearLayout> | ... | ... |
-
Please register or login to post a comment