From b8eedc565c2f1ff17cb979f03572bf38d2c223fc Mon Sep 17 00:00:00 2001 From: "marcin.jedynski" Date: Wed, 21 Nov 2018 04:59:50 +0100 Subject: [PATCH] hiden tutor portion of drawer if student logged in --- .../java/com/uam/wmi/findmytutor/activity/BaseActivity.java | 1 + .../java/com/uam/wmi/findmytutor/activity/SharingFragment.java | 2 ++ .../main/java/com/uam/wmi/findmytutor/utils/SharingLevel.java | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/BaseActivity.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/BaseActivity.java index 610b1ea..17ac628 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/activity/BaseActivity.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/BaseActivity.java @@ -138,6 +138,7 @@ public abstract class BaseActivity if (!isTutor) { navigationView.findViewById(R.id.nav_profile).setVisibility(View.GONE); + drawerNavigationView.getMenu().setGroupVisible(R.id.drawer_group_tutor, false); } } diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java index 38bff8d..9bfc6a5 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java @@ -45,6 +45,8 @@ public class SharingFragment extends PreferenceFragment { locationLevelMapping.put(0, SharingLevel.PRESENCE.toString()); locationLevelMapping.put(1, SharingLevel.APPROXIMATED.toString()); locationLevelMapping.put(2, SharingLevel.EXACT.toString()); + locationLevelMapping.put(3, SharingLevel.MANUAL.toString()); + addPreferencesFromResource(R.layout.pref_sharing); Preference manualStatus = findPreference("key_manual_status"); diff --git a/app/src/main/java/com/uam/wmi/findmytutor/utils/SharingLevel.java b/app/src/main/java/com/uam/wmi/findmytutor/utils/SharingLevel.java index 055651b..9b0a027 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/utils/SharingLevel.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/utils/SharingLevel.java @@ -3,7 +3,8 @@ package com.uam.wmi.findmytutor.utils; public enum SharingLevel { PRESENCE("presence"), APPROXIMATED("approximated"), - EXACT("exact"); + EXACT("exact"), + MANUAL("manuak"); private final String text;