package Ġcn . art aris . custom view Ċ Ċ import Ġandroid . content . res . Resources Ċ import Ġandroid . graphics . Bitmap Ċ import Ġandroid . graphics . Bitmap Factory Ċ import Ġandroid . util . Typed Value Ċ Ċ /** Ċ Ġ* Ġcn . art aris . h encode practice Ċ Ġ* ĠHen Code Layout Pract ice Ċ Ġ* Ġ 2 0 1 9 . 0 4 . 1 9 ĠĠ 2 2 : 1 6 Ċ Ġ* Ġ@ author Ġ: Ġart airs Ċ Ġ*/ Ċ Ċ fun ĠFloat . dp 2 px () Ġ= ĠTyped Value . apply Dimension ( Typed Value . COMPLEX _ UNIT _ DIP , Ġthis , ĠResources . getSystem (). display Metrics ) ĊĊ Ċ fun Ġget Avatar ( resources : Resources , radius : Int ): Bitmap { ĊĠĠĠ Ġval Ġoption Ġ= ĠBitmap Factory . Options () ĊĠĠĠ Ġoption . in Just Decode Bounds Ġ= Ġtrue ĊĠĠĠ ĠBitmap Factory . decode Resource ( resources , ĠR . drawable . avatar , Ġoption ) ĊĠĠĠ Ġoption . in Just Decode Bounds Ġ= Ġfalse ĊĠĠĠ Ġoption . in Density Ġ= Ġoption . out Width ĊĠĠĠ Ġoption . in Target Density Ġ= Ġradius ĊĊĠĠĠ Ġreturn ĠBitmap Factory . decode Resource ( resources , ĠR . drawable . avatar , Ġoption ) Ċ } ĊĊ Ċ fun Ġget Z For Camera () Ġ= Ġ- 6 Ġ* ĠResources . getSystem (). display Metrics . density