HomeSketchwareSwipe Refresh WebView In sketchware

Swipe Refresh WebView In sketchware

1) Create a new sketchware project.

2) Drag and Drop a Linear Layout with id linear1 and height match_parent.

3) Drag and Drop a WebView with id wb inside that Linear Layout linear1.

4) Enable the AppCompat and Design Library.

5) In Oncreate event do as below:-

6) Code used in ASD block is :-

final sr = new;
sr.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, android.widget.LinearLayout.LayoutParams.MATCH_PARENT));
linear1.removeView(wb); Runnable() { @Override public void run() {sr.addView(wb); } });
wb.setWebViewClient(new WebViewClient() { public void onPageFinished(WebView view, String url) {
sr.setOnRefreshListener( new {
@Override public void onRefresh() { wb.reload();

That’s All.
Save and run Project..

Leave a Reply