diff --git a/app/src/main/kotlin/jackall/moncalc/adapter/MainFragmentPagerAdapter.kt b/app/src/main/kotlin/jackall/moncalc/adapter/MainFragmentPagerAdapter.kt index 2df497f..7c6b34f 100644 --- a/app/src/main/kotlin/jackall/moncalc/adapter/MainFragmentPagerAdapter.kt +++ b/app/src/main/kotlin/jackall/moncalc/adapter/MainFragmentPagerAdapter.kt @@ -5,23 +5,21 @@ import android.support.v4.app.FragmentManager import android.support.v4.app.FragmentPagerAdapter import jackall.moncalc.R -import jackall.moncalc.fragment.AnalyzeFragment +import jackall.moncalc.fragment.FruitAnalyze import jackall.moncalc.fragment.HistoryFragment +import jackall.moncalc.fragment.TempleAnalyze /** * Created by matsumoto_k on 2017/11/03. */ class MainFragmentPagerAdapter(fragmentManager: FragmentManager, val context: Context) : FragmentPagerAdapter(fragmentManager) { - val pageCount = 2 - val titles = arrayOf(context.resources.getString(R.string.history), context.resources.getString(R.string.analyze)) + val pageCount = 3 + val titles = arrayOf(context.resources.getString(R.string.history), context.resources.getString(R.string.temple_analyze), context.resources.getString(R.string.fruit_analyze)) override fun getItem(position: Int): Fragment? { when (position) { - 0 -> { - return HistoryFragment() - } - 1 -> { - return AnalyzeFragment() - } + 0 -> return HistoryFragment() + 1 -> return TempleAnalyze() + 2 -> return FruitAnalyze() } return null }