blob: 4ca45d860f6a1140d8a521ef284fd54246dc6524 (
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
26
27
28
29
30
31
|
package com.pitchedapps.frost.fragments
import android.support.annotation.CallSuper
import android.support.v4.app.Fragment
import com.pitchedapps.frost.utils.putInt
import com.pitchedapps.frost.utils.refWatch
/**
* 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
}
}
// override fun onDestroyView() {
// super.onDestroyView()
// refWatch()
// }
}
|