Nicer ZRTP validate/reset action messages.

This commit is contained in:
Guillaume Beraudo 2011-11-17 13:23:34 +01:00
parent 7f9558567c
commit 0f3926e6a7
3 changed files with 9 additions and 7 deletions

View file

@ -10,11 +10,11 @@
<LinearLayout android:id="@+id/encrypted" android:visibility="gone"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageButton android:id="@+id/set_auth_token_verified" android:src="@drawable/conf_maybe_secured" android:visibility="gone"
<ImageButton android:id="@+id/set_auth_token_verified" android:src="@drawable/conf_secured" android:visibility="gone"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageButton android:id="@+id/set_auth_token_not_verified" android:src="@drawable/conf_secured" android:visibility="gone"
<ImageButton android:id="@+id/set_auth_token_not_verified" android:src="@drawable/conf_maybe_secured" android:visibility="gone"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:id="@+id/authentication_token" android:layout_gravity="center_vertical"
<TextView android:id="@+id/authentication_token" android:layout_gravity="center_vertical"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>

View file

@ -3,7 +3,9 @@
<string name="not_ready_to_make_new_call">Not ready for a new call</string>
<string name="bad_target_uri">Bad contact : %s</string>
<string name="authenticationTokenFormat">Encrypted %s</string>
<string name="reset_sas_fmt">Reset validated %s</string>
<string name="validate_sas_fmt">Validate %s</string>
<string name="communication_encrypted">Encrypted</string>
<string name="not_encrypted">Not encrypted</string>
<string name="waiting_for_startup">Starting up...</string>

View file

@ -696,16 +696,16 @@ public class IncallActivity extends ListActivity implements
setVisibility(content, R.id.unencrypted, showUnencrypted);
} else {
TextView token = (TextView) content.findViewById(R.id.authentication_token);
String fmt = getString(R.string.authenticationTokenFormat);
if ("zrtp".equals(mediaEncryption)) {
token.setText(String.format(fmt, call.getAuthenticationToken()));
boolean authVerified = call.isAuthenticationTokenVerified();
String fmt = getString(authVerified ? R.string.reset_sas_fmt : R.string.validate_sas_fmt);
token.setText(String.format(fmt, call.getAuthenticationToken()));
enableView(content, R.id.set_auth_token_not_verified, l, authVerified);
enableView(content, R.id.set_auth_token_verified, l, !authVerified);
enableView(content, R.id.encrypted, l, true);
} else {
setVisibility(content, R.id.encrypted, true);
token.setText(String.format(fmt, ""));
token.setText(R.string.communication_encrypted);
}
}