Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

malaria profile with more than one visit #14

Closed
wants to merge 10 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.smartregister.chw.core.contract.FamilyCallDialogContract;
import org.smartregister.chw.core.custom_views.CoreAncFloatingMenu;
import org.smartregister.chw.core.custom_views.CoreFamilyMemberFloatingMenu;
import org.smartregister.chw.core.custom_views.CoreMalariaFloatingMenu;
import org.smartregister.chw.core.fragment.CopyToClipboardDialog;
import org.smartregister.clientandeventmodel.Obs;
import org.smartregister.commonregistry.CommonPersonObject;
Expand Down Expand Up @@ -467,6 +468,7 @@ public static void redrawWithOption(LinearLayout menu, boolean has_phone) {
private static void setCallLayoutListener(boolean has_phone, LinearLayout menu) {
CoreFamilyMemberFloatingMenu memberFloatingMenu;
CoreAncFloatingMenu ancFloatingMenu;
CoreMalariaFloatingMenu coreMalariaFloatingMenu;
if (has_phone && menu instanceof CoreFamilyMemberFloatingMenu) {
memberFloatingMenu = (CoreFamilyMemberFloatingMenu) menu;
memberFloatingMenu.getCallLayout().setOnClickListener(memberFloatingMenu);
Expand All @@ -479,6 +481,12 @@ private static void setCallLayoutListener(boolean has_phone, LinearLayout menu)
} else if (!has_phone && menu instanceof CoreFamilyMemberFloatingMenu) {
memberFloatingMenu = (CoreFamilyMemberFloatingMenu) menu;
memberFloatingMenu.getCallLayout().setOnClickListener(null);
} else if (has_phone && menu instanceof CoreMalariaFloatingMenu) {
coreMalariaFloatingMenu = (CoreMalariaFloatingMenu) menu;
coreMalariaFloatingMenu.getCallLayout().setOnClickListener(coreMalariaFloatingMenu);
} else if (!has_phone && menu instanceof CoreMalariaFloatingMenu) {
coreMalariaFloatingMenu = (CoreMalariaFloatingMenu) menu;
coreMalariaFloatingMenu.getCallLayout().setOnClickListener(null);
}
}

Expand Down
125 changes: 125 additions & 0 deletions opensrp-chw-core/src/main/res/layout/view_malaria_floating_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:id="@+id/menu_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/malaria_fab"
android:layout_alignParentEnd="true"
android:layout_marginEnd="24dp"
android:orientation="vertical"
android:visibility="invisible">

<RelativeLayout
android:id="@+id/call_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="visible">

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_toLeftOf="@+id/callFab"
android:background="@color/white"
android:elevation="2dp"
android:gravity="center"
android:minWidth="50dp"
android:padding="10dp">

<TextView
android:id="@+id/CallTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:text="@string/call"
android:textColor="@android:color/black" />

<TextView
android:id="@+id/CallTextViewHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_toEndOf="@+id/CallTextView"
android:layout_toRightOf="@+id/CallTextView"
android:text="@string/call_no_number_provided"
android:textColor="@color/grey"
android:textStyle="italic"
android:visibility="gone" />

</RelativeLayout>


<android.support.design.widget.FloatingActionButton
android:id="@+id/callFab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
app:backgroundTint="@color/white"
app:fabSize="mini"
app:srcCompat="@drawable/floating_call" />

</RelativeLayout>

<RelativeLayout
android:id="@+id/refer_to_facility_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="visible">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_toLeftOf="@+id/refer_to_facility_fab"
android:background="@color/white"
android:elevation="2dp"
android:gravity="center"
android:minWidth="50dp"
android:padding="10dp"
android:text="@string/refer_to_facility"
android:textColor="@android:color/black" />


<android.support.design.widget.FloatingActionButton
android:id="@+id/refer_to_facility_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
app:backgroundTint="@color/white"
app:fabSize="mini"
app:srcCompat="@mipmap/ic_refer" />

</RelativeLayout>

</LinearLayout>

<android.support.design.widget.FloatingActionButton
android:id="@+id/malaria_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:clickable="true"
android:tint="@android:color/white"
app:backgroundTint="@color/text_black"
app:fabSize="normal"
app:srcCompat="@drawable/ic_edit_white" />

</RelativeLayout>