신기성

adding signup confirm

......@@ -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'
......
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
}
}
package com.example.vip
class PolicyField(val title:String, val content:String)
\ No newline at end of file
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)
}
}
......
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()
......
......@@ -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
......
<?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