Browse Source

add privacy section

main
Distopico Vegan 6 years ago
parent
commit
fefe3a109b
7 changed files with 105 additions and 16 deletions
  1. +4
    -3
      app/src/main/java/org/dystopia/email/ActivityView.java
  2. +0
    -4
      app/src/main/java/org/dystopia/email/FragmentAbout.java
  3. +41
    -0
      app/src/main/java/org/dystopia/email/FragmentPrivacy.java
  4. +3
    -1
      app/src/main/java/org/dystopia/email/FragmentSetup.java
  5. +0
    -8
      app/src/main/java/org/dystopia/email/Helper.java
  6. +53
    -0
      app/src/main/res/layout/fragment_privacy.xml
  7. +4
    -0
      app/src/main/res/values/strings.xml

+ 4
- 3
app/src/main/java/org/dystopia/email/ActivityView.java View File

@ -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() {


+ 0
- 4
app/src/main/java/org/dystopia/email/FragmentAbout.java View File

@ -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;
}
}

+ 41
- 0
app/src/main/java/org/dystopia/email/FragmentPrivacy.java View File

@ -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 <http://www.gnu.org/licenses/>.
Copyright 2019 by Distopico <distopico@riseup.net>
*/
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;
}
}

+ 3
- 1
app/src/main/java/org/dystopia/email/FragmentSetup.java View File

@ -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() {


+ 0
- 8
app/src/main/java/org/dystopia/email/Helper.java View File

@ -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/"));


+ 53
- 0
app/src/main/res/layout/fragment_privacy.xml View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp">
<TextView
android:id="@+id/tvPrivacy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_privacy"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvPrivacyText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_privacy_description"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPrivacy" />
<TextView
android:id="@+id/tvPermissions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/title_permissions"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPrivacyText" />
<TextView
android:id="@+id/tvPermissionsList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_permissions_list"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPermissions" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

+ 4
- 0
app/src/main/res/values/strings.xml View File

@ -45,6 +45,10 @@
<string name="menu_rate">Rate this app</string>
<string name="menu_other">Other apps</string>
<string name="title_privacy">Privacy policy</string>
<string name="title_privacy_description"><b>SimpleEmail</b> does not collect any information, does not require unnecessary permissions and is <b>100% Free Software</b>.</string>
<string name="title_permissions"><b>Permissions are needed and why</b></string>
<string name="title_permissions_list"><b>• have full network access</b> (INTERNET): \nto send and receive email <b>\n• view network connections</b> (ACCESS_NETWORK_STATE): \nto monitor internet connectivity changes <b>\n• run at startup</b> (RECEIVE_BOOT_COMPLETED): \nto start monitoring on device start <b>\n• foreground service</b> (FOREGROUND_SERVICE): \nto run a foreground service on Android 9 Pie and later <b>\n• prevent device from sleeping</b> (WAKE_LOCK): \nto keep the device awake while synchronizing messages <b>\n• [Optional] read your contacts</b> (READ_CONTACTS): \nto autocomplete addresses and to show photos <b>\n• [Optional] find accounts on the device</b> (GET_ACCOUNTS): \nto use OAuth instead of passwords</string>
<string name="title_eula">End-user license agreement</string>
<string name="title_agree">I agree</string>
<string name="title_disagree">I disagree</string>


Loading…
Cancel
Save