Added legend

This commit is contained in:
M66B
2018-08-22 06:20:31 +00:00
parent e60f8a6ffd
commit 12779b6ff6
5 changed files with 251 additions and 8 deletions

View File

@@ -117,12 +117,15 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
case R.string.menu_operations:
onMenuOperations();
break;
case R.string.menu_privacy:
onMenuPrivacy();
case R.string.menu_legend:
onMenuLegend();
break;
case R.string.menu_faq:
onMenuFAQ();
break;
case R.string.menu_privacy:
onMenuPrivacy();
break;
case R.string.menu_about:
onMenuAbout();
break;
@@ -165,13 +168,15 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
if (PreferenceManager.getDefaultSharedPreferences(ActivityView.this).getBoolean("debug", false))
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_list_24, R.string.menu_operations));
if (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_help_24, R.string.menu_legend));
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));
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_help_24, R.string.menu_about));
if (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_info_24, R.string.menu_about));
if (getIntentOtherApps().resolveActivity(getPackageManager()) != null)
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_get_app_24, R.string.menu_other));
@@ -446,14 +451,20 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
fragmentTransaction.commit();
}
private void onMenuPrivacy() {
startActivity(getIntentPrivacy());
private void onMenuLegend() {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentLegend()).addToBackStack("legend");
fragmentTransaction.commit();
}
private void onMenuFAQ() {
startActivity(getIntentFAQ());
}
private void onMenuPrivacy() {
startActivity(getIntentPrivacy());
}
private void onMenuAbout() {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentAbout()).addToBackStack("about");

View File

@@ -0,0 +1,40 @@
package eu.faircode.email;
/*
This file is part of FairEmail.
FairEmail 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.
NetGuard 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 NetGuard. If not, see <http://www.gnu.org/licenses/>.
Copyright 2018 by Marcel Bokhorst (M66B)
*/
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 FragmentLegend extends FragmentEx {
@Override
@Nullable
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
setSubtitle(R.string.menu_legend);
View view = inflater.inflate(R.layout.fragment_legend, container, false);
return view;
}
}