package Ġcom . y uy ash u ai . frame animation . drawer Ċ Ċ import Ġandroid . graphics .* Ċ import Ġandroid . view . Surface View Ċ Ċ /** Ċ Ġ* Ġ@ author Ġy uy ash u ai ĠĠĠ 2 0 1 9 - 0 5 - 0 5 . Ċ Ġ*/ Ċ class ĠSurface View Bitmap Drawer ( surface View : ĠSurface View ) Ġ: ĠBitmap Drawer Ġ{ ĊĠĠĠ Ġprivate Ġval Ġm Surface View Ġ= Ġsurface View ĊĠĠĠ Ġprivate Ġval Ġm Surface Holder Ġ= Ġsurface View . holder ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġm Surface Holder . set Format ( PixelFormat . TRANSL UC ENT ) ĊĠĠĠĠĠĠĠ Ġm Surface View . set Z Order On Top ( true ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdraw ( bitmap : ĠBitmap , Ġmatrix : ĠMatrix ): ĠCanvas ? Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( Thread . currentThread (). is Inter rupted ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġnull ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġcanvas Ġ= Ġm Surface Holder . lock Canvas () Ġ?: Ġreturn Ġnull ĊĠĠĠĠĠĠĠ Ġcanvas . draw Color ( Color . TRANSP ARENT , ĠPort er D uff . Mode . CLEAR ) ĊĠĠĠĠĠĠĠ Ġcanvas . draw Bitmap ( bitmap , Ġmatrix , Ġnull ) ĊĠĠĠĠĠĠĠ Ġreturn Ġcanvas ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġclear () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcanvas Ġ= Ġm Surface Holder . lock Canvas () Ġ?: Ġreturn ĊĠĠĠĠĠĠĠ Ġcanvas . draw Color ( Color . TRANSP ARENT , ĠPort er D uff . Mode . CLEAR ) ĊĠĠĠĠĠĠĠ Ġm Surface Holder . unlock Canvas And Post ( canvas ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġunlock And Post ( canvas : ĠCanvas ) Ġ{ ĊĠĠĠĠĠĠĠ Ġm Surface Holder . unlock Canvas And Post ( canvas ) ĊĠĠĠ Ġ} Ċ }