diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-08-15 19:12:51 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-08-15 19:12:51 +0200 |
commit | ecac1e59434b78faf75c3a461abada5928c0b73c (patch) | |
tree | 56e9d78f1edbae0166ce3085fa544f5564a865d0 /src | |
parent | 1f34fb742ceaa941f48ca858010961f834e3d1b8 (diff) | |
parent | 6aec49f06d3d6be9695a4f4f958f201880d09abc (diff) |
Merge branch 'development'
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java | 10 | ||||
-rw-r--r-- | src/main/res/layout/activity_trust_keys.xml | 32 | ||||
-rw-r--r-- | src/main/res/values/strings.xml | 6 |
3 files changed, 48 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java index cf22416f..0e685c3e 100644 --- a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java @@ -32,6 +32,8 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate private boolean hasNoTrustedKeys = true; private Contact contact; + private TextView keyErrorMessage; + private LinearLayout keyErrorMessageCard; private TextView ownKeysTitle; private LinearLayout ownKeys; private LinearLayout ownKeysCard; @@ -92,6 +94,8 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate } hasNoTrustedKeys = getIntent().getBooleanExtra("has_no_trusted", false); + keyErrorMessageCard = (LinearLayout) findViewById(R.id.key_error_message_card); + keyErrorMessage = (TextView) findViewById(R.id.key_error_message); ownKeysTitle = (TextView) findViewById(R.id.own_keys_title); ownKeys = (LinearLayout) findViewById(R.id.own_keys_details); ownKeysCard = (LinearLayout) findViewById(R.id.own_keys_card); @@ -157,6 +161,12 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate setFetching(); lock(); } else { + if (!hasForeignKeys && !hasOtherTrustedKeys) { + keyErrorMessageCard.setVisibility(View.VISIBLE); + keyErrorMessage.setText(R.string.error_no_keys_to_trust); + ownKeys.removeAllViews(); ownKeysCard.setVisibility(View.GONE); + foreignKeys.removeAllViews(); foreignKeysCard.setVisibility(View.GONE); + } lockOrUnlockAsNeeded(); setDone(); } diff --git a/src/main/res/layout/activity_trust_keys.xml b/src/main/res/layout/activity_trust_keys.xml index c535d51d..6f8a1bc9 100644 --- a/src/main/res/layout/activity_trust_keys.xml +++ b/src/main/res/layout/activity_trust_keys.xml @@ -16,6 +16,38 @@ android:orientation="vertical"> <LinearLayout + android:id="@+id/key_error_message_card" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="@dimen/activity_horizontal_margin" + android:layout_marginRight="@dimen/activity_horizontal_margin" + android:layout_marginTop="@dimen/activity_vertical_margin" + android:layout_marginBottom="@dimen/activity_vertical_margin" + android:background="@drawable/infocard_border" + android:orientation="vertical" + android:padding="@dimen/infocard_padding" + android:visibility="gone"> + + <TextView + android:id="@+id/key_error_message_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/black87" + android:textSize="?attr/TextSizeHeadline" + android:textStyle="bold" + android:text="@string/error_trustkeys_title"/> + + <TextView + android:id="@+id/key_error_message" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/black87" + android:textSize="?attr/TextSizeBody" + android:padding="8dp"/> + + </LinearLayout> + + <LinearLayout android:id="@+id/own_keys_card" android:layout_width="fill_parent" android:layout_height="wrap_content" diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 0e396491..2a03847d 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -306,6 +306,10 @@ \n\nhttps://github.com/zxing/zxing\n(Apache License, Version 2.0) \n\nhttps://github.com/google/material-design-icons\n(CC BY 4.0) \n\nhttps://github.com/timroes/EnhancedListView\n(Apache License, Version 2.0) + \n\nhttps://github.com/leolin310148/ShortcutBadger\n(Apache License, Version 2.0) + \n\nhttps://github.com/kyleduo/SwitchButton\n(Apache License, Version 2.0) + \n\nhttps://github.com/WhisperSystems/libaxolotl-java\n(GPLv3) + \n\nhttps://github.com/vinc3m1/RoundedImageView\n(Apache License, Version 2.0) </string> <string name="title_pref_quiet_hours">Quiet Hours</string> <string name="title_pref_quiet_hours_start_time">Start time</string> @@ -397,6 +401,8 @@ <string name="purge_key">Purge key</string> <string name="purge_key_desc_part1">Are you sure you want to purge this key?</string> <string name="purge_key_desc_part2">It will irreversibly be considered compromised, and you can never build a session with it again.</string> + <string name="error_no_keys_to_trust">There are no usable keys available for this contact. If you have purged any of their keys, they need to generate new ones.</string> + <string name="error_trustkeys_title">Error</string> <string name="fetching_history_from_server">Fetching history from server</string> <string name="no_more_history_on_server">No more history on server</string> <string name="updating">Updating…</string> |