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
Network
Create a new issue
Commits
Issue Boards
Authored by
신기성
2019-11-16 14:04:57 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
44c75f021af650abfe0c7d1310427654d0c505ed
44c75f02
1 parent
3e871c38
merge hard
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
144 additions
and
43 deletions
vip/app/src/main/java/com/example/vip/InputProfilSecondOneActivity.kt
vip/app/src/main/java/com/example/vip/MainActivity.kt
vip/app/src/main/res/layout/activity_input_profil_fifth_four.xml
vip/app/src/main/res/layout/activity_input_profil_fifth_one.xml
vip/app/src/main/res/layout/activity_input_profil_fifth_three.xml
vip/app/src/main/res/layout/activity_input_profil_fifth_two.xml
vip/app/src/main/res/layout/activity_input_profil_fourth_five.xml
vip/app/src/main/res/layout/activity_input_profil_fourth_four.xml
vip/app/src/main/res/layout/activity_input_profil_fourth_one.xml
vip/app/src/main/res/layout/activity_input_profil_fourth_three.xml
vip/app/src/main/res/layout/activity_input_profil_fourth_two.xml
vip/app/src/main/res/layout/activity_input_profil_second_one.xml
vip/app/src/main/res/layout/activity_input_profil_second_three.xml
vip/app/src/main/res/layout/activity_input_profil_second_two.xml
vip/app/src/main/res/layout/activity_input_profil_third_four.xml
vip/app/src/main/res/layout/activity_input_profil_third_one.xml
vip/app/src/main/res/layout/activity_input_profil_third_three.xml
vip/app/src/main/res/layout/activity_input_profil_third_two.xml
vip/app/src/main/java/com/example/vip/InputProfilSecondOneActivity.kt
View file @
44c75f0
...
...
@@ -5,21 +5,79 @@ import android.content.Intent
import
android.content.SharedPreferences
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
android.util.Log
import
android.widget.TextView
import
android.widget.Toast
import
androidx.appcompat.app.AlertDialog
import
com.google.android.gms.tasks.OnCompleteListener
import
com.google.firebase.auth.FirebaseAuth
import
com.google.firebase.database.FirebaseDatabase
import
com.google.firebase.iid.FirebaseInstanceId
import
kotlinx.android.synthetic.main.activity_input_profil_second_one.*
class
InputProfilSecondOneActivity
:
AppCompatActivity
()
{
private
val
firebaseAuth
=
FirebaseAuth
.
getInstance
()
val
user_db
=
FirebaseDatabase
.
getInstance
(
"https://capstone-vip-user.firebaseio.com/"
).
reference
private
fun
sendToken
(){
FirebaseInstanceId
.
getInstance
().
instanceId
.
addOnCompleteListener
(
OnCompleteListener
{
task
->
if
(!
task
.
isSuccessful
)
{
//Log.w(TAG, "getInstanceId failed", task.exception)
return
@OnCompleteListener
}
// Get new Instance ID token
tkn
=
task
.
result
!!
.
token
// Log and toast
val
msg
=
getString
(
R
.
string
.
msg_token_fmt
,
tkn
)
//Log.d(TAG, msg)
Toast
.
makeText
(
baseContext
,
msg
,
Toast
.
LENGTH_SHORT
).
show
()
})
}
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)
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_input_profil_second_one
)
val
prof
:
SharedPreferences
=
getSharedPreferences
(
"profdata"
,
Context
.
MODE_PRIVATE
)
val
editor
:
SharedPreferences
.
Editor
=
prof
.
edit
()
// 1. 툴바 사용 설정
setSupportActionBar
(
toolbar
)
//pushing code start
intent
.
extras
?.
let
{
for
(
key
in
it
.
keySet
())
{
val
value
=
intent
.
extras
?.
get
(
key
)
//Log.d(TAG, "Key: $key Value: $value")
}
}
//pushing code end
skipButton
.
setOnClickListener
{
var
intent
=
Intent
(
this
,
InputProfilSecondOneActivity
::
class
.
java
)
sendToken
()
val
user
=
firebaseAuth
?.
currentUser
val
cat_list
=
listOf
(
"c1_1"
)
val
policy_string_list
=
listOf
(
""
)
var
policy_string
=
""
prof
.
getInt
(
"c1_1"
,
1
)
if
(
prof
.
getInt
(
"c1_1"
,
1
)==
1
){
policy_string
=
policy_string
}
writeNewUser
(
user
!!
.
uid
,
"$tkn"
,
policy_string
)
var
intent
=
Intent
(
this
,
SignInActivity
::
class
.
java
)
startActivity
(
intent
)
}
...
...
@@ -53,8 +111,7 @@ class InputProfilSecondOneActivity : AppCompatActivity() {
startActivity
(
intent
)
}
val
prof
:
SharedPreferences
=
getSharedPreferences
(
"profdata"
,
Context
.
MODE_PRIVATE
)
val
editor
:
SharedPreferences
.
Editor
=
prof
.
edit
()
nextButton
.
setOnClickListener
{
...
...
vip/app/src/main/java/com/example/vip/MainActivity.kt
View file @
44c75f0
...
...
@@ -14,7 +14,10 @@ import android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.Toast
import
com.google.android.gms.tasks.OnCompleteListener
import
com.google.firebase.auth.FirebaseAuth
import
com.google.firebase.iid.FirebaseInstanceId
import
com.google.firebase.iid.FirebaseInstanceId.getInstance
import
kotlinx.android.synthetic.main.activity_main.*
import
org.w3c.dom.Node
import
java.lang.Boolean.getBoolean
...
...
@@ -28,10 +31,8 @@ class MainActivity : AppCompatActivity() {
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_main
)
emailSigninBtn
.
setOnClickListener
{
emailSigninBtn
.
setOnClickListener
{
loginEmail
()
}
textview2
.
setOnClickListener
{
...
...
@@ -48,6 +49,8 @@ class MainActivity : AppCompatActivity() {
}
private
fun
loginEmail
(){
firebaseAuth
!!
.
signInWithEmailAndPassword
(
edit_email
.
text
.
toString
(),
edit_password
.
text
.
toString
())
.
addOnCompleteListener
(
this
)
{
...
...
@@ -62,12 +65,13 @@ class MainActivity : AppCompatActivity() {
}
}
else
{
// If sign in fails, display a message to the user.
Toast
.
makeText
(
this
,
"signInWithEmail failed."
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
}
...
...
vip/app/src/main/res/layout/activity_input_profil_fifth_four.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_fifth_one.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_fifth_three.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_fifth_two.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_fourth_five.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_fourth_four.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_fourth_one.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_fourth_three.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_fourth_two.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_second_one.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_second_three.xml
View file @
44c75f0
...
...
@@ -32,32 +32,31 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:orientation=
"horizontal"
/>
android:orientation=
"horizontal"
android:layout_weight=
"1"
/>
<ImageView
android:layout_width=
"77dp"
android:layout_height=
"44dp"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:src=
"@drawable/toolbar_logo"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:orientation=
"horizontal"
/>
android:orientation=
"horizontal"
android:layout_weight=
"1"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:
layout_weight=
"1.5
"
android:
orientation=
"horizontal"
/>
android:
orientation=
"horizontal
"
android:
layout_weight=
"1.5"
/>
</LinearLayout>
...
...
vip/app/src/main/res/layout/activity_input_profil_second_two.xml
View file @
44c75f0
...
...
@@ -32,32 +32,31 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:orientation=
"horizontal"
/>
android:orientation=
"horizontal"
android:layout_weight=
"1"
/>
<ImageView
android:layout_width=
"77dp"
android:layout_height=
"44dp"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:src=
"@drawable/toolbar_logo"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:orientation=
"horizontal"
/>
android:orientation=
"horizontal"
android:layout_weight=
"1"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:
layout_weight=
"1.5
"
android:
orientation=
"horizontal"
/>
android:
orientation=
"horizontal
"
android:
layout_weight=
"1.5"
/>
</LinearLayout>
...
...
vip/app/src/main/res/layout/activity_input_profil_third_four.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_third_one.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_third_three.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
vip/app/src/main/res/layout/activity_input_profil_third_two.xml
View file @
44c75f0
...
...
@@ -31,7 +31,10 @@
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.5"
android:text=
"건너뛰기"
/>
android:background=
"#FFFFFF"
android:text=
"나가기"
android:textColor=
"#29ABE2"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"10dp"
android:layout_height=
"match_parent"
...
...
Please
register
or
login
to post a comment