1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-09 12:48:02 -05:00

Show warning about data coming over unsafe http. Bit of restyling for detection screen ( note: still a 'hack' to get the progresscircle high enough ).

This commit is contained in:
dzan 2011-08-20 16:27:42 +02:00 committed by Andrew Chen
parent a645ea08b3
commit 0bf09401c9
3 changed files with 40 additions and 25 deletions

View File

@ -13,39 +13,53 @@
android:paddingBottom="6dip"/> android:paddingBottom="6dip"/>
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_below="@id/status_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:layout_alignParentBottom="true" android:orientation="vertical"
android:layout_centerHorizontal="true"> android:layout_centerHorizontal="true">
<TextView android:id="@+id/autoconfig_warning" <TextView android:id="@+id/autoconfig_warning"
android:gravity="center"
android:textColor="#C44141"
android:textStyle="bold"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:text="@string/account_setup_autoconfig_unsafe_connection" />
android:text="Warning blaat blaat" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignParentBottom="true">
<!-- kind of a hack.... need to have a look at whis this is behind the buttons -->
<ProgressBar android:id="@+id/autoconfig_progress" <ProgressBar android:id="@+id/autoconfig_progress"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/status_message" android:layout_centerInParent="true"
android:layout_centerHorizontal="true" android:layout_marginBottom="50dp"
android:layout_marginBottom="60dp"
style="@android:style/Widget.ProgressBar.Large" /> style="@android:style/Widget.ProgressBar.Large" />
<LinearLayout
android:layout_below="@id/autoconfig_progress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<Button android:id="@+id/autoconfig_button_cancel" <Button android:id="@+id/autoconfig_button_cancel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/autoconfig_progress"
android:text="@string/cancel_action"/> android:text="@string/cancel_action"/>
<Button android:id="@+id/autoconfig_button_next" <Button android:id="@+id/autoconfig_button_next"
android:drawableRight="@drawable/button_indicator_next" android:drawableRight="@drawable/button_indicator_next"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/autoconfig_progress"
android:layout_toRightOf="@id/autoconfig_button_cancel"
android:text="@string/next_action"/> android:text="@string/next_action"/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>

View File

@ -372,6 +372,7 @@ http://k9mail.googlecode.com/
<string name="account_setup_confirm_incoming_title">Confirm incoming server settings</string> <string name="account_setup_confirm_incoming_title">Confirm incoming server settings</string>
<string name="account_setup_confirm_outgoing_title">Confirm outgoing server settings</string> <string name="account_setup_confirm_outgoing_title">Confirm outgoing server settings</string>
<string name="account_setup_autoconfig_info">Attempting to configure your account...</string> <string name="account_setup_autoconfig_info">Attempting to configure your account...</string>
<string name="account_setup_autoconfig_unsafe_connection">Warning! This information was acquired over an unencrypted connection, be sure to verify the specifics following next!</string>
<string name="account_setup_autoconfig_test_safe_serverside">Looking for safe server-side configuration files...</string> <string name="account_setup_autoconfig_test_safe_serverside">Looking for safe server-side configuration files...</string>
<string name="account_setup_autoconfig_test_unsafe_serverside">Looking for UNSAFE server-side configuration files...</string> <string name="account_setup_autoconfig_test_unsafe_serverside">Looking for UNSAFE server-side configuration files...</string>
<string name="account_setup_autoconfig_test_ispdb">Querying ISP database for configuration settings...</string> <string name="account_setup_autoconfig_test_ispdb">Querying ISP database for configuration settings...</string>
@ -381,7 +382,7 @@ http://k9mail.googlecode.com/
<string name="account_setup_autoconfig_missing">not found!</string> <string name="account_setup_autoconfig_missing">not found!</string>
<string name="account_setup_autoconfig_succesful">successful!</string> <string name="account_setup_autoconfig_succesful">successful!</string>
<string name="account_setup_autoconfig_fail">failed!</string> <string name="account_setup_autoconfig_fail">failed!</string>
<string name="account_setup_autoconfig_forcemanual">No settings found, use manual configuration.</string> <string name="account_setup_autoconfig_forcemanual">No were settings found, use manual configuration to continue.</string>
<string name="account_setup_autoconfig_trynext">Searching other places for configuration settings...</string> <string name="account_setup_autoconfig_trynext">Searching other places for configuration settings...</string>
<string name="account_setup_names_title">You\'re almost done!</string> <string name="account_setup_names_title">You\'re almost done!</string>

View File

@ -92,6 +92,7 @@ public class AccountSetupAutoConfiguration extends K9Activity implements View.On
private boolean bDoneSearching = false; private boolean bDoneSearching = false;
private boolean bFound = false; private boolean bFound = false;
private boolean bParseFailed = false; private boolean bParseFailed = false;
private boolean bUnsafe = false;
/* /*
Start the auto-configuration activity Start the auto-configuration activity
@ -114,7 +115,7 @@ public class AccountSetupAutoConfiguration extends K9Activity implements View.On
setContentView(R.layout.account_setup_autoconfig); setContentView(R.layout.account_setup_autoconfig);
mMessageView = (TextView)findViewById(R.id.status_message); mMessageView = (TextView)findViewById(R.id.status_message);
mWarningMsg = (TextView)findViewById(R.id.autoconfig_warning); mWarningMsg = (TextView)findViewById(R.id.autoconfig_warning);
mWarningMsg.setVisibility(View.GONE); mWarningMsg.setVisibility(View.INVISIBLE);
mProgressCircle = (ProgressBar)findViewById(R.id.autoconfig_progress); mProgressCircle = (ProgressBar)findViewById(R.id.autoconfig_progress);
mProgressCircle.setIndeterminate(true); mProgressCircle.setIndeterminate(true);
mProgressCircle.setVisibility(View.VISIBLE); mProgressCircle.setVisibility(View.VISIBLE);
@ -182,8 +183,7 @@ public class AccountSetupAutoConfiguration extends K9Activity implements View.On
setMessage(R.string.account_setup_autoconfig_succesful,false); setMessage(R.string.account_setup_autoconfig_succesful,false);
// alert user these settings might be tampered with!!! ( no https ) // alert user these settings might be tampered with!!! ( no https )
if( i >= UNSAFE_URL_START ) if( i >= UNSAFE_URL_START ) bUnsafe = true;
mWarningMsg.setVisibility(View.VISIBLE);
bFound = true; bFound = true;
continue; continue;
@ -243,7 +243,7 @@ public class AccountSetupAutoConfiguration extends K9Activity implements View.On
// 2. Nothing came up, must manually config.. + help? // 2. Nothing came up, must manually config.. + help?
// 3. Data did not came over HTTPS this could be UNSAFE !!!!!! // 3. Data did not came over HTTPS this could be UNSAFE !!!!!!
mProgressCircle.setVisibility(View.INVISIBLE); mProgressCircle.setVisibility(View.INVISIBLE);
mWarningMsg.setVisibility(View.VISIBLE); if( bUnsafe /*&& !bForceManual*/ ) mWarningMsg.setVisibility(View.VISIBLE);
mNextButton.setEnabled(true); mNextButton.setEnabled(true);
if( bForceManual ) if( bForceManual )
mNextButton.setText(getString(R.string.account_setup_basics_manual_setup_action)); mNextButton.setText(getString(R.string.account_setup_basics_manual_setup_action));