From b7194f2783e5e97c3e544a4470b4b2c879cc0d48 Mon Sep 17 00:00:00 2001 From: baksosapi Date: Thu, 16 Nov 2017 12:22:27 +0800 Subject: [PATCH] WD| Fix Start Registers: casting Location view to Registers activity #4 --- bidan-cloudant/build.gradle | 8 ++++ .../activity/BidanDetailActivity.java | 5 ++- .../activity/BidanHomeActivity.java | 4 +- .../activity/BidanRecapitulationActivity.java | 2 +- .../activity/KANCDetailActivity.java | 7 ++-- .../activity/KChildDetailActivity.java | 2 - .../activity/KChildSmartRegisterActivity.java | 8 ++-- .../activity/KPNCDetailActivity.java | 9 +---- .../activity/LoginActivity.java | 24 ++++++------ .../application/BidanApplication.java | 8 ++-- .../controller/BidanNavigationController.java | 9 ++--- .../fragment/ANCSmartRegisterFragment.java | 10 ++--- .../BidanLocationSelectorDialogFragment.java | 8 ++-- .../fragment/ChildSmartRegisterFragment.java | 2 +- .../fragment/FPSmartRegisterFragment.java | 10 ++--- .../fragment/MotherSmartRegisterFragment.java | 13 +++++-- .../fragment/PNCSmartRegisterFragment.java | 8 ++-- .../option/VaksinatorSearchOption.java | 2 +- .../option/VaksinatorServiceModeOption.java | 2 +- .../provider/ChildSmartClientsProvider.java | 2 +- .../VaksinatorSmartClientsProvider.java | 38 ------------------- .../repository/BidanRepository.java | 2 +- .../repository/UniqueIdRepository.java | 2 +- .../bidan_cloudant/utils/Config.java | 3 -- .../main/res/layout/mother_detail_profile.xml | 20 +++++----- 25 files changed, 86 insertions(+), 122 deletions(-) diff --git a/bidan-cloudant/build.gradle b/bidan-cloudant/build.gradle index 24855c8..cb87671 100644 --- a/bidan-cloudant/build.gradle +++ b/bidan-cloudant/build.gradle @@ -54,6 +54,14 @@ android { } debug { + resValue "string", 'opensrp_url', '"http://192.168.1.253:8080/opensrp"' + resValue "string", 'debug_mode', '"ON"' + buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '250' + buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100' + buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' + buildConfigField "int", "DATABASE_VERSION", '9' + buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" + buildConfigField "boolean", "TIME_CHECK", "false" testCoverageEnabled true } diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanDetailActivity.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanDetailActivity.java index 649547b..327aeb2 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanDetailActivity.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanDetailActivity.java @@ -13,13 +13,12 @@ import com.flurry.android.FlurryAgent; import org.smartregister.Context; +import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.libs.FlurryFacade; import org.smartregister.commonregistry.AllCommonsRepository; import org.smartregister.commonregistry.CommonPersonObject; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.repository.DetailsRepository; -import org.smartregister.bidan_cloudant.R; -//import org.smartregister.bidan_cloudant.face.camera.SmartShutterActivity; import org.smartregister.view.activity.DrishtiApplication; import java.io.File; @@ -31,6 +30,8 @@ import util.ImageFetcher; import util.formula.Support; +//import org.smartregister.bidan_cloudant.face.camera.SmartShutterActivity; + /** * Created by Iq on 09/06/16. */ diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanHomeActivity.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanHomeActivity.java index dc7d9f4..bd192a5 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanHomeActivity.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanHomeActivity.java @@ -14,17 +14,17 @@ import org.json.JSONObject; import org.smartregister.Context; +import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.controller.BidanNavigationController; import org.smartregister.bidan_cloudant.utils.AllConstantsINA; import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.enketo.view.fragment.DisplayFormFragment; import org.smartregister.event.Listener; import org.smartregister.service.PendingFormSubmissionService; -import org.smartregister.bidan_cloudant.R; import org.smartregister.view.activity.SecuredActivity; import org.smartregister.view.contract.HomeContext; import org.smartregister.view.controller.NativeAfterANMDetailsFetchListener; import org.smartregister.view.controller.NativeUpdateANMDetailsTask; -import org.smartregister.enketo.view.fragment.DisplayFormFragment; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanRecapitulationActivity.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanRecapitulationActivity.java index c4648fe..6db02f4 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanRecapitulationActivity.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/BidanRecapitulationActivity.java @@ -11,9 +11,9 @@ import android.widget.TextView; import org.smartregister.Context; +import org.smartregister.bidan_cloudant.R; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; -import org.smartregister.bidan_cloudant.R; import java.util.Date; import java.util.Map; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KANCDetailActivity.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KANCDetailActivity.java index edb0664..5381a52 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KANCDetailActivity.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KANCDetailActivity.java @@ -2,7 +2,6 @@ import android.app.Activity; import android.content.Intent; -import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.ImageButton; @@ -161,8 +160,8 @@ protected void onCreate(Bundle savedInstanceState) { TextView highRiskPostPartumDistosia = (TextView) findViewById(R.id.txt_highRiskPostPartumDistosia); TextView txt_highRiskHIVAIDS = (TextView) findViewById(R.id.txt_highRiskHIVAIDS); - ImageView heart_bpm = (ImageView) findViewById(R.id.icon_device); - heart_bpm.setVisibility(View.VISIBLE); +// ImageView heart_bpm = (ImageView) findViewById(R.id.icon_device); +// heart_bpm.setVisibility(View.VISIBLE); ImageButton back = (ImageButton) findViewById(R.id.btn_back_to_home); back.setOnClickListener(new View.OnClickListener() { @@ -178,7 +177,7 @@ public void onClick(View v) { } }); - ImageView device = (ImageView) findViewById(R.id.icon_device); +// ImageView device = (ImageView) findViewById(R.id.icon_device); // device.setOnClickListener(bpmListener); DetailsRepository detailsRepository = org.smartregister.Context.getInstance().detailsRepository(); diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KChildDetailActivity.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KChildDetailActivity.java index 0ec07d0..40485b6 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KChildDetailActivity.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KChildDetailActivity.java @@ -9,8 +9,6 @@ import android.widget.ImageView; import android.widget.TextView; -import com.flurry.android.FlurryAgent; - import org.smartregister.Context; import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.libs.FlurryFacade; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KChildSmartRegisterActivity.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KChildSmartRegisterActivity.java index c41fefb..b7f8c67 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KChildSmartRegisterActivity.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KChildSmartRegisterActivity.java @@ -12,6 +12,9 @@ import com.flurry.android.FlurryAgent; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.fragment.ChildSmartRegisterFragment; import org.smartregister.bidan_cloudant.pageradapter.BaseRegisterActivityPagerAdapter; import org.smartregister.bidan_cloudant.service.SaveService; @@ -19,18 +22,15 @@ import org.smartregister.domain.form.FieldOverrides; import org.smartregister.domain.form.FormSubmission; import org.smartregister.enketo.listener.DisplayFormListener; +import org.smartregister.enketo.view.fragment.DisplayFormFragment; import org.smartregister.provider.SmartRegisterClientsProvider; -import org.smartregister.bidan_cloudant.R; import org.smartregister.sync.ClientProcessor; import org.smartregister.view.activity.SecuredNativeSmartRegisterActivity; import org.smartregister.view.dialog.DialogOption; import org.smartregister.view.dialog.LocationSelectorDialogFragment; import org.smartregister.view.dialog.OpenFormOption; -import org.smartregister.enketo.view.fragment.DisplayFormFragment; import org.smartregister.view.fragment.SecuredNativeSmartRegisterFragment; import org.smartregister.view.viewpager.OpenSRPViewPager; -import org.json.JSONException; -import org.json.JSONObject; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KPNCDetailActivity.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KPNCDetailActivity.java index a97351e..836c151 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KPNCDetailActivity.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/KPNCDetailActivity.java @@ -2,9 +2,7 @@ import android.app.Activity; import android.content.Intent; -import android.net.Uri; import android.os.Bundle; -import android.util.Log; import android.view.View; import android.widget.ImageButton; import android.widget.ImageView; @@ -12,7 +10,6 @@ import com.flurry.android.FlurryAgent; -import org.json.JSONObject; import org.smartregister.Context; import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.libs.FlurryFacade; @@ -27,11 +24,9 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; -import java.util.UUID; import util.ImageFetcher; import util.Utils; -import util.formula.Support; import static org.smartregister.util.StringUtil.humanize; import static org.smartregister.util.StringUtil.humanizeAndDoUPPERCASE; @@ -89,8 +84,8 @@ protected void onCreate(Bundle savedInstanceState) { // TextView risk8 = (TextView) findViewById(R.id.txt_risk8); // ImageView heart_bpm = (ImageView) findViewById(R.id.icon_device); - ImageView device = (ImageView) findViewById(R.id.icon_device); - device.setVisibility(View.VISIBLE); +// ImageView device = (ImageView) findViewById(R.id.icon_device); +// device.setVisibility(View.VISIBLE); // device.setOnClickListener(bpmListener); //detail data diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/LoginActivity.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/LoginActivity.java index 31e2b88..b51b5af 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/LoginActivity.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/activity/LoginActivity.java @@ -25,21 +25,19 @@ import android.widget.TextView; import org.smartregister.Context; -import org.smartregister.bidan_cloudant.application.BidanApplication; +import org.smartregister.bidan_cloudant.BuildConfig; import org.smartregister.bidan_cloudant.R; +import org.smartregister.bidan_cloudant.application.BidanApplication; import org.smartregister.bidan_cloudant.utils.Config; import org.smartregister.domain.LoginResponse; import org.smartregister.domain.Response; import org.smartregister.domain.ResponseStatus; import org.smartregister.event.Listener; -//import org.smartregister.bidan_cloudant.lib.ErrorReportingFacade; import org.smartregister.repository.AllSharedPreferences; -import org.smartregister.service.UserService; import org.smartregister.util.Log; import org.smartregister.view.BackgroundAction; import org.smartregister.view.LockingBackgroundTask; import org.smartregister.view.ProgressIndicator; -import org.smartregister.view.activity.DrishtiApplication; import java.io.IOException; import java.text.SimpleDateFormat; @@ -47,7 +45,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; -//import io.fabric.sdk.android.Fabric; import util.uniqueIdGenerator.Generator; import static android.preference.PreferenceManager.getDefaultSharedPreferences; @@ -59,6 +56,9 @@ import static org.smartregister.util.Log.logError; import static org.smartregister.util.Log.logVerbose; +//import org.smartregister.bidan_cloudant.lib.ErrorReportingFacade; +//import io.fabric.sdk.android.Fabric; + public class LoginActivity extends AppCompatActivity { private static final String TAG = LoginActivity.class.getSimpleName(); private Context context; @@ -106,25 +106,25 @@ public void onCreate(Bundle savedInstanceState) { setLanguage(); - debugApp(); - + if (BuildConfig.DEBUG) { + debugApp(); + } } private void debugApp() { Config config = new Config(); - String uname = "demo1", pwd = "Satu2345"; + String uname = null, pwd = null; try { uname = config.getCredential("uname", getApplicationContext()); - pwd = config.getCredential("pwd", getApplicationContext()); + pwd = config.getCredential("pwd", getApplicationContext()); } catch (IOException e) { e.printStackTrace(); } LayoutInflater layoutInflater = getLayoutInflater(); View view = layoutInflater.inflate(R.layout.login, null); - if (context.userService().hasARegisteredUser()){ - localLoginWith(uname, pwd); - //localLogin(view, uname, pwd); + if (BidanApplication.getInstance().context().userService().hasARegisteredUser()) { + localLogin(view, uname, pwd); } else { remoteLogin(view, uname, pwd); } diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/application/BidanApplication.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/application/BidanApplication.java index 880dad3..c183b52 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/application/BidanApplication.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/application/BidanApplication.java @@ -3,22 +3,22 @@ import android.content.Intent; import android.content.res.Configuration; +import org.smartregister.Context; +import org.smartregister.CoreLibrary; import org.smartregister.bidan_cloudant.activity.LoginActivity; import org.smartregister.bidan_cloudant.libs.FlurryFacade; import org.smartregister.bidan_cloudant.repository.BidanRepository; -import org.smartregister.Context; -import org.smartregister.CoreLibrary; import org.smartregister.commonregistry.CommonFtsObject; import org.smartregister.repository.Repository; import org.smartregister.sync.DrishtiSyncScheduler; import org.smartregister.view.activity.DrishtiApplication; import org.smartregister.view.receiver.SyncBroadcastReceiver; +import java.util.Locale; + import static org.smartregister.util.Log.logError; import static org.smartregister.util.Log.logInfo; -import java.util.Locale; - /** * Created by koros on 1/22/16. */ diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/controller/BidanNavigationController.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/controller/BidanNavigationController.java index 87da206..1218175 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/controller/BidanNavigationController.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/controller/BidanNavigationController.java @@ -5,20 +5,19 @@ import android.content.SharedPreferences; import android.net.Uri; - -//import org.ei.opensrp.vaksinator.test.TestSmartRegisterActivity; +import org.json.JSONObject; +import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.activity.KANCSmartRegisterActivity; import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity; -import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.activity.KFPSmartRegisterActivity; import org.smartregister.bidan_cloudant.activity.KMotherSmartRegisterActivity; import org.smartregister.bidan_cloudant.activity.KPNCSmartRegisterActivity; import org.smartregister.view.controller.ANMController; -import org.json.JSONObject; - import static android.preference.PreferenceManager.getDefaultSharedPreferences; +//import org.ei.opensrp.vaksinator.test.TestSmartRegisterActivity; + public class BidanNavigationController extends org.smartregister.view.controller.NavigationController { private Activity activity; private ANMController anmController; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/ANCSmartRegisterFragment.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/ANCSmartRegisterFragment.java index aa62a6c..54409fc 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/ANCSmartRegisterFragment.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/ANCSmartRegisterFragment.java @@ -20,11 +20,11 @@ import org.smartregister.Context; import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.activity.KANCDetailActivity; -import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity; +import org.smartregister.bidan_cloudant.activity.KANCSmartRegisterActivity; import org.smartregister.bidan_cloudant.activity.LoginActivity; import org.smartregister.bidan_cloudant.libs.FlurryFacade; -import org.smartregister.bidan_cloudant.option.KICommonObjectFilterOption; import org.smartregister.bidan_cloudant.option.ANCServiceModeOption; +import org.smartregister.bidan_cloudant.option.KICommonObjectFilterOption; import org.smartregister.bidan_cloudant.provider.ANCSmartClientsProvider; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.commonregistry.CommonPersonObjectController; @@ -181,7 +181,7 @@ protected SmartRegisterClientsProvider clientsProvider() { } private DialogOption[] getEditOptions() { - return ((KChildSmartRegisterActivity)getActivity()).getEditOptions(); + return ((KANCSmartRegisterActivity)getActivity()).getEditOptions(); } @Override @@ -314,7 +314,7 @@ public void startRegistration() { ft.addToBackStack(null); LocationSelectorDialogFragment - .newInstance((KChildSmartRegisterActivity) getActivity(), new EditDialogOptionModel(), context().anmLocationController().get(), "registrasi_ibu") + .newInstance((KANCSmartRegisterActivity) getActivity(), new EditDialogOptionModel(), context().anmLocationController().get(), "registrasi_ibu") .show(ft, locationDialogTAG); } @@ -640,7 +640,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data){ if (requestCode == 2 ) { if (resultCode != 0) { - Intent myIntent = new Intent(getActivity(), KChildSmartRegisterActivity.class); + Intent myIntent = new Intent(getActivity(), KANCSmartRegisterActivity.class); if (data != null) { myIntent.putExtra("org.smartregister.indonesia.face.face_mode", true); myIntent.putExtra("org.smartregister.indonesia.face.base_id", data.getStringExtra("org.smartregister.indonesia.face.base_id")); diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/BidanLocationSelectorDialogFragment.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/BidanLocationSelectorDialogFragment.java index 1f3ddb2..895bc0d 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/BidanLocationSelectorDialogFragment.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/BidanLocationSelectorDialogFragment.java @@ -9,14 +9,14 @@ import com.google.common.base.Strings; -import org.smartregister.domain.form.FieldOverrides; -import org.smartregister.view.activity.SecuredNativeSmartRegisterActivity; -import org.smartregister.view.dialog.DialogOption; -import org.smartregister.view.dialog.DialogOptionModel; import org.json.JSONObject; import org.opensrp.api.domain.Location; import org.opensrp.api.util.EntityUtils; import org.opensrp.api.util.LocationTree; +import org.smartregister.domain.form.FieldOverrides; +import org.smartregister.view.activity.SecuredNativeSmartRegisterActivity; +import org.smartregister.view.dialog.DialogOption; +import org.smartregister.view.dialog.DialogOptionModel; import java.util.Map; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/ChildSmartRegisterFragment.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/ChildSmartRegisterFragment.java index d9d6f04..d47b207 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/ChildSmartRegisterFragment.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/ChildSmartRegisterFragment.java @@ -23,8 +23,8 @@ import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity; import org.smartregister.bidan_cloudant.activity.LoginActivity; import org.smartregister.bidan_cloudant.libs.FlurryFacade; -import org.smartregister.bidan_cloudant.option.KICommonObjectFilterOption; import org.smartregister.bidan_cloudant.option.ChildServiceModeOption; +import org.smartregister.bidan_cloudant.option.KICommonObjectFilterOption; import org.smartregister.bidan_cloudant.provider.ChildSmartClientsProvider; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.commonregistry.CommonPersonObjectController; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/FPSmartRegisterFragment.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/FPSmartRegisterFragment.java index 7997ac8..e0b3243 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/FPSmartRegisterFragment.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/FPSmartRegisterFragment.java @@ -20,11 +20,11 @@ import org.smartregister.Context; import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.activity.KFPDetailActivity; -import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity; +import org.smartregister.bidan_cloudant.activity.KFPSmartRegisterActivity; import org.smartregister.bidan_cloudant.activity.LoginActivity; import org.smartregister.bidan_cloudant.libs.FlurryFacade; -import org.smartregister.bidan_cloudant.option.KICommonObjectFilterOption; import org.smartregister.bidan_cloudant.option.FPServiceModeOption; +import org.smartregister.bidan_cloudant.option.KICommonObjectFilterOption; import org.smartregister.bidan_cloudant.provider.FPSmartClientsProvider; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.commonregistry.CommonPersonObjectController; @@ -181,7 +181,7 @@ protected SmartRegisterClientsProvider clientsProvider() { } private DialogOption[] getEditOptions() { - return ((KChildSmartRegisterActivity)getActivity()).getEditOptions(); + return ((KFPSmartRegisterActivity)getActivity()).getEditOptions(); } @Override @@ -314,7 +314,7 @@ public void startRegistration() { ft.addToBackStack(null); LocationSelectorDialogFragment - .newInstance((KChildSmartRegisterActivity) getActivity(), new EditDialogOptionModel(), context().anmLocationController().get(), "registrasi_ibu") + .newInstance((KFPSmartRegisterActivity) getActivity(), new EditDialogOptionModel(), context().anmLocationController().get(), "registrasi_ibu") .show(ft, locationDialogTAG); } @@ -640,7 +640,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data){ if (requestCode == 2 ) { if (resultCode != 0) { - Intent myIntent = new Intent(getActivity(), KChildSmartRegisterActivity.class); + Intent myIntent = new Intent(getActivity(), KFPSmartRegisterActivity.class); if (data != null) { myIntent.putExtra("org.smartregister.indonesia.face.face_mode", true); myIntent.putExtra("org.smartregister.indonesia.face.base_id", data.getStringExtra("org.smartregister.indonesia.face.base_id")); diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/MotherSmartRegisterFragment.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/MotherSmartRegisterFragment.java index cdb8f01..0697763 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/MotherSmartRegisterFragment.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/MotherSmartRegisterFragment.java @@ -20,7 +20,7 @@ import org.smartregister.Context; import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.activity.KMotherDetailActivity; -import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity; +import org.smartregister.bidan_cloudant.activity.KMotherSmartRegisterActivity; import org.smartregister.bidan_cloudant.activity.LoginActivity; import org.smartregister.bidan_cloudant.libs.FlurryFacade; import org.smartregister.bidan_cloudant.option.KICommonObjectFilterOption; @@ -176,7 +176,7 @@ protected SmartRegisterClientsProvider clientsProvider() { } private DialogOption[] getEditOptions() { - return ((KChildSmartRegisterActivity)getActivity()).getEditOptions(); + return ((KMotherSmartRegisterActivity)getActivity()).getEditOptions(); } @Override @@ -272,7 +272,8 @@ public void startRegistration() { ft.addToBackStack(null); LocationSelectorDialogFragment - .newInstance((KChildSmartRegisterActivity) getActivity(), new EditDialogOptionModel(), context().anmLocationController().get(), "registrasi_ibu") + .newInstance((KMotherSmartRegisterActivity) getActivity(), + new EditDialogOptionModel(), context().anmLocationController().get(), "registrasi_ibu") .show(ft, locationDialogTAG); } @@ -305,12 +306,15 @@ private void showProfileView(ECClient client) { private String KiSortByNameAZ() { return " namaBayi ASC"; } + private String KiSortByNameZA() { return " namaBayi DESC"; } + private String KiSortByAgeASC() { return " tanggalLahirAnak DESC"; } + private String KiSortByAgeDESC() { return " tanggalLahirAnak ASC"; } @@ -318,6 +322,7 @@ private String KiSortByAgeDESC() { private String KiSortByAge() { return " umur DESC"; } + private String KiSortByNoIbu() { return " noIbu ASC"; } @@ -598,7 +603,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data){ if (requestCode == 2 ) { if (resultCode != 0) { - Intent myIntent = new Intent(getActivity(), KChildSmartRegisterActivity.class); + Intent myIntent = new Intent(getActivity(), KMotherSmartRegisterActivity.class); if (data != null) { myIntent.putExtra("org.smartregister.indonesia.face.face_mode", true); myIntent.putExtra("org.smartregister.indonesia.face.base_id", data.getStringExtra("org.smartregister.indonesia.face.base_id")); diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/PNCSmartRegisterFragment.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/PNCSmartRegisterFragment.java index d1ee55c..3f5e393 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/PNCSmartRegisterFragment.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/fragment/PNCSmartRegisterFragment.java @@ -20,7 +20,7 @@ import org.smartregister.Context; import org.smartregister.bidan_cloudant.R; import org.smartregister.bidan_cloudant.activity.KPNCDetailActivity; -import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity; +import org.smartregister.bidan_cloudant.activity.KPNCSmartRegisterActivity; import org.smartregister.bidan_cloudant.activity.LoginActivity; import org.smartregister.bidan_cloudant.libs.FlurryFacade; import org.smartregister.bidan_cloudant.option.KICommonObjectFilterOption; @@ -181,7 +181,7 @@ protected SmartRegisterClientsProvider clientsProvider() { } private DialogOption[] getEditOptions() { - return ((KChildSmartRegisterActivity)getActivity()).getEditOptions(); + return ((KPNCSmartRegisterActivity)getActivity()).getEditOptions(); } @Override @@ -314,7 +314,7 @@ public void startRegistration() { ft.addToBackStack(null); LocationSelectorDialogFragment - .newInstance((KChildSmartRegisterActivity) getActivity(), new EditDialogOptionModel(), context().anmLocationController().get(), "registrasi_ibu") + .newInstance((KPNCSmartRegisterActivity) getActivity(), new EditDialogOptionModel(), context().anmLocationController().get(), "registrasi_ibu") .show(ft, locationDialogTAG); } @@ -640,7 +640,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data){ if (requestCode == 2 ) { if (resultCode != 0) { - Intent myIntent = new Intent(getActivity(), KChildSmartRegisterActivity.class); + Intent myIntent = new Intent(getActivity(), KPNCSmartRegisterActivity.class); if (data != null) { myIntent.putExtra("org.smartregister.indonesia.face.face_mode", true); myIntent.putExtra("org.smartregister.indonesia.face.base_id", data.getStringExtra("org.smartregister.indonesia.face.base_id")); diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/option/VaksinatorSearchOption.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/option/VaksinatorSearchOption.java index 6a5a81c..ac86959 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/option/VaksinatorSearchOption.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/option/VaksinatorSearchOption.java @@ -1,8 +1,8 @@ package org.smartregister.bidan_cloudant.option; import org.smartregister.Context; -import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.bidan_cloudant.R; +import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.view.contract.SmartRegisterClient; import org.smartregister.view.dialog.FilterOption; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/option/VaksinatorServiceModeOption.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/option/VaksinatorServiceModeOption.java index 4935a3c..1e74fe4 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/option/VaksinatorServiceModeOption.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/option/VaksinatorServiceModeOption.java @@ -1,8 +1,8 @@ package org.smartregister.bidan_cloudant.option; import org.smartregister.Context; -import org.smartregister.provider.SmartRegisterClientsProvider; import org.smartregister.bidan_cloudant.R; +import org.smartregister.provider.SmartRegisterClientsProvider; import org.smartregister.view.dialog.ServiceModeOption; import static org.smartregister.view.activity.SecuredNativeSmartRegisterActivity.ClientsHeaderProvider; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/provider/ChildSmartClientsProvider.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/provider/ChildSmartClientsProvider.java index 10330a6..18bb5a9 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/provider/ChildSmartClientsProvider.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/provider/ChildSmartClientsProvider.java @@ -8,12 +8,12 @@ import android.widget.AbsListView; import android.widget.TextView; +import org.smartregister.bidan_cloudant.R; import org.smartregister.commonregistry.AllCommonsRepository; import org.smartregister.commonregistry.CommonPersonObject; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.commonregistry.CommonRepository; import org.smartregister.cursoradapter.SmartRegisterCLientsProviderForCursorAdapter; -import org.smartregister.bidan_cloudant.R; import org.smartregister.repository.DetailsRepository; import org.smartregister.service.AlertService; import org.smartregister.view.contract.SmartRegisterClient; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/provider/VaksinatorSmartClientsProvider.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/provider/VaksinatorSmartClientsProvider.java index 0714257..ebf0b5c 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/provider/VaksinatorSmartClientsProvider.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/provider/VaksinatorSmartClientsProvider.java @@ -1,44 +1,6 @@ package org.smartregister.bidan_cloudant.provider; - -import android.app.Activity; -import android.content.Context; -import android.graphics.drawable.Drawable; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.AbsListView; -import android.widget.Button; -import android.widget.FrameLayout; -import android.widget.ImageButton; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.TextView; - -import org.smartregister.commonregistry.AllCommonsRepository; -import org.smartregister.commonregistry.CommonPersonObject; -import org.smartregister.commonregistry.CommonPersonObjectClient; -import org.smartregister.commonregistry.CommonPersonObjectController; -import org.smartregister.cursoradapter.SmartRegisterCLientsProviderForCursorAdapter; -import org.smartregister.repository.DetailsRepository; -import org.smartregister.service.AlertService; -import org.smartregister.bidan_cloudant.R; -import org.smartregister.view.activity.DrishtiApplication; -import org.smartregister.view.contract.SmartRegisterClient; -import org.smartregister.view.contract.SmartRegisterClients; -import org.smartregister.view.dialog.FilterOption; -import org.smartregister.view.dialog.ServiceModeOption; -import org.smartregister.view.dialog.SortOption; -import org.smartregister.view.viewholder.OnClickFormLauncher; - -import java.io.File; -import java.text.SimpleDateFormat; - -import util.formula.Support; - -import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; - /** * Created by user on 2/12/15. */ diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/repository/BidanRepository.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/repository/BidanRepository.java index 9c67824..c52a6cc 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/repository/BidanRepository.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/repository/BidanRepository.java @@ -6,10 +6,10 @@ import net.sqlcipher.database.SQLiteDatabase; import org.apache.commons.lang3.StringUtils; +import org.smartregister.bidan_cloudant.application.BidanApplication; import org.smartregister.commonregistry.CommonFtsObject; import org.smartregister.repository.EventClientRepository; import org.smartregister.repository.Repository; -import org.smartregister.bidan_cloudant.application.BidanApplication; import java.util.ArrayList; import java.util.LinkedHashSet; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/repository/UniqueIdRepository.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/repository/UniqueIdRepository.java index 166f098..865dddf 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/repository/UniqueIdRepository.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/repository/UniqueIdRepository.java @@ -9,8 +9,8 @@ import org.smartregister.bidan_cloudant.application.BidanApplication; import org.smartregister.bidan_cloudant.domain.UniqueId; -import org.smartregister.repository.Repository; import org.smartregister.repository.BaseRepository; +import org.smartregister.repository.Repository; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/utils/Config.java b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/utils/Config.java index 974cad6..ffade5d 100644 --- a/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/utils/Config.java +++ b/bidan-cloudant/src/main/java/org/smartregister/bidan_cloudant/utils/Config.java @@ -2,9 +2,6 @@ import android.content.Context; import android.content.res.AssetManager; -import android.view.LayoutInflater; -import android.view.View; - import java.io.IOException; import java.io.InputStream; diff --git a/bidan-cloudant/src/main/res/layout/mother_detail_profile.xml b/bidan-cloudant/src/main/res/layout/mother_detail_profile.xml index 33e469b..f6de40b 100644 --- a/bidan-cloudant/src/main/res/layout/mother_detail_profile.xml +++ b/bidan-cloudant/src/main/res/layout/mother_detail_profile.xml @@ -160,16 +160,16 @@ android:gravity="center" android:layout_weight="1" > - + + + + + + + + + +