From fefe3a109b68bf575c2191100da01ce36b28783e Mon Sep 17 00:00:00 2001 From: Distopico Vegan Date: Tue, 30 Oct 2018 19:05:13 -0500 Subject: [PATCH] add privacy section --- .../java/org/dystopia/email/ActivityView.java | 7 +-- .../org/dystopia/email/FragmentAbout.java | 4 -- .../org/dystopia/email/FragmentPrivacy.java | 41 ++++++++++++++ .../org/dystopia/email/FragmentSetup.java | 4 +- .../main/java/org/dystopia/email/Helper.java | 8 --- app/src/main/res/layout/fragment_privacy.xml | 53 +++++++++++++++++++ app/src/main/res/values/strings.xml | 4 ++ 7 files changed, 105 insertions(+), 16 deletions(-) create mode 100644 app/src/main/java/org/dystopia/email/FragmentPrivacy.java create mode 100644 app/src/main/res/layout/fragment_privacy.xml diff --git a/app/src/main/java/org/dystopia/email/ActivityView.java b/app/src/main/java/org/dystopia/email/ActivityView.java index db18e119..538e7022 100644 --- a/app/src/main/java/org/dystopia/email/ActivityView.java +++ b/app/src/main/java/org/dystopia/email/ActivityView.java @@ -225,8 +225,7 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack if (getIntentFAQ().resolveActivity(getPackageManager()) != null) drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_question_answer_24, R.string.menu_faq)); - if (Helper.getIntentPrivacy().resolveActivity(getPackageManager()) != null) - drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_account_box_24, R.string.menu_privacy)); + drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_account_box_24, R.string.menu_privacy)); drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_info_24, R.string.menu_about)); @@ -675,7 +674,9 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack } private void onMenuPrivacy() { - Helper.view(this, Helper.getIntentPrivacy()); + FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); + fragmentTransaction.replace(R.id.content_frame, new FragmentPrivacy()).addToBackStack("privacy"); + fragmentTransaction.commit(); } private void onMenuAbout() { diff --git a/app/src/main/java/org/dystopia/email/FragmentAbout.java b/app/src/main/java/org/dystopia/email/FragmentAbout.java index af07282a..5742116f 100644 --- a/app/src/main/java/org/dystopia/email/FragmentAbout.java +++ b/app/src/main/java/org/dystopia/email/FragmentAbout.java @@ -276,10 +276,6 @@ public class FragmentAbout extends FragmentEx { } }); - //boolean debug = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("debug", false); - //btnLog.setVisibility(debug || BuildConfig.DEBUG ? View.VISIBLE : View.GONE); - //btnDebugInfo.setVisibility(debug || BuildConfig.DEBUG ? View.VISIBLE : View.GONE); - return view; } } diff --git a/app/src/main/java/org/dystopia/email/FragmentPrivacy.java b/app/src/main/java/org/dystopia/email/FragmentPrivacy.java new file mode 100644 index 00000000..90449352 --- /dev/null +++ b/app/src/main/java/org/dystopia/email/FragmentPrivacy.java @@ -0,0 +1,41 @@ +package org.dystopia.email; + +/* + This file is part of SimpleEmail. + + SimpleEmail is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + SimpleEmail is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with SimpleEmail. If not, see . + + Copyright 2019 by Distopico +*/ + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +public class FragmentPrivacy extends FragmentEx { + @Override + @Nullable + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) + { + setSubtitle(R.string.menu_privacy); + + View view = inflater.inflate(R.layout.fragment_privacy, container, false); + + return view; + } +} diff --git a/app/src/main/java/org/dystopia/email/FragmentSetup.java b/app/src/main/java/org/dystopia/email/FragmentSetup.java index 0b6a263e..2c81421d 100644 --- a/app/src/main/java/org/dystopia/email/FragmentSetup.java +++ b/app/src/main/java/org/dystopia/email/FragmentSetup.java @@ -426,7 +426,9 @@ public class FragmentSetup extends FragmentEx { } private void onMenuPrivacy() { - Helper.view(getContext(), Helper.getIntentPrivacy()); + FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); + fragmentTransaction.replace(R.id.content_frame, new FragmentPrivacy()).addToBackStack("privacy"); + fragmentTransaction.commit(); } private void onMenuLegend() { diff --git a/app/src/main/java/org/dystopia/email/Helper.java b/app/src/main/java/org/dystopia/email/Helper.java index 27b3d2ed..5a5c006e 100644 --- a/app/src/main/java/org/dystopia/email/Helper.java +++ b/app/src/main/java/org/dystopia/email/Helper.java @@ -27,7 +27,6 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.res.TypedArray; import android.net.Uri; -import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.text.TextUtils; import android.util.Log; @@ -39,7 +38,6 @@ import android.widget.EditText; import android.widget.ImageView; import android.widget.Spinner; -import com.android.billingclient.api.BillingClient; import com.google.android.material.bottomnavigation.BottomNavigationView; import com.sun.mail.imap.IMAPStore; @@ -103,12 +101,6 @@ public class Helper { customTabsIntent.launchUrl(context, uri); } - static Intent getIntentPrivacy() { - Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(Uri.parse("https://email.faircode.eu/privacy/")); - return intent; - } - static Intent getIntentOpenKeychain() { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("https://f-droid.org/en/packages/org.sufficientlysecure.keychain/")); diff --git a/app/src/main/res/layout/fragment_privacy.xml b/app/src/main/res/layout/fragment_privacy.xml new file mode 100644 index 00000000..ca884ba7 --- /dev/null +++ b/app/src/main/res/layout/fragment_privacy.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0ae60351..2aaef7d9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -45,6 +45,10 @@ Rate this app Other apps + Privacy policy + SimpleEmail does not collect any information, does not require unnecessary permissions and is 100% Free Software. + Permissions are needed and why + • have full network access (INTERNET): \nto send and receive email \n• view network connections (ACCESS_NETWORK_STATE): \nto monitor internet connectivity changes \n• run at startup (RECEIVE_BOOT_COMPLETED): \nto start monitoring on device start \n• foreground service (FOREGROUND_SERVICE): \nto run a foreground service on Android 9 Pie and later \n• prevent device from sleeping (WAKE_LOCK): \nto keep the device awake while synchronizing messages \n• [Optional] read your contacts (READ_CONTACTS): \nto autocomplete addresses and to show photos \n• [Optional] find accounts on the device (GET_ACCOUNTS): \nto use OAuth instead of passwords End-user license agreement I agree I disagree