Ċ Ċ package Ġdev . pat rick gold . fl or is board . ime . media Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . res . Color State List Ċ import Ġandroid . util . Attribute Set Ċ import Ġandroid . widget . Button Ċ import Ġandroid . widget . Image Button Ċ import Ġandroid . widget . LinearLayout Ċ import Ġcom . google . android . material . tabs . Tab Layout Ċ import Ġdev . pat rick gold . fl or is board . R Ċ import Ġdev . pat rick gold . fl or is board . ime . core . Fl or is Board Ċ import Ġdev . pat rick gold . fl or is board . ime . theme . Theme Ċ import Ġdev . pat rick gold . fl or is board . ime . theme . Theme Manager Ċ import Ġkotlin . math . round ToInt Ċ Ċ class ĠMedia Input View Ġ: ĠLinearLayout , ĠFl or is Board . EventListener , ĊĠĠĠ ĠTheme Manager . On Theme Updated Listener Ġ{ ĊĠĠĠ Ġprivate Ġval Ġfl or is board : ĠFl or is Board ? Ġ= ĠFl or is Board . getInstance OrNull () ĊĠĠĠ Ġprivate Ġval Ġtheme Manager : ĠTheme Manager Ġ= ĠTheme Manager . default () ĊĊĠĠĠ Ġvar Ġtab Layout : ĠTab Layout ? Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġprivate Ġset ĊĠĠĠ Ġvar Ġswitch To TextInput Button : ĠButton ? Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġprivate Ġset ĊĠĠĠ Ġvar Ġback space Button : ĠImage Button ? Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġprivate Ġset ĊĊĠĠĠ Ġconstructor ( context : ĠContext ) Ġ: Ġthis ( context , Ġnull ) ĊĠĠĠ Ġconstructor ( context : ĠContext , Ġattrs : ĠAttributeSet ?) Ġ: Ġthis ( context , Ġattrs , Ġ 0 ) ĊĠĠĠ Ġconstructor ( context : ĠContext , Ġattrs : ĠAttributeSet ?, Ġdef Style Attr : ĠInt ) Ġ: Ġsuper ( context , Ġattrs , Ġdef Style Attr ) ĊĊĠĠĠ Ġoverride Ġfun Ġon Attached To Window () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Attached To Window () ĊĠĠĠĠĠĠĠ Ġfl or is board ?. addEventListener ( this ) ĊĠĠĠĠĠĠĠ Ġtheme Manager . register On Theme Updated Listener ( this ) ĊĠĠĠĠĠĠĠ Ġtab Layout Ġ= ĠfindViewById ( R . id . media _ input _ tabs ) ĊĠĠĠĠĠĠĠ Ġswitch To TextInput Button Ġ= ĠfindViewById ( R . id . media _ input _ switch _ to _ text _ input _ button ) ĊĠĠĠĠĠĠĠ Ġback space Button Ġ= ĠfindViewById ( R . id . media _ input _ back space _ button ) ĊĠĠĠĠĠĠĠ Ġon Apply Theme Attributes () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Detached From Window () Ġ{ ĊĠĠĠĠĠĠĠ Ġtheme Manager . unregister On Theme Updated Listener ( this ) ĊĠĠĠĠĠĠĠ Ġfl or is board ?. removeEventListener ( this ) ĊĠĠĠĠĠĠĠ Ġsuper . on Detached From Window () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Theme Updated ( theme : ĠTheme ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfg Color Ġ= Ġtheme . get Attr ( Theme . Attr . MEDIA _ FO REG ROUND ). to Solid Color (). color ĊĠĠĠĠĠĠĠ Ġval Ġcolor Primary Ġ= Ġtheme . get Attr ( Theme . Attr . WINDOW _ COLOR _ PRIMARY ). to Solid Color (). color ĊĠĠĠĠĠĠĠ Ġtab Layout ?. set Tab Text Colors ( fg Color , Ġfg Color ) ĊĠĠĠĠĠĠĠ Ġtab Layout ?. tab Icon Tint Ġ= ĠColor State List . valueOf ( fg Color ) ĊĠĠĠĠĠĠĠ Ġtab Layout ?. setSelected Tab Indicator Color ( color Primary ) ĊĠĠĠĠĠĠĠ Ġswitch To TextInput Button ?. setTextColor ( fg Color ) ĊĠĠĠĠĠĠĠ Ġback space Button ?. image Tint List Ġ= ĠColor State List . valueOf ( fg Color ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Measure ( width Measure Spec : ĠInt , Ġheight Measure Spec : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġheight Ġ= Ġfl or is board ?. input View ?. desired Media Keyboard View Height Ġ?: Ġ 0 . 0 f ĊĠĠĠĠĠĠĠ Ġsuper . on Measure ( width Measure Spec , ĠMeasure Spec . make Measure Spec ( height . round ToInt (), ĠMeasure Spec . EX ACT LY )) ĊĠĠĠ Ġ} Ċ } Ċ