package com.example.smart119

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.smart119.views.AddressSearchFragment
import com.example.smart119.views.LocationSearchFragment

class ViewPagerAdapter(activity: FragmentActivity) : FragmentStateAdapter(activity)  {
    override fun getItemCount(): Int = 2 // 탭 개수

    override fun createFragment(position: Int): Fragment {
        return when (position) {
            0 -> AddressSearchFragment()
            1 -> LocationSearchFragment()
            else -> AddressSearchFragment()
        }
    }

}