From 84ed5d88e7d04379af5975f3a8af76ef4010d8c7 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Fri, 4 Aug 2023 01:15:33 +0200 Subject: hard code calyx and riseup provider names ... --- .../providersetup/fragments/ProviderSelectionFragment.java | 3 +-- .../fragments/viewmodel/ProviderSelectionViewModel.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/ProviderSelectionFragment.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/ProviderSelectionFragment.java index 7f80a99d..bf508e0b 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/ProviderSelectionFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/ProviderSelectionFragment.java @@ -58,9 +58,8 @@ public class ProviderSelectionFragment extends BaseSetupFragment implements Canc radioButtons = new ArrayList<>(); for (int i = 0; i < viewModel.size(); i++) { - Provider provider = viewModel.getProvider(i); RadioButton radioButton = new RadioButton(binding.getRoot().getContext()); - radioButton.setText(provider.getDomain()); + radioButton.setText(viewModel.getProviderName(i)); radioButton.setId(i); binding.providerRadioGroup.addView(radioButton); radioButtons.add(radioButton); diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/viewmodel/ProviderSelectionViewModel.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/viewmodel/ProviderSelectionViewModel.java index e3880181..d1954ffb 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/viewmodel/ProviderSelectionViewModel.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/viewmodel/ProviderSelectionViewModel.java @@ -78,4 +78,16 @@ public class ProviderSelectionViewModel extends ViewModel { public void setCustomUrl(String url) { customUrl = url; } + + + public String getProviderName(int pos) { + String domain = getProvider(pos).getDomain(); + if ("riseup.net".equals(domain)) { + return "Riseup"; + } + if ("calyx.net".equals(domain)) { + return "The Calyx Institute"; + } + return domain; + } } \ No newline at end of file -- cgit v1.2.3