diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d28cf451..6b349d31 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -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"> diff --git a/app/src/main/java/org/apache/fineract/data/remote/BaseUrl.java b/app/src/main/java/org/apache/fineract/data/remote/BaseUrl.java index 95fee4b5..a609842f 100755 --- a/app/src/main/java/org/apache/fineract/data/remote/BaseUrl.java +++ b/app/src/main/java/org/apache/fineract/data/remote/BaseUrl.java @@ -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 diff --git a/app/src/main/java/org/apache/fineract/ui/online/customers/createcustomer/formcustomeraddress/FormCustomerAddressFragment.java b/app/src/main/java/org/apache/fineract/ui/online/customers/createcustomer/formcustomeraddress/FormCustomerAddressFragment.java index f3ba64c7..b4c446fb 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/customers/createcustomer/formcustomeraddress/FormCustomerAddressFragment.java +++ b/app/src/main/java/org/apache/fineract/ui/online/customers/createcustomer/formcustomeraddress/FormCustomerAddressFragment.java @@ -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 diff --git a/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java b/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java index b34f58e1..ab855fa6 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java +++ b/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java @@ -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; @@ -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) { diff --git a/app/src/main/java/org/apache/fineract/utils/DateUtils.java b/app/src/main/java/org/apache/fineract/utils/DateUtils.java index 172bfef0..55339541 100644 --- a/app/src/main/java/org/apache/fineract/utils/DateUtils.java +++ b/app/src/main/java/org/apache/fineract/utils/DateUtils.java @@ -11,7 +11,7 @@ /** * @author Rajan Maurya - * On 06/07/17. + * On 06/07/17. */ public class DateUtils { @@ -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()); } diff --git a/app/src/main/res/xml/network_security_config.xml b/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 00000000..36935823 --- /dev/null +++ b/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,6 @@ + + + + buffalo.mifos.io + + \ No newline at end of file