package Ġcom . tas om ani ac . open with . settings . advanced . features Ċ Ċ import Ġandroid . os . Build . VERSION _ CODES . M Ċ import Ġandroidx . annotation . Requires Api Ċ import Ġandroidx . annotation . String Res Ċ import Ġcom . tas om ani ac . open with . R Ċ import Ġcom . tas om ani ac . open with . settings . Settings Ċ import Ġjavax . inject . Inject Ċ Ċ @ Requires Api ( M ) Ċ class ĠFeatures List Settings Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġfeature Preferences : ĠFeature Preferences , ĊĠĠĠ Ġfragment : ĠFeatures List Fragment Ċ ) Ġ: ĠSettings ( fragment ) Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġsetup () Ġ{ ĊĠĠĠĠĠĠĠ Ġadd Preferences From Resource ( R . xml . pref _ features ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġresume () Ġ{ ĊĠĠĠĠĠĠĠ ĠFeature . values (). forEach Ġ{ Ġfeature Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġenabled Ġ= Ġfeature Preferences . isEnabled ( feature ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment . find Preference ( feature . pref Key )?. set Summary ( enabled . to Summary ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ String Res ĊĠĠĠ Ġprivate Ġfun ĠBoolean . to Summary () Ġ= ĊĠĠĠĠĠĠĠ Ġif Ġ( this ) ĠR . string . pref _ state _ feature _ enabled Ġelse ĠR . string . pref _ state _ feature _ disabled Ċ } Ċ