package Ġcom . zm j . re learn android . view . lesson 1 6 bitmap drawable Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . graphics . Canvas Ċ import Ġandroid . graphics . Color Ċ import Ġandroid . graphics . drawable . Color Drawable Ċ import Ġandroid . util . Attribute Set Ċ import Ġandroid . view . View Ċ import Ġcom . zm j . re learn android . view . dp Ċ import Ġcom . zm j . re learn android . view . lesson 1 6 bitmap drawable . c andle view . C andle Drawable Ċ Ċ /** Ċ Ġ* ĠAuthor Ġ: ĠZ mj Ċ Ġ* ĠBlog Ġ: Ġhttps :// blog . cs dn . net / Zm j _ Dns Ċ Ġ* ĠGitHub Ġ: Ġhttps :// github . com / Zm j Dns Ċ Ġ* ĠTime Ġ: Ġ 2 0 2 1 - 0 4 - 2 0 Ċ Ġ* ĠDescription Ġ: Ċ Ġ*/ Ċ class ĠDraw ableView ( context : ĠContext ?, Ġattrs : ĠAttributeSet ?) Ġ: ĠView ( context , Ġattrs ) Ġ{ Ċ // ĠĠĠ Ġprivate Ġval Ġdrawable Ġ= ĠColor Drawable ( Color . RED ) ĊĠĠĠ Ġprivate Ġval Ġ Ġdrawable Ġ= ĠMesh Drawable () ĊĊĠĠĠ Ġoverride Ġfun Ġon Draw ( canvas : ĠCanvas ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġdrawable . setBounds ( 0 . dp . toInt (), 0 . dp . toInt (), width , height ) ĊĠĠĠĠĠĠĠ Ġdrawable . draw ( canvas ) ĊĠĠĠ Ġ} Ċ }