|
| 1 | +class z2ui5_cl_demo_app_243 definition |
| 2 | + public |
| 3 | + create public . |
| 4 | + |
| 5 | +public section. |
| 6 | + |
| 7 | + interfaces Z2UI5_IF_APP . |
| 8 | + |
| 9 | + data CHECK_INITIALIZED type ABAP_BOOL . |
| 10 | + PROTECTED SECTION. |
| 11 | + |
| 12 | + METHODS display_view |
| 13 | + IMPORTING |
| 14 | + client TYPE REF TO z2ui5_if_client. |
| 15 | + METHODS on_event |
| 16 | + IMPORTING |
| 17 | + client TYPE REF TO z2ui5_if_client. |
| 18 | + |
| 19 | + PRIVATE SECTION. |
| 20 | +ENDCLASS. |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +CLASS z2ui5_cl_demo_app_243 IMPLEMENTATION. |
| 25 | + |
| 26 | + |
| 27 | + METHOD DISPLAY_VIEW. |
| 28 | + |
| 29 | + DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( |
| 30 | + )->page( |
| 31 | + title = 'abap2UI5 - Sample: Negative Margins' |
| 32 | + navbuttonpress = client->_event( 'BACK' ) |
| 33 | + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) |
| 34 | + |
| 35 | + )->page( showheader = `false` class = `sapUiContentPadding` |
| 36 | + )->sub_header( )->toolbar( design = `Info` |
| 37 | + )->icon( src = `sap-icon://begin` |
| 38 | + )->text( text = `This sample demonstrates classes which let you to add negative margin at two opposite sides (begin/end).` )->get_parent( )->get_parent( ). |
| 39 | + |
| 40 | + DATA(layout) = page->panel( class = `sapUiTinyNegativeMarginBeginEnd` |
| 41 | + )->content( |
| 42 | + )->text( text = `This panel uses margin class 'sapUiTinyNegativeMarginBeginEnd' to add a -0.5rem space at the panel's left and right sides.` |
| 43 | + class = `sapMH4FontSize` )->get_parent( )->get_parent( |
| 44 | + )->panel( class = `sapUiSmallNegativeMarginBeginEnd` |
| 45 | + )->content( |
| 46 | + )->text( text = `This panel uses margin class 'sapUiSmallNegativeMarginBeginEnd' to add a -1rem space at the panel's left and right sides.` |
| 47 | + class = `sapMH4FontSize` )->get_parent( )->get_parent( |
| 48 | + )->panel( class = `sapUiMediumNegativeMarginBeginEnd` |
| 49 | + )->content( |
| 50 | + )->text( text = `This panel uses margin class 'sapUiMediumNegativeMarginBeginEnd' to add a -2rem space at the panel's left and right sides.` |
| 51 | + class = `sapMH4FontSize` )->get_parent( )->get_parent( |
| 52 | + )->panel( class = `sapUiLargeNegativeMarginBeginEnd` |
| 53 | + )->content( |
| 54 | + )->text( text = `This panel uses margin class 'sapUiLargeNegativeMarginBeginEnd' to add a -3rem space at the panel's left and right sides.` |
| 55 | + class = `sapMH4FontSize` |
| 56 | + ). |
| 57 | + |
| 58 | + client->view_display( page->stringify( ) ). |
| 59 | + |
| 60 | + ENDMETHOD. |
| 61 | + |
| 62 | + |
| 63 | + METHOD ON_EVENT. |
| 64 | + |
| 65 | + CASE client->get( )-event. |
| 66 | + WHEN 'BACK'. |
| 67 | + client->nav_app_leave( ). |
| 68 | + ENDCASE. |
| 69 | + |
| 70 | + ENDMETHOD. |
| 71 | + |
| 72 | + |
| 73 | + METHOD Z2UI5_IF_APP~MAIN. |
| 74 | + |
| 75 | + IF check_initialized = abap_false. |
| 76 | + check_initialized = abap_true. |
| 77 | + display_view( client ). |
| 78 | + ENDIF. |
| 79 | + |
| 80 | + on_event( client ). |
| 81 | + |
| 82 | + ENDMETHOD. |
| 83 | +ENDCLASS. |
0 commit comments