summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2018-09-07 03:01:06 +0200
committercyBerta <cyberta@riseup.net>2018-09-07 03:01:06 +0200
commit25f822e35f6f1f34a430f836d0883c19998b9452 (patch)
tree6c5f02abe5f8e6e7cb89af2d119799968224ec3a /app/src/main
parent727bbdbd04ba2aabe516cfa1f902c1e7cdc62563 (diff)
change theme color, terms of services, custom donation string for riseup.vpn
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/fragments/AboutFragment.java19
-rw-r--r--app/src/main/res/layout-xlarge/f_about.xml9
-rw-r--r--app/src/main/res/layout/f_about.xml9
3 files changed, 37 insertions, 0 deletions
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
@@ -23,6 +23,15 @@
android:layout_height="12sp" />
<TextView
+ android:id="@+id/terms_of_service"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:autoLink="all"
+ android:visibility="gone"
+ android:paddingBottom="12dp"
+ />
+
+ <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
diff --git a/app/src/main/res/layout/f_about.xml b/app/src/main/res/layout/f_about.xml
index aba51141..b4a8d9b6 100644
--- a/app/src/main/res/layout/f_about.xml
+++ b/app/src/main/res/layout/f_about.xml
@@ -23,6 +23,15 @@
android:layout_height="10sp" />
<TextView
+ android:id="@+id/terms_of_service"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:autoLink="all"
+ android:visibility="gone"
+ android:paddingBottom="12dp"
+ />
+
+ <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="all"