From d38b41687c233d6363ae5ae49f8b341581b971ef Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 15 Mar 2023 23:08:57 +0000 Subject: [PATCH] Throw in the towel on swipe refresh and add a refresh button. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4225 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- .../com/unprompted/tildefriends/MainActivity.java | 10 ++++++++++ src/android/res/layout/activity_main.xml | 15 ++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/android/com/unprompted/tildefriends/MainActivity.java b/src/android/com/unprompted/tildefriends/MainActivity.java index 8f6650bd..628a6746 100644 --- a/src/android/com/unprompted/tildefriends/MainActivity.java +++ b/src/android/com/unprompted/tildefriends/MainActivity.java @@ -10,12 +10,14 @@ import android.os.CountDownTimer; import android.os.SystemClock; import android.util.Log; import android.view.KeyEvent; +import android.view.View; import android.view.Window; import android.webkit.JsResult; import android.webkit.WebChromeClient; import android.webkit.WebResourceRequest; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.widget.Button; import java.lang.Process; import java.lang.Thread; @@ -128,6 +130,14 @@ public class MainActivity extends Activity { }); web_view.loadUrl("http://127.0.0.1:12345/"); + + + Button refresh = (Button)findViewById(R.id.refresh); + refresh.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + web_view.reload(); + } + }); } @Override diff --git a/src/android/res/layout/activity_main.xml b/src/android/res/layout/activity_main.xml index 12d30a3f..d4251cc9 100644 --- a/src/android/res/layout/activity_main.xml +++ b/src/android/res/layout/activity_main.xml @@ -1,5 +1,5 @@ - - + android:id="@+id/web"> + +