X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Ffragments%2FAboutTabFragment.java;h=486f593ceee79706cf0e160d8eed7c8c2a2cdbad;hb=01d647c09b892384e0b42e86b000b5cb858f7a2b;hp=8496d00fdf1b94f995878a65ea35d1b1f7fc1ec5;hpb=ffdec8106ad23f62ca529749ade99f51e336ce55;p=PrivacyBrowserAndroid.git diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutTabFragment.java b/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutTabFragment.java index 8496d00f..486f593c 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutTabFragment.java +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutTabFragment.java @@ -126,6 +126,7 @@ public class AboutTabFragment extends Fragment { TextView webViewProviderTextView = tabLayout.findViewById(R.id.webview_provider); TextView webViewVersionTextView = tabLayout.findViewById(R.id.webview_version); TextView orbotTextView = tabLayout.findViewById(R.id.orbot); + TextView i2pTextView = tabLayout.findViewById(R.id.i2p); TextView openKeychainTextView = tabLayout.findViewById(R.id.open_keychain); TextView easyListTextView = tabLayout.findViewById(R.id.easylist); TextView easyPrivacyTextView = tabLayout.findViewById(R.id.easyprivacy); @@ -192,6 +193,15 @@ public class AboutTabFragment extends Fragment { orbot = ""; } + // Get the I2P version name if I2P is installed. + String i2p; + try { + // Store the version name. + i2p = context.getPackageManager().getPackageInfo("net.i2p.android.router", 0).versionName; + } catch (PackageManager.NameNotFoundException exception) { // I2P is not installed. + i2p = ""; + } + // Get the OpenKeychain version name if it is installed. String openKeychain; try { @@ -319,6 +329,16 @@ public class AboutTabFragment extends Fragment { orbotTextView.setVisibility(View.GONE); } + // Only populate the I2P text view if it is installed. + if (!i2p.isEmpty()) { + String i2pLabel = getString(R.string.i2p) + " "; + SpannableStringBuilder i2pStringBuilder = new SpannableStringBuilder(i2pLabel + i2p); + i2pStringBuilder.setSpan(blueColorSpan, i2pLabel.length(), i2pStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); + i2pTextView.setText(i2pStringBuilder); + } else { // I2P is not installed. + i2pTextView.setVisibility(View.GONE); + } + // Only populate the OpenKeychain text view if it is installed. if (!openKeychain.isEmpty()) { String openKeychainLabel = getString(R.string.openkeychain) + " ";