Skip to content

Commit 954f781

Browse files
New Sample: Tile Statuses (#348)
* New Sample: Tile Statuses * New Sample: Tile Statues (2)
1 parent b7c7513 commit 954f781

File tree

5 files changed

+190
-0
lines changed

5 files changed

+190
-0
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
722722
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
723723
).
724724

725+
panel->generic_tile(
726+
header = 'Tile'
727+
subheader = 'Statuses'
728+
press = client->_event( 'Z2UI5_CL_DEMO_APP_281' )
729+
mode = 'LineMode'
730+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
731+
).
732+
725733
page = page2->panel(
726734
expandable = abap_true
727735
expanded = client->_bind_edit( ms_check_expanded-more )

src/z2ui5_cl_demo_app_276.clas.abap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ CLASS z2ui5_cl_demo_app_276 IMPLEMENTATION.
3131

3232

3333
METHOD display_view.
34+
DATA(css) = `.tileLayout {` &&
35+
` float: left;` &&
36+
`}`.
3437

3538
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
3639
)->page(

src/z2ui5_cl_demo_app_278.clas.abap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ CLASS z2ui5_cl_demo_app_278 IMPLEMENTATION.
3131

3232

3333
METHOD display_view.
34+
DATA(css) = `.tileLayout {` &&
35+
` float: left;` &&
36+
`}`.
37+
3438
" Define the base URL for the server
3539
DATA base_url TYPE string VALUE 'https://sapui5.hana.ondemand.com/'.
3640

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
CLASS z2ui5_cl_demo_app_281 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+
11+
PROTECTED SECTION.
12+
13+
DATA client TYPE REF TO z2ui5_if_client.
14+
15+
METHODS display_view
16+
IMPORTING
17+
client TYPE REF TO z2ui5_if_client.
18+
METHODS on_event
19+
IMPORTING
20+
client TYPE REF TO z2ui5_if_client.
21+
METHODS z2ui5_display_popover
22+
IMPORTING
23+
id TYPE string.
24+
25+
PRIVATE SECTION.
26+
ENDCLASS.
27+
28+
29+
30+
CLASS z2ui5_cl_demo_app_281 IMPLEMENTATION.
31+
32+
33+
METHOD display_view.
34+
DATA(css) = `.tileLayout {` &&
35+
` float: left;` &&
36+
`}`.
37+
38+
" Define the base URL for the server
39+
DATA base_url TYPE string VALUE 'https://sapui5.hana.ondemand.com/'.
40+
41+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
42+
)->page(
43+
title = 'abap2UI5 - Sample: Tile Statuses'
44+
navbuttonpress = client->_event( 'BACK' )
45+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
46+
47+
page->header_content(
48+
)->button( id = `button_hint_id`
49+
icon = `sap-icon://hint`
50+
tooltip = `Sample information`
51+
press = client->_event( 'CLICK_HINT_ICON' ) ).
52+
53+
page->header_content(
54+
)->link(
55+
text = 'UI5 Demo Kit'
56+
target = '_blank'
57+
href = base_url && 'sdk/#/entity/sap.m.GenericTile/sample/sap.m.sample.GenericTileStates' ).
58+
59+
page->generic_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout` header = `Status Loaded - no press event`
60+
subheader = `Subheader`
61+
)->tile_content( unit = `Unit` footer = `Footer`
62+
)->image_Content( src = `sap-icon://line-charts` )->get_parent( )->get_parent( )->get_parent(
63+
)->generic_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout` header = `Status Loaded - with press event`
64+
subheader = `Subheader` press = client->_event( `press` )
65+
)->tile_content( unit = `Unit` footer = `Footer`
66+
)->image_Content( src = `sap-icon://home-share` )->get_parent( )->get_parent( )->get_parent(
67+
)->generic_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout` header = `Status Loading - no press event`
68+
subheader = `Subheader` state = `Loading`
69+
)->tile_content( unit = `Unit` footer = `Footer`
70+
)->numeric_content( scale = `M` value = `2.1` valuecolor = `Good` indicator = `Up` withmargin = abap_false )->get_parent( )->get_parent( )->get_parent(
71+
)->generic_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout` header = `Status Loading - with press event`
72+
subheader = `Subheader` state = `Loading` press = client->_event( `press` )
73+
)->tile_content( unit = `Unit` footer = `Footer`
74+
)->numeric_content( scale = `M` value = `1.96` valuecolor = `Error` indicator = `Down` withmargin = `false` )->get_parent( )->get_parent( )->get_parent(
75+
)->generic_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout` header = `Status Failed - no press event`
76+
subheader = `Subheader` frametype = `TwoByOne` state = `Failed`
77+
)->tile_content( unit = `Unit` footer = `Footer`
78+
)->feed_content(
79+
contenttext = `@@notify Great outcome of the Presentation today. The new functionality and the design was well received. Berlin, Tokyo, Rome, Budapest, New York, Munich, London`
80+
subheader = `Subheader` value = `9`)->get_parent( )->get_parent( )->get_parent(
81+
)->generic_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout` header = `Status Failed - with press event`
82+
subheader = `Subheader` frametype = `TwoByOne` state = `Failed` press = client->_event( `press` )
83+
)->tile_content( unit = `Unit` footer = `Footer`
84+
)->feed_content(
85+
contenttext = `@@notify Great outcome of the Presentation today. The new functionality and the design was well received. Berlin, Tokyo, Rome, Budapest, New York, Munich, London`
86+
subheader = `Subheader` value = `9` )->get_parent( )->get_parent( )->get_parent(
87+
)->slide_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
88+
)->generic_tile(
89+
backgroundimage = base_url && `test-resources/sap/m/demokit/sample/GenericTileAsFeedTile/images/NewsImage1.png`
90+
frametype = `TwoByOne` state = `Loading`
91+
)->tile_content( unit = `Unit` footer = `Footer`
92+
)->news_content(
93+
contenttext = `Status Loading - no press event`
94+
subheader = `Subheader` )->get_parent( )->get_parent( )->get_parent(
95+
)->generic_tile(
96+
backgroundimage = base_url && `test-resources/sap/m/demokit/sample/GenericTileAsFeedTile/images/NewsImage2.png`
97+
frametype = `TwoByOne` state = `Loaded` press = client->_event( `press` )
98+
)->tile_content( unit = `Unit` footer = `Footer`
99+
)->news_content(
100+
contenttext = `Status Loaded - with press event`
101+
subheader = `Subheader` )->get_parent( )->get_parent( )->get_parent( )->get_parent(
102+
)->generic_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout` header = `Status Disabled - no press event`
103+
subheader = `Subheader` state = `Disabled`
104+
)->tile_content( footer = `Footer` unit = `Unit`
105+
)->numeric_content( value = `3` icon = `sap-icon://travel-expense` withmargin = abap_false )->get_parent( )->get_parent( )->get_parent(
106+
)->generic_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout` header = `Status Disabled - with press event`
107+
subheader = `Subheader` state = `Disabled` press = client->_event( `press` )
108+
)->tile_content( footer = `Footer` unit = `Unit`
109+
)->numeric_content( value = `3` icon = `sap-icon://travel-expense` withmargin = abap_false
110+
).
111+
112+
client->view_display( page->stringify( ) ).
113+
114+
ENDMETHOD.
115+
116+
117+
METHOD on_event.
118+
119+
CASE client->get( )-event.
120+
WHEN 'BACK'.
121+
client->nav_app_leave( ).
122+
WHEN 'CLICK_HINT_ICON'.
123+
z2ui5_display_popover( `button_hint_id` ).
124+
WHEN 'press'.
125+
client->message_toast_display( `The GenericTile is pressed.` ).
126+
ENDCASE.
127+
128+
ENDMETHOD.
129+
130+
131+
METHOD z2ui5_display_popover.
132+
133+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
134+
view->quick_view( placement = `Bottom` width = `auto`
135+
)->quick_view_page( pageid = `sampleInformationId`
136+
header = `Sample information`
137+
description = `Shows the GenericTile while it is loading, if loading fails, and in disabled status.` ).
138+
139+
client->popover_display(
140+
xml = view->stringify( )
141+
by_id = id
142+
).
143+
144+
ENDMETHOD.
145+
146+
147+
METHOD z2ui5_if_app~main.
148+
149+
me->client = client.
150+
151+
IF check_initialized = abap_false.
152+
check_initialized = abap_true.
153+
display_view( client ).
154+
ENDIF.
155+
156+
on_event( client ).
157+
158+
ENDMETHOD.
159+
ENDCLASS.

src/z2ui5_cl_demo_app_281.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_281</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Tile Statuses</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)