신기성

welcome onboarding proto done

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