Browse Source

Before Changing Dialog to bottom sheet dialog

master
preyearegmi 6 years ago
parent
commit
414d34bf73
  1. 21
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/payoutmode/PayoutModeBranchListingDialog.java
  2. 1
      app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/payoutmode/PayoutModeSendMoneyFragment.java

21
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/payoutmode/PayoutModeBranchListingDialog.java

@ -36,6 +36,8 @@ public class PayoutModeBranchListingDialog extends DialogFragment implements Vie
private Window window; private Window window;
private boolean windowHieghtNotFixed=true; private boolean windowHieghtNotFixed=true;
private TextView dialogTitle; private TextView dialogTitle;
private final String NO_BRANCH_FOUND="Sorry, no branch found.";
private final String SEARCH_FOR_BRANCH="Type to search branches.";
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
@ -46,13 +48,14 @@ public class PayoutModeBranchListingDialog extends DialogFragment implements Vie
cancelButton = view.findViewById(R.id.iv_cancel); cancelButton = view.findViewById(R.id.iv_cancel);
dialogTitle = view.findViewById(R.id.dialog_title_txt); dialogTitle = view.findViewById(R.id.dialog_title_txt);
searchEditTextView = view.findViewById(R.id.searchEditText); searchEditTextView = view.findViewById(R.id.searchEditText);
showCountryNotFoundView(true,SEARCH_FOR_BRANCH);
builder.setView(view); builder.setView(view);
Dialog dialog = builder.create(); Dialog dialog = builder.create();
try { try {
this.window = dialog.getWindow(); this.window = dialog.getWindow();
window.setBackgroundDrawableResource(R.drawable.ic_rounded_country_listing_gray); window.setBackgroundDrawableResource(R.drawable.ic_rounded_country_listing_gray);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
} catch (NullPointerException e) { } catch (NullPointerException e) {
@ -77,12 +80,6 @@ public class PayoutModeBranchListingDialog extends DialogFragment implements Vie
this.listener = listener; this.listener = listener;
} }
public void setCountryData(List<BranchList> data) {
if (data != null) {
this.data = data;
}
}
@Override @Override
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
@ -117,10 +114,9 @@ public class PayoutModeBranchListingDialog extends DialogFragment implements Vie
searchEditTextView.removeTextChangedListener(this); searchEditTextView.removeTextChangedListener(this);
} }
private void showCountryNotFoundView(boolean action) {
private void showCountryNotFoundView(boolean action,String message) {
if (action) { if (action) {
int rvHeight = countryListRv.getHeight();
noCountryFoundView.setHeight(rvHeight);
noCountryFoundView.setHint(message);
countryListRv.setVisibility(View.INVISIBLE); countryListRv.setVisibility(View.INVISIBLE);
noCountryFoundView.setVisibility(View.VISIBLE); noCountryFoundView.setVisibility(View.VISIBLE);
} else { } else {
@ -156,9 +152,10 @@ public class PayoutModeBranchListingDialog extends DialogFragment implements Vie
} }
} }
if (searchedData.size() > 0) if (searchedData.size() > 0)
showCountryNotFoundView(false);
showCountryNotFoundView(false,NO_BRANCH_FOUND);
else else
showCountryNotFoundView(true);
showCountryNotFoundView(false,SEARCH_FOR_BRANCH);
payoutModeBranchListingRvAdapter.setData(searchedData); payoutModeBranchListingRvAdapter.setData(searchedData);
} else } else

1
app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/payoutmode/PayoutModeSendMoneyFragment.java

@ -296,7 +296,6 @@ public class PayoutModeSendMoneyFragment extends BaseFragment implements SendMon
private void showBranchListInDialog() { private void showBranchListInDialog() {
if (payoutModeBranchListingDialog == null) if (payoutModeBranchListingDialog == null)
payoutModeBranchListingDialog = new PayoutModeBranchListingDialog(); payoutModeBranchListingDialog = new PayoutModeBranchListingDialog();
payoutModeBranchListingDialog.setCountryData(this.selectedBank.getBranchList());
payoutModeBranchListingDialog.setListener(this); payoutModeBranchListingDialog.setListener(this);
payoutModeBranchListingDialog.show(getActivity().getFragmentManager(), "BranchListingFragment"); payoutModeBranchListingDialog.show(getActivity().getFragmentManager(), "BranchListingFragment");
} }

Loading…
Cancel
Save