/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 9 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġcom . android . tools . idea . wizard . template . impl . activities . tab bed Activity . src . app _ package Ċ Ċ import Ġcom . android . tools . idea . wizard . template . Language Ċ import Ġcom . android . tools . idea . wizard . template . get Material Component Name Ċ import Ġcom . android . tools . idea . wizard . template . escape Kotlin Identifier Ċ import Ġcom . android . tools . idea . wizard . template . impl . activities . common . findViewById Ċ import Ġcom . android . tools . idea . wizard . template . impl . activities . common . import View Binding Class Ċ import Ġcom . android . tools . idea . wizard . template . impl . activities . common . layout To View Binding Class Ċ import Ġcom . android . tools . idea . wizard . template . render If Ċ Ċ fun Ġtabs Activity Kt ( ĊĠ Ġactivity Class : ĠString , ĊĠ Ġlayout Name : ĠString , ĊĠ ĠpackageName : ĠString , ĊĠ Ġuse Android X : ĠBoolean , ĊĠ Ġis View Binding Supported : ĠBoolean Ċ ): ĠString Ġ{ ĊĊĠ Ġval Ġcontent View Block Ġ= Ġif Ġ( is View Binding Supported ) Ġ""" ĊĠĠĠĠ Ġbinding Ġ= Ġ${ layout To View Binding Class ( layout Name )}. inflate ( layout Inflater ) ĊĠĠĠĠ ĠsetContentView ( binding . root ) ĊĠ Ġ""" Ġelse Ġ" set ContentView ( R . layout .$ layout Name )" ĊĊĠ Ġreturn Ġ""" package Ġ${ escape Kotlin Identifier ( packageName )} Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġ${ get Material Component Name (" android . support . design . widget . Floating ActionButton ", Ġuse Android X )} Ċ import Ġ${ get Material Component Name (" android . support . design . widget . Snackbar ", Ġuse Android X )} Ċ import Ġ${ get Material Component Name (" android . support . design . widget . Tab Layout ", Ġuse Android X )} Ċ import Ġ${ get Material Component Name (" android . support . v 4 . view . ViewPager ", Ġuse Android X )} Ċ import Ġ${ get Material Component Name (" android . support . v 7 . app . AppCompatActivity ", Ġuse Android X )} Ċ import Ġandroid . view . Menu Ċ import Ġandroid . view . MenuItem Ċ import Ġ${ packageName }. ui . main . Sections Pager Adapter Ċ ${ import View Binding Class ( is View Binding Supported , ĠpackageName , Ġlayout Name , ĠLanguage . Kotlin )} Ċ Ċ class Ġ${ activity Class } Ġ: ĠAppCompatActivity () Ġ{ Ċ Ċ ${ render If ( is View Binding Supported ) Ġ{ """ ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding : Ġ${ layout To View Binding Class ( layout Name )} Ċ """ }} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġ$ content View Block ĊĠĠĠĠĠĠĠ Ġval Ġsections Pager Adapter Ġ= ĠSe ctions Pager Adapter ( this , Ġsupport FragmentManager ) ĊĠĠĠĠĠĠĠ Ġval Ġview Pager : ĠView Pager Ġ= Ġ${ findViewById ( ĊĠĠĠĠĠĠĠĠĠ ĠLanguage . Kotlin , ĊĠĠĠĠĠĠĠĠĠ Ġis View Binding Supported Ġ= Ġis View Binding Supported , ĊĠĠĠĠĠĠĠĠĠ Ġid Ġ= Ġ" view _ pager ")} ĊĠĠĠĠĠĠĠ Ġview Pager . adapter Ġ= Ġsections Pager Adapter ĊĠĠĠĠĠĠĠ Ġval Ġtabs : ĠTab Layout Ġ= Ġ${ findViewById ( ĊĠĠĠĠĠĠĠĠĠ ĠLanguage . Kotlin , ĊĠĠĠĠĠĠĠĠĠ Ġis View Binding Supported Ġ= Ġis View Binding Supported , ĊĠĠĠĠĠĠĠĠĠ Ġid Ġ= Ġ" tabs ")} ĊĠĠĠĠĠĠĠ Ġtabs . setup With ViewPager ( view Pager ) ĊĠĠĠĠĠĠĠ Ġval Ġfab : ĠFloating ActionButton Ġ= Ġ${ findViewById ( ĊĠĠĠĠĠĠĠĠĠ ĠLanguage . Kotlin , ĊĠĠĠĠĠĠĠĠĠ Ġis View Binding Supported Ġ= Ġis View Binding Supported , ĊĠĠĠĠĠĠĠĠĠ Ġid Ġ= Ġ" fab ")} ĊĊĠĠĠĠĠĠĠ Ġfab . setOnClickListener Ġ{ Ġview Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ ĠSn ackbar . make ( view , Ġ" Replace Ġwith Ġyour Ġown Ġaction ", ĠSn ackbar . LENGTH _ LONG ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. setAction (" Action ", Ġnull ). show () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } """ Ċ } Ċ