1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Added link to FAQ

This commit is contained in:
M66B 2018-08-06 17:04:24 +00:00
parent 74e8134e6c
commit d8e8f3bc99
2 changed files with 17 additions and 0 deletions

View file

@ -26,6 +26,7 @@ import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
@ -107,6 +108,9 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
case R.string.menu_setup: case R.string.menu_setup:
onMenuSetup(); onMenuSetup();
break; break;
case R.string.menu_faq:
onMenuFAQ();
break;
case R.string.menu_about: case R.string.menu_about:
onMenuAbout(); onMenuAbout();
break; break;
@ -275,10 +279,18 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
public void updateDrawer() { public void updateDrawer() {
ArrayAdapterDrawer drawerArray = new ArrayAdapterDrawer(this, R.layout.item_drawer); ArrayAdapterDrawer drawerArray = new ArrayAdapterDrawer(this, R.layout.item_drawer);
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_setup)); drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_setup));
if (getIntentFAQ().resolveActivity(getPackageManager()) != null)
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_faq));
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_about)); drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_about));
drawerList.setAdapter(drawerArray); drawerList.setAdapter(drawerArray);
} }
private Intent getIntentFAQ() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://github.com/M66B/open-source-email/blob/master/FAQ.md"));
return intent;
}
private void onMenuFolders() { private void onMenuFolders() {
getSupportFragmentManager().popBackStack("unified", 0); getSupportFragmentManager().popBackStack("unified", 0);
@ -291,6 +303,10 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
startActivity(new Intent(ActivityView.this, ActivitySetup.class)); startActivity(new Intent(ActivityView.this, ActivitySetup.class));
} }
private void onMenuFAQ() {
startActivity(getIntentFAQ());
}
private void onMenuAbout() { private void onMenuAbout() {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentAbout()).addToBackStack("about"); fragmentTransaction.replace(R.id.content_frame, new FragmentAbout()).addToBackStack("about");

View file

@ -14,6 +14,7 @@
<string name="menu_folders">Folders</string> <string name="menu_folders">Folders</string>
<string name="menu_setup">Setup</string> <string name="menu_setup">Setup</string>
<string name="menu_faq">FAQ</string>
<string name="menu_about">About</string> <string name="menu_about">About</string>
<string name="title_agree">I agree</string> <string name="title_agree">I agree</string>