1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Added progressbar to autconfig screen and played bit with margins.

This commit is contained in:
Sander Bogaert 2011-07-08 12:52:40 +02:00 committed by Andrew Chen
parent 91e55e38b9
commit 7e4b4c4bc7
2 changed files with 32 additions and 12 deletions

View File

@ -1,16 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- TODO: add a nice ?animated? image here, hourglass or something -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView android:id="@+id/status_message"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:gravity="center_horizontal"
android:paddingBottom="6dip"/>
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_marginTop="20dp"
android:gravity="center_horizontal"
android:paddingBottom="6dip"/>
<!-- TODO: add a cancel button -->
</LinearLayout>
<ProgressBar android:id="@+id/autoconfig_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/status_message"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
style="@android:style/Widget.ProgressBar.Large" />
<!-- TODO: add a cancel button
<include layout="@layout/wizard_cancel"/> -->
</RelativeLayout>

View File

@ -8,6 +8,7 @@ import android.os.*;
import android.os.Process;
import android.util.Log;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.fsck.k9.K9;
import com.fsck.k9.R;
@ -76,6 +77,8 @@ public class AccountSetupAutoConfiguration extends K9Activity implements View.On
private boolean mDestroyed;
private TextView mMessageView;
private ProgressBar mProgressCircle;
private String mEmailAddress;
private String mPassword;
private String mLastMessage;
@ -100,6 +103,9 @@ public class AccountSetupAutoConfiguration extends K9Activity implements View.On
// Setting up the view
setContentView(R.layout.account_setup_autoconfig);
mMessageView = (TextView)findViewById(R.id.status_message);
mProgressCircle = (ProgressBar)findViewById(R.id.autoconfig_progress);
mProgressCircle.setIndeterminate(true);
mProgressCircle.setVisibility(View.VISIBLE);
// ((Button)findViewById(R.id.cancel)).setOnClickListener(this);
// Getting our data to work with
@ -125,7 +131,7 @@ public class AccountSetupAutoConfiguration extends K9Activity implements View.On
String domain = emailParts[1];
/*
First part: check if serverside configuration data exists
Check if configuration data exists and if it does read in
*/
int i = 0;
while( i < urlTemplates.size() ){
@ -147,6 +153,11 @@ public class AccountSetupAutoConfiguration extends K9Activity implements View.On
// parse and finish
// remember if i >= UNSAFE_URL_START => POSSIBLE UNSAFE DATA, alert user!!!
parse(data);
try {
Thread.sleep(1750);
} catch (InterruptedException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
finish();
return;
}