mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Improve error handling when creating backups, minor UI changes
This commit is contained in:
@@ -296,11 +296,13 @@ class ConversationVisitor implements
|
||||
@Override
|
||||
public ConversationItem visitShardMessage(ShardMessageHeader r) {
|
||||
if (r.isLocal()) {
|
||||
String text = ctx.getString(R.string.social_backup_shard_sent);
|
||||
String text = ctx.getString(R.string.social_backup_shard_sent,
|
||||
contactName.getValue());
|
||||
return new ConversationNoticeItem(
|
||||
R.layout.list_item_conversation_notice_out, text, r);
|
||||
} else {
|
||||
String text = ctx.getString(R.string.social_backup_shard_received);
|
||||
String text = ctx.getString(R.string.social_backup_shard_received,
|
||||
contactName.getValue());
|
||||
return new ConversationNoticeItem(
|
||||
R.layout.list_item_conversation_notice_in, text, r);
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package org.briarproject.briar.android.socialbackup;
|
||||
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
public interface CustodianScanQrButtonListener {
|
||||
@UiThread
|
||||
void scanQrButtonClicked();
|
||||
}
|
||||
@@ -80,7 +80,10 @@ public class DistributedBackupActivity extends BriarActivity implements
|
||||
showNextFragment(fragment);
|
||||
});
|
||||
} catch (DbException e) {
|
||||
e.printStackTrace();
|
||||
Toast.makeText(this,
|
||||
"There was an error when creating the backup",
|
||||
Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,10 +54,15 @@ public class ExistingBackupFragment extends BaseFragment {
|
||||
container, false);
|
||||
Bundle args = requireArguments();
|
||||
ArrayList<String> custodianNames = args.getStringArrayList(CUSTODIANS);
|
||||
String custodianNamesString = "";
|
||||
for (String custodianName : custodianNames) {
|
||||
custodianNamesString += custodianName + ", ";
|
||||
}
|
||||
|
||||
StringBuilder custodianNamesString = new StringBuilder();
|
||||
for (String custodianName : custodianNames) {
|
||||
custodianNamesString
|
||||
.append("• ")
|
||||
.append(custodianName)
|
||||
.append("\n");
|
||||
}
|
||||
|
||||
TextView textViewThreshold = view.findViewById(R.id.textViewThreshold);
|
||||
textViewThreshold.setText(String.format("%d of %d contacts needed to restore account", args.getInt(THRESHOLD), custodianNames.size()));
|
||||
TextView textViewCustodians = view.findViewById(R.id.textViewCustodians);
|
||||
|
||||
@@ -67,4 +67,8 @@ public class ShardsSentFragment extends BaseFragment {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
public void onBackPressed() {
|
||||
listener.shardsSentDismissed();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -723,8 +723,8 @@
|
||||
<string name="activity_name_restore_account">Restore Account</string>
|
||||
|
||||
<!-- conversation -->
|
||||
<string name="social_backup_shard_received">You have received a social backup shard.</string>
|
||||
<string name="social_backup_shard_sent">You have sent a social backup shard.</string>
|
||||
<string name="social_backup_shard_received">%1$s has sent you a social backup shard.</string>
|
||||
<string name="social_backup_shard_sent">You have sent a social backup shard to %1$s.</string>
|
||||
|
||||
<string name="activity_name_new_or_recover_account">Create new account or recover existing account</string>
|
||||
<string name="activity_name_recovery">Recover Account</string>
|
||||
|
||||
Reference in New Issue
Block a user