Skip to content

Commit ee5f3e2

Browse files
New Demo: Rating Indicator (#255)
1 parent 2fe9c20 commit ee5f3e2

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,13 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
393393
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
394394
).
395395

396+
panel->generic_tile(
397+
header = 'Rating Indicator'
398+
press = client->_event( 'Z2UI5_CL_DEMO_APP_220' )
399+
mode = 'LineMode'
400+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
401+
).
402+
396403
panel = page->panel(
397404
expandable = abap_false
398405
expanded = abap_true

src/z2ui5_cl_demo_app_220.clas.abap

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
class z2ui5_cl_demo_app_220 definition
2+
public
3+
create public .
4+
5+
public section.
6+
7+
interfaces IF_SERIALIZABLE_OBJECT .
8+
interfaces Z2UI5_IF_APP .
9+
10+
data CHECK_INITIALIZED type ABAP_BOOL .
11+
PROTECTED SECTION.
12+
13+
METHODS display_view
14+
IMPORTING
15+
client TYPE REF TO z2ui5_if_client.
16+
METHODS on_event
17+
IMPORTING
18+
client TYPE REF TO z2ui5_if_client.
19+
20+
PRIVATE SECTION.
21+
ENDCLASS.
22+
23+
24+
25+
CLASS z2ui5_cl_demo_app_220 IMPLEMENTATION.
26+
27+
28+
METHOD DISPLAY_VIEW.
29+
30+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
31+
)->page(
32+
title = 'abap2UI5 - Sample: Rating Indicator'
33+
navbuttonpress = client->_event( 'BACK' )
34+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
35+
36+
DATA(layout) = page->vertical_layout( class = `sapUiContentPadding` ).
37+
layout->label( text = `Rating Indicator default size` labelfor = `RI_default` ).
38+
layout->rating_indicator( id = `RI_default` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` tooltip = `Rating Tooltip` ).
39+
40+
layout->label( text = `Rating Indicator with size L` labelfor = `RI_L` ).
41+
layout->rating_indicator( id = `RI_L` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` iconSize = `32px` tooltip = `Rating Tooltip` ).
42+
43+
layout->label( text = `Rating Indicator with size M` labelfor = `RI_M` ).
44+
layout->rating_indicator( id = `RI_M` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` iconSize = `22px` tooltip = `Rating Tooltip` ).
45+
46+
layout->label( text = `Rating Indicator with size S` labelfor = `RI_S` ).
47+
layout->rating_indicator( id = `RI_S` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` iconSize = `16px` tooltip = `Rating Tooltip` ).
48+
49+
layout->label( text = `Rating Indicator with size XS` labelfor = `RI_XS` ).
50+
layout->rating_indicator( id = `RI_XS` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` iconSize = `12px` tooltip = `Rating Tooltip` ).
51+
52+
layout->label( text = `Rating Indicator with non active state` labelfor = `RI_EnabledFalse` ).
53+
layout->rating_indicator( id = `RI_EnabledFalse` maxValue = `5` enabled = `false` class = `sapUiSmallMarginBottom` value = `4` iconSize = `12px` tooltip = `Rating Tooltip` ).
54+
55+
layout->label( text = `Rating Indicator display only` labelfor = `RI_display_only` ).
56+
layout->rating_indicator( id = `RI_display_only` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` tooltip = `Rating Tooltip` displayonly = abap_true ).
57+
58+
layout->label( text = `Rating Indicator readonly mode` labelfor = `RI_read_only` ).
59+
layout->rating_indicator( id = `RI_read_only` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` tooltip = `Rating Tooltip` editable = `false` ).
60+
61+
layout->label( text = `Rating Indicator with different maxValue` labelfor = `RI_maxValue` ).
62+
layout->rating_indicator( id = `RI_maxValue` maxValue = `8` class = `sapUiSmallMarginBottom` value = `4` tooltip = `Rating Tooltip` ).
63+
layout->rating_indicator( maxValue = `7` class = `sapUiSmallMarginBottom` value = `4` tooltip = `Rating Tooltip` ).
64+
layout->rating_indicator( maxValue = `6` class = `sapUiSmallMarginBottom` value = `3` tooltip = `Rating Tooltip` ).
65+
layout->rating_indicator( maxValue = `5` class = `sapUiSmallMarginBottom` value = `2` ).
66+
layout->rating_indicator( maxValue = `4` class = `sapUiSmallMarginBottom` value = `2` ).
67+
68+
client->view_display( page->stringify( ) ).
69+
70+
ENDMETHOD.
71+
72+
73+
METHOD ON_EVENT.
74+
75+
CASE client->get( )-event.
76+
WHEN 'BACK'.
77+
client->nav_app_leave( ).
78+
ENDCASE.
79+
80+
ENDMETHOD.
81+
82+
83+
METHOD Z2UI5_IF_APP~MAIN.
84+
85+
IF check_initialized = abap_false.
86+
check_initialized = abap_true.
87+
display_view( client ).
88+
ENDIF.
89+
90+
on_event( client ).
91+
92+
ENDMETHOD.
93+
ENDCLASS.

src/z2ui5_cl_demo_app_220.clas.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>Z2UI5_CL_DEMO_APP_220</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Rating Indicator</DESCRIPT>
9+
<STATE>1</STATE>
10+
<CLSCCINCL>X</CLSCCINCL>
11+
<FIXPT>X</FIXPT>
12+
<UNICODE>X</UNICODE>
13+
</VSEOCLASS>
14+
</asx:values>
15+
</asx:abap>
16+
</abapGit>

0 commit comments

Comments
 (0)