1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-26 21:01:32 +00:00

Added text to loading view.

This commit is contained in:
Felix Ableitner 2014-05-06 12:28:46 +02:00
parent 76d7429a58
commit 099645b66b
3 changed files with 29 additions and 10 deletions

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<WebView
android:id="@+id/webview"
@ -11,11 +11,24 @@
android:layout_height="match_parent"
android:visibility="gone" />
<ProgressBar
<RelativeLayout
android:layout_centerInParent="true"
android:id="@+id/loading"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
android:layout_below="@id/progress"
android:text="@string/web_gui_loading" />
</RelativeLayout>
</RelativeLayout>

View file

@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Syncthing</string>
<string name="app_name">Syncthing</string>
<string name="web_gui_loading">Waiting for GUI</string>
</resources>

View file

@ -21,7 +21,7 @@ public class WebGuiActivity extends Activity {
private static final String SYNCTHING_URL = "http://127.0.0.1:8080";
private WebView mWebView;
private ProgressBar mLoadingView;
private View mLoadingView;
/**
* Retries loading every second until the web UI becomes available.
@ -60,8 +60,10 @@ public class WebGuiActivity extends Activity {
setContentView(R.layout.main);
mLoadingView = (ProgressBar) findViewById(R.id.loading);
mLoadingView.setIndeterminate(true);
mLoadingView = findViewById(R.id.loading);
ProgressBar pb = (ProgressBar) mLoadingView.findViewById(R.id.progress);
pb.setIndeterminate(true);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebViewClient(new WebViewClient());