Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Fix: Change base URL to new FineractCN demo instance and fix all the …
Browse files Browse the repository at this point in the history
…related bugs
  • Loading branch information
jawidMuhammadi committed Jun 18, 2020
1 parent 2af08b0 commit 91690b6
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 17 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
android:allowBackup="true"
android:icon="@drawable/launcher_image"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/AppTheme">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/
public class BaseUrl {

public static final String PROTOCOL_HTTPS = "https://";
public static final String API_ENDPOINT = "pilot.kuelap.io";
public static final String PROTOCOL_HTTPS = "http://";
public static final String API_ENDPOINT = "buffalo.mifos.io:4200";
public static final String PORT = "80";
// "/" in the last of the base url always

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,18 @@ public void showUserInterface() {

public void showPreviousAddress() {
Address address = customer.getAddress();
etStreet.setText(address.getStreet());
etCity.setText(address.getCity());
if (address.getPostalCode() != null) {
etPostalCode.setText(address.getPostalCode());
if (address != null) {
etStreet.setText(address.getStreet());
etCity.setText(address.getCity());
if (address.getPostalCode() != null) {
etPostalCode.setText(address.getPostalCode());
}
etCountry.setText(address.getCountry());
if (address.getRegion() != null) {
etRegion.setText(address.getRegion());
}
}
etCountry.setText(address.getCountry());
showTextInputLayoutError(tilCountry, null);
if (address.getRegion() != null) {
etRegion.setText(address.getRegion());
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;

import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;

import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -246,14 +250,16 @@ public void showCustomerDetails(Customer customer) {

Address address = customer.getAddress();
StringBuilder addressBuilder = new StringBuilder();
addressBuilder
.append(address.getStreet()).append(", ")
.append(address.getCity()).append(", ");
if (address.getPostalCode() != null) {
if (address != null) {
addressBuilder.append(address.getStreet()).append(", ")
.append(address.getCity()).append(", ");

addressBuilder.append(address.getPostalCode());
addressBuilder.append(", ");

addressBuilder.append(address.getCountry());
}
addressBuilder.append(address.getCountry());

tvAddress.setText(addressBuilder);

if (customer.getContactDetails().size() == 0) {
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/org/apache/fineract/utils/DateUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/**
* @author Rajan Maurya
* On 06/07/17.
* On 06/07/17.
*/
public class DateUtils {

Expand Down Expand Up @@ -61,7 +61,8 @@ public static String getDate(String dateString, String inputFormat, String outFo
SimpleDateFormat dateFormat = new SimpleDateFormat(inputFormat, Locale.ENGLISH);
Date date = new Date();
try {
date = dateFormat.parse(dateString);
if (dateString != null)
date = dateFormat.parse(dateString);
} catch (ParseException e) {
Log.d(LOG_TAG, e.getLocalizedMessage());
}
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">buffalo.mifos.io</domain>
</domain-config>
</network-security-config>

0 comments on commit 91690b6

Please sign in to comment.