package Ġstan . android demo . project . M ito Ċ Ċ import Ġandroid . support . v 7 . app . AppCompatActivity Ċ import Ġandroid . os . Bundle Ċ import Ġkotlinx . android . synt hetic . main . activity _ mit o .* Ċ import Ġstan . android demo . Page Adapter Ċ import Ġstan . android demo . R Ċ Ċ class ĠDynamic M ito Activity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġlateinit Ġvar Ġm Adapter : ĠPage Adapter ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ dynamic _ mit o ) ĊĊĠĠĠĠĠĠĠ Ġset Support ActionBar ( toolbar ) ĊĠĠĠĠĠĠĠ Ġtoolbar . set Navigation OnClickListener Ġ{ Ġon Back Pressed () Ġ} ĊĊĠĠĠĠĠĠĠ Ġsupport ActionBar ?. set Display Home As Up Enabled ( true ) ĊĠĠĠĠĠĠĠ Ġval Ġtitles Ġ= Ġarray ListOf (" åħ¨éĥ¨ ", ĉ " å¨ ± ä¹Ĳ æĺİ æĺŁ "," ç½ĳç»ľ çº¢ äºº "," æŃĮ æĽ² èĪ ŀ è ¹ Ī "," å½± è§Ĩ å¤§ åħ¨ "," åĬ¨ æ¼ « åį¡ éĢļ "," æ¸¸æĪı å¤© åľ° "," åĬ¨ çī© èĲ Į å® ł "," é£İ æĻ¯ åĲį èĥ ľ "," å¤© çĶŁ å° ¤ çī© "," åħ¶ä»ĸ è§Ĩé¢ĳ ") ĊĠĠĠĠĠĠĠ Ġval Ġfragments Ġ= Ġarray ListOf < Dynamic M ito Fragment >() ĊĠĠĠĠĠĠĠ Ġfor Ġ( i Ġin Ġ 0 Ġuntil Ġtitles . size ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġf ra Ġ= ĠDynamic M ito Fragment . create Fragment () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġbundle Ġ= ĠBundle () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbundle . putString (" cat ", titles [ i ]) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġf ra . arguments Ġ= Ġbundle ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragments . add ( f ra ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġm Adapter Ġ= ĠPage Adapter ( support FragmentManager , fragments , titles ) ĊĠĠĠĠĠĠĠ Ġview Pager . adapter Ġ= Ġm Adapter ĊĠĠĠĠĠĠĠ Ġtab Layout . setup With ViewPager ( view Pager ) ĊĊĊĊĠĠĠ Ġ} Ċ } Ċ