-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into #8-implement-malari…
…a-profile-page # Conflicts: # opensrp-chw-malaria/src/main/res/values/strings.xml
- Loading branch information
Showing
5 changed files
with
150 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...src/main/java/org/smartregister/chw/malaria/listener/MalariaBottomNavigationListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.smartregister.chw.malaria.listener; | ||
|
||
import android.app.Activity; | ||
import android.support.annotation.NonNull; | ||
import android.view.MenuItem; | ||
|
||
import org.smartregister.listener.BottomNavigationListener; | ||
import org.smartregister.malaria.R; | ||
import org.smartregister.view.activity.BaseRegisterActivity; | ||
|
||
public class MalariaBottomNavigationListener extends BottomNavigationListener { | ||
private Activity context; | ||
|
||
public MalariaBottomNavigationListener(Activity context) { | ||
super(context); | ||
this.context = context; | ||
} | ||
|
||
@Override | ||
public boolean onNavigationItemSelected(@NonNull MenuItem item) { | ||
super.onNavigationItemSelected(item); | ||
|
||
BaseRegisterActivity baseRegisterActivity = (BaseRegisterActivity) context; | ||
|
||
if (item.getItemId() == R.id.action_family) { | ||
baseRegisterActivity.switchToBaseFragment(); | ||
} else if (item.getItemId() == R.id.action_scan_qr) { | ||
baseRegisterActivity.startQrCodeScanner(); | ||
} | ||
|
||
return true; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
opensrp-chw-malaria/src/main/res/menu/bottom_nav_family_menu.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
<item | ||
android:id="@+id/action_family" | ||
android:enabled="true" | ||
android:icon="@mipmap/ic_home" | ||
android:title="@string/home" | ||
app:showAsAction="ifRoom" /> | ||
<item | ||
android:id="@+id/action_scan_qr" | ||
android:enabled="true" | ||
android:icon="@mipmap/ic_scan_qr" | ||
android:title="@string/scan_qr" | ||
app:showAsAction="ifRoom" /> | ||
<item | ||
android:id="@+id/action_register" | ||
android:enabled="true" | ||
android:icon="@mipmap/ic_add_family" | ||
android:title="@string/add_family" | ||
app:showAsAction="ifRoom" /> | ||
|
||
<item | ||
android:id="@+id/action_job_aids" | ||
android:enabled="true" | ||
android:icon="@mipmap/ic_jobaids" | ||
android:title="@string/job_aids" | ||
app:showAsAction="ifRoom" /> | ||
</menu> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters