From 25f822e35f6f1f34a430f836d0883c19998b9452 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Fri, 7 Sep 2018 03:01:06 +0200 Subject: change theme color, terms of services, custom donation string for riseup.vpn --- app/src/custom/res/values/custom-theme.xml | 6 +++--- app/src/custom/res/values/strings.xml | 3 ++- .../leap/bitmaskclient/fragments/AboutFragment.java | 19 +++++++++++++++++++ app/src/main/res/layout-xlarge/f_about.xml | 9 +++++++++ app/src/main/res/layout/f_about.xml | 9 +++++++++ 5 files changed, 42 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/src/custom/res/values/custom-theme.xml b/app/src/custom/res/values/custom-theme.xml index 4421adb9..1c8f1ab2 100644 --- a/app/src/custom/res/values/custom-theme.xml +++ b/app/src/custom/res/values/custom-theme.xml @@ -2,11 +2,11 @@ - #b39ddb + #5e9ee3 - #ac97d2 + #5c7ce1 #ffffff - #000000 + #cccccc diff --git a/app/src/custom/res/values/strings.xml b/app/src/custom/res/values/strings.xml index b923b42b..25e617b1 100644 --- a/app/src/custom/res/values/strings.xml +++ b/app/src/custom/res/values/strings.xml @@ -1,4 +1,5 @@ - Please donate today if you value secure communication that is easy for both the end-user and the service provider. + RiseupVPN is an easy, fast and secure VPN service from riseup.net. RiseupVPN does not require an user account, keep logs or track you in any way. This service paid for entirely by donations from users like you. Please donate at https://riseup.net/vpn/donate. + By using this application you agree to the Terms of Service available at https://riseup.net/tos. This service is provide as-is, without any warranty and is intended for people who work to make the world a better place. diff --git a/app/src/main/java/se/leap/bitmaskclient/fragments/AboutFragment.java b/app/src/main/java/se/leap/bitmaskclient/fragments/AboutFragment.java index 2f37f5b0..25249371 100644 --- a/app/src/main/java/se/leap/bitmaskclient/fragments/AboutFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/fragments/AboutFragment.java @@ -11,8 +11,11 @@ import android.widget.TextView; import butterknife.ButterKnife; import butterknife.InjectView; +import se.leap.bitmaskclient.BuildConfig; import se.leap.bitmaskclient.R; +import static android.view.View.VISIBLE; + public class AboutFragment extends Fragment { final public static String TAG = "aboutFragment"; @@ -21,6 +24,9 @@ public class AboutFragment extends Fragment { @InjectView(R.id.version) TextView versionTextView; + @InjectView(R.id.terms_of_service) + TextView termsOfService; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.f_about, container, false); @@ -43,6 +49,19 @@ public class AboutFragment extends Fragment { } versionTextView.setText(getString(R.string.version_info, name, version)); + + if (BuildConfig.FLAVOR_branding.equals("custom") && hasTermsOfServiceResource()) { + termsOfService.setText(getString(getTermsOfServiceResource())); + termsOfService.setVisibility(VISIBLE); + } + } + + private boolean hasTermsOfServiceResource() { + return getTermsOfServiceResource() != 0; + } + + private int getTermsOfServiceResource() { + return this.getContext().getResources().getIdentifier("terms_of_service", "string", this.getContext().getPackageName()); } } diff --git a/app/src/main/res/layout-xlarge/f_about.xml b/app/src/main/res/layout-xlarge/f_about.xml index c7896917..4165215c 100644 --- a/app/src/main/res/layout-xlarge/f_about.xml +++ b/app/src/main/res/layout-xlarge/f_about.xml @@ -22,6 +22,15 @@ android:layout_width="match_parent" android:layout_height="12sp" /> + + + +