blob: 0648450037060aaa3cb6de33dc1798ef2ae4bb5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package com.pitchedapps.frost.fragments
import android.support.v4.app.Fragment
import com.pitchedapps.frost.utils.putInt
/**
* Created by Allan Wang on 2017-05-29.
*/
interface BaseFragmentContract {
fun onBackPressed(): Boolean
}
abstract class BaseFragment : Fragment(), BaseFragmentContract {
val position: Int by lazy { arguments.getInt(ARG_POSITION) }
companion object {
val ARG_POSITION = "arg_position"
fun <T : BaseFragment> newInstance(fragment: T, position: Int): T {
fragment.putInt(ARG_POSITION, position)
return fragment
}
}
}
|