package Ġio . github . r ak sh ak he g de . last pager adapter sample Ċ Ċ import Ġandroid . support . v 4 . view . ViewPager Ċ import Ġio . github . r ak sh ak he g de . last pager adapter . Last Pager Adapter Ċ import Ġio . github . r ak sh ak he g de . last pager adapter . last Pager Adapter Ċ Ċ /** Ċ Ġ* ĠCreated Ġby Ġr ak sh ak he g de Ġon Ġ 0 2 / 0 2 / 1 7 . Ċ Ġ*/ Ċ Ċ /* ĠNot Ġused Ġanywhere Ġ*/ Ċ class ĠKotlin Api Usage Ġ{ ĊĊ ĉ late init Ġvar Ġview pager : ĠView Pager ĊĊ ĉ fun Ġapi Usage 1 () Ġ{ Ċĉ ĉ view pager . last Pager Adapter ( BR . model ) Ġ{ Ċĉĉ ĉ add ( layout Id Ġ= ĠR . layout . one _ layout , Ġmodel Ġ= Ġ" one ", Ġtitle Ġ= Ġ" First ĠLayout ") Ċĉĉ ĉ add ( R . layout . two _ layout , Ġtitle Ġ= Ġ" Different ĠLayout ") Ċĉĉ ĉ add ( layout Id Ġ= ĠR . layout . one _ layout , Ġmodel Ġ= Ġ" Last ĠIndex ", Ġtitle Ġ= Ġ" First ĠLayout ĠAgain ") Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ fun Ġapi Usage 2 () Ġ{ ĊĊĉ ĉ Last Pager Adapter ( BR . model ) Ċĉĉĉ ĉ . add ( layout Id Ġ= ĠR . layout . one _ layout , Ġmodel Ġ= Ġ" one ", Ġtitle Ġ= Ġ" First ĠLayout ") Ċĉĉĉ ĉ . add ( R . layout . two _ layout , Ġtitle Ġ= Ġ" Different ĠLayout ") Ċĉĉĉ ĉ . add ( layout Id Ġ= ĠR . layout . one _ layout , Ġmodel Ġ= Ġ" Last ĠIndex ", Ġtitle Ġ= Ġ" First ĠLayout ĠAgain ") Ċĉĉĉ ĉ . into ( view pager ) Ċ ĉ } ĊĊ ĉ fun Ġapi Usage 3 () Ġ{ ĊĊĉ ĉ Last Pager Adapter ( BR . model ). apply Ġ{ ĊĊĉĉ ĉ add ( layout Id Ġ= ĠR . layout . one _ layout , Ġmodel Ġ= Ġ" one ", Ġtitle Ġ= Ġ" First ĠLayout ") Ċĉĉ ĉ add ( R . layout . two _ layout , Ġtitle Ġ= Ġ" Different ĠLayout ") Ċĉĉ ĉ add ( layout Id Ġ= ĠR . layout . one _ layout , Ġmodel Ġ= Ġ" Last ĠIndex ", Ġtitle Ġ= Ġ" First ĠLayout ĠAgain ") ĊĊĉĉ ĉ into ( view pager ) Ċĉ ĉ } Ċ ĉ } Ċ }