Skip to content

Commit cd46e84

Browse files
New Sample: Feed and News Tile (#339)
* New Sample: Feed and News Tile * New Sample: Feed and News Tile (2) --------- Co-authored-by: oblomov-dev <102328295+oblomov-dev@users.noreply.github.com>
1 parent 342d422 commit cd46e84

File tree

3 files changed

+150
-0
lines changed

3 files changed

+150
-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
@@ -707,6 +707,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
707707
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
708708
).
709709

710+
panel->generic_tile(
711+
header = 'Tile'
712+
subheader = 'Feed and News Tile'
713+
press = client->_event( 'Z2UI5_CL_DEMO_APP_278' )
714+
mode = 'LineMode'
715+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
716+
).
717+
710718
page = page2->panel(
711719
expandable = abap_true
712720
expanded = client->_bind_edit( ms_check_expanded-more )

src/z2ui5_cl_demo_app_278.clas.abap

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
CLASS z2ui5_cl_demo_app_278 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_278 IMPLEMENTATION.
31+
32+
33+
METHOD display_view.
34+
" Define the base URL for the server
35+
DATA base_url TYPE string VALUE 'https://sapui5.hana.ondemand.com/'.
36+
37+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
38+
)->page(
39+
title = 'abap2UI5 - Sample: Feed and News Tile'
40+
navbuttonpress = client->_event( 'BACK' )
41+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
42+
43+
page->header_content(
44+
)->button( id = `button_hint_id`
45+
icon = `sap-icon://hint`
46+
tooltip = `Sample information`
47+
press = client->_event( 'CLICK_HINT_ICON' ) ).
48+
49+
page->header_content(
50+
)->link(
51+
text = 'UI5 Demo Kit'
52+
target = '_blank'
53+
href = base_url && 'sdk/#/entity/sap.m.GenericTile/sample/sap.m.sample.GenericTileAsFeedTile' ).
54+
55+
page->generic_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout` header = `Feed Tile that shows updates of the last feeds given to a specific topic:`
56+
frametype = `TwoByOne` press = client->_event( `press` )
57+
)->tile_content( footer = `New Notifications`
58+
)->feed_content( contenttext = `@@notify Great outcome of the Presentation today. New functionality well received.`
59+
subheader = `About 1 minute ago in Computer Market` value = `352` )->get_parent( )->get_parent( )->get_parent(
60+
61+
)->slide_tile( class = `sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout`
62+
)->tiles(
63+
)->generic_tile(
64+
backgroundimage = base_url && `test-resources/sap/m/demokit/sample/GenericTileAsFeedTile/images/NewsImage1.png`
65+
frametype = `TwoByOne` press = client->_event( `press` )
66+
)->tile_content( footer = `August 21, 2016`
67+
)->news_content(
68+
contentText = `Wind Map: Monitoring Real-Time and Fore-casted Wind Conditions across the Globe`
69+
subheader = `Today, SAP News` )->get_parent( )->get_parent( )->get_parent(
70+
)->generic_tile(
71+
backgroundImage = base_url && `test-resources/sap/m/demokit/sample/GenericTileAsFeedTile/images/NewsImage2.png`
72+
frametype = `TwoByOne` press = client->_event( `press` )
73+
)->tile_content( footer = `August 21, 2016`
74+
)->news_content(
75+
contenttext = `SAP Unveils Powerful New Player Comparision Tool Exclusively on NFL.com`
76+
subheader = `Today, SAP News`
77+
).
78+
79+
client->view_display( page->stringify( ) ).
80+
81+
ENDMETHOD.
82+
83+
84+
METHOD on_event.
85+
86+
CASE client->get( )-event.
87+
WHEN 'BACK'.
88+
client->nav_app_leave( ).
89+
WHEN 'CLICK_HINT_ICON'.
90+
z2ui5_display_popover( `button_hint_id` ).
91+
WHEN 'press'.
92+
client->message_toast_display( `The GenericTile is pressed.` ).
93+
ENDCASE.
94+
95+
ENDMETHOD.
96+
97+
98+
METHOD z2ui5_display_popover.
99+
100+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
101+
view->quick_view( placement = `Bottom` width = `auto`
102+
)->quick_view_page( pageid = `sampleInformationId`
103+
header = `Sample information`
104+
description = `Shows Feed Tile and News Tile samples that can contain feed content, news content, and a footer.` ).
105+
106+
client->popover_display(
107+
xml = view->stringify( )
108+
by_id = id
109+
).
110+
111+
ENDMETHOD.
112+
113+
114+
METHOD z2ui5_if_app~main.
115+
116+
me->client = client.
117+
118+
IF check_initialized = abap_false.
119+
check_initialized = abap_true.
120+
display_view( client ).
121+
ENDIF.
122+
123+
on_event( client ).
124+
125+
ENDMETHOD.
126+
ENDCLASS.

src/z2ui5_cl_demo_app_278.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_278</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Feed and News Tile</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)