public void setElementButton ( Integer index , String title , String type , String url , Boolean messenger_extensions , String webview_height_ratio , String fallback_url ) { if ( this . elements . get ( index ) . containsKey ( "buttons" ) ) { HashMap < String , String > button = new HashMap < String , String > ( ) ; button . put ( "title" , title ) ; button . put ( "type" , type ) ; button . put ( "url" , url ) ; button . put ( "messenger_extensions" , String . valueOf ( messenger_extensions ) ) ; button . put ( "webview_height_ratio" , webview_height_ratio ) ; button . put ( "fallback_url" , fallback_url ) ; @ SuppressWarnings ( "unchecked" ) ArrayList < HashMap < String , String > > element_buttons = ( ArrayList < HashMap < String , String > > ) this . elements . get ( index ) . get ( "buttons" ) ; element_buttons . add ( button ) ; this . elements . get ( index ) . put ( "buttons" , element_buttons ) ; } else { ArrayList < HashMap < String , String > > element_buttons = new ArrayList < HashMap < String , String > > ( ) ; HashMap < String , String > button = new HashMap < String , String > ( ) ; button . put ( "title" , title ) ; button . put ( "type" , type ) ; button . put ( "url" , url ) ; button . put ( "messenger_extensions" , String . valueOf ( messenger_extensions ) ) ; button . put ( "webview_height_ratio" , webview_height_ratio ) ; button . put ( "fallback_url" , fallback_url ) ; element_buttons . add ( button ) ; this . elements . get ( index ) . put ( "buttons" , element_buttons ) ; } }
Set Element Button