@ O p t I n ( E x p e r i m e n t a l L a y o u t A p i : : c l a s s ) 
 
 @ C o m p o s a b l e 
 
 p r i v a t e   f u n   E d i t T o d o D i a l o g ( 
 
         s t a t e :   E d i t T o d o D i a l o g U i S t a t e , 
 
         g r o u p N a m e s :   L i s t < S t r i n g > , 
 
         t i m e z o n e I d :   S t r i n g   =   T i m e Z o n e . g e t D e f a u l t ( ) . i d , 
 
         o n D i s m i s s :   ( )   - >   U n i t , 
 
         o n C o n t e n t C h a n g e d :   ( S t r i n g )   - >   U n i t , 
 
         o n D u e D a t e C h a n g e d :   ( L o n g ? )   - >   U n i t , 
 
         o n G r o u p C h a n g e d :   ( S t r i n g )   - >   U n i t , 
 
         o n N e w S u b t a s k T e x t C h a n g e d :   ( S t r i n g )   - >   U n i t , 
 
         o n A d d S u b t a s k :   ( )   - >   U n i t , 
 
         o n R e m o v e S u b t a s k :   ( I n t )   - >   U n i t , 
 
         o n T o g g l e S u b t a s k :   ( I n t )   - >   U n i t , 
 
         o n U p d a t e S u b t a s k C o n t e n t :   ( I n t ,   S t r i n g )   - >   U n i t , 
 
         o n N e w T a g T e x t C h a n g e d :   ( S t r i n g )   - >   U n i t , 
 
         o n A d d T a g :   ( )   - >   U n i t , 
 
         o n R e m o v e T a g :   ( S t r i n g )   - >   U n i t , 
 
         o n S a v e :   ( )   - >   U n i t 
 
 )   { 
 
         v a l   c o n t e x t   =   a n d r o i d x . c o m p o s e . u i . p l a t f o r m . L o c a l C o n t e x t . c u r r e n t 
 
         v a l   d i a l o g T i t l e   =   i f   ( s t a t e . i s C r e a t e M o d e )   " ? ? ?   N o u v e l l e   t ? ? c h e "   e l s e   " ? ? ? ? ? ?   M o d i f i e r   l a   t ? ? c h e " 
 
 
 
         A l e r t D i a l o g ( 
 
                 o n D i s m i s s R e q u e s t   =   o n D i s m i s s , 
 
                 t i t l e   =   { 
 
                         R o w ( 
 
                                 m o d i f i e r   =   M o d i f i e r . f i l l M a x W i d t h ( ) , 
 
                                 v e r t i c a l A l i g n m e n t   =   A l i g n m e n t . C e n t e r V e r t i c a l l y , 
 
                                 h o r i z o n t a l A r r a n g e m e n t   =   A r r a n g e m e n t . S p a c e B e t w e e n 
 
                         )   { 
 
                                 T e x t ( d i a l o g T i t l e ) 
 
                                 I c o n B u t t o n ( o n C l i c k   =   o n D i s m i s s )   { 
 
                                         I c o n ( I c o n s . D e f a u l t . C l o s e ,   c o n t e n t D e s c r i p t i o n   =   " F e r m e r " ) 
 
                                 } 
 
                         } 
 
                 } , 
 
                 t e x t   =   { 
 
                         C o l u m n ( 
 
                                 m o d i f i e r   =   M o d i f i e r 
 
                                         . f i l l M a x W i d t h ( ) 
 
                                         . w r a p C o n t e n t H e i g h t ( ) 
 
                                         . v e r t i c a l S c r o l l ( r e m e m b e r S c r o l l S t a t e ( ) ) , 
 
                                 v e r t i c a l A r r a n g e m e n t   =   A r r a n g e m e n t . s p a c e d B y ( 1 2 . d p ) 
 
                         )   { 
 
                                 / /   C o n t e n t 
 
                                 O u t l i n e d T e x t F i e l d ( 
 
                                         v a l u e   =   s t a t e . c o n t e n t , 
 
                                         o n V a l u e C h a n g e   =   o n C o n t e n t C h a n g e d , 
 
                                         m o d i f i e r   =   M o d i f i e r . f i l l M a x W i d t h ( ) , 
 
                                         l a b e l   =   {   T e x t ( " C o n t e n u " )   } , 
 
                                         s i n g l e L i n e   =   f a l s e , 
 
                                         m a x L i n e s   =   4 , 
 
                                         k e y b o a r d O p t i o n s   =   K e y b o a r d O p t i o n s ( c a p i t a l i z a t i o n   =   K e y b o a r d C a p i t a l i z a t i o n . S e n t e n c e s ) 
 
                                 ) 
 
 
 
                                 / /   G r o u p 
 
                                 O u t l i n e d T e x t F i e l d ( 
 
                                         v a l u e   =   s t a t e . g r o u p N a m e , 
 
                                         o n V a l u e C h a n g e   =   o n G r o u p C h a n g e d , 
 
                                         m o d i f i e r   =   M o d i f i e r . f i l l M a x W i d t h ( ) , 
 
                                         l a b e l   =   {   T e x t ( " G r o u p e " )   } , 
 
                                         p l a c e h o l d e r   =   {   T e x t ( " E x :   F a m i l l e ,   P e r s o n n e l ,   P r o j e t   X . . . " )   } , 
 
                                         s i n g l e L i n e   =   t r u e , 
 
                                         l e a d i n g I c o n   =   {   I c o n ( I c o n s . D e f a u l t . F o l d e r ,   c o n t e n t D e s c r i p t i o n   =   n u l l )   } 
 
                                 ) 
 
 
 
                                 i f   ( g r o u p N a m e s . i s N o t E m p t y ( ) )   { 
 
                                         F l o w R o w ( 
 
                                                 h o r i z o n t a l A r r a n g e m e n t   =   A r r a n g e m e n t . s p a c e d B y ( 6 . d p ) , 
 
                                                 v e r t i c a l A r r a n g e m e n t   =   A r r a n g e m e n t . s p a c e d B y ( 6 . d p ) 
 
                                         )   { 
 
                                                 g r o u p N a m e s . f o r E a c h   {   g r o u p   - > 
 
                                                         S u r f a c e ( 
 
                                                                 c o l o r   =   i f   ( s t a t e . g r o u p N a m e   = =   g r o u p )   { 
 
                                                                         M a t e r i a l T h e m e . c o l o r S c h e m e . p r i m a r y C o n t a i n e r 
 
                                                                 }   e l s e   { 
 
                                                                         M a t e r i a l T h e m e . c o l o r S c h e m e . s u r f a c e V a r i a n t 
 
                                                                 } , 
 
                                                                 s h a p e   =   M a t e r i a l T h e m e . s h a p e s . s m a l l , 
 
                                                                 o n C l i c k   =   {   o n G r o u p C h a n g e d ( g r o u p )   } 
 
                                                         )   { 
 
                                                                 T e x t ( 
 
                                                                         t e x t   =   g r o u p , 
 
                                                                         s t y l e   =   M a t e r i a l T h e m e . t y p o g r a p h y . l a b e l S m a l l , 
 
                                                                         m o d i f i e r   =   M o d i f i e r . p a d d i n g ( h o r i z o n t a l   =   1 0 . d p ,   v e r t i c a l   =   6 . d p ) , 
 
                                                                         c o l o r   =   i f   ( s t a t e . g r o u p N a m e   = =   g r o u p )   { 
 
                                                                                 M a t e r i a l T h e m e . c o l o r S c h e m e . o n P r i m a r y C o n t a i n e r 
 
                                                                         }   e l s e   { 
 
                                                                                 M a t e r i a l T h e m e . c o l o r S c h e m e . o n S u r f a c e V a r i a n t 
 
                                                                         } 
 
                                                                 ) 
 
                                                         } 
 
                                                 } 
 
                                         } 
 
                                 } 
 
 
 
                                 / /   D u e   d a t e 
 
                                 R o w ( 
 
                                         m o d i f i e r   =   M o d i f i e r . f i l l M a x W i d t h ( ) , 
 
                                         h o r i z o n t a l A r r a n g e m e n t   =   A r r a n g e m e n t . S p a c e B e t w e e n , 
 
                                         v e r t i c a l A l i g n m e n t   =   A l i g n m e n t . C e n t e r V e r t i c a l l y 
 
                                 )   { 
 
                                         T e x t ( 
 
                                                 t e x t   =   s t a t e . d u e D a t e ? . l e t   {   f o r m a t D a t e T i m e ( i t ,   t i m e z o n e I d )   }   ? :   " S a n s   ? ? c h ? ? a n c e " , 
 
                                                 s t y l e   =   M a t e r i a l T h e m e . t y p o g r a p h y . b o d y S m a l l , 
 
                                                 c o l o r   =   M a t e r i a l T h e m e . c o l o r S c h e m e . o n S u r f a c e V a r i a n t 
 
                                         ) 
 
                                         R o w   { 
 
                                                 T e x t B u t t o n ( o n C l i c k   =   { 
 
                                                         p i c k D a t e T i m e ( c o n t e x t ,   s t a t e . d u e D a t e ,   t i m e z o n e I d )   {   m i l l i s   - >   o n D u e D a t e C h a n g e d ( m i l l i s )   } 
 
                                                 } )   { 
 
                                                         T e x t ( " D a t e " ) 
 
                                                 } 
 
                                                 i f   ( s t a t e . d u e D a t e   ! =   n u l l )   { 
 
                                                         T e x t B u t t o n ( o n C l i c k   =   {   o n D u e D a t e C h a n g e d ( n u l l )   } )   { 
 
                                                                 T e x t ( " E f f a c e r " ) 
 
                                                         } 
 
                                                 } 
 
                                         } 
 
                                 } 
 
 
 
                                 / /   S u b t a s k s 
 
                                 T e x t ( 
 
                                         t e x t   =   " S o u s - t ? ? c h e s " , 
 
                                         s t y l e   =   M a t e r i a l T h e m e . t y p o g r a p h y . l a b e l L a r g e , 
 
                                         f o n t W e i g h t   =   F o n t W e i g h t . B o l d , 
 
                                         c o l o r   =   M a t e r i a l T h e m e . c o l o r S c h e m e . p r i m a r y 
 
                                 ) 
 
 
 
                                 s t a t e . s u b t a s k s . f o r E a c h I n d e x e d   {   i n d e x ,   s u b   - > 
 
                                         R o w ( 
 
                                                 m o d i f i e r   =   M o d i f i e r . f i l l M a x W i d t h ( ) , 
 
                                                 v e r t i c a l A l i g n m e n t   =   A l i g n m e n t . C e n t e r V e r t i c a l l y 
 
                                         )   { 
 
                                                 C h e c k b o x ( 
 
                                                         c h e c k e d   =   s u b . i s D o n e , 
 
                                                         o n C h e c k e d C h a n g e   =   {   o n T o g g l e S u b t a s k ( i n d e x )   } , 
 
                                                         m o d i f i e r   =   M o d i f i e r . s i z e ( 3 2 . d p ) 
 
                                                 ) 
 
                                                 O u t l i n e d T e x t F i e l d ( 
 
                                                         v a l u e   =   s u b . c o n t e n t , 
 
                                                         o n V a l u e C h a n g e   =   {   o n U p d a t e S u b t a s k C o n t e n t ( i n d e x ,   i t )   } , 
 
                                                         m o d i f i e r   =   M o d i f i e r . w e i g h t ( 1 f ) , 
 
                                                         s i n g l e L i n e   =   t r u e , 
 
                                                         t e x t S t y l e   =   M a t e r i a l T h e m e . t y p o g r a p h y . b o d y S m a l l . c o p y ( 
 
                                                                 t e x t D e c o r a t i o n   =   i f   ( s u b . i s D o n e )   T e x t D e c o r a t i o n . L i n e T h r o u g h   e l s e   T e x t D e c o r a t i o n . N o n e 
 
                                                         ) 
 
                                                 ) 
 
                                                 I c o n B u t t o n ( 
 
                                                         o n C l i c k   =   {   o n R e m o v e S u b t a s k ( i n d e x )   } , 
 
                                                         m o d i f i e r   =   M o d i f i e r . s i z e ( 3 2 . d p ) 
 
                                                 )   { 
 
                                                         I c o n ( 
 
                                                                 I c o n s . D e f a u l t . C l o s e , 
 
                                                                 c o n t e n t D e s c r i p t i o n   =   " S u p p r i m e r " , 
 
                                                                 m o d i f i e r   =   M o d i f i e r . s i z e ( 1 6 . d p ) , 
 
                                                                 t i n t   =   M a t e r i a l T h e m e . c o l o r S c h e m e . e r r o r 
 
                                                         ) 
 
                                                 } 
 
                                         } 
 
                                 } 
 
 
 
                                 / /   A d d   s u b t a s k 
 
                                 R o w ( 
 
                                         m o d i f i e r   =   M o d i f i e r . f i l l M a x W i d t h ( ) , 
 
                                         v e r t i c a l A l i g n m e n t   =   A l i g n m e n t . C e n t e r V e r t i c a l l y 
 
                                 )   { 
 
                                         O u t l i n e d T e x t F i e l d ( 
 
                                                 v a l u e   =   s t a t e . n e w S u b t a s k T e x t , 
 
                                                 o n V a l u e C h a n g e   =   o n N e w S u b t a s k T e x t C h a n g e d , 
 
                                                 m o d i f i e r   =   M o d i f i e r . w e i g h t ( 1 f ) , 
 
                                                 p l a c e h o l d e r   =   {   T e x t ( " N o u v e l l e   s o u s - t ? ? c h e . . . " )   } , 
 
                                                 s i n g l e L i n e   =   t r u e , 
 
                                                 k e y b o a r d O p t i o n s   =   K e y b o a r d O p t i o n s ( 
 
                                                         i m e A c t i o n   =   I m e A c t i o n . D o n e , 
 
                                                         c a p i t a l i z a t i o n   =   K e y b o a r d C a p i t a l i z a t i o n . S e n t e n c e s 
 
                                                 ) , 
 
                                                 k e y b o a r d A c t i o n s   =   K e y b o a r d A c t i o n s ( o n D o n e   =   {   o n A d d S u b t a s k ( )   } ) 
 
                                         ) 
 
                                         I c o n B u t t o n ( o n C l i c k   =   o n A d d S u b t a s k )   { 
 
                                                 I c o n ( I c o n s . D e f a u l t . A d d ,   c o n t e n t D e s c r i p t i o n   =   " A j o u t e r " ) 
 
                                         } 
 
                                 } 
 
 
 
                                 / /   T a g s   s e c t i o n   w i t h   a d d   c a p a b i l i t y 
 
                                 T e x t ( 
 
                                         t e x t   =   " T a g s " , 
 
                                         s t y l e   =   M a t e r i a l T h e m e . t y p o g r a p h y . l a b e l L a r g e , 
 
                                         f o n t W e i g h t   =   F o n t W e i g h t . B o l d , 
 
                                         c o l o r   =   M a t e r i a l T h e m e . c o l o r S c h e m e . p r i m a r y 
 
                                 ) 
 
 
 
                                 i f   ( s t a t e . t a g s . i s N o t E m p t y ( ) )   { 
 
                                         F l o w R o w ( 
 
                                                 h o r i z o n t a l A r r a n g e m e n t   =   A r r a n g e m e n t . s p a c e d B y ( 6 . d p ) , 
 
                                                 v e r t i c a l A r r a n g e m e n t   =   A r r a n g e m e n t . s p a c e d B y ( 6 . d p ) 
 
                                         )   { 
 
                                                 s t a t e . t a g s . f o r E a c h   {   t a g   - > 
 
                                                         S u r f a c e ( 
 
                                                                 c o l o r   =   M a t e r i a l T h e m e . c o l o r S c h e m e . s e c o n d a r y C o n t a i n e r , 
 
                                                                 s h a p e   =   M a t e r i a l T h e m e . s h a p e s . s m a l l , 
 
                                                                 o n C l i c k   =   {   o n R e m o v e T a g ( t a g )   } 
 
                                                         )   { 
 
                                                                 R o w ( 
 
                                                                         m o d i f i e r   =   M o d i f i e r . p a d d i n g ( h o r i z o n t a l   =   8 . d p ,   v e r t i c a l   =   4 . d p ) , 
 
                                                                         v e r t i c a l A l i g n m e n t   =   A l i g n m e n t . C e n t e r V e r t i c a l l y 
 
                                                                 )   { 
 
                                                                         T e x t ( 
 
                                                                                 t e x t   =   " # $ t a g " , 
 
                                                                                 s t y l e   =   M a t e r i a l T h e m e . t y p o g r a p h y . l a b e l S m a l l , 
 
                                                                                 c o l o r   =   M a t e r i a l T h e m e . c o l o r S c h e m e . o n S e c o n d a r y C o n t a i n e r 
 
                                                                         ) 
 
                                                                         S p a c e r ( m o d i f i e r   =   M o d i f i e r . w i d t h ( 4 . d p ) ) 
 
                                                                         I c o n ( 
 
                                                                                 i m a g e V e c t o r   =   I c o n s . D e f a u l t . C l o s e , 
 
                                                                                 c o n t e n t D e s c r i p t i o n   =   " S u p p r i m e r   l e   t a g " , 
 
                                                                                 m o d i f i e r   =   M o d i f i e r . s i z e ( 1 2 . d p ) , 
 
                                                                                 t i n t   =   M a t e r i a l T h e m e . c o l o r S c h e m e . o n S e c o n d a r y C o n t a i n e r 
 
                                                                         ) 
 
                                                                 } 
 
                                                         } 
 
                                                 } 
 
                                         } 
 
                                 } 
 
 
 
                                 / /   A d d   t a g 
 
                                 R o w ( 
 
                                         m o d i f i e r   =   M o d i f i e r . f i l l M a x W i d t h ( ) , 
 
                                         v e r t i c a l A l i g n m e n t   =   A l i g n m e n t . C e n t e r V e r t i c a l l y 
 
                                 )   { 
 
                                         O u t l i n e d T e x t F i e l d ( 
 
                                                 v a l u e   =   s t a t e . n e w T a g T e x t , 
 
                                                 o n V a l u e C h a n g e   =   o n N e w T a g T e x t C h a n g e d , 
 
                                                 m o d i f i e r   =   M o d i f i e r . w e i g h t ( 1 f ) , 
 
                                                 p l a c e h o l d e r   =   {   T e x t ( " N o u v e a u   t a g . . . " )   } , 
 
                                                 s i n g l e L i n e   =   t r u e , 
 
                                                 k e y b o a r d O p t i o n s   =   K e y b o a r d O p t i o n s ( 
 
                                                         i m e A c t i o n   =   I m e A c t i o n . D o n e , 
 
                                                         c a p i t a l i z a t i o n   =   K e y b o a r d C a p i t a l i z a t i o n . N o n e 
 
                                                 ) , 
 
                                                 k e y b o a r d A c t i o n s   =   K e y b o a r d A c t i o n s ( o n D o n e   =   {   o n A d d T a g ( )   } ) 
 
                                         ) 
 
                                         I c o n B u t t o n ( o n C l i c k   =   o n A d d T a g )   { 
 
                                                 I c o n ( I c o n s . D e f a u l t . A d d ,   c o n t e n t D e s c r i p t i o n   =   " A j o u t e r   t a g " ) 
 
                                         } 
 
                                 } 
 
 
 
                                 s t a t e . e r r o r M e s s a g e ? . l e t   {   m e s s a g e   - > 
 
                                         T e x t ( 
 
                                                 t e x t   =   m e s s a g e , 
 
                                                 c o l o r   =   M a t e r i a l T h e m e . c o l o r S c h e m e . e r r o r , 
 
                                                 s t y l e   =   M a t e r i a l T h e m e . t y p o g r a p h y . b o d y S m a l l 
 
                                         ) 
 
                                 } 
 
                         } 
 
                 } , 
 
                 c o n f i r m B u t t o n   =   { 
 
                         T e x t B u t t o n ( 
 
                                 o n C l i c k   =   o n S a v e , 
 
                                 e n a b l e d   =   ! s t a t e . i s S a v i n g   & &   s t a t e . c o n t e n t . i s N o t B l a n k ( ) 
 
                         )   { 
 
                                 i f   ( s t a t e . i s S a v i n g )   { 
 
                                         C i r c u l a r P r o g r e s s I n d i c a t o r ( m o d i f i e r   =   M o d i f i e r . s i z e ( 1 6 . d p ) ,   s t r o k e W i d t h   =   2 . d p ) 
 
                                         S p a c e r ( m o d i f i e r   =   M o d i f i e r . w i d t h ( 8 . d p ) ) 
 
                                 } 
 
                                 I c o n ( I c o n s . D e f a u l t . C h e c k ,   c o n t e n t D e s c r i p t i o n   =   n u l l ) 
 
                                 S p a c e r ( m o d i f i e r   =   M o d i f i e r . w i d t h ( 6 . d p ) ) 
 
                                 T e x t ( i f   ( s t a t e . i s C r e a t e M o d e )   " C r ? ? e r "   e l s e   " E n r e g i s t r e r " ) 
 
                         } 
 
                 } , 
 
                 d i s m i s s B u t t o n   =   { 
 
                         T e x t B u t t o n ( o n C l i c k   =   o n D i s m i s s )   { 
 
                                 T e x t ( " A n n u l e r " ) 
 
                         } 
 
                 } 
 
         ) 
 
 } 
 
 