Toggle navigation
Toggle navigation
This project
Loading...
Sign in
신기성
/
WELLO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Authored by
soonmyeong2
2019-10-30 01:36:13 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
ec9e40edc2d02c93acc0cfe63399c92f07668e8f
ec9e40ed
2 parents
9d24c924
c17d39bd
merge userDB, serach view
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletions
vip/app/src/main/java/com/example/vip/SearchActivity.kt
vip/app/src/main/java/com/example/vip/SignUpActivity.kt
vip/app/src/main/java/com/example/vip/SearchActivity.kt
View file @
ec9e40e
...
...
@@ -50,7 +50,19 @@ class SearchActivity : AppCompatActivity() {
Toast
.
makeText
(
this
@SearchActivity
,
"실패부분 : $query"
,
Toast
.
LENGTH_SHORT
).
show
()
}
override
fun
onDataChange
(
dataSnapshot
:
DataSnapshot
)
{
<<<<<<<
HEAD
for
(
memoSnapshot
in
dataSnapshot
.
children
){
=======
// 타겟 1개 if (dataSnapshot.exists()){
// val memo = dataSnapshot.getValue(MemoItem::class.java)
// if (memo != null){
// Toast.makeText(this@SearchActivity, memo!!.Policy, Toast.LENGTH_SHORT).show()
// }
//
// }
for
(
memoSnapshot
in
dataSnapshot
.
children
){
>>>>>>>
makeUserDB
val
memo
=
memoSnapshot
.
getValue
(
MemoItem
::
class
.
java
)
searchList
.
add
(
...
...
vip/app/src/main/java/com/example/vip/SignUpActivity.kt
View file @
ec9e40e
...
...
@@ -5,12 +5,20 @@ import android.os.Bundle
import
android.widget.Toast
import
androidx.appcompat.app.AppCompatActivity
import
com.google.firebase.auth.FirebaseAuth
import
com.google.firebase.database.FirebaseDatabase
import
kotlinx.android.synthetic.main.activity_signup.*
data class
User
(
val
u_token
:
String
=
""
,
val
Policy
:
String
=
""
)
var
cnt
=
0
class
SignUpActivity
:
AppCompatActivity
()
{
private
val
RC_SIGN_IN
=
9001
private
val
firebaseAuth
=
FirebaseAuth
.
getInstance
()
val
user_db
=
FirebaseDatabase
.
getInstance
(
"https://capstone-vip-user.firebaseio.com/"
).
reference
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
...
...
@@ -21,6 +29,11 @@ class SignUpActivity : AppCompatActivity() {
}
}
private
fun
writeNewUser
(
u_id
:
String
,
u_token
:
String
,
Policy
:
String
?)
{
val
user
=
User
(
u_token
,
Policy
!!
)
user_db
.
child
(
u_id
).
setValue
(
user
)
/// .setValue(user)
}
private
fun
createEmail
(){
firebaseAuth
!!
.
createUserWithEmailAndPassword
(
edit_email_sign_up
.
text
.
toString
(),
edit_password_sign_up
.
text
.
toString
())
.
addOnCompleteListener
(
this
)
{
...
...
@@ -28,6 +41,9 @@ class SignUpActivity : AppCompatActivity() {
// Sign in success, update UI with the signed-in user's information
val
user
=
firebaseAuth
?.
currentUser
Toast
.
makeText
(
this
,
"회원가입 완료!"
,
Toast
.
LENGTH_SHORT
).
show
()
writeNewUser
(
user
!!
.
uid
,
"따큰$cnt"
,
"NULL$cnt"
)
cnt
++
if
(
user
!=
null
){
var
intent
=
Intent
(
this
,
MainActivity
::
class
.
java
)
startActivity
(
intent
)
...
...
Please
register
or
login
to post a comment