package Ġcom . ak ex orc ist . localization app . h ilt Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġcom . ak ex orc ist . localization activity . ui . Localization Activity Ċ import Ġcom . ak ex orc ist . localization app . databinding . Activity H ilt Binding Ċ import Ġdagger . h ilt . android . Android EntryPoint Ċ import Ġjavax . inject . Inject Ċ Ċ @ Android EntryPoint Ċ class ĠH ilt Activity Ġ: ĠLocalization Activity () Ġ{ ĊĠĠĠ Ġprivate Ġval Ġbinding : ĠActivity H ilt Binding Ġby Ġlazy Ġ{ ĠActivity H ilt Binding . inflate ( layout Inflater ) Ġ} ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġstory Provider : ĠStory Provider ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠKEY _ SCROLL _ X Ġ= Ġ" scroll _ x " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( binding . root ) ĊĊĠĠĠĠĠĠĠ Ġbinding . textView Content . text Ġ= Ġstory Provider . get Apple Story () ĊĠĠĠĠĠĠĠ Ġbinding . btn Back . setOnClickListener Ġ{ Ġsuper . on Back Pressed () Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . layout Language Chooser . btn American . setOnClickListener Ġ{ Ġset Language (" en ") Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . layout Language Chooser . btn Chinese . setOnClickListener Ġ{ Ġset Language (" zh ") Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . layout Language Chooser . btn It alian . setOnClickListener Ġ{ Ġset Language (" it ") Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . layout Language Chooser . btn J apanese . setOnClickListener Ġ{ Ġset Language (" ja ") Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . layout Language Chooser . btn K orean . setOnClickListener Ġ{ Ġset Language (" ko ") Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . layout Language Chooser . btn Port ug ue se . setOnClickListener Ġ{ Ġset Language (" pt ") Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . layout Language Chooser . btn Th ai . setOnClickListener Ġ{ Ġset Language (" th ") Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġpublic Ġoverride Ġfun Ġon Save InstanceState ( out State : ĠBundle ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠSave Ġx - position Ġof Ġhorizontal Ġscroll Ġview . ĊĠĠĠĠĠĠĠ Ġout State . put Int ( KEY _ SCROLL _ X , Ġbinding . layout Language Chooser . sv Language Chooser . scroll X ) ĊĠĠĠĠĠĠĠ Ġsuper . on Save InstanceState ( out State ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġpublic Ġoverride Ġfun Ġon Restore InstanceState ( savedInstanceState : ĠBundle ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Restore InstanceState ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġ// ĠRestore Ġx - position Ġof Ġhorizontal Ġscroll Ġview . ĊĠĠĠĠĠĠĠ Ġbinding . layout Language Chooser . sv Language Chooser . scrollTo ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠsavedInstanceState . getInt ( KEY _ SCROLL _ X ), Ġ 0 ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ } Ċ