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
신기성
2019-10-23 17:03:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ff9b6376ab0882d4d27423c93b6b40a140664a72
ff9b6376
1 parent
6632e7c7
adding signup confirm
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
87 additions
and
5 deletions
vip/app/build.gradle
vip/app/src/main/java/com/example/vip/FieldAdapter.kt
vip/app/src/main/java/com/example/vip/PolicyField.kt
vip/app/src/main/java/com/example/vip/SignInActivity.kt
vip/app/src/main/java/com/example/vip/SignUpActivity.kt
vip/app/src/main/res/layout/activity_signin.xml
vip/app/src/main/res/layout/field.xml
vip/app/build.gradle
View file @
ff9b637
...
...
@@ -35,6 +35,7 @@ dependencies {
testImplementation
'junit:junit:4.12'
androidTestImplementation
'androidx.test:runner:1.2.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
implementation
'androidx.recyclerview:recyclerview:1.1.0-beta05'
}
apply
plugin:
'com.google.gms.google-services'
...
...
vip/app/src/main/java/com/example/vip/FieldAdapter.kt
0 → 100644
View file @
ff9b637
package
com.example.vip
import
android.view.LayoutInflater
import
android.view.ViewGroup
import
androidx.recyclerview.widget.RecyclerView
import
kotlinx.android.synthetic.main.field.view.*
class
MainAdapter
:
RecyclerView
.
Adapter
<
MainAdapter
.
MainViewHolder
>()
{
var
items
:
MutableList
<
PolicyField
>
=
mutableListOf
(
PolicyField
(
"Title1"
,
"Content1"
),
PolicyField
(
"Title2"
,
"Content2"
),
PolicyField
(
"Title3"
,
"Content3"
))
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
p1
:
Int
)
=
MainViewHolder
(
parent
)
override
fun
getItemCount
():
Int
=
items
.
size
override
fun
onBindViewHolder
(
holer
:
MainViewHolder
,
position
:
Int
)
{
items
[
position
].
let
{
item
->
with
(
holer
)
{
tvTitle
.
text
=
item
.
title
tvContent
.
text
=
item
.
content
}
}
}
inner
class
MainViewHolder
(
parent
:
ViewGroup
)
:
RecyclerView
.
ViewHolder
(
LayoutInflater
.
from
(
parent
.
context
).
inflate
(
R
.
layout
.
field
,
parent
,
false
))
{
val
tvTitle
=
itemView
.
tv_main_title
val
tvContent
=
itemView
.
tv_main_content
}
}
vip/app/src/main/java/com/example/vip/PolicyField.kt
0 → 100644
View file @
ff9b637
package
com.example.vip
class
PolicyField
(
val
title
:
String
,
val
content
:
String
)
\ No newline at end of file
vip/app/src/main/java/com/example/vip/SignInActivity.kt
View file @
ff9b637
package
com.example.vip
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
androidx.appcompat.app.AppCompatActivity
import
androidx.recyclerview.widget.LinearLayoutManager
import
kotlinx.android.synthetic.main.activity_signin.*
class
SignInActivity
:
AppCompatActivity
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_signin
)
rv_field
.
adapter
=
MainAdapter
()
rv_field
.
layoutManager
=
LinearLayoutManager
(
this
)
}
}
...
...
vip/app/src/main/java/com/example/vip/SignUpActivity.kt
View file @
ff9b637
package
com.example.vip
import
android.content.Intent
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
android.widget.Toast
import
androidx.appcompat.app.AppCompatActivity
import
com.google.firebase.auth.FirebaseAuth
import
kotlinx.android.synthetic.main.activity_main.*
import
kotlinx.android.synthetic.main.activity_signup.*
class
SignUpActivity
:
AppCompatActivity
()
{
...
...
@@ -19,8 +18,6 @@ class SignUpActivity : AppCompatActivity() {
signupBtn
.
setOnClickListener
{
createEmail
()
var
intent
=
Intent
(
this
,
MainActivity
::
class
.
java
)
startActivity
(
intent
)
}
}
...
...
@@ -31,6 +28,10 @@ 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
()
if
(
user
!=
null
){
var
intent
=
Intent
(
this
,
MainActivity
::
class
.
java
)
startActivity
(
intent
)
}
}
else
{
// If sign in fails, display a message to the user.
Toast
.
makeText
(
this
,
"회원가입 실패"
,
Toast
.
LENGTH_SHORT
).
show
()
...
...
vip/app/src/main/res/layout/activity_signin.xml
View file @
ff9b637
...
...
@@ -17,4 +17,13 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_field"
android:layout_width=
"200dp"
android:layout_height=
"50dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/textView"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...
...
vip/app/src/main/res/layout/field.xml
0 → 100644
View file @
ff9b637
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_margin=
"20dp"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_main_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"TITLE"
/>
<TextView
android:id=
"@+id/tv_main_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/tv_main_title"
android:layout_marginTop=
"10dp"
android:autoLink=
"web"
tools:text=
"Content"
/>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
Please
register
or
login
to post a comment