Skip to content

Commit

Permalink
Merge branch 'master' into medium-date-error-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
k4wel committed Jan 28, 2017
2 parents 7b9e0dc + 5dc42de commit 69b2ea4
Show file tree
Hide file tree
Showing 90 changed files with 4,135 additions and 1,506 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {

// App dependencies
supportLibraryVersion = '23.1.1'
playServicesVersion = '8.3.0'
playServicesVersion = '10.0.1'
mapUtilsServices = '0.4.2'
daggerVersion = '2.2'
raizLabsDBFlow = '3.1.1'
Expand Down
2 changes: 2 additions & 0 deletions mifosng-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ dependencies {
compile "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:design:$rootProject.supportLibraryVersion"
compile "com.google.android.gms:play-services-places:$rootProject.playServicesVersion"
compile "com.google.android.gms:play-services-location:$rootProject.playServicesVersion"
compile "com.google.android.gms:play-services-maps:$rootProject.playServicesVersion"
compile "com.google.maps.android:android-maps-utils:$rootProject.mapUtilsServices"
compile "com.android.support.test.espresso:espresso-idling-resource:$rootProject.espressoVersion"

Expand Down
19 changes: 19 additions & 0 deletions mifosng-android/src/debug/res/values/google_maps_api.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<resources>
<!--
TODO: Before you run your application, you need a Google Maps API key.
To get one, follow this link, follow the directions and press "Create" at the end:
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=2F:8C:E9:C7:28:AC:F6:B9:C5:07:50:B3:28:74:2D:53:91:C0:B3:03%3Bcom.mifos.mifosxdroid.activity.pinpointclient
You can also add your credentials to an existing key, using this line:
2F:8C:E9:C7:28:AC:F6:B9:C5:07:50:B3:28:74:2D:53:91:C0:B3:03;com.mifos.mifosxdroid.activity.pinpointclient
Alternatively, follow the directions here:
https://developers.google.com/maps/documentation/android/start#get-key
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyAZTZqvDGyyw21z2Ee7N-dE_WuZQwKL0bs</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void testViewsVisible() throws InterruptedException {
onView(withId(R.id.cb_center_active_status))
.perform(scrollTo())
.check(matches(isDisplayed()));
onView(withId(R.id.bt_submit))
onView(withId(R.id.btn_submit))
.perform(scrollTo())
.check(matches(isDisplayed()));

Expand Down Expand Up @@ -155,7 +155,7 @@ public void testCreateCenter() throws InterruptedException {
.check(matches(withText(currentDate)));

// submit
onView(withId(R.id.bt_submit))
onView(withId(R.id.btn_submit))
.perform(scrollTo(), click());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private void changeBirthDate(final String dateOfBirth) throws InterruptedExcepti
onView(withId(R.id.tv_dateofbirth)).perform(scrollTo());
onView(withId(R.id.tv_dateofbirth)).perform(click());
Thread.sleep(1000);
assertTrue(createNewClientFragment.newDatePicker.isAdded());
assertTrue(createNewClientFragment.datePickerDateOfBirth.isAdded());

// update date and close date picker
dashboardActivity.runOnUiThread(new Runnable() {
Expand All @@ -120,7 +120,7 @@ public void run() {
createNewClientFragment.onDatePicked(dateOfBirth);
}
});
createNewClientFragment.newDatePicker.dismiss();
createNewClientFragment.datePickerDateOfBirth.dismiss();
Thread.sleep(1000);
}

Expand All @@ -129,7 +129,7 @@ private void changeSubmissionDate(final String submissionDate) throws Interrupte
onView(withId(R.id.tv_submission_date)).perform(scrollTo());
onView(withId(R.id.tv_submission_date)).perform(click());
Thread.sleep(1000);
assertTrue(createNewClientFragment.mfDatePicker.isAdded());
assertTrue(createNewClientFragment.datePickerSubmissionDate.isAdded());

// update date and close date picker
dashboardActivity.runOnUiThread(new Runnable() {
Expand All @@ -138,7 +138,7 @@ public void run() {
createNewClientFragment.onDatePicked(submissionDate);
}
});
createNewClientFragment.mfDatePicker.dismiss();
createNewClientFragment.datePickerSubmissionDate.dismiss();
Thread.sleep(1000);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void testViewsVisible() throws InterruptedException {
onView(withId(R.id.cb_group_active_status))
.perform(scrollTo())
.check(matches(isDisplayed()));
onView(withId(R.id.bt_submit))
onView(withId(R.id.btn_submit))
.perform(scrollTo())
.check(matches(isDisplayed()));

Expand Down Expand Up @@ -172,7 +172,7 @@ public void testCreateGroup() throws InterruptedException {
.check(matches(withText(currentDate)));

// submit
onView(withId(R.id.bt_submit))
onView(withId(R.id.btn_submit))
.perform(scrollTo(), click());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.mifos.mifosxdroid.ClientListActivity;
import com.mifos.mifosxdroid.GroupListActivity;
import com.mifos.mifosxdroid.R;
import com.mifos.mifosxdroid.activity.PathTrackingActivity;
import com.mifos.mifosxdroid.activity.pathtracking.PathTrackingActivity;
import com.mifos.mifosxdroid.offline.offlinedashbarod.OfflineDashboardFragment;
import com.mifos.mifosxdroid.online.CentersActivity;
import com.mifos.mifosxdroid.online.DashboardActivity;
Expand Down
39 changes: 25 additions & 14 deletions mifosng-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<application
android:name="com.mifos.App"
android:allowBackup="false"
Expand All @@ -22,6 +26,18 @@
android:theme="@style/MaterialAppTheme"
android:supportsRtl="true">

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<meta-data
android:name="com.crashlytics.ApiKey"
android:value="b781afbde2e7db1df8455861d3f5d59c158f3bff" />

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />

<activity
android:name=".SplashScreenActivity"
android:label="@string/app_name"
Expand Down Expand Up @@ -85,10 +101,15 @@
<activity
android:name=".activity.pinpointclient.PinpointClientActivity"
android:label="@string/pinpoint"
android:screenOrientation="portrait" />
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity
android:name=".activity.PathTrackingActivity"
android:name=".activity.pathtracking.PathTrackingActivity"
android:label="@string/track_path"
android:screenOrientation="portrait" />

Expand All @@ -110,19 +131,9 @@
android:screenOrientation="portrait"/>


<service android:name=".LocationService" />

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<meta-data
android:name="com.crashlytics.ApiKey"
android:value="b781afbde2e7db1df8455861d3f5d59c158f3bff" />
<service android:name=".activity.pathtracking.PathTrackingService"
android:exported="false"/>

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyAfMi31d35olEcgYDRTB28gXV8kbH7LOMw" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.mifos.api.services.ClientService;
import com.mifos.api.services.DataTableService;
import com.mifos.api.services.DocumentService;
import com.mifos.api.services.GpsCoordinatesService;
import com.mifos.api.services.GroupService;
import com.mifos.api.services.LoanService;
import com.mifos.api.services.OfficeService;
Expand Down Expand Up @@ -48,7 +47,6 @@ public class BaseApiManager {
private static SavingsAccountService savingsApi;
private static ChargeService chargeApi;
private static SearchService searchApi;
private static GpsCoordinatesService gpsApi;
private static GroupService groupApi;
private static DocumentService documentApi;
private static OfficeService officeApi;
Expand All @@ -68,7 +66,6 @@ public static void init() {
loanApi = createApi(LoanService.class);
savingsApi = createApi(SavingsAccountService.class);
searchApi = createApi(SearchService.class);
gpsApi = createApi(GpsCoordinatesService.class);
groupApi = createApi(GroupService.class);
documentApi = createApi(DocumentService.class);
officeApi = createApi(OfficeService.class);
Expand Down Expand Up @@ -128,10 +125,6 @@ public SearchService getSearchApi() {
return searchApi;
}

public GpsCoordinatesService getGpsApi() {
return gpsApi;
}

public GroupService getGroupApi() {
return groupApi;
}
Expand Down
20 changes: 1 addition & 19 deletions mifosng-android/src/main/java/com/mifos/api/DataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import com.google.gson.JsonArray;
import com.mifos.api.datamanager.DataManagerClient;
import com.mifos.api.model.CollectionSheetPayload;
import com.mifos.api.model.GpsCoordinatesRequest;
import com.mifos.api.model.GpsCoordinatesResponse;
import com.mifos.api.model.Payload;
import com.mifos.api.model.SaveResponse;
import com.mifos.objects.User;
import com.mifos.objects.user.User;
import com.mifos.objects.accounts.loan.LoanApproval;
import com.mifos.objects.accounts.loan.LoanDisbursement;
import com.mifos.objects.accounts.loan.LoanWithAssociations;
Expand Down Expand Up @@ -234,20 +232,4 @@ public Observable<GenericResponse> approveSavingsApplication(int savingsAccountI
return mBaseApiManager.getSavingsApi().approveSavingsApplication(
savingsAccountId, savingsApproval);
}


/**
* GPS API
*/
public Observable<GpsCoordinatesResponse> sendGpsData(
int clientId, GpsCoordinatesRequest gpsCoordinatesRequest) {
return mBaseApiManager.getGpsApi().setGpsCoordinates(clientId, gpsCoordinatesRequest);
}

public Observable<GpsCoordinatesResponse> updateGpsData(int client,
GpsCoordinatesRequest request) {
return mBaseApiManager.getGpsApi().updateGpsCoordinates(client, request);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import com.mifos.api.BaseApiManager;
import com.mifos.api.GenericResponse;
import com.mifos.api.local.databasehelper.DatabaseHelperClient;
import com.mifos.objects.client.ClientPayload;
import com.mifos.objects.accounts.ClientAccounts;
import com.mifos.objects.client.Client;
import com.mifos.objects.client.ClientAddressRequest;
import com.mifos.objects.client.ClientAddressResponse;
import com.mifos.objects.client.ClientPayload;
import com.mifos.objects.client.Page;
import com.mifos.objects.noncore.Identifier;
import com.mifos.objects.noncore.IdentifierPayload;
Expand Down Expand Up @@ -192,7 +194,7 @@ public Observable<ResponseBody> deleteClientImage(int clientId) {
* The response of the updating the client image can be true or false its depends upon the
* network and right choice image file.
*
* @param id Client Id
* @param id Client Id
* @param file MultipartBody of the Image file
* @return ResponseBody is the Retrofit 2 response
*/
Expand Down Expand Up @@ -268,6 +270,7 @@ public Observable<? extends Client> call(Client client) {

/**
* Loading All Client payload from database to sync to the server
*
* @return List<ClientPayload></>
*/
public Observable<List<ClientPayload>> getAllDatabaseClientPayload() {
Expand All @@ -278,6 +281,7 @@ public Observable<List<ClientPayload>> getAllDatabaseClientPayload() {
* This method will called when user is syncing the client created from Database.
* whenever a client is synced then request goes to Database to delete that client form
* Database and reload the list from Database and update the list in UI
*
* @param id of the clientPayload in Database
* @return List<ClientPayload></>
*/
Expand Down Expand Up @@ -308,7 +312,7 @@ public Observable<List<Identifier>> getClientIdentifiers(int clientId) {
/**
* This Method is, for creating the Client Identifier.
*
* @param clientId Client Id
* @param clientId Client Id
* @param identifierPayload IdentifierPayload
* @return GenericResponse
*/
Expand All @@ -330,11 +334,62 @@ public Observable<IdentifierTemplate> getClientIdentifierTemplate(int clientId)
/**
* This Method is for deleting the Client Identifier.
*
* @param clientId Client Id
* @param clientId Client Id
* @param identifierId Identifier Id
* @return GenericResponse
*/
public Observable<GenericResponse> deleteClientIdentifier(int clientId, int identifierId) {
return mBaseApiManager.getClientsApi().deleteClientIdentifier(clientId, identifierId);
}

/**
* This Method is fetching the Client Pinpoint location from the DataTable
* "client_pinpoint_location"
*
* @param clientId Client Id
* @return ClientAddressResponse
*/
public Observable<List<ClientAddressResponse>> getClientPinpointLocations(int clientId) {
return mBaseApiManager.getClientsApi().getClientPinpointLocations(clientId);
}

/**
* This Method is adding the new address in the DataTable "client_pinpoint_location"
*
* @param clientId Client Id
* @param address Client Address
* @return GenericResponse
*/
public Observable<GenericResponse> addClientPinpointLocation(int clientId,
ClientAddressRequest address) {
return mBaseApiManager.getClientsApi().addClientPinpointLocation(clientId, address);
}

/**
* This Method is deleting the client address from the DataTable "client_pinpoint_location"
*
* @param apptableId
* @param datatableId
* @return GenericResponse
*/
public Observable<GenericResponse> deleteClientAddressPinpointLocation(int apptableId,
int datatableId) {
return mBaseApiManager.getClientsApi()
.deleteClientPinpointLocation(apptableId, datatableId);
}

/**
* This Method is updating the client address from the DataTable "client_pinpoint_location"
*
* @param apptableId
* @param datatableId
* @param address Client Address
* @return GenericResponse
*/
public Observable<GenericResponse> updateClientPinpointLocation(int apptableId,
int datatableId,
ClientAddressRequest address) {
return mBaseApiManager.getClientsApi().updateClientPinpointLocation(
apptableId, datatableId, address);
}
}
Loading

0 comments on commit 69b2ea4

Please sign in to comment.