About menu: Added url method.

This commit is contained in:
FlyingP1g FlyingP1g
2022-07-15 20:25:43 +03:00
parent f3a3fa0ea8
commit 89cce89650

View File

@@ -63,31 +63,20 @@ public class AboutFragment extends Fragment {
briarChangelog = requireActivity().findViewById(R.id.BriarChangelog);
briarWebsite.setOnClickListener(View -> {
String url = "https://briarproject.org/";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
try {
startActivity(i);
} catch (ActivityNotFoundException e) {
logException(LOG, WARNING, e);
Toast.makeText(requireContext(),
R.string.error_start_activity, LENGTH_LONG).show();
}
goToUrl(url);
});
briarSourceCode.setOnClickListener(View -> {
String url = "https://code.briarproject.org/briar/briar";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
try {
startActivity(i);
} catch (ActivityNotFoundException e) {
logException(LOG, WARNING, e);
Toast.makeText(requireContext(),
R.string.error_start_activity, LENGTH_LONG).show();
}
goToUrl(url);
});
briarChangelog.setOnClickListener(View -> {
String url =
"https://code.briarproject.org/briar/briar/-/wikis/changelog";
goToUrl(url);
});
}
private void goToUrl(String url) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
try {
@@ -97,7 +86,7 @@ public class AboutFragment extends Fragment {
Toast.makeText(requireContext(),
R.string.error_start_activity, LENGTH_LONG).show();
}
});
}
}