dhis-mobile-devs team mailing list archive
-
dhis-mobile-devs team
-
Mailing list archive
-
Message #00384
[Branch ~dhis-mobile-devs/dhis-mobile/lwuit-tracking] Rev 210: https://blueprints.launchpad.net/dhis-mobile/+spec/enhance-tracker-client
------------------------------------------------------------
revno: 210
committer: sherylyn.marie
branch nick: lwuit-tracking
timestamp: Mon 2014-05-05 15:06:56 +0800
message:
https://blueprints.launchpad.net/dhis-mobile/+spec/enhance-tracker-client
#1 All tracked entity support
- Tracking Main Menu labels
- Find Instance Search Result Screen
modified:
src/org/hisp/dhis/mobile/ui/Text.java
src/org/hisp/dhis/mobile/view/PersonListView.java
src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java
--
lp:~dhis-mobile-devs/dhis-mobile/lwuit-tracking
https://code.launchpad.net/~dhis-mobile-devs/dhis-mobile/lwuit-tracking
Your team DHIS mobile developers is subscribed to branch lp:~dhis-mobile-devs/dhis-mobile/lwuit-tracking.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis-mobile-devs/dhis-mobile/lwuit-tracking/+edit-subscription
=== modified file 'src/org/hisp/dhis/mobile/ui/Text.java'
--- src/org/hisp/dhis/mobile/ui/Text.java 2014-03-26 10:24:58 +0000
+++ src/org/hisp/dhis/mobile/ui/Text.java 2014-05-05 07:06:56 +0000
@@ -464,7 +464,7 @@
public static String PERSON_SEARCH()
{
- return get( (short) 82, "Person Search" );
+ return get( (short) 82, "Find Instance" );
}
public static String ENTER_KEY_WORD()
=== modified file 'src/org/hisp/dhis/mobile/view/PersonListView.java'
--- src/org/hisp/dhis/mobile/view/PersonListView.java 2014-02-07 11:02:56 +0000
+++ src/org/hisp/dhis/mobile/view/PersonListView.java 2014-05-05 07:06:56 +0000
@@ -37,10 +37,12 @@
import com.sun.lwuit.Command;
import com.sun.lwuit.Form;
+import com.sun.lwuit.Label;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;
import com.sun.lwuit.layouts.BoxLayout;
+import com.sun.lwuit.plaf.Style;
/**
* @author Nguyen Kim Lai
@@ -76,41 +78,55 @@
for ( int i = 0; i < patientInfos.size(); i++ )
{
String patientInfo = (String) patientInfos.elementAt( i );
-
- final String id = patientInfo.substring( 0, patientInfo.indexOf( "/" ) );
-
- patientInfo = patientInfo.substring( patientInfo.indexOf( "/" ) + 1, patientInfo.length() );
- /*
- * String name = patientInfo.substring( 0, patientInfo.indexOf( "/"
- * ) ); String birthday = patientInfo.substring(
- * patientInfo.indexOf( "/" ) + 1, patientInfo.length() );
- * LinkButton personLink = new LinkButton( name + ", DOB: " +
- * birthday );
- */
- LinkButton personLink = new LinkButton( patientInfo );
- personLink.addActionListener( new ActionListener()
- {
- public void actionPerformed( ActionEvent ae )
+
+ if(patientInfo.indexOf( "/" ) == -1)
+ {
+ Style labelStyle = new Style();
+ labelStyle.setBgColor( 0xcccccc );
+
+ Label trackedEntitylbl = new Label( patientInfo );
+ trackedEntitylbl.setUnselectedStyle( labelStyle );
+ trackedEntitylbl.setSelectedStyle( labelStyle );
+ trackedEntitylbl.setFocusable( false );
+ mainForm.addComponent( trackedEntitylbl );
+ }
+ else
+ {
+ final String id = patientInfo.substring( 0, patientInfo.indexOf( "/" ) );
+
+ patientInfo = patientInfo.substring( patientInfo.indexOf( "/" ) + 1, patientInfo.length() );
+ /*
+ * String name = patientInfo.substring( 0, patientInfo.indexOf( "/"
+ * ) ); String birthday = patientInfo.substring(
+ * patientInfo.indexOf( "/" ) + 1, patientInfo.length() );
+ * LinkButton personLink = new LinkButton( name + ", DOB: " +
+ * birthday );
+ */
+ LinkButton personLink = new LinkButton( patientInfo );
+ personLink.addActionListener( new ActionListener()
{
- nameBasedMIDlet.getWaitingView().showView();
- if ( enrollmentRelationship == null )
- {
- ConnectionManager.setUrl( nameBasedMIDlet.getCurrentOrgUnit().getFindPatientUrl() );
- ConnectionManager.getPatientById( id );
- }
- else
- {
- enrollmentRelationship.setPersonBId( Integer.parseInt( id ) );
- ConnectionManager.addRelationship( enrollmentRelationship );
- }
- mainForm = null;
- patientInfos = null;
- backCommand = null;
- enrollmentRelationship = null;
- System.gc();
- }
- } );
- mainForm.addComponent( personLink );
+ public void actionPerformed( ActionEvent ae )
+ {
+ nameBasedMIDlet.getWaitingView().showView();
+ if ( enrollmentRelationship == null )
+ {
+ ConnectionManager.setUrl( nameBasedMIDlet.getCurrentOrgUnit().getFindPatientUrl() );
+ ConnectionManager.getPatientById( id );
+ }
+ else
+ {
+ enrollmentRelationship.setPersonBId( Integer.parseInt( id ) );
+ ConnectionManager.addRelationship( enrollmentRelationship );
+ }
+ mainForm = null;
+ patientInfos = null;
+ backCommand = null;
+ enrollmentRelationship = null;
+ System.gc();
+ }
+ } );
+ mainForm.addComponent( personLink );
+ }
}
if ( patientInfos.size() == 10 )
{
@@ -149,7 +165,7 @@
{
if ( mainForm == null )
{
- mainForm = new Form( "Select Person" );
+ mainForm = new Form( "Select Instance" );
mainForm.setLayout( new BoxLayout( BoxLayout.Y_AXIS ) );
mainForm.setTransitionOutAnimator( CommonTransitions.createSlide( CommonTransitions.SLIDE_HORIZONTAL, true,
200 ) );
=== modified file 'src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java'
--- src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java 2014-04-22 07:25:20 +0000
+++ src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java 2014-05-05 07:06:56 +0000
@@ -46,6 +46,14 @@
implements ActionListener
{
private static final String CLASS_TAG = "TrackingMainMenuView";
+
+ private static final String MENU_FIND_INSTANCE = "Find Instance";
+ private static final String MENU_ADD_INSTANCE = "Add Instance";
+ private static final String MENU_VISIT_SCHEDULE = "Visit Schedule";
+ private static final String MENU_HISTORY = "History";
+ private static final String MENU_PENDING_REGISTRATION = "Pending Registration";
+ private static final String MENU_SINGLE_EVENT_WITHOUT_REGISTRATION = "Single Event Without Registration";
+ private static final String MENU_LOST_TO_FOLLOW_UP = "Lost to Follow Up";
private List menuList;
@@ -107,12 +115,12 @@
int sizeOfOrgUnits = OrgUnitRecordStore.loadAllOrgUnit().size();
nameBasedMidlet.setCurrentOrgUnit( (OrgUnit) OrgUnitRecordStore.loadAllOrgUnit().elementAt( 0 ) );
- if ( nextPageName.equals( "Find Person" ) )
+ if ( nextPageName.equals( MENU_FIND_INSTANCE ) )
{
nameBasedMidlet.getFindBeneficiaryView().showView();
}
- else if ( nextPageName.equals( "Add Person" ) )
+ else if ( nextPageName.equals( MENU_ADD_INSTANCE ) )
{
if ( sizeOfOrgUnits > 1 )
{
@@ -127,7 +135,7 @@
nameBasedMidlet.getProgramSelectView().showView();
}
}
- else if ( nextPageName.equals( "Lost to Follow Up" ) )
+ else if ( nextPageName.equals( MENU_LOST_TO_FOLLOW_UP ) )
{
if ( sizeOfOrgUnits > 1 )
{
@@ -142,19 +150,19 @@
ConnectionManager.getAllAnonymousProgram( "1", true );
}
}
- else if ( nextPageName.equals( "History" ) )
+ else if ( nextPageName.equals( MENU_HISTORY ) )
{
ModelList modelList = PatientRecordStore.getCurrentPatients();
nameBasedMidlet.getHistoryPersonListView().setModelList( modelList );
nameBasedMidlet.getHistoryPersonListView().showView();
}
- else if ( nextPageName.equals( "Pending Registration" ) )
+ else if ( nextPageName.equals( MENU_PENDING_REGISTRATION ) )
{
nameBasedMidlet.getWaitingView().showView();
nameBasedMidlet.getOfflineOrgUnitSelectView().showView();
}
- else if ( nextPageName.equals( "Single Event Without Registration" ) )
+ else if ( nextPageName.equals( MENU_SINGLE_EVENT_WITHOUT_REGISTRATION ) )
{
if ( sizeOfOrgUnits > 1 )
{
@@ -180,7 +188,7 @@
public List getMenuList()
{
- String[] menuItems = { "Find Person", "Add Person", "History", "Pending Registration", "Single Event Without Registration" };
+ String[] menuItems = { MENU_FIND_INSTANCE, MENU_ADD_INSTANCE, MENU_HISTORY, MENU_PENDING_REGISTRATION, MENU_SINGLE_EVENT_WITHOUT_REGISTRATION };
if ( menuList == null )
{