From 3fca9a0d086973696808201b2b91040147efd56b Mon Sep 17 00:00:00 2001 From: Shaleen Jain Date: Mon, 18 Nov 2019 18:33:42 +0530 Subject: [PATCH] add help page option in drawer as well --- .../java/com/shalzz/attendance/ui/main/MainActivity.kt | 10 ++++++++-- app/src/main/res/menu/drawer.xml | 4 ++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/shalzz/attendance/ui/main/MainActivity.kt b/app/src/main/java/com/shalzz/attendance/ui/main/MainActivity.kt index fd67d80b..78335189 100644 --- a/app/src/main/java/com/shalzz/attendance/ui/main/MainActivity.kt +++ b/app/src/main/java/com/shalzz/attendance/ui/main/MainActivity.kt @@ -45,6 +45,7 @@ import com.android.billingclient.api.BillingClient.BillingResponse import com.bugsnag.android.Bugsnag import com.github.amlcurran.showcaseview.ShowcaseView import com.google.android.material.navigation.NavigationView +import com.shalzz.attendance.MyApplication import com.shalzz.attendance.R import com.shalzz.attendance.billing.BillingManager import com.shalzz.attendance.billing.BillingProvider @@ -170,8 +171,12 @@ class MainActivity : BaseActivity(), MainMvpView, BillingProvider { navController: NavController ) { navigationView.setNavigationItemSelectedListener { item -> - if (navController.currentDestination!!.id != item.itemId) - NavigationUI.onNavDestinationSelected(item, navController) + if (navController.currentDestination!!.id != item.itemId) { + if (item.itemId == R.id.helpNSupport) { + MyApplication.deskInstance.startDeskHomeScreen(this) + } else + NavigationUI.onNavDestinationSelected(item, navController) + } val parent = navigationView.parent (parent as DrawerLayout).closeDrawer(navigationView) true @@ -179,6 +184,7 @@ class MainActivity : BaseActivity(), MainMvpView, BillingProvider { val weakReference = WeakReference(navigationView) navController.addOnDestinationChangedListener(object : NavController.OnDestinationChangedListener { + override fun onDestinationChanged(controller: NavController, destination: NavDestination, arguments: Bundle?) { diff --git a/app/src/main/res/menu/drawer.xml b/app/src/main/res/menu/drawer.xml index 5f68c3d9..82a08d08 100644 --- a/app/src/main/res/menu/drawer.xml +++ b/app/src/main/res/menu/drawer.xml @@ -33,6 +33,10 @@ android:id="@+id/settingsFragment" android:orderInCategory="3" android:title="@string/navigation_item_3"/> + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 670dfa60..259a4c48 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -155,6 +155,7 @@ Attendance Timetable Settings + Help and Support Proxy About