Prepares for the first demo.

Returns to main screen after Commcare registration or follow up.
Polished the interface.
parent e8cb3bae
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/AppTheme" > android:theme="@style/Widget.AppCompat.Light.ActionBar" >
<!-- <activity <!-- <activity
android:name=".MainActivity" android:name=".MainActivity"
android:label="@string/app_name" > android:label="@string/app_name" >
......
...@@ -24,6 +24,9 @@ public class SelectFollowupActivity extends Activity { ...@@ -24,6 +24,9 @@ public class SelectFollowupActivity extends Activity {
public EarIdList earIdList = null; public EarIdList earIdList = null;
private static final int COMMCARE_REGISTER = 1;
private static final int COMMCARE_FOLLOW_UP = 2;
//private EarIdList earIdList; //private EarIdList earIdList;
@Override @Override
...@@ -56,9 +59,9 @@ public class SelectFollowupActivity extends Activity { ...@@ -56,9 +59,9 @@ public class SelectFollowupActivity extends Activity {
"COMMAND_ID" + " " + "m1" + " " "COMMAND_ID" + " " + "m1" + " "
+ +
"CASE_ID" + " " + "case_id" + " " + earIdList.getTop().get(position).person.getCaseId() + " " + // "99de08b8-7235-41ba-9dbe-d1e5d70575cf" + " " + "CASE_ID" + " " + "case_id" + " " + earIdList.getTop().get(position).person.getCaseId() + " " + // "99de08b8-7235-41ba-9dbe-d1e5d70575cf" + " " +
"COMMAND_ID" + " " + "m1-f1"; "COMMAND_ID" + " " + "m1-f0";
intent.putExtra("ccodk_session_request", sssd); intent.putExtra("ccodk_session_request", sssd);
SelectFollowupActivity.this.startActivity(intent); SelectFollowupActivity.this.startActivityForResult(intent, COMMCARE_FOLLOW_UP);
} }
}); });
...@@ -68,10 +71,22 @@ public class SelectFollowupActivity extends Activity { ...@@ -68,10 +71,22 @@ public class SelectFollowupActivity extends Activity {
Intent i = new Intent("org.commcare.dalvik.action.CommCareSession"); Intent i = new Intent("org.commcare.dalvik.action.CommCareSession");
String sssd = "COMMAND_ID" + " " + "root" + " " + "COMMAND_ID" + " " + "m0-f0"; String sssd = "COMMAND_ID" + " " + "root" + " " + "COMMAND_ID" + " " + "m0-f0";
i.putExtra("ccodk_session_request", sssd); i.putExtra("ccodk_session_request", sssd);
SelectFollowupActivity.this.startActivity(i); SelectFollowupActivity.this.startActivityForResult(i, COMMCARE_REGISTER);
} }
}); });
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch(requestCode) {
case COMMCARE_REGISTER:
case COMMCARE_FOLLOW_UP:
{
Intent intent = new Intent(this, EarCaptureActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}
break;
}
} }
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" > android:orientation="vertical" >
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
android:id="@+id/extra_image_value" android:id="@+id/extra_image_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Grab an Image!" /> android:drawableTop="@mipmap/ic_ear"
android:text="Identify ear"
android:layout_gravity="center_horizontal"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:shadowColor="#000000" />
</LinearLayout> </RelativeLayout>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent" <TextView
android:layout_height="match_parent">
<ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/imageView4" android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal" android:text="Top 10 matches"
android:maxHeight="300dp" android:id="@+id/textView"
android:maxWidth="300dp" android:layout_above="@+id/topNListView"
android:minHeight="100dp" android:layout_alignLeft="@+id/register_commcare"
android:minWidth="100dp" android:layout_alignStart="@+id/register_commcare" />
android:nestedScrollingEnabled="true" />
<ListView <ListView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="453dp" android:layout_height="453dp"
android:id="@+id/topNListView" android:id="@+id/topNListView"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:choiceMode="singleChoice" /> android:choiceMode="singleChoice"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true" />
<Button <Button
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Register to Commcare" android:text="Register new patient"
android:id="@+id/register_commcare" android:id="@+id/register_commcare"
android:layout_gravity="center_horizontal" /> android:layout_gravity="center_horizontal"
</LinearLayout> android:layout_alignParentBottom="true"
</ScrollView> android:layout_centerHorizontal="true" />
\ No newline at end of file </RelativeLayout>
\ No newline at end of file
<resources> <resources>
<string name="app_name">Ear Recognition</string> <string name="app_name">Ear Identification</string>
<string name="hello_world">Hello world!</string> <string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string> <string name="action_settings">Settings</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment