package Ġcom . ta zz ix . we ar . sal ah Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . util . Log Ċ import Ġandroidx . fragment . app . Fragment Activity Ċ Ċ import Ġandroidx . we ar . widget . W ear able Linear LayoutManager Ċ import Ġandroidx . we ar . widget . W ear able RecyclerView ĊĊ Ċ class ĠConfig As r Calc Activity Ġ: ĠFragment Activity () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ config ) ĊĊĠĠĠĠĠĠĠ Ġval Ġre cyclerView : ĠW ear able RecyclerView Ġ= ĠfindViewById ( R . id . config _ menu _ view ) ĊĠĠĠĠĠĠĠ Ġre cyclerView . set Has Fixed Size ( true ) ĊĠĠĠĠĠĠĠ Ġre cyclerView . is Edge Items Center ing Enabled Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġre cyclerView . layout Manager Ġ= ĠW ear able Linear LayoutManager ( this ) ĊĊĠĠĠĠĠĠĠ Ġval Ġmenu Items : ĠArrayList < MenuItem > Ġ= ĠArrayList () ĊĠĠĠĠĠĠĠ Ġval Ġmethods Ġ= Ġresources . getString Array ( R . array . array _ as rc al cs ) ĊĊĠĠĠĠĠĠĠ Ġfor Ġ( method Ġin Ġmethods ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmenu Items . add ( MenuItem ( android . R . drawable . ic _ menu _ info _ details , Ġ"", Ġmethod )) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġre cyclerView . adapter Ġ= ĠMenu Adapter ( this , ĠR . layout . not itle _ item , Ġmenu Items , Ġobject : ĠMenu Adapter . Adapter Callback Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Item Clicked ( menu Position : ĠInt ?) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġshared Preferences Ġ= Ġ Ġget SharedPreferences (" SAL AH _ LOCATION ", ĠContext . MODE _ PRIVATE ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġshared Preferences . edit (). put Int (" AS R _ CAL C ", Ġmenu Position !! ). apply () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} Ċ } Ċ