Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class Layout[TL <: TypedLayout[_], TVHF <: TypedViewHolderFactory[TL]]( layout: Witness.Lt[TL] )(
- implicit
- val tvhf: TVHF
- ) extends Activity {
- private var holder: TVHF#VH = _
- @inline
- final def view: TVHF#VH = holder
- override def onCreate( state: Option[Bundle] ) = {
- super.onCreate( state )
- val content = getWindow.getDecorView
- .findViewById( android.R.id.content )
- .asInstanceOf[ViewGroup]
- holder = tvhf.create {
- getLayoutInflater.inflate( layout.value.id, content, false )
- .asInstanceOf[tvhf.V]
- }
- setContentView( holder.rootView, holder.rootView.getLayoutParams )
- }
- }
- class Activity extends Layout( TR.layout.screen_control_center ) {
- override def onCreate( state: Option[Bundle] ) = {
- super.onCreate( state )
- view.recycler.setLayoutManager( new LinearLayoutManager( context, VERTICAL, false ) )
- }
- }
Add Comment
Please, Sign In to add comment