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