package com.example.watch.ui.activity

import android.view.View
import android.view.ViewGroup
import android.view.WindowManager

import androidx.viewpager.widget.PagerAdapter
import com.example.watch.R


class MyPagerAdapter : PagerAdapter {
    private var viewLists: ArrayList<View>? = null

    constructor() {}
    constructor(viewLists: ArrayList<View>?) : super() {
        this.viewLists = viewLists
    }

    override fun getCount(): Int {
        return viewLists!!.size
    }

    override fun isViewFromObject(view: View, `object`: Any): Boolean {
        return view === `object`
    }

    override fun instantiateItem(container: ViewGroup, position: Int): Any {
        container.addView(viewLists!![position])
        return viewLists!![position]
    }

    override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
        container.removeView(viewLists!![position])
    }
}
