package com.scliang.kquick.demo

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.scliang.kquick.BaseFragment

/**
 * Created by scliang on 2017/6/23.
 *
 */
class DemoFragment : BaseFragment<IData>() {

    override fun onCreateView(inflater: LayoutInflater?,
                              container: ViewGroup?,
                              savedInstanceState: Bundle?): View? {
        return inflater!!.inflate(R.layout.fragment_demo, container, false)
    }

    override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        val action: TextView? = view!!.findViewById(R.id.action)
        action?.setOnClickListener {
            val args = Bundle()
            args.putString("From", "DemoFragment")
            startFragment(TwoFragment().javaClass,
                    container = DemoContainerActivity().javaClass,
                    args = args)
        }
    }
}