package Ġcom . ex oz et . android . core . ui . custom Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . graphics . Canvas Ċ import Ġandroid . graphics . Path Ċ import Ġandroid . graphics . Rect F Ċ import Ġandroid . util . Attribute Set Ċ import Ġcom . ex oz et . android . core . R Ċ import Ġcom . google . android . material . card . Material Card View Ċ import Ġcom . google . android . material . shape . Corner Family Ċ import Ġcom . google . android . material . shape . Shape Appearance Model Ċ import Ġcom . google . android . material . shape . Shape Appearance Path Provider Ċ import Ġnet . k ib ot u . resource extension . dp ĊĊ Ċ /** ĠA ĠCard Ġview Ġthat Ġcli ps Ġthe Ġcontent Ġof Ġany Ġshape , Ġthis Ġshould Ġbe Ġdone Ġupstream Ġin Ġcard , Ċ Ġ* Ġworking Ġaround Ġit Ġfor Ġnow . Ċ Ġ*/ Ċ open Ġclass ĠCustom Card View Ġ@ Jvm Over loads Ġconstructor ( ĊĠĠĠ Ġcontext : ĠContext , ĊĠĠĠ Ġattrs : ĠAttributeSet ? Ġ= Ġnull , ĊĠĠĠ Ġdef Style : ĠInt Ġ= ĠR . attr . material Card View Style Ċ ) Ġ: ĠMaterial Card View ( context , Ġattrs , Ġdef Style ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġpath Provider Ġ= ĠShape Appearance Path Provider () ĊĊĠĠĠ Ġprivate Ġval Ġpath : ĠPath Ġ= ĠPath () ĊĊĠĠĠ Ġ// Ġcontext , Ġattrs , Ġdef Style , ĠR . style . Widget _ Material Components _ Card View ĊĠĠĠ Ġprivate Ġval Ġshape Appearance : ĠShape Appearance Model Ġ= ĠShape Appearance Model ĊĠĠĠĠĠĠĠ Ġ. Builder () ĊĠĠĠĠĠĠĠ Ġ. set Top Left Corner ( Corner Family . RO UN DED , Ġ 6 f . dp ) ĊĠĠĠĠĠĠĠ Ġ. set Top Right Corner ( Corner Family . RO UN DED , Ġ 6 f . dp ) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġprivate Ġval Ġrect F Ġ= ĠRect F ( 0 f , Ġ 0 f , Ġ 0 f , Ġ 0 f ) ĊĊĠĠĠ Ġoverride Ġfun Ġon Draw ( canvas : ĠCanvas ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġrect F . right Ġ= Ġwidth . toFloat () ĊĠĠĠĠĠĠĠ Ġrect F . bottom Ġ= Ġheight . toFloat () ĊĠĠĠĠĠĠĠ Ġpath Provider . calculate Path ( shape Appearance , Ġ 1 f , Ġrect F , Ġpath ) ĊĠĠĠĠĠĠĠ Ġcanvas !!. clip Path ( path ) ĊĠĠĠĠĠĠĠ Ġsuper . on Draw ( canvas ) ĊĠĠĠ Ġ} Ċ }