package Ġcom . rit esh ak ya . core . extension Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . graphics . Point Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroid . view . WindowManager ĊĊ Ċ fun ĠView . view Height (): ĠInt Ġ{ ĊĠĠĠ Ġval Ġwm Ġ= Ġcontext . getSystem Service ( Context . WINDOW _ SERVICE ) Ġas ĠWindow Manager ĊĠĠĠ Ġval Ġdisplay Ġ= Ġwm . default Display ĊĊĠĠĠ Ġval Ġdevice Width : ĠInt ĊĊĊĠĠĠ Ġval Ġsize Ġ= ĠPoint () ĊĠĠĠ Ġdisplay . getSize ( size ) ĊĠĠĠ Ġdevice Width Ġ= Ġsize . x ĊĊĊĠĠĠ Ġval Ġwidth Measure Spec Ġ= ĠView . Measure Spec . make Measure Spec ( device Width , ĠView . Measure Spec . AT _ MO ST ) ĊĠĠĠ Ġval Ġheight Measure Spec Ġ= ĠView . Measure Spec . make Measure Spec ( 0 , ĠView . Measure Spec . UNSPECIFIED ) ĊĠĠĠ Ġmeasure ( width Measure Spec , Ġheight Measure Spec ) ĊĠĠĠ Ġreturn Ġmeasured Height Ċ } Ċ Ċ fun ĠView . getView Width (): ĠInt Ġ{ ĊĠĠĠ Ġval Ġwm Ġ= Ġcontext . getSystem Service ( Context . WINDOW _ SERVICE ) Ġas ĠWindow Manager ĊĠĠĠ Ġval Ġdisplay Ġ= Ġwm . default Display ĊĊĠĠĠ Ġval Ġdevice Height : ĠInt ĊĊĊĠĠĠ Ġval Ġsize Ġ= ĠPoint () ĊĠĠĠ Ġdisplay . getSize ( size ) ĊĠĠĠ Ġdevice Height Ġ= Ġsize . y ĊĊĊĠĠĠ Ġval Ġwidth Measure Spec Ġ= ĠView . Measure Spec . make Measure Spec ( 0 , ĠView . Measure Spec . AT _ MO ST ) ĊĠĠĠ Ġval Ġheight Measure Spec Ġ= ĠView . Measure Spec . make Measure Spec ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdevice Height , ĠView . Measure Spec . UNSPECIFIED ĊĠĠĠ Ġ) ĊĠĠĠ Ġmeasure ( width Measure Spec , Ġheight Measure Spec ) ĊĠĠĠ Ġreturn Ġmeasured Width Ċ } ĊĊ Ċ fun ĠView . set Select ive Padding ( ĊĠĠĠĠĠĠĠ Ġleft : ĠInt Ġ= Ġpadding Left , Ġtop : ĠInt Ġ= Ġpadding Top , Ġright : ĠInt Ġ= Ġpadding Right , ĊĠĠĠĠĠĠĠ Ġbottom : ĠInt Ġ= Ġpadding Bottom Ċ ) Ġ{ ĊĠĠĠ Ġset Padding ( left , Ġtop , Ġright , Ġbottom ) Ċ } Ċ Ċ fun ĠView . change LayoutParams ( body : Ġ( layout Params : ĠViewGroup . LayoutParams ) Ġ-> ĠUnit ): ĠView Ġ{ ĊĠĠĠ Ġval Ġlayout Params Ġ= Ġthis . layout Params ĊĠĠĠ Ġbody ( layout Params ) ĊĠĠĠ Ġthis . layout Params Ġ= Ġlayout Params ĊĠĠĠ Ġreturn Ġthis Ċ }