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
This commit is contained in:
Cory McWilliams 2023-03-15 23:08:57 +00:00
parent 08125cd1e8
commit d38b41687c
2 changed files with 22 additions and 3 deletions

View File

@ -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

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -7,5 +7,14 @@
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/web"/>
</LinearLayout>
android:id="@+id/web">
</WebView>
<Button
android:id="@+id/refresh"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:text="REFRESH"/>
</RelativeLayout>