diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryFlagMapper.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryFlagMapper.java index 02769092..a372b748 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryFlagMapper.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryFlagMapper.java @@ -32,6 +32,11 @@ public class CountryFlagMapper { return R.drawable.flag_srilanka; case "SG": return R.drawable.flag_singapore; + case "VN": + return R.drawable.flag_vietnam; + case "RU": + return R.drawable.flag_vietnam; + default: return -1; } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryListingDialog.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryListingDialog.java index d975e387..f2570aef 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryListingDialog.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryListingDialog.java @@ -10,6 +10,7 @@ import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.view.Window; +import android.view.WindowManager; import android.widget.EditText; import com.gmeremit.online.gmeremittance_native.R; @@ -28,6 +29,8 @@ public class CountryListingDialog extends DialogFragment implements View.OnClick private EditText noCountryFoundView; private EditText searchEditTextView; private CountryListingRvAdapter countryListingRvAdapter; + private Window window; + private boolean windowHieghtNotFixed=true; @Override public Dialog onCreateDialog(Bundle savedInstanceState) { @@ -42,8 +45,9 @@ public class CountryListingDialog extends DialogFragment implements View.OnClick Dialog dialog = builder.create(); try { - Window window = dialog.getWindow(); + this.window = dialog.getWindow(); window.setBackgroundDrawableResource(R.drawable.ic_rounded_white); + } catch (NullPointerException e) { } @@ -72,6 +76,22 @@ public class CountryListingDialog extends DialogFragment implements View.OnClick } } + @Override + public void onStart() { + super.onStart(); + if(windowHieghtNotFixed&&window!=null) + { + WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); + lp.copyFrom(window.getAttributes()); + lp.height = WindowManager.LayoutParams.MATCH_PARENT; + float multi = getActivity().getResources().getDisplayMetrics().density; + lp.verticalMargin=10*multi; + window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); + window.setAttributes(lp); + windowHieghtNotFixed=false; + } + } + @Override public void onClick(View v) { switch (v.getId()) { @@ -93,10 +113,10 @@ public class CountryListingDialog extends DialogFragment implements View.OnClick if (action) { int rvHeight = countryListRv.getHeight(); noCountryFoundView.setHeight(rvHeight); - countryListRv.setVisibility(View.GONE); + countryListRv.setVisibility(View.INVISIBLE); noCountryFoundView.setVisibility(View.VISIBLE); } else { - noCountryFoundView.setVisibility(View.GONE); + noCountryFoundView.setVisibility(View.INVISIBLE); countryListRv.setVisibility(View.VISIBLE); } } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/adapter/PaymentModeRvAdapter.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/adapter/PaymentModeRvAdapter.java index 6516268e..9b218a71 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/adapter/PaymentModeRvAdapter.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/adapter/PaymentModeRvAdapter.java @@ -40,9 +40,9 @@ public class PaymentModeRvAdapter extends RecyclerView.Adapter0) + if(position!=-1) { this.selectedItemPosition=position; if(listener!=null) diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/PaymentModeMapper.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/PaymentModeMapper.java index 2d6bbaac..3d2f35b8 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/PaymentModeMapper.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/model/PaymentModeMapper.java @@ -14,9 +14,12 @@ public class PaymentModeMapper { case "2": return R.drawable.ic_bank_image; - case "3": + case "12": return R.drawable.ic_home_delivery; + case "13": + return R.drawable.ic_menu_wallet; + default: return -1; diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java index 06a7ea28..b595ab5d 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java @@ -77,7 +77,7 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod private void performDefaultAction(Bundle savedInstanceState) { toolbarTitle.setText("Today's Rate"); - mockData(); +// mockData(); this.presenter.getAllData(); } @@ -101,10 +101,21 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod this.mockedData.add(new CountryPaymentService("Nepal", "NP", "123", "NPR", paymentModeList)); paymentModeRvAdapter.setData(paymentModeList); paymentModeRvAdapter.setSelectedItem(0); + showPaymentService(paymentModeList); } + + private void showPaymentService(List paymentModeList) + { + if(paymentModeRvAdapter!=null) + { + paymentModeRvAdapter.setData(paymentModeList); + paymentModeRvAdapter.setSelectedItem(0); + } + } + private void setupRv() { paymentModeRvAdapter = new PaymentModeRvAdapter(this); paymentModeRv.setAdapter(paymentModeRvAdapter); @@ -144,6 +155,7 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod Log.d("ExchangeRateV2", "Selected Country " + countryPaymentService.getCountryCode()); this.selectedCountryPaymentService = countryPaymentService; showSelectedRecipient(countryPaymentService.getCountryCode(), countryPaymentService.getCurrency()); + showPaymentService(countryPaymentService.getServiceAvailable()); if (this.countryListingDialog != null) this.countryListingDialog.dismiss(); } @@ -175,6 +187,7 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod this.sendMoneyEditText.setText(""); } showSelectedRecipient(defaultCountryPaymentService.getCountryCode(), defaultCountryPaymentService.getCurrency()); + showPaymentService(defaultCountryPaymentService.getServiceAvailable()); } else { @@ -186,6 +199,7 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod //We are taking first item as default as we don't have any default item enlisted CountryPaymentService firstSelectedItem=countryPaymentServiceList.get(0); showSelectedRecipient(firstSelectedItem.getCountryCode(), firstSelectedItem.getCurrency()); + showPaymentService(firstSelectedItem.getServiceAvailable()); } this.paymentServiceList = countryPaymentServiceList; diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/PaymentModeViewHolder.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/PaymentModeViewHolder.java index 9506df65..ca7e7b2a 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/PaymentModeViewHolder.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/PaymentModeViewHolder.java @@ -28,6 +28,7 @@ public class PaymentModeViewHolder extends RecyclerView.ViewHolder { public void setImage(int resId) { + if(resId!=-1) paymentModeLogo.setImageResource(resId); } diff --git a/app/src/main/res/layout/activity_exchange_method_v2.xml b/app/src/main/res/layout/activity_exchange_method_v2.xml index 3da12aa0..dd7597fe 100644 --- a/app/src/main/res/layout/activity_exchange_method_v2.xml +++ b/app/src/main/res/layout/activity_exchange_method_v2.xml @@ -128,7 +128,7 @@ android:layout_marginRight="6dp" android:orientation="horizontal" - android:layout_gravity="center" + android:layout_gravity="center_vertical|start" app:layoutManager="android.support.v7.widget.LinearLayoutManager" /> diff --git a/app/src/main/res/layout/dialog_country_listing.xml b/app/src/main/res/layout/dialog_country_listing.xml index 4ec0257b..b9e3e42f 100644 --- a/app/src/main/res/layout/dialog_country_listing.xml +++ b/app/src/main/res/layout/dialog_country_listing.xml @@ -3,6 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="@color/white" android:orientation="vertical"> + android:layout_height="wrap_content" />