aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-05-24 21:22:37 +0200
committerChristian Schneppe <christian@pix-art.de>2018-05-24 21:22:37 +0200
commita29a087f124061ae8200edc51fdfcd3ff0d9a7c8 (patch)
treeebc545d0f18810473d32031136d8152964660b56
parent95db2118b2ef8e8ff41bc184bdead1265e91dd2c (diff)
add links to *Terms Of Use* and *Privacy Policy* to AboutActivity
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/ui/AboutActivity.java19
-rw-r--r--src/main/res/layout/activity_about.xml62
-rw-r--r--src/main/res/values/defaults.xml8
-rw-r--r--src/main/res/values/strings.xml2
4 files changed, 85 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/AboutActivity.java b/src/main/java/de/pixart/messenger/ui/AboutActivity.java
index 093ea3bb7..88f863476 100644
--- a/src/main/java/de/pixart/messenger/ui/AboutActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/AboutActivity.java
@@ -1,12 +1,18 @@
package de.pixart.messenger.ui;
+import android.content.Intent;
+import android.net.Uri;
import android.os.Bundle;
+import android.widget.Button;
import de.pixart.messenger.R;
import de.pixart.messenger.utils.ThemeHelper;
public class AboutActivity extends XmppActivity {
+ private Button privacyButton;
+ private Button termsOfUseButton;
+
@Override
protected void refreshUiReal() {
@@ -24,5 +30,18 @@ public class AboutActivity extends XmppActivity {
setContentView(R.layout.activity_about);
setSupportActionBar(findViewById(R.id.toolbar));
configureActionBar(getSupportActionBar());
+
+ privacyButton = findViewById(R.id.show_privacy_policy);
+ privacyButton.setOnClickListener(view -> {
+ final Uri uri = Uri.parse("https://jabber.pix-art.de/privacy/");
+ Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri);
+ startActivity(browserIntent);
+ });
+ termsOfUseButton = findViewById(R.id.show_terms_of_use);
+ termsOfUseButton.setOnClickListener(view -> {
+ final Uri uri = Uri.parse("https://jabber.pix-art.de/termsofuse/");
+ Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri);
+ startActivity(browserIntent);
+ });
}
} \ No newline at end of file
diff --git a/src/main/res/layout/activity_about.xml b/src/main/res/layout/activity_about.xml
index 8192f1d29..e05b74549 100644
--- a/src/main/res/layout/activity_about.xml
+++ b/src/main/res/layout/activity_about.xml
@@ -45,10 +45,66 @@
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
+ android:background="?attr/color_background_primary"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/aboutmessage"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/activity_horizontal_margin"
+ android:layout_marginRight="@dimen/activity_horizontal_margin"
+ android:layout_marginTop="@dimen/activity_vertical_margin"
+ android:autoLink="web"
+ android:fontFamily="monospace"
+ android:linksClickable="true"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:text="@string/pref_about_message"
+ android:textAppearance="@style/TextAppearance.Conversations.Body1"
+ android:textSize="?attr/TextSizeBody"
+ android:typeface="monospace" />
+
+ <Button
+ android:id="@+id/show_privacy_policy"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="4dp"
+ android:layout_marginTop="4dp"
+ android:text="@string/show_privacy" />
+
+ <Button
+ android:id="@+id/show_terms_of_use"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="4dp"
+ android:layout_marginTop="4dp"
+ android:text="@string/show_termsofuse" />
+ </LinearLayout>
+
+ </android.support.v7.widget.CardView>
+
+ <android.support.v7.widget.CardView
+ android:id="@+id/libLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/aboutLayout"
+ android:layout_marginBottom="@dimen/activity_vertical_margin"
+ android:layout_marginLeft="@dimen/activity_horizontal_margin"
+ android:layout_marginRight="@dimen/activity_horizontal_margin"
+ android:layout_marginTop="@dimen/activity_vertical_margin"
android:background="?attr/color_background_primary">
<TextView
- android:id="@+id/aboutmessage"
+ android:id="@+id/libraries"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
@@ -58,9 +114,9 @@
android:fontFamily="monospace"
android:linksClickable="true"
android:paddingBottom="@dimen/activity_vertical_margin"
- android:text="@string/pref_about_message"
- android:textSize="?attr/TextSizeBody"
+ android:text="@string/pref_about_libraries"
android:textAppearance="@style/TextAppearance.Conversations.Body1"
+ android:textSize="?attr/TextSizeBody"
android:typeface="monospace" />
</android.support.v7.widget.CardView>
diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml
index d4d28e169..59754dee2 100644
--- a/src/main/res/values/defaults.xml
+++ b/src/main/res/values/defaults.xml
@@ -21,7 +21,8 @@
along with this program. If not, see https://www.gnu.org/licenses
\n\nDownload the full original source code at https://github.com/siacs/Conversations (Copyright © 2014-2018 Daniel Gultsch)
\n\nDownload the modified source code at https://github.com/kriztan/Pix-Art-Messenger
- \n\n\nLibraries
+ </string>
+ <string name="pref_about_libraries" translatable="false"><b>Libraries</b>
\n\nhttps://www.bouncycastle.org\n(The MIT License (MIT))
\n\nhttps://www.gnu.org/software/libidn\n(Apache License, Version 2.0)
\n\nhttps://github.com/ge0rg/MemorizingTrustManager\n(The MIT License (MIT))
@@ -50,7 +51,8 @@
\n\nhttps://www.openstreetmap.org/\n(Open Database License)
\n\nhttp://xmpp.rocks/\n(The MIT License (MIT))
\n\nhttps://github.com/championswimmer/SimpleFingerGestures_Android_Library/\n(Apache License, Version 2.0)
- </string>
+ </string>
+
<string name="default_resource" translatable="false">Phone</string>
<bool name="portrait_only">true</bool>
<bool name="enter_is_send">false</bool>
@@ -222,7 +224,7 @@
<item>xmpp.slack.com</item>
<item>chat.hipchat.com</item>
<item>googlemail.com</item>
- <item>nsa.li</item>
+ <item>nsa.li</item>
</string-array>
</resources>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 9b4f16d07..9a127addd 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -790,4 +790,6 @@
<string name="copy_link">Copy web address</string>
<string name="server_hint">Choose provider</string>
<string name="choose_your_server">Choose your jabber provider</string>
+ <string name="show_privacy">Privacy Policy</string>
+ <string name="show_termsofuse">Terms of Use</string>
</resources>