신기성

welcome onboarding proto done

......@@ -43,6 +43,8 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
apply plugin: 'com.google.gms.google-services'
......
......@@ -9,13 +9,14 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/NoActionBar">
<activity android:name=".OnboardingActivity"></activity>
<activity android:name=".WelcomeActivity"></activity>
<activity android:name=".OnboardingActivity" />
<activity android:name=".PushingActivity" />
<activity android:name=".DetailActivity" />
<activity android:name=".InfoActivity" />
<activity android:name=".FavoritesActivity" />
<activity android:name=".RecommendActivity" />
<activity android:name=".TestingActivity" />
<activity android:name=".WelcomeActivity" />
<activity android:name=".SignInActivity" />
<activity android:name=".SignUpActivity" />
<activity android:name=".MainActivity" />
......
......@@ -2,10 +2,13 @@ package com.example.vip
import android.animation.Animator
import android.animation.AnimatorInflater
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.preference.PreferenceManager
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
......@@ -21,9 +24,30 @@ class MainActivity : AppCompatActivity() {
private val firebaseAuth = FirebaseAuth.getInstance()
// EmailCreate
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//onboarding start
//onboarding end
setContentView(R.layout.activity_main)
emailSigninBtn.setOnClickListener{
loginEmail()
}
emailSignupBtn.setOnClickListener {
var intent = Intent(this, SignUpActivity::class.java)
startActivity(intent)
}
}
// Email SignIn
private fun loginEmail(){
firebaseAuth!!.signInWithEmailAndPassword(edit_email.text.toString(), edit_password.text.toString())
.addOnCompleteListener(this) {
......@@ -48,25 +72,7 @@ class MainActivity : AppCompatActivity() {
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
emailSigninBtn.setOnClickListener{
loginEmail()
}
emailSignupBtn.setOnClickListener {
var intent = Intent(this, SignUpActivity::class.java)
startActivity(intent)
}
}
......
package com.example.vip
import android.content.Intent
import android.system.Os.bind
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.item_policyfield.view.*
import kotlinx.android.synthetic.main.item_search.view.*
class SearchAdapter(private val items: ArrayList<SearchItem>) :
......@@ -40,7 +37,7 @@ class SearchAdapter(private val items: ArrayList<SearchItem>) :
view.searchIconText.text = item.searchItemText
view.setOnClickListener{
val intent=Intent(view.context, TestingActivity::class.java)
val intent=Intent(view.context, WelcomeActivity::class.java)
view.context.startActivity(intent)
}
}
......
package com.example.vip
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.view.Menu
......@@ -66,7 +65,7 @@ class SignInActivity : AppCompatActivity() {
val adapter = PolicyFieldAdapter(policyFieldList)
policyFieldRecyclerView.adapter = adapter
viewpager = findViewById(R.id.viewpager) as ViewPager
viewpager = findViewById(R.id.welcomeViewPager) as ViewPager
val viewpageradapter = ViewPagerAdapter(this)
viewpager.adapter = viewpageradapter
......
package com.example.vip
import android.content.Intent
import android.content.SharedPreferences
import android.os.Bundle
import android.os.Handler
import android.os.SystemClock
import androidx.appcompat.app.AppCompatActivity
class SplashActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val settings: SharedPreferences = getSharedPreferences("dico", MODE_PRIVATE)
if(!settings.getBoolean("isFirst", false))
{
val editor: SharedPreferences.Editor = settings.edit()
editor.putBoolean("isFirst", true)
editor.commit()
val intent = Intent(this, WelcomeActivity::class.java)
startActivity(intent)
finish()
}
else
{
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
}
}
\ No newline at end of file
......
package com.example.vip
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class TestingActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_testing)
}
}
package com.example.vip
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.viewpager.widget.ViewPager
import kotlinx.android.synthetic.main.activity_signin.*
import kotlinx.android.synthetic.main.activity_welcome.*
class WelcomeActivity : AppCompatActivity() {
internal lateinit var welcomeViewPager: ViewPager
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_welcome)
welcomeViewPager = findViewById(R.id.welcomeViewPager) as ViewPager
val viewpageradapter = WelcomeViewPagerAdapter(this)
welcomeViewPager.adapter = viewpageradapter
buttonGotIt.setOnClickListener{
var intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
}
}
package com.example.vip
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
class WelcomeViewPagerAdapter(private val context : Context) : PagerAdapter() {
private var layoutInflater : LayoutInflater? = null
val Image = arrayOf(
R.drawable.hwajilgooji1,
R.drawable.hwajilgooji2,
R.drawable.hwajilgooji3
)
override fun isViewFromObject(view: View, `object`: Any): Boolean {
return view === `object`
}
override fun getCount(): Int {
return Image.size
}
override fun instantiateItem(container: ViewGroup, position: Int): Any {
layoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
val v = layoutInflater!!.inflate(R.layout.welcomeviewpager_activity, null)
val image = v.findViewById<View>(R.id.imageview) as ImageView
image.setImageResource(Image[position])
val vp = container as ViewPager
vp.addView(v , 0)
return v
}
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
val vp = container as ViewPager
val v = `object` as View
vp.removeView(v)
}
}
\ No newline at end of file
......@@ -35,7 +35,7 @@
</androidx.appcompat.widget.Toolbar>
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewpager"
android:id="@+id/welcomeViewPager"
android:layout_width="400dp"
android:layout_height="220dp"
android:layout_gravity="center"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".TestingActivity">
</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:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".WelcomeActivity">
<androidx.viewpager.widget.ViewPager
android:id="@+id/welcomeViewPager"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_gravity="fill_vertical"
android:layout_weight="1">
</androidx.viewpager.widget.ViewPager>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:orientation="horizontal">
<Button
android:id="@+id/buttonGotIt"
android:layout_width="wrap_content"
android:layout_height="70dp"
android:layout_weight="1"
android:text="시작하기" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/hwajilgooji1">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/hwajilgooji2">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/hwajilgooji3">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
tools:srcCompat="@tools:sample/avatars" />
</LinearLayout>
\ No newline at end of file
......@@ -20,7 +20,6 @@ allprojects {
repositories {
google()
jcenter()
}
}
......