Replace illustration for add contact nearby error

This commit is contained in:
Torsten Grote
2022-10-25 15:42:34 -03:00
parent c76ed41958
commit 645eba7fe7
9 changed files with 419 additions and 81 deletions

View File

@@ -22,7 +22,7 @@ import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.ViewModelProvider;
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
import static android.view.View.GONE;
import static org.briarproject.briar.android.util.UiUtils.hideViewOnSmallScreen;
import static org.briarproject.briar.android.util.UiUtils.onSingleLinkClick;
@MethodsNotNullByDefault
@@ -70,8 +70,11 @@ public class AddNearbyContactErrorFragment extends BaseFragment {
TextView explanation = v.findViewById(R.id.errorMessage);
Bundle args = getArguments();
String errorMessage = args == null ? null : args.getString(ERROR_MSG);
if (errorMessage == null) explanation.setVisibility(GONE);
else explanation.setText(args.getString(ERROR_MSG));
if (errorMessage == null) {
explanation.setText(getString(R.string.add_contact_error_two_way));
} else {
explanation.setText(args.getString(ERROR_MSG));
}
// make feedback link clickable
TextView sendFeedback = v.findViewById(R.id.sendFeedback);
@@ -100,6 +103,12 @@ public class AddNearbyContactErrorFragment extends BaseFragment {
viewModel.stopListening();
}
@Override
public void onStart() {
super.onStart();
hideViewOnSmallScreen(requireView().findViewById(R.id.errorIcon));
}
private void triggerFeedback() {
UiUtils.triggerFeedback(requireContext());
finish();