package Ġcom . react native graphics Ċ Ċ import Ġandroid . annotation . Target Api Ċ import Ġandroid . graphics . Rect Ċ import Ġandroid . os . Build Ċ import Ġandroid . view . View Ċ import Ġandroidx . annotation . NonNull Ċ import Ġandroidx . annotation . Nullable Ċ import Ġcom . facebook . react . bridge . JS Application IllegalArgumentException Ċ import Ġcom . facebook . react . bridge . Readable Array Ċ import Ġcom . facebook . react . bridge . Readable Map Ċ import Ġcom . facebook . react . common . Map Builder Ċ import Ġcom . facebook . react . u im an ager . Pixel Util Ċ import Ġcom . facebook . react . u im an ager . Spacing Ċ import Ġcom . facebook . react . u im an ager . View Props Ċ import Ġcom . facebook . react . u im an ager . annotations . React Prop Ċ import Ġcom . facebook . react . u im an ager . annotations . React Prop Group Ċ import Ġcom . facebook . react . views . view . React Cli pping View Manager Ċ import Ġcom . facebook . react . views . view . React Drawable Helper Ċ import Ġcom . facebook . react . views . view . React ViewGroup Ċ import Ġcom . facebook . y oga . Y oga Constants Ċ Ċ abstract Ġclass ĠGraphics View Manager < T : ĠReact ViewGroup >: ĠReact Cli pping View Manager < T >() Ġ{ ĊĠ Ġ@ React Prop ( name Ġ= Ġ" accessible ") ĊĠ Ġfun Ġset Accessible ( view : ĠReact ViewGroup , Ġaccessible : ĠBoolean ) Ġ{ ĊĠĠĠ Ġview . is Focus able Ġ= Ġaccessible ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= Ġ" has T VP referred Focus ") ĊĠ Ġfun Ġset T VP referred Focus ( view : ĠReact ViewGroup , Ġhas T VP referred Focus : ĠBoolean ) Ġ{ ĊĠĠĠ Ġif Ġ( has T VP referred Focus ) Ġ{ ĊĠĠĠĠĠ Ġview . is Focus able Ġ= Ġtrue ĊĠĠĠĠĠ Ġview . is Focus able In Touch Mode Ġ= Ġtrue ĊĠĠĠĠĠ Ġview . request Focus () ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= Ġ" next Focus Down ", Ġdefault Int Ġ= ĠView . NO _ ID ) ĊĠ Ġfun Ġnext Focus Down ( view : ĠReact ViewGroup , Ġview Id : ĠInt ) Ġ{ ĊĠĠĠ Ġview . next Focus Down Id Ġ= Ġview Id ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= Ġ" next Focus Forward ", Ġdefault Int Ġ= ĠView . NO _ ID ) ĊĠ Ġfun Ġnext Focus Forward ( view : ĠReact ViewGroup , Ġview Id : ĠInt ) Ġ{ ĊĠĠĠ Ġview . next Focus Forward Id Ġ= Ġview Id ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= Ġ" next Focus Left ", Ġdefault Int Ġ= ĠView . NO _ ID ) ĊĠ Ġfun Ġnext Focus Left ( view : ĠReact ViewGroup , Ġview Id : ĠInt ) Ġ{ ĊĠĠĠ Ġview . next Focus Left Id Ġ= Ġview Id ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= Ġ" next Focus Right ", Ġdefault Int Ġ= ĠView . NO _ ID ) ĊĠ Ġfun Ġnext Focus Right ( view : ĠReact ViewGroup , Ġview Id : ĠInt ) Ġ{ ĊĠĠĠ Ġview . next Focus Right Id Ġ= Ġview Id ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= Ġ" next Focus Up ", Ġdefault Int Ġ= ĠView . NO _ ID ) ĊĠ Ġfun Ġnext Focus Up ( view : ĠReact ViewGroup , Ġview Id : ĠInt ) Ġ{ ĊĠĠĠ Ġview . next Focus Up Id Ġ= Ġview Id ĊĠ Ġ} ĊĊĠ Ġ@ React Prop Group ( names Ġ= Ġ[ View Props . BORDER _ RADIUS , ĠView Props . BORDER _ TOP _ LEFT _ RADIUS , ĠView Props . BORDER _ TOP _ RIGHT _ RADIUS , ĠView Props . BORDER _ BOTTOM _ RIGHT _ RADIUS , ĠView Props . BORDER _ BOTTOM _ LEFT _ RADIUS , ĠView Props . BORDER _ TOP _ START _ RADIUS , ĠView Props . BORDER _ TOP _ END _ RADIUS , ĠView Props . BORDER _ BOTTOM _ START _ RADIUS , ĠView Props . BORDER _ BOTTOM _ END _ RADIUS ]) ĊĠ Ġfun Ġset Border Radius ( view : ĠReact ViewGroup , Ġindex : ĠInt , ĠborderRadius Value : ĠFloat ) Ġ{ ĊĠĠĠ Ġvar ĠborderRadius Ġ= ĠborderRadius Value ĊĠĠĠ Ġif Ġ(! Y oga Constants . is Undefined ( border Radius ) Ġ&& ĠborderRadius Ġ< Ġ 0 ) Ġ{ ĊĠĠĠĠĠ ĠborderRadius Ġ= ĠY oga Constants . UNDEFINED ĊĠĠĠ Ġ} ĊĠĠĠ Ġif Ġ(! Y oga Constants . is Undefined ( border Radius )) Ġ{ ĊĠĠĠĠĠ ĠborderRadius Ġ= ĠPixel Util . to Pixel From DIP ( border Radius ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġif Ġ( index Ġ== Ġ 0 ) Ġ{ ĊĠĠĠĠĠ Ġview . setBorder Radius ( border Radius ) ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ Ġview . setBorder Radius ( border Radius , Ġindex Ġ- Ġ 1 ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= Ġ" border Style ") ĊĠ Ġfun Ġset BorderStyle ( view : ĠReact ViewGroup , Ġborder Style : ĠString ?) Ġ{ ĊĠĠĠ Ġview . set BorderStyle ( border Style ) ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= Ġ" hit S lop ") ĊĠ Ġfun Ġset Hit S lop ( view : ĠReact ViewGroup , Ġhit S lop : ĠRead able Map ?) Ġ{ ĊĠĠĠ Ġif Ġ( hit S lop Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġview . hit S lop Rect Ġ= Ġnull ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ Ġview . hit S lop Rect Ġ= ĠRect ( ĊĠĠĠĠĠĠĠ Ġif Ġ( hit S lop . has Key (" left ")) ĠPixel Util . to Pixel From DIP ( hit S lop . getDouble (" left ")). toInt () Ġelse Ġ 0 , ĊĠĠĠĠĠĠĠ Ġif Ġ( hit S lop . has Key (" top ")) ĠPixel Util . to Pixel From DIP ( hit S lop . getDouble (" top ")). toInt () Ġelse Ġ 0 , ĊĠĠĠĠĠĠĠ Ġif Ġ( hit S lop . has Key (" right ")) ĠPixel Util . to Pixel From DIP ( hit S lop . getDouble (" right ")). toInt () Ġelse Ġ 0 , ĊĠĠĠĠĠĠĠ Ġif Ġ( hit S lop . has Key (" bottom ")) ĠPixel Util . to Pixel From DIP ( hit S lop . getDouble (" bottom ")). toInt () Ġelse Ġ 0 ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= Ġ" native Background Android ") ĊĠ Ġfun Ġset Native Background ( view : ĠReact ViewGroup , Ġbg : ĠRead able Map ?) Ġ{ ĊĠĠĠ Ġview . set Trans luc ent Background Drawable ( ĊĠĠĠĠĠ Ġif Ġ( bg Ġ== Ġnull ) Ġnull Ġelse ĠReact Drawable Helper . create Drawable From JS Description ( view . context , Ġbg )) ĊĠ Ġ} ĊĊĠ Ġ@ Target Api ( Build . VERSION _ CODES . M ) ĊĠ Ġ@ React Prop ( name Ġ= Ġ" native Foreground Android ") ĊĠ Ġfun Ġset Native Foreground ( view : ĠReact ViewGroup , Ġfg : ĠRead able Map ?) Ġ{ ĊĠĠĠ Ġview . foreground Ġ= Ġif Ġ( fg Ġ== Ġnull ) Ġnull Ġelse ĠReact Drawable Helper . create Drawable From JS Description ( view . context , Ġfg ) ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= ĠView Props . NEED S _ OFF SCREEN _ ALPHA _ COMP OS IT ING ) ĊĠ Ġfun Ġset Needs Off screen Alpha Comp osit ing ( ĊĠĠĠ Ġview : ĠReact ViewGroup , Ġneeds Off screen Alpha Comp osit ing : ĠBoolean ) Ġ{ ĊĠĠĠ Ġview . set Needs Off screen Alpha Comp osit ing ( needs Off screen Alpha Comp osit ing ) ĊĠ Ġ} ĊĊĠ Ġ@ React Prop Group ( names Ġ= Ġ[ View Props . BORDER _ WIDTH , ĠView Props . BORDER _ LEFT _ WIDTH , ĠView Props . BORDER _ RIGHT _ WIDTH , ĠView Props . BORDER _ TOP _ WIDTH , ĠView Props . BORDER _ BOTTOM _ WIDTH , ĠView Props . BORDER _ START _ WIDTH , ĠView Props . BORDER _ END _ WIDTH ]) ĊĠ Ġfun Ġset Border Width ( view : ĠReact ViewGroup , Ġindex : ĠInt , Ġwidth Value : ĠFloat ) Ġ{ ĊĠĠĠ Ġvar Ġwidth Ġ= Ġwidth Value ĊĠĠĠ Ġif Ġ(! Y oga Constants . is Undefined ( width ) Ġ&& Ġwidth Ġ< Ġ 0 ) Ġ{ ĊĠĠĠĠĠ Ġwidth Ġ= ĠY oga Constants . UNDEFINED ĊĠĠĠ Ġ} ĊĠĠĠ Ġif Ġ(! Y oga Constants . is Undefined ( width )) Ġ{ ĊĠĠĠĠĠ Ġwidth Ġ= ĠPixel Util . to Pixel From DIP ( width ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġview . setBorder Width ( SPACING _ TYPES [ index ], Ġwidth ) ĊĠ Ġ} ĊĊĠ Ġ@ React Prop Group ( names Ġ= Ġ[ View Props . BORDER _ COLOR , ĠView Props . BORDER _ LEFT _ COLOR , ĠView Props . BORDER _ RIGHT _ COLOR , ĠView Props . BORDER _ TOP _ COLOR , ĠView Props . BORDER _ BOTTOM _ COLOR , ĠView Props . BORDER _ START _ COLOR , ĠView Props . BORDER _ END _ COLOR ], Ġcustom Type Ġ= Ġ" Color ") ĊĠ Ġfun Ġset BorderColor ( view : ĠReact ViewGroup , Ġindex : ĠInt , Ġcolor : ĠInt ?) Ġ{ ĊĠĠĠ Ġval Ġrgb Component Ġ= Ġif Ġ( color Ġ== Ġnull ) ĠY oga Constants . UNDEFINED Ġelse Ġ( color Ġand Ġ 0 x 0 0 FFFFFF ). toFloat () ĊĠĠĠ Ġval Ġalpha Component Ġ= Ġif Ġ( color Ġ== Ġnull ) ĠY oga Constants . UNDEFINED Ġelse Ġ( color Ġ ush r Ġ 2 4 ). toFloat () ĊĠĠĠ Ġview . set BorderColor ( SPACING _ TYPES [ index ], Ġrgb Component , Ġalpha Component ) ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= ĠView Props . OVER FLOW ) ĊĠ Ġfun Ġset Overflow ( view : ĠReact ViewGroup , Ġoverflow : ĠString ?) Ġ{ ĊĠĠĠ Ġview . overflow Ġ= Ġoverflow ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= Ġ" back face Visibility ") ĊĠ Ġfun Ġset Back face Visibility ( view : ĠReact ViewGroup , Ġback face Visibility : ĠString ?) Ġ{ ĊĠĠĠ Ġview . set Back face Visibility ( back face Visibility ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġset Opacity (@ NonNull Ġview : ĠT , Ġopacity : ĠFloat ) Ġ{ ĊĠĠĠ Ġview . set Opacity If Possible ( opacity ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġset Transform (@ NonNull Ġview : ĠT , Ġmatrix : ĠRead able Array ?) Ġ{ ĊĠĠĠ Ġsuper . set Transform ( view , Ġmatrix ) ĊĠĠĠ Ġview . set Back face Visibility Depend ant Opacity () ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġget Commands Map (): ĠMap < String , ĠInt >? Ġ{ ĊĠĠĠ Ġreturn ĠMap Builder . of ( HOT SP OT _ UPDATE _ KEY , ĠCMD _ HOT SP OT _ UPDATE , Ġ" set Pressed ", ĠCMD _ SET _ PRES SED ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġreceive Command ( root : ĠT , Ġcommand Id : ĠInt , Ġ@ Nullable Ġargs : ĠRead able Array ?) Ġ{ ĊĠĠĠ Ġwhen Ġ( command Id ) Ġ{ ĊĠĠĠĠĠ ĠCMD _ HOT SP OT _ UPDATE Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġhandle Hot spot Update ( root , Ġargs ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ ĠCMD _ SET _ PRES SED Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġhandle Set Pressed ( root , Ġargs ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġreceive Command ( root : ĠT , Ġcommand Id : ĠString ?, Ġ@ Nullable Ġargs : ĠRead able Array ?) Ġ{ ĊĠĠĠ Ġwhen Ġ( command Id ) Ġ{ ĊĠĠĠĠĠ ĠH OT SP OT _ UPDATE _ KEY Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġhandle Hot spot Update ( root , Ġargs ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ" set Pressed " Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġhandle Set Pressed ( root , Ġargs ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġhandle Set Pressed ( root : ĠReact ViewGroup , Ġ@ Nullable Ġargs : ĠRead able Array ?) Ġ{ ĊĠĠĠ Ġif Ġ( args Ġ== Ġnull Ġ|| Ġargs . size () Ġ!= Ġ 1 ) Ġ{ ĊĠĠĠĠĠ Ġthrow ĠJS Application IllegalArgumentException ( ĊĠĠĠĠĠĠĠ Ġ" Illegal Ġnumber Ġof Ġarguments Ġfor Ġ' set Pressed ' Ġcommand ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġroot . is Pressed Ġ= Ġargs . getBoolean ( 0 ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġhandle Hot spot Update ( root : ĠReact ViewGroup , Ġ@ Nullable Ġargs : ĠRead able Array ?) Ġ{ ĊĠĠĠ Ġif Ġ( args Ġ== Ġnull Ġ|| Ġargs . size () Ġ!= Ġ 2 ) Ġ{ ĊĠĠĠĠĠ Ġthrow ĠJS Application IllegalArgumentException ( ĊĠĠĠĠĠĠĠ Ġ" Illegal Ġnumber Ġof Ġarguments Ġfor Ġ' update Hot spot ' Ġcommand ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġx Ġ= ĠPixel Util . to Pixel From DIP ( args . getDouble ( 0 )) ĊĠĠĠ Ġval Ġy Ġ= ĠPixel Util . to Pixel From DIP ( args . getDouble ( 1 )) ĊĠĠĠ Ġroot . drawable Hot spot Changed ( x , Ġy ) ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġconst Ġval ĠCMD _ HOT SP OT _ UPDATE Ġ= Ġ 1 ĊĠĠĠ Ġconst Ġval ĠCMD _ SET _ PRES SED Ġ= Ġ 2 ĊĠĠĠ Ġconst Ġval ĠH OT SP OT _ UPDATE _ KEY Ġ= Ġ" hot spot Update " ĊĠĠĠ Ġval ĠSP ACING _ TYPES Ġ= ĠlistOf ( ĊĠĠĠĠĠ ĠSp acing . ALL , ĊĠĠĠĠĠ ĠSp acing . LEFT , ĊĠĠĠĠĠ ĠSp acing . RIGHT , ĊĠĠĠĠĠ ĠSp acing . TOP , ĊĠĠĠĠĠ ĠSp acing . BOTTOM , ĊĠĠĠĠĠ ĠSp acing . START , ĊĠĠĠĠĠ ĠSp acing . END ĊĠĠĠ Ġ) ĊĠ Ġ} Ċ } Ċ