Browse Source

fix: change app Invite to share because require google account

main
Distopico Vegan 6 years ago
parent
commit
8299d54fdf
6 changed files with 34 additions and 20 deletions
  1. +15
    -18
      app/src/main/java/org/dystopia/email/ActivityView.java
  2. +0
    -0
      app/src/main/res/drawable/baseline_people_24.xml
  3. +11
    -0
      app/src/main/res/drawable/baseline_share_24.xml
  4. +3
    -1
      app/src/main/res/values-en/strings.xml
  5. +2
    -0
      app/src/main/res/values-es-rES/strings.xml
  6. +3
    -1
      app/src/main/res/values/strings.xml

+ 15
- 18
app/src/main/java/org/dystopia/email/ActivityView.java View File

@ -106,7 +106,6 @@ public class ActivityView extends ActivityBase
static final int REQUEST_ERROR = 3;
static final int REQUEST_ATTACHMENT = 1;
static final int REQUEST_INVITE = 2;
static final int REQUEST_DECRYPT = 3;
static final String ACTION_VIEW_MESSAGES = BuildConfig.APPLICATION_ID + ".VIEW_MESSAGES";
@ -286,14 +285,12 @@ public class ActivityView extends ActivityBase
drawerArray.add(new DrawerItem(R.layout.item_drawer_separator));
if (getIntentInvite().resolveActivity(getPackageManager()) != null) {
drawerArray.add(
new DrawerItem(
ActivityView.this,
R.layout.item_drawer,
R.drawable.baseline_people_24,
R.string.menu_invite));
}
drawerArray.add(
new DrawerItem(
ActivityView.this,
R.layout.item_drawer,
R.drawable.baseline_share_24,
R.string.menu_invite));
drawerList.setAdapter(drawerArray);
}
@ -716,18 +713,18 @@ public class ActivityView extends ActivityBase
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(
Uri.parse(
"https://framagit.org/dystopia-project/simple-email/blob/8f7296ddc2275471d4190df1dd55dee4025a5114/docs/FAQ.md"));
"https://framagit.org/dystopia-project/simple-email/blob/HEAD/docs/FAQ.md"));
return intent;
}
private Intent getIntentInvite() {
Intent intent = new Intent("com.google.android.gms.appinvite.ACTION_APP_INVITE");
intent.setPackage("com.google.android.gms");
intent.putExtra("com.google.android.gms.appinvite.TITLE", getString(R.string.menu_invite));
intent.putExtra("com.google.android.gms.appinvite.MESSAGE", getString(R.string.title_try));
intent.putExtra("com.google.android.gms.appinvite.BUTTON_TEXT", getString(R.string.title_try));
// com.google.android.gms.appinvite.DEEP_LINK_URL
return intent;
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.title_try_subject));
shareIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.title_try));
shareIntent.setType("text/plain");
return Intent.createChooser(shareIntent, getString(R.string.title_try_text));
}
private void onMenuFolders(long account) {
@ -789,7 +786,7 @@ public class ActivityView extends ActivityBase
}
private void onMenuInvite() {
startActivityForResult(getIntentInvite(), REQUEST_INVITE);
startActivity(getIntentInvite());
}
private class DrawerItem {


+ 0
- 0
app/src/main/res/drawable/baseline_people_24.xml View File


+ 11
- 0
app/src/main/res/drawable/baseline_share_24.xml View File

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"/>
</vector>

+ 3
- 1
app/src/main/res/values-en/strings.xml View File

@ -244,7 +244,9 @@
<string name="title_yes">Yes</string>
<string name="title_no">No</string>
<string name="title_undo">Undo</string>
<string name="title_try">Try SimpleEmail, an simple, free software,, privacy friendly email app for Android</string>
<string name="title_try">Try SimpleEmail, an simple, free software, privacy friendly email app for Android</string>
<string name="title_try_subject">Try SimpleEmail</string>
<string name="title_try_text">Invite to:</string>
<string name="title_unexpected_error">Unexpected error</string>
<string name="title_log">Log</string>
<string name="title_debug_info">Debug info</string>


+ 2
- 0
app/src/main/res/values-es-rES/strings.xml View File

@ -244,6 +244,8 @@
<string name="title_no">No</string>
<string name="title_undo">Deshacer</string>
<string name="title_try">Pruebe SimpleEmail, un cliente de correo electrónico para Android de código abierto y enfocado en la privacidad</string>
<string name="title_try_subject">Prueba SimpleEmail</string>
<string name="title_try_text">Invita a:</string>
<string name="title_unexpected_error">Error inesperado</string>
<string name="title_log">Log</string>
<string name="title_debug_info">Información de depuración</string>


+ 3
- 1
app/src/main/res/values/strings.xml View File

@ -290,7 +290,9 @@
<string name="title_undo">Undo</string>
<string name="title_try">Try SimpleEmail, an simple, free software, privacy friendly email app for Android</string>
<string name="title_try_subject">Try SimpleEmail</string>
<string name="title_try_text">Invite to:</string>
<string name="title_unexpected_error">Unexpected error</string>
<string name="title_log">Log</string>
<string name="title_debug_info">Debug info</string>


Loading…
Cancel
Save