mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-23 08:09:54 +01:00
Improve error handling when creating backups, minor UI changes
This commit is contained in:
@@ -296,11 +296,13 @@ class ConversationVisitor implements
|
|||||||
@Override
|
@Override
|
||||||
public ConversationItem visitShardMessage(ShardMessageHeader r) {
|
public ConversationItem visitShardMessage(ShardMessageHeader r) {
|
||||||
if (r.isLocal()) {
|
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(
|
return new ConversationNoticeItem(
|
||||||
R.layout.list_item_conversation_notice_out, text, r);
|
R.layout.list_item_conversation_notice_out, text, r);
|
||||||
} else {
|
} 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(
|
return new ConversationNoticeItem(
|
||||||
R.layout.list_item_conversation_notice_in, text, r);
|
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);
|
showNextFragment(fragment);
|
||||||
});
|
});
|
||||||
} catch (DbException e) {
|
} 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);
|
container, false);
|
||||||
Bundle args = requireArguments();
|
Bundle args = requireArguments();
|
||||||
ArrayList<String> custodianNames = args.getStringArrayList(CUSTODIANS);
|
ArrayList<String> custodianNames = args.getStringArrayList(CUSTODIANS);
|
||||||
String custodianNamesString = "";
|
|
||||||
for (String custodianName : custodianNames) {
|
StringBuilder custodianNamesString = new StringBuilder();
|
||||||
custodianNamesString += custodianName + ", ";
|
for (String custodianName : custodianNames) {
|
||||||
}
|
custodianNamesString
|
||||||
|
.append("• ")
|
||||||
|
.append(custodianName)
|
||||||
|
.append("\n");
|
||||||
|
}
|
||||||
|
|
||||||
TextView textViewThreshold = view.findViewById(R.id.textViewThreshold);
|
TextView textViewThreshold = view.findViewById(R.id.textViewThreshold);
|
||||||
textViewThreshold.setText(String.format("%d of %d contacts needed to restore account", args.getInt(THRESHOLD), custodianNames.size()));
|
textViewThreshold.setText(String.format("%d of %d contacts needed to restore account", args.getInt(THRESHOLD), custodianNames.size()));
|
||||||
TextView textViewCustodians = view.findViewById(R.id.textViewCustodians);
|
TextView textViewCustodians = view.findViewById(R.id.textViewCustodians);
|
||||||
|
|||||||
@@ -67,4 +67,8 @@ public class ShardsSentFragment extends BaseFragment {
|
|||||||
component.inject(this);
|
component.inject(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onBackPressed() {
|
||||||
|
listener.shardsSentDismissed();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -723,8 +723,8 @@
|
|||||||
<string name="activity_name_restore_account">Restore Account</string>
|
<string name="activity_name_restore_account">Restore Account</string>
|
||||||
|
|
||||||
<!-- conversation -->
|
<!-- conversation -->
|
||||||
<string name="social_backup_shard_received">You have received 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.</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_new_or_recover_account">Create new account or recover existing account</string>
|
||||||
<string name="activity_name_recovery">Recover Account</string>
|
<string name="activity_name_recovery">Recover Account</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user