preyearegmi
6 years ago
18 changed files with 20 additions and 1855 deletions
-
1app/src/main/java/com/gmeremit/online/gmeremittance_native/autodebitV2/view/autodebitaccountlisting/AutoDebitAccountListingV2Activity.java
-
1app/src/main/java/com/gmeremit/online/gmeremittance_native/autodebitV2/view/autodebitaccountlisting/CountryListingRvAdapter.java
-
3app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/GenericTextListingDialog.java
-
67app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/adapter/view1/NativeCountryListingRvAdapter.java
-
59app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/adapter/view1/OccupationListingRvAdapter.java
-
59app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/adapter/view1/ProvinceListingRvAdapter.java
-
59app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/adapter/view2/IDListingRvAdapter.java
-
59app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/adapter/view2/PrimaryBankListingRvAdapter.java
-
59app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/adapter/view2/SourceOfFundListingRvAdapter.java
-
109app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/view1/KYCView1Fragment.java
-
38app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/view1/NativeCountryListRvViewHolder.java
-
209app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/view1/NativeCountryListingDialog.java
-
204app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/view1/OccupationListingDialog.java
-
203app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/view1/ProvinceListingDialog.java
-
204app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/view2/IDListingDialog.java
-
133app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/view2/KYCView2Fragment.java
-
204app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/view2/PrimaryBankListingDialog.java
-
204app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/view2/SourceOfFundListingDialog.java
@ -1,67 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.adapter.view1; |
|
||||
|
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.view.LayoutInflater; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.NativeCountry; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.view.view1.NativeCountryListingDialog; |
|
||||
import com.gmeremit.online.gmeremittance_native.recipientV2.view.RecipientCountryListRvViewHolder; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class NativeCountryListingRvAdapter extends RecyclerView.Adapter<RecipientCountryListRvViewHolder> { |
|
||||
|
|
||||
private final NativeCountryListingDialog.NativeCountrySelectionListener listener; |
|
||||
private List<NativeCountry> data; |
|
||||
private boolean shouldHideflag=false; |
|
||||
|
|
||||
public NativeCountryListingRvAdapter(NativeCountryListingDialog.NativeCountrySelectionListener listener) { |
|
||||
this.data=new ArrayList<>(); |
|
||||
this.listener=listener; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@Override |
|
||||
public RecipientCountryListRvViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.countrylist_item_view, parent, false); |
|
||||
return new RecipientCountryListRvViewHolder(view); } |
|
||||
|
|
||||
@Override |
|
||||
public void onBindViewHolder(final RecipientCountryListRvViewHolder holder, int position) { |
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
if(listener!=null) |
|
||||
listener.onNativeCountrySelected(data.get(holder.getAdapterPosition())); |
|
||||
} |
|
||||
}); |
|
||||
NativeCountry countryPaymentService= data.get(position); |
|
||||
// holder.setFlagImage(CountryFlagMapper.getFlagFromCountryCode(countryPaymentService.getCode())); |
|
||||
holder.setCountryName(countryPaymentService.getText()); |
|
||||
if(shouldHideflag) |
|
||||
holder.getCountrFlagImageView().setVisibility(View.GONE); |
|
||||
} |
|
||||
|
|
||||
public void shouldHideflag(boolean action) |
|
||||
{ |
|
||||
this.shouldHideflag=action; |
|
||||
} |
|
||||
@Override |
|
||||
public int getItemCount() { |
|
||||
return data.size(); |
|
||||
} |
|
||||
|
|
||||
public void setData(List<NativeCountry> data) { |
|
||||
if(data!=null) |
|
||||
{ |
|
||||
this.data=data; |
|
||||
notifyDataSetChanged(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,59 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.adapter.view1; |
|
||||
|
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.view.LayoutInflater; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.Occupation; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.view.view1.OccupationListingDialog; |
|
||||
import com.gmeremit.online.gmeremittance_native.recipientV2.view.RecipientProvinceListRvViewHolder; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class OccupationListingRvAdapter extends RecyclerView.Adapter<RecipientProvinceListRvViewHolder> { |
|
||||
|
|
||||
private final OccupationListingDialog.OccupationSelectionListener listener; |
|
||||
private List<Occupation> data; |
|
||||
|
|
||||
public OccupationListingRvAdapter(OccupationListingDialog.OccupationSelectionListener listener) { |
|
||||
this.data=new ArrayList<>(); |
|
||||
this.listener=listener; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@Override |
|
||||
public RecipientProvinceListRvViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.provincelist_item_view, parent, false); |
|
||||
return new RecipientProvinceListRvViewHolder(view); } |
|
||||
|
|
||||
@Override |
|
||||
public void onBindViewHolder(final RecipientProvinceListRvViewHolder holder, int position) { |
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
if(listener!=null) |
|
||||
listener.onOccupationSelected(data.get(holder.getAdapterPosition())); |
|
||||
} |
|
||||
}); |
|
||||
Occupation province= data.get(position); |
|
||||
holder.setName(province.getText()); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int getItemCount() { |
|
||||
return data.size(); |
|
||||
} |
|
||||
|
|
||||
public void setData(List<Occupation> data) { |
|
||||
if(data!=null) |
|
||||
{ |
|
||||
this.data=data; |
|
||||
notifyDataSetChanged(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,59 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.adapter.view1; |
|
||||
|
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.view.LayoutInflater; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.Province; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.view.view1.ProvinceListingDialog; |
|
||||
import com.gmeremit.online.gmeremittance_native.recipientV2.view.RecipientProvinceListRvViewHolder; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class ProvinceListingRvAdapter extends RecyclerView.Adapter<RecipientProvinceListRvViewHolder> { |
|
||||
|
|
||||
private final ProvinceListingDialog.ProvinceSelectionListener listener; |
|
||||
private List<Province> data; |
|
||||
|
|
||||
public ProvinceListingRvAdapter(ProvinceListingDialog.ProvinceSelectionListener listener) { |
|
||||
this.data=new ArrayList<>(); |
|
||||
this.listener=listener; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@Override |
|
||||
public RecipientProvinceListRvViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.provincelist_item_view, parent, false); |
|
||||
return new RecipientProvinceListRvViewHolder(view); } |
|
||||
|
|
||||
@Override |
|
||||
public void onBindViewHolder(final RecipientProvinceListRvViewHolder holder, int position) { |
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
if(listener!=null) |
|
||||
listener.onProvinceSelected(data.get(holder.getAdapterPosition())); |
|
||||
} |
|
||||
}); |
|
||||
Province province= data.get(position); |
|
||||
holder.setName(province.getText()); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int getItemCount() { |
|
||||
return data.size(); |
|
||||
} |
|
||||
|
|
||||
public void setData(List<Province> data) { |
|
||||
if(data!=null) |
|
||||
{ |
|
||||
this.data=data; |
|
||||
notifyDataSetChanged(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,59 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.adapter.view2; |
|
||||
|
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.view.LayoutInflater; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.IdType; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.view.view2.IDListingDialog; |
|
||||
import com.gmeremit.online.gmeremittance_native.recipientV2.view.RecipientProvinceListRvViewHolder; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class IDListingRvAdapter extends RecyclerView.Adapter<RecipientProvinceListRvViewHolder> { |
|
||||
|
|
||||
private final IDListingDialog.IDSelectionListener listener; |
|
||||
private List<IdType> data; |
|
||||
|
|
||||
public IDListingRvAdapter(IDListingDialog.IDSelectionListener listener) { |
|
||||
this.data=new ArrayList<>(); |
|
||||
this.listener=listener; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@Override |
|
||||
public RecipientProvinceListRvViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.provincelist_item_view, parent, false); |
|
||||
return new RecipientProvinceListRvViewHolder(view); } |
|
||||
|
|
||||
@Override |
|
||||
public void onBindViewHolder(final RecipientProvinceListRvViewHolder holder, int position) { |
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
if(listener!=null) |
|
||||
listener.onIdSelected(data.get(holder.getAdapterPosition())); |
|
||||
} |
|
||||
}); |
|
||||
IdType province= data.get(position); |
|
||||
holder.setName(province.getText()); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int getItemCount() { |
|
||||
return data.size(); |
|
||||
} |
|
||||
|
|
||||
public void setData(List<IdType> data) { |
|
||||
if(data!=null) |
|
||||
{ |
|
||||
this.data=data; |
|
||||
notifyDataSetChanged(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,59 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.adapter.view2; |
|
||||
|
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.view.LayoutInflater; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.Bank; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.view.view2.PrimaryBankListingDialog; |
|
||||
import com.gmeremit.online.gmeremittance_native.recipientV2.view.RecipientProvinceListRvViewHolder; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class PrimaryBankListingRvAdapter extends RecyclerView.Adapter<RecipientProvinceListRvViewHolder> { |
|
||||
|
|
||||
private final PrimaryBankListingDialog.PrimaryBankSelectionListener listener; |
|
||||
private List<Bank> data; |
|
||||
|
|
||||
public PrimaryBankListingRvAdapter(PrimaryBankListingDialog.PrimaryBankSelectionListener listener) { |
|
||||
this.data=new ArrayList<>(); |
|
||||
this.listener=listener; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@Override |
|
||||
public RecipientProvinceListRvViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.provincelist_item_view, parent, false); |
|
||||
return new RecipientProvinceListRvViewHolder(view); } |
|
||||
|
|
||||
@Override |
|
||||
public void onBindViewHolder(final RecipientProvinceListRvViewHolder holder, int position) { |
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
if(listener!=null) |
|
||||
listener.onPrimaryBankSelected(data.get(holder.getAdapterPosition())); |
|
||||
} |
|
||||
}); |
|
||||
Bank province= data.get(position); |
|
||||
holder.setName(province.getText()); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int getItemCount() { |
|
||||
return data.size(); |
|
||||
} |
|
||||
|
|
||||
public void setData(List<Bank> data) { |
|
||||
if(data!=null) |
|
||||
{ |
|
||||
this.data=data; |
|
||||
notifyDataSetChanged(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,59 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.adapter.view2; |
|
||||
|
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.view.LayoutInflater; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.SourceOfFund; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.view.view2.SourceOfFundListingDialog; |
|
||||
import com.gmeremit.online.gmeremittance_native.recipientV2.view.RecipientProvinceListRvViewHolder; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class SourceOfFundListingRvAdapter extends RecyclerView.Adapter<RecipientProvinceListRvViewHolder> { |
|
||||
|
|
||||
private final SourceOfFundListingDialog.SourceOfFundListingListener listener; |
|
||||
private List<SourceOfFund> data; |
|
||||
|
|
||||
public SourceOfFundListingRvAdapter(SourceOfFundListingDialog.SourceOfFundListingListener listener) { |
|
||||
this.data=new ArrayList<>(); |
|
||||
this.listener=listener; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@Override |
|
||||
public RecipientProvinceListRvViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.provincelist_item_view, parent, false); |
|
||||
return new RecipientProvinceListRvViewHolder(view); } |
|
||||
|
|
||||
@Override |
|
||||
public void onBindViewHolder(final RecipientProvinceListRvViewHolder holder, int position) { |
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
if(listener!=null) |
|
||||
listener.onSourceOfFundListingSelected(data.get(holder.getAdapterPosition())); |
|
||||
} |
|
||||
}); |
|
||||
SourceOfFund province= data.get(position); |
|
||||
holder.setName(province.getText()); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int getItemCount() { |
|
||||
return data.size(); |
|
||||
} |
|
||||
|
|
||||
public void setData(List<SourceOfFund> data) { |
|
||||
if(data!=null) |
|
||||
{ |
|
||||
this.data=data; |
|
||||
notifyDataSetChanged(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,38 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.view.view1; |
|
||||
|
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.view.View; |
|
||||
import android.widget.ImageView; |
|
||||
import android.widget.TextView; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
|
|
||||
import butterknife.BindView; |
|
||||
import butterknife.ButterKnife; |
|
||||
|
|
||||
public class NativeCountryListRvViewHolder extends RecyclerView.ViewHolder { |
|
||||
|
|
||||
@BindView(R.id.countryName) |
|
||||
TextView countryNameTxtView; |
|
||||
|
|
||||
@BindView(R.id.countryFlagImageView) |
|
||||
ImageView countryImageView; |
|
||||
|
|
||||
|
|
||||
public NativeCountryListRvViewHolder(View itemView) { |
|
||||
super(itemView); |
|
||||
ButterKnife.bind(this, itemView); |
|
||||
} |
|
||||
|
|
||||
public void setFlagImage(int resId) |
|
||||
{ |
|
||||
if(resId!=-1) |
|
||||
countryImageView.setBackgroundResource(resId); |
|
||||
} |
|
||||
|
|
||||
public void setCountryName(String name) |
|
||||
{ |
|
||||
if(name!=null) |
|
||||
countryNameTxtView.setText(name); |
|
||||
} |
|
||||
} |
|
@ -1,209 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.view.view1; |
|
||||
|
|
||||
import android.app.Dialog; |
|
||||
import android.app.DialogFragment; |
|
||||
import android.content.Context; |
|
||||
import android.content.DialogInterface; |
|
||||
import android.os.Bundle; |
|
||||
import android.support.v7.app.AlertDialog; |
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.text.Editable; |
|
||||
import android.text.TextWatcher; |
|
||||
import android.util.Log; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
import android.view.Window; |
|
||||
import android.view.inputmethod.InputMethodManager; |
|
||||
import android.widget.EditText; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.customwidgets.LineDividerItemDecoration; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.adapter.view1.NativeCountryListingRvAdapter; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.NativeCountry; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class NativeCountryListingDialog extends android.support.v4.app.DialogFragment implements View.OnClickListener, TextWatcher { |
|
||||
|
|
||||
private List<NativeCountry> data; |
|
||||
private NativeCountrySelectionListener listener; |
|
||||
private RecyclerView countryListRv; |
|
||||
private View cancelButton; |
|
||||
private EditText noCountryFoundView; |
|
||||
private EditText searchEditTextView; |
|
||||
private NativeCountryListingRvAdapter countryListingRvAdapter; |
|
||||
private View searchViewContainer; |
|
||||
private boolean shouldHideFlag=false; |
|
||||
|
|
||||
|
|
||||
@Override |
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) { |
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |
|
||||
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_country_listing, null); |
|
||||
countryListRv = view.findViewById(R.id.countryListRv); |
|
||||
noCountryFoundView = view.findViewById(R.id.noCountryFoundTextView); |
|
||||
cancelButton = view.findViewById(R.id.iv_cancel); |
|
||||
searchEditTextView = view.findViewById(R.id.searchEditText); |
|
||||
searchViewContainer= view.findViewById(R.id.searchViewContainer); |
|
||||
|
|
||||
builder.setView(view); |
|
||||
|
|
||||
|
|
||||
initialize(); |
|
||||
return builder.create(); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
private void initialize() { |
|
||||
cancelButton.setOnClickListener(this); |
|
||||
searchEditTextView.setHint("Search Country"); |
|
||||
|
|
||||
searchEditTextView.addTextChangedListener(this); |
|
||||
countryListingRvAdapter = new NativeCountryListingRvAdapter(this.listener); |
|
||||
countryListingRvAdapter.setData(this.data); |
|
||||
countryListingRvAdapter.shouldHideflag(shouldHideFlag); |
|
||||
countryListRv.setAdapter(countryListingRvAdapter); |
|
||||
LineDividerItemDecoration lineDividerItemDecoration = new LineDividerItemDecoration(getActivity(), LineDividerItemDecoration.VERTICAL_LIST); |
|
||||
countryListRv.addItemDecoration(lineDividerItemDecoration); |
|
||||
|
|
||||
searchViewContainer.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
searchEditTextView.requestFocus(); |
|
||||
showKeyBoard(searchEditTextView); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void setListener(NativeCountrySelectionListener listener) { |
|
||||
this.listener = listener; |
|
||||
} |
|
||||
|
|
||||
public void setCountryData(List<NativeCountry> data) { |
|
||||
if (data != null) { |
|
||||
this.data = data; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public void hideFlag(boolean flag) |
|
||||
{ |
|
||||
this.shouldHideFlag=flag; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onStart() { |
|
||||
super.onStart(); |
|
||||
|
|
||||
Window window = getDialog().getWindow(); |
|
||||
if (window != null) { |
|
||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); |
|
||||
window.setBackgroundDrawableResource(R.drawable.ic_rounded_grey_bg_with_inset); |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
switch (v.getId()) { |
|
||||
case R.id.iv_cancel: |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
hideKeyboard(); |
|
||||
dismiss(); |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onDismiss(DialogInterface dialog) { |
|
||||
super.onDismiss(dialog); |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
searchEditTextView.removeTextChangedListener(this); |
|
||||
searchViewContainer.setOnClickListener(null); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
private void showCountryNotFoundView(boolean action) { |
|
||||
if (action) { |
|
||||
if (countryListRv.getVisibility() == View.VISIBLE) { |
|
||||
countryListRv.setVisibility(View.GONE); |
|
||||
noCountryFoundView.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} else { |
|
||||
if (countryListRv.getVisibility() != View.VISIBLE) { |
|
||||
noCountryFoundView.setVisibility(View.GONE); |
|
||||
countryListRv.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void afterTextChanged(Editable s) { |
|
||||
if (countryListingRvAdapter != null) { |
|
||||
searchForCountry(s.toString()); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private void searchForCountry(String s) { |
|
||||
if (this.data != null) { |
|
||||
if (s.length() > 0) { |
|
||||
List<NativeCountry> searchedData = new ArrayList<>(); |
|
||||
for (NativeCountry item : data) { |
|
||||
if (item.getText().toLowerCase().contains(s.toLowerCase())) { |
|
||||
searchedData.add(item); |
|
||||
} |
|
||||
} |
|
||||
if (searchedData.size() > 0) |
|
||||
showCountryNotFoundView(false); |
|
||||
else |
|
||||
showCountryNotFoundView(true); |
|
||||
countryListingRvAdapter.setData(searchedData); |
|
||||
|
|
||||
} else { |
|
||||
showCountryNotFoundView(false); |
|
||||
countryListingRvAdapter.setData(this.data); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public void hideKeyboard() { |
|
||||
// Check if no view has focus: |
|
||||
try { |
|
||||
View view = getActivity().getCurrentFocus(); |
|
||||
|
|
||||
InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); |
|
||||
} |
|
||||
catch(Exception ex) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void showKeyBoard(View view) { |
|
||||
try { |
|
||||
InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); |
|
||||
Log.d("GMEEXCEPTION", "Keyboard shown"); |
|
||||
} catch (NullPointerException e) { |
|
||||
Log.d("GMEEXCEPTION", "Null pointer while showing keyboard"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
public interface NativeCountrySelectionListener { |
|
||||
void onNativeCountrySelected(NativeCountry countryPaymentService); |
|
||||
} |
|
||||
} |
|
@ -1,204 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.view.view1; |
|
||||
|
|
||||
import android.app.Dialog; |
|
||||
import android.app.DialogFragment; |
|
||||
import android.content.Context; |
|
||||
import android.content.DialogInterface; |
|
||||
import android.os.Bundle; |
|
||||
import android.support.v7.app.AlertDialog; |
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.text.Editable; |
|
||||
import android.text.TextWatcher; |
|
||||
import android.util.Log; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
import android.view.Window; |
|
||||
import android.view.inputmethod.InputMethodManager; |
|
||||
import android.widget.EditText; |
|
||||
import android.widget.TextView; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.customwidgets.LineDividerItemDecoration; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.adapter.view1.OccupationListingRvAdapter; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.Occupation; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class OccupationListingDialog extends android.support.v4.app.DialogFragment implements View.OnClickListener, TextWatcher { |
|
||||
|
|
||||
private List<Occupation> data; |
|
||||
private OccupationSelectionListener listener; |
|
||||
private RecyclerView transferRv; |
|
||||
private View cancelButton; |
|
||||
private EditText noTransferFoundView; |
|
||||
private EditText searchEditTextView; |
|
||||
private OccupationListingRvAdapter occupationListingRvAdapter; |
|
||||
|
|
||||
private TextView dialogTitle; |
|
||||
private View searchViewContainer; |
|
||||
|
|
||||
@Override |
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) { |
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |
|
||||
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_country_listing, null); |
|
||||
transferRv = view.findViewById(R.id.countryListRv); |
|
||||
noTransferFoundView = view.findViewById(R.id.noCountryFoundTextView); |
|
||||
cancelButton = view.findViewById(R.id.iv_cancel); |
|
||||
searchEditTextView = view.findViewById(R.id.searchEditText); |
|
||||
dialogTitle = view.findViewById(R.id.dialog_title_txt); |
|
||||
searchViewContainer= view.findViewById(R.id.searchViewContainer); |
|
||||
|
|
||||
builder.setView(view); |
|
||||
initialize(); |
|
||||
|
|
||||
return builder.create(); |
|
||||
} |
|
||||
|
|
||||
private void initialize() { |
|
||||
cancelButton.setOnClickListener(this); |
|
||||
searchEditTextView.addTextChangedListener(this); |
|
||||
occupationListingRvAdapter = new OccupationListingRvAdapter(this.listener); |
|
||||
occupationListingRvAdapter.setData(this.data); |
|
||||
transferRv.setAdapter(occupationListingRvAdapter); |
|
||||
LineDividerItemDecoration lineDividerItemDecoration = new LineDividerItemDecoration(getActivity(), LineDividerItemDecoration.VERTICAL_LIST); |
|
||||
transferRv.addItemDecoration(lineDividerItemDecoration); |
|
||||
noTransferFoundView.setHint("No occupation found."); |
|
||||
dialogTitle.setText("Select Occupation"); |
|
||||
searchEditTextView.setHint("Search Occupation"); |
|
||||
|
|
||||
|
|
||||
searchViewContainer.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
searchEditTextView.requestFocus(); |
|
||||
showKeyBoard(searchEditTextView); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void setListener(OccupationSelectionListener listener) { |
|
||||
this.listener = listener; |
|
||||
} |
|
||||
|
|
||||
public void setProvinceData(List<Occupation> data) { |
|
||||
if (data != null&&data.size()>0) { |
|
||||
this.data = data; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onStart() { |
|
||||
super.onStart(); |
|
||||
Window window = getDialog().getWindow(); |
|
||||
if (window != null) { |
|
||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); |
|
||||
window.setBackgroundDrawableResource(R.drawable.ic_rounded_grey_bg_with_inset); |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
switch (v.getId()) { |
|
||||
case R.id.iv_cancel: |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
hideKeyboard(); |
|
||||
dismiss(); |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onDismiss(DialogInterface dialog) { |
|
||||
super.onDismiss(dialog); |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
searchEditTextView.removeTextChangedListener(this); |
|
||||
searchViewContainer.setOnClickListener(null); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
private void showRecipientNotFoundView(boolean action) { |
|
||||
if (action) { |
|
||||
if(transferRv.getVisibility()==View.VISIBLE) { |
|
||||
transferRv.setVisibility(View.GONE); |
|
||||
noTransferFoundView.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} else { |
|
||||
if(transferRv.getVisibility()!=View.VISIBLE) { |
|
||||
noTransferFoundView.setVisibility(View.GONE); |
|
||||
transferRv.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void afterTextChanged(Editable s) { |
|
||||
if (occupationListingRvAdapter != null) { |
|
||||
searchForCountry(s.toString()); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private void searchForCountry(String s) { |
|
||||
if (this.data != null) { |
|
||||
if (s.length() > 0) { |
|
||||
List<Occupation> searchedData = new ArrayList<>(); |
|
||||
for (Occupation item : data) { |
|
||||
if (item.getText().toLowerCase().contains(s.toLowerCase())) { |
|
||||
searchedData.add(item); |
|
||||
} |
|
||||
} |
|
||||
if (searchedData.size() > 0) |
|
||||
showRecipientNotFoundView(false); |
|
||||
else |
|
||||
showRecipientNotFoundView(true); |
|
||||
occupationListingRvAdapter.setData(searchedData); |
|
||||
|
|
||||
} else { |
|
||||
showRecipientNotFoundView(false); |
|
||||
occupationListingRvAdapter.setData(this.data); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public void hideKeyboard() { |
|
||||
// Check if no view has focus: |
|
||||
try { |
|
||||
View view = getActivity().getCurrentFocus(); |
|
||||
|
|
||||
InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); |
|
||||
} |
|
||||
catch(Exception ex) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void showKeyBoard(View view) { |
|
||||
try { |
|
||||
InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); |
|
||||
Log.d("GMEEXCEPTION", "Keyboard shown"); |
|
||||
} catch (NullPointerException e) { |
|
||||
Log.d("GMEEXCEPTION", "Null pointer while showing keyboard"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
public interface OccupationSelectionListener { |
|
||||
void onOccupationSelected(Occupation selectedOccupation); |
|
||||
} |
|
||||
} |
|
@ -1,203 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.view.view1; |
|
||||
|
|
||||
import android.app.Dialog; |
|
||||
import android.app.DialogFragment; |
|
||||
import android.content.Context; |
|
||||
import android.content.DialogInterface; |
|
||||
import android.os.Bundle; |
|
||||
import android.support.v7.app.AlertDialog; |
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.text.Editable; |
|
||||
import android.text.TextWatcher; |
|
||||
import android.util.Log; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
import android.view.Window; |
|
||||
import android.view.inputmethod.InputMethodManager; |
|
||||
import android.widget.EditText; |
|
||||
import android.widget.TextView; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.customwidgets.LineDividerItemDecoration; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.adapter.view1.ProvinceListingRvAdapter; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.Province; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class ProvinceListingDialog extends android.support.v4.app.DialogFragment implements View.OnClickListener, TextWatcher { |
|
||||
|
|
||||
private List<Province> data; |
|
||||
private ProvinceSelectionListener listener; |
|
||||
private RecyclerView transferRv; |
|
||||
private View cancelButton; |
|
||||
private EditText noTransferFoundView; |
|
||||
private EditText searchEditTextView; |
|
||||
private ProvinceListingRvAdapter transferListingRvAdapter; |
|
||||
|
|
||||
private TextView dialogTitle; |
|
||||
private View searchViewContainer; |
|
||||
|
|
||||
@Override |
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) { |
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |
|
||||
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_country_listing, null); |
|
||||
transferRv = view.findViewById(R.id.countryListRv); |
|
||||
noTransferFoundView = view.findViewById(R.id.noCountryFoundTextView); |
|
||||
cancelButton = view.findViewById(R.id.iv_cancel); |
|
||||
searchEditTextView = view.findViewById(R.id.searchEditText); |
|
||||
dialogTitle = view.findViewById(R.id.dialog_title_txt); |
|
||||
searchViewContainer= view.findViewById(R.id.searchViewContainer); |
|
||||
|
|
||||
builder.setView(view); |
|
||||
initialize(); |
|
||||
|
|
||||
return builder.create(); |
|
||||
} |
|
||||
|
|
||||
private void initialize() { |
|
||||
cancelButton.setOnClickListener(this); |
|
||||
searchEditTextView.addTextChangedListener(this); |
|
||||
transferListingRvAdapter = new ProvinceListingRvAdapter(this.listener); |
|
||||
transferListingRvAdapter.setData(this.data); |
|
||||
transferRv.setAdapter(transferListingRvAdapter); |
|
||||
LineDividerItemDecoration lineDividerItemDecoration = new LineDividerItemDecoration(getActivity(), LineDividerItemDecoration.VERTICAL_LIST); |
|
||||
transferRv.addItemDecoration(lineDividerItemDecoration); |
|
||||
noTransferFoundView.setHint("No province found."); |
|
||||
dialogTitle.setText("Select Province"); |
|
||||
searchEditTextView.setHint("Search Province"); |
|
||||
|
|
||||
searchViewContainer.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
searchEditTextView.requestFocus(); |
|
||||
showKeyBoard(searchEditTextView); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void setListener(ProvinceSelectionListener listener) { |
|
||||
this.listener = listener; |
|
||||
} |
|
||||
|
|
||||
public void setProvinceData(List<Province> data) { |
|
||||
if (data != null&&data.size()>0) { |
|
||||
this.data = data; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onStart() { |
|
||||
super.onStart(); |
|
||||
Window window = getDialog().getWindow(); |
|
||||
if (window != null) { |
|
||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); |
|
||||
window.setBackgroundDrawableResource(R.drawable.ic_rounded_grey_bg_with_inset); |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
switch (v.getId()) { |
|
||||
case R.id.iv_cancel: |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
hideKeyboard(); |
|
||||
dismiss(); |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onDismiss(DialogInterface dialog) { |
|
||||
super.onDismiss(dialog); |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
searchEditTextView.removeTextChangedListener(this); |
|
||||
searchViewContainer.setOnClickListener(null); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
private void showRecipientNotFoundView(boolean action) { |
|
||||
if (action) { |
|
||||
if(transferRv.getVisibility()==View.VISIBLE) { |
|
||||
transferRv.setVisibility(View.GONE); |
|
||||
noTransferFoundView.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} else { |
|
||||
if(transferRv.getVisibility()!=View.VISIBLE) { |
|
||||
noTransferFoundView.setVisibility(View.GONE); |
|
||||
transferRv.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void afterTextChanged(Editable s) { |
|
||||
if (transferListingRvAdapter != null) { |
|
||||
searchForCountry(s.toString()); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private void searchForCountry(String s) { |
|
||||
if (this.data != null) { |
|
||||
if (s.length() > 0) { |
|
||||
List<Province> searchedData = new ArrayList<>(); |
|
||||
for (Province item : data) { |
|
||||
if (item.getText().toLowerCase().contains(s.toLowerCase())) { |
|
||||
searchedData.add(item); |
|
||||
} |
|
||||
} |
|
||||
if (searchedData.size() > 0) |
|
||||
showRecipientNotFoundView(false); |
|
||||
else |
|
||||
showRecipientNotFoundView(true); |
|
||||
transferListingRvAdapter.setData(searchedData); |
|
||||
|
|
||||
} else { |
|
||||
showRecipientNotFoundView(false); |
|
||||
transferListingRvAdapter.setData(this.data); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public void hideKeyboard() { |
|
||||
// Check if no view has focus: |
|
||||
try { |
|
||||
View view = getActivity().getCurrentFocus(); |
|
||||
|
|
||||
InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); |
|
||||
} |
|
||||
catch(Exception ex) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void showKeyBoard(View view) { |
|
||||
try { |
|
||||
InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); |
|
||||
Log.d("GMEEXCEPTION", "Keyboard shown"); |
|
||||
} catch (NullPointerException e) { |
|
||||
Log.d("GMEEXCEPTION", "Null pointer while showing keyboard"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
public interface ProvinceSelectionListener { |
|
||||
void onProvinceSelected(Province selectedProvince); |
|
||||
} |
|
||||
} |
|
@ -1,204 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.view.view2; |
|
||||
|
|
||||
import android.app.Dialog; |
|
||||
import android.app.DialogFragment; |
|
||||
import android.content.Context; |
|
||||
import android.content.DialogInterface; |
|
||||
import android.os.Bundle; |
|
||||
import android.support.v7.app.AlertDialog; |
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.text.Editable; |
|
||||
import android.text.TextWatcher; |
|
||||
import android.util.Log; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
import android.view.Window; |
|
||||
import android.view.inputmethod.InputMethodManager; |
|
||||
import android.widget.EditText; |
|
||||
import android.widget.TextView; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.customwidgets.LineDividerItemDecoration; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.adapter.view2.IDListingRvAdapter; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.IdType; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class IDListingDialog extends android.support.v4.app.DialogFragment implements View.OnClickListener, TextWatcher { |
|
||||
|
|
||||
private List<IdType> data; |
|
||||
private IDSelectionListener listener; |
|
||||
private RecyclerView transferRv; |
|
||||
private View cancelButton; |
|
||||
private EditText noTransferFoundView; |
|
||||
private EditText searchEditTextView; |
|
||||
private IDListingRvAdapter transferListingRvAdapter; |
|
||||
|
|
||||
private TextView dialogTitle; |
|
||||
private View searchViewContainer; |
|
||||
|
|
||||
@Override |
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) { |
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |
|
||||
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_country_listing, null); |
|
||||
transferRv = view.findViewById(R.id.countryListRv); |
|
||||
noTransferFoundView = view.findViewById(R.id.noCountryFoundTextView); |
|
||||
cancelButton = view.findViewById(R.id.iv_cancel); |
|
||||
searchEditTextView = view.findViewById(R.id.searchEditText); |
|
||||
dialogTitle = view.findViewById(R.id.dialog_title_txt); |
|
||||
searchViewContainer= view.findViewById(R.id.searchViewContainer); |
|
||||
|
|
||||
builder.setView(view); |
|
||||
initialize(); |
|
||||
|
|
||||
return builder.create(); |
|
||||
} |
|
||||
|
|
||||
private void initialize() { |
|
||||
cancelButton.setOnClickListener(this); |
|
||||
searchEditTextView.addTextChangedListener(this); |
|
||||
transferListingRvAdapter = new IDListingRvAdapter(this.listener); |
|
||||
transferListingRvAdapter.setData(this.data); |
|
||||
transferRv.setAdapter(transferListingRvAdapter); |
|
||||
LineDividerItemDecoration lineDividerItemDecoration = new LineDividerItemDecoration(getActivity(), LineDividerItemDecoration.VERTICAL_LIST); |
|
||||
transferRv.addItemDecoration(lineDividerItemDecoration); |
|
||||
noTransferFoundView.setHint("No id found."); |
|
||||
dialogTitle.setText("Select Id Type"); |
|
||||
searchEditTextView.setHint("Search Id"); |
|
||||
|
|
||||
|
|
||||
searchViewContainer.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
searchEditTextView.requestFocus(); |
|
||||
showKeyBoard(searchEditTextView); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void setListener(IDSelectionListener listener) { |
|
||||
this.listener = listener; |
|
||||
} |
|
||||
|
|
||||
public void setIdTypeData(List<IdType> data) { |
|
||||
if (data != null&&data.size()>0) { |
|
||||
this.data = data; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onStart() { |
|
||||
super.onStart(); |
|
||||
Window window = getDialog().getWindow(); |
|
||||
if (window != null) { |
|
||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); |
|
||||
window.setBackgroundDrawableResource(R.drawable.ic_rounded_grey_bg_with_inset); |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
switch (v.getId()) { |
|
||||
case R.id.iv_cancel: |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
hideKeyboard(); |
|
||||
dismiss(); |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onDismiss(DialogInterface dialog) { |
|
||||
super.onDismiss(dialog); |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
searchEditTextView.removeTextChangedListener(this); |
|
||||
searchViewContainer.setOnClickListener(null); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
private void showRecipientNotFoundView(boolean action) { |
|
||||
if (action) { |
|
||||
if(transferRv.getVisibility()==View.VISIBLE) { |
|
||||
transferRv.setVisibility(View.GONE); |
|
||||
noTransferFoundView.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} else { |
|
||||
if(transferRv.getVisibility()!=View.VISIBLE) { |
|
||||
noTransferFoundView.setVisibility(View.GONE); |
|
||||
transferRv.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void afterTextChanged(Editable s) { |
|
||||
if (transferListingRvAdapter != null) { |
|
||||
searchForCountry(s.toString()); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private void searchForCountry(String s) { |
|
||||
if (this.data != null) { |
|
||||
if (s.length() > 0) { |
|
||||
List<IdType> searchedData = new ArrayList<>(); |
|
||||
for (IdType item : data) { |
|
||||
if (item.getText().toLowerCase().contains(s.toLowerCase())) { |
|
||||
searchedData.add(item); |
|
||||
} |
|
||||
} |
|
||||
if (searchedData.size() > 0) |
|
||||
showRecipientNotFoundView(false); |
|
||||
else |
|
||||
showRecipientNotFoundView(true); |
|
||||
transferListingRvAdapter.setData(searchedData); |
|
||||
|
|
||||
} else { |
|
||||
showRecipientNotFoundView(false); |
|
||||
transferListingRvAdapter.setData(this.data); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public void hideKeyboard() { |
|
||||
// Check if no view has focus: |
|
||||
try { |
|
||||
View view = getActivity().getCurrentFocus(); |
|
||||
|
|
||||
InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); |
|
||||
} |
|
||||
catch(Exception ex) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void showKeyBoard(View view) { |
|
||||
try { |
|
||||
InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); |
|
||||
Log.d("GMEEXCEPTION", "Keyboard shown"); |
|
||||
} catch (NullPointerException e) { |
|
||||
Log.d("GMEEXCEPTION", "Null pointer while showing keyboard"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
public interface IDSelectionListener { |
|
||||
void onIdSelected(IdType selectedIdType); |
|
||||
} |
|
||||
} |
|
@ -1,204 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.view.view2; |
|
||||
|
|
||||
import android.app.Dialog; |
|
||||
import android.app.DialogFragment; |
|
||||
import android.content.Context; |
|
||||
import android.content.DialogInterface; |
|
||||
import android.os.Bundle; |
|
||||
import android.support.v7.app.AlertDialog; |
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.text.Editable; |
|
||||
import android.text.TextWatcher; |
|
||||
import android.util.Log; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
import android.view.Window; |
|
||||
import android.view.inputmethod.InputMethodManager; |
|
||||
import android.widget.EditText; |
|
||||
import android.widget.TextView; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.customwidgets.LineDividerItemDecoration; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.adapter.view2.PrimaryBankListingRvAdapter; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.Bank; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class PrimaryBankListingDialog extends android.support.v4.app.DialogFragment implements View.OnClickListener, TextWatcher { |
|
||||
|
|
||||
private List<Bank> data; |
|
||||
private PrimaryBankSelectionListener listener; |
|
||||
private RecyclerView transferRv; |
|
||||
private View cancelButton; |
|
||||
private EditText noTransferFoundView; |
|
||||
private EditText searchEditTextView; |
|
||||
private PrimaryBankListingRvAdapter transferListingRvAdapter; |
|
||||
|
|
||||
private TextView dialogTitle; |
|
||||
private View searchViewContainer; |
|
||||
|
|
||||
@Override |
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) { |
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |
|
||||
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_country_listing, null); |
|
||||
transferRv = view.findViewById(R.id.countryListRv); |
|
||||
noTransferFoundView = view.findViewById(R.id.noCountryFoundTextView); |
|
||||
cancelButton = view.findViewById(R.id.iv_cancel); |
|
||||
searchEditTextView = view.findViewById(R.id.searchEditText); |
|
||||
dialogTitle = view.findViewById(R.id.dialog_title_txt); |
|
||||
searchViewContainer= view.findViewById(R.id.searchViewContainer); |
|
||||
|
|
||||
builder.setView(view); |
|
||||
initialize(); |
|
||||
|
|
||||
return builder.create(); |
|
||||
} |
|
||||
|
|
||||
private void initialize() { |
|
||||
cancelButton.setOnClickListener(this); |
|
||||
searchEditTextView.addTextChangedListener(this); |
|
||||
transferListingRvAdapter = new PrimaryBankListingRvAdapter(this.listener); |
|
||||
transferListingRvAdapter.setData(this.data); |
|
||||
transferRv.setAdapter(transferListingRvAdapter); |
|
||||
LineDividerItemDecoration lineDividerItemDecoration = new LineDividerItemDecoration(getActivity(), LineDividerItemDecoration.VERTICAL_LIST); |
|
||||
transferRv.addItemDecoration(lineDividerItemDecoration); |
|
||||
noTransferFoundView.setHint("No primary bank found."); |
|
||||
dialogTitle.setText("Select Primary Bank"); |
|
||||
searchEditTextView.setHint("Search Primary Bank"); |
|
||||
|
|
||||
|
|
||||
searchViewContainer.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
searchEditTextView.requestFocus(); |
|
||||
showKeyBoard(searchEditTextView); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void setListener(PrimaryBankSelectionListener listener) { |
|
||||
this.listener = listener; |
|
||||
} |
|
||||
|
|
||||
public void setPrimaryBankData(List<Bank> data) { |
|
||||
if (data != null&&data.size()>0) { |
|
||||
this.data = data; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onStart() { |
|
||||
super.onStart(); |
|
||||
Window window = getDialog().getWindow(); |
|
||||
if (window != null) { |
|
||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); |
|
||||
window.setBackgroundDrawableResource(R.drawable.ic_rounded_grey_bg_with_inset); |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
switch (v.getId()) { |
|
||||
case R.id.iv_cancel: |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
hideKeyboard(); |
|
||||
dismiss(); |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onDismiss(DialogInterface dialog) { |
|
||||
super.onDismiss(dialog); |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
searchEditTextView.removeTextChangedListener(this); |
|
||||
searchViewContainer.setOnClickListener(null); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
private void showRecipientNotFoundView(boolean action) { |
|
||||
if (action) { |
|
||||
if(transferRv.getVisibility()==View.VISIBLE) { |
|
||||
transferRv.setVisibility(View.GONE); |
|
||||
noTransferFoundView.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} else { |
|
||||
if(transferRv.getVisibility()!=View.VISIBLE) { |
|
||||
noTransferFoundView.setVisibility(View.GONE); |
|
||||
transferRv.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void afterTextChanged(Editable s) { |
|
||||
if (transferListingRvAdapter != null) { |
|
||||
searchForCountry(s.toString()); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private void searchForCountry(String s) { |
|
||||
if (this.data != null) { |
|
||||
if (s.length() > 0) { |
|
||||
List<Bank> searchedData = new ArrayList<>(); |
|
||||
for (Bank item : data) { |
|
||||
if (item.getText().toLowerCase().contains(s.toLowerCase())) { |
|
||||
searchedData.add(item); |
|
||||
} |
|
||||
} |
|
||||
if (searchedData.size() > 0) |
|
||||
showRecipientNotFoundView(false); |
|
||||
else |
|
||||
showRecipientNotFoundView(true); |
|
||||
transferListingRvAdapter.setData(searchedData); |
|
||||
|
|
||||
} else { |
|
||||
showRecipientNotFoundView(false); |
|
||||
transferListingRvAdapter.setData(this.data); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public void hideKeyboard() { |
|
||||
// Check if no view has focus: |
|
||||
try { |
|
||||
View view = getActivity().getCurrentFocus(); |
|
||||
|
|
||||
InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); |
|
||||
} |
|
||||
catch(Exception ex) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void showKeyBoard(View view) { |
|
||||
try { |
|
||||
InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); |
|
||||
Log.d("GMEEXCEPTION", "Keyboard shown"); |
|
||||
} catch (NullPointerException e) { |
|
||||
Log.d("GMEEXCEPTION", "Null pointer while showing keyboard"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
public interface PrimaryBankSelectionListener { |
|
||||
void onPrimaryBankSelected(Bank selectedPrimaryBank); |
|
||||
} |
|
||||
} |
|
@ -1,204 +0,0 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.kycV2.view.view2; |
|
||||
|
|
||||
import android.app.Dialog; |
|
||||
import android.app.DialogFragment; |
|
||||
import android.content.Context; |
|
||||
import android.content.DialogInterface; |
|
||||
import android.os.Bundle; |
|
||||
import android.support.v7.app.AlertDialog; |
|
||||
import android.support.v7.widget.RecyclerView; |
|
||||
import android.text.Editable; |
|
||||
import android.text.TextWatcher; |
|
||||
import android.util.Log; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
import android.view.Window; |
|
||||
import android.view.inputmethod.InputMethodManager; |
|
||||
import android.widget.EditText; |
|
||||
import android.widget.TextView; |
|
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.R; |
|
||||
import com.gmeremit.online.gmeremittance_native.customwidgets.LineDividerItemDecoration; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.adapter.view2.SourceOfFundListingRvAdapter; |
|
||||
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.SourceOfFund; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.List; |
|
||||
|
|
||||
public class SourceOfFundListingDialog extends android.support.v4.app.DialogFragment implements View.OnClickListener, TextWatcher { |
|
||||
|
|
||||
private List<SourceOfFund> data; |
|
||||
private SourceOfFundListingListener listener; |
|
||||
private RecyclerView transferRv; |
|
||||
private View cancelButton; |
|
||||
private EditText noTransferFoundView; |
|
||||
private EditText searchEditTextView; |
|
||||
private SourceOfFundListingRvAdapter sourceOfFundListingRvAdapter; |
|
||||
|
|
||||
private TextView dialogTitle; |
|
||||
private View searchViewContainer; |
|
||||
|
|
||||
@Override |
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) { |
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |
|
||||
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_country_listing, null); |
|
||||
transferRv = view.findViewById(R.id.countryListRv); |
|
||||
noTransferFoundView = view.findViewById(R.id.noCountryFoundTextView); |
|
||||
cancelButton = view.findViewById(R.id.iv_cancel); |
|
||||
searchEditTextView = view.findViewById(R.id.searchEditText); |
|
||||
dialogTitle = view.findViewById(R.id.dialog_title_txt); |
|
||||
searchViewContainer= view.findViewById(R.id.searchViewContainer); |
|
||||
|
|
||||
builder.setView(view); |
|
||||
initialize(); |
|
||||
|
|
||||
return builder.create(); |
|
||||
} |
|
||||
|
|
||||
private void initialize() { |
|
||||
cancelButton.setOnClickListener(this); |
|
||||
searchEditTextView.addTextChangedListener(this); |
|
||||
sourceOfFundListingRvAdapter = new SourceOfFundListingRvAdapter(this.listener); |
|
||||
sourceOfFundListingRvAdapter.setData(this.data); |
|
||||
transferRv.setAdapter(sourceOfFundListingRvAdapter); |
|
||||
LineDividerItemDecoration lineDividerItemDecoration = new LineDividerItemDecoration(getActivity(), LineDividerItemDecoration.VERTICAL_LIST); |
|
||||
transferRv.addItemDecoration(lineDividerItemDecoration); |
|
||||
noTransferFoundView.setHint("No source of found."); |
|
||||
dialogTitle.setText("Select Source Of Fund"); |
|
||||
searchEditTextView.setHint("Search Source of Fund"); |
|
||||
|
|
||||
|
|
||||
searchViewContainer.setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
searchEditTextView.requestFocus(); |
|
||||
showKeyBoard(searchEditTextView); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void setListener(SourceOfFundListingListener listener) { |
|
||||
this.listener = listener; |
|
||||
} |
|
||||
|
|
||||
public void setSourceOfFundData(List<SourceOfFund> data) { |
|
||||
if (data != null&&data.size()>0) { |
|
||||
this.data = data; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onStart() { |
|
||||
super.onStart(); |
|
||||
Window window = getDialog().getWindow(); |
|
||||
if (window != null) { |
|
||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); |
|
||||
window.setBackgroundDrawableResource(R.drawable.ic_rounded_grey_bg_with_inset); |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onClick(View v) { |
|
||||
switch (v.getId()) { |
|
||||
case R.id.iv_cancel: |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
hideKeyboard(); |
|
||||
dismiss(); |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onDismiss(DialogInterface dialog) { |
|
||||
super.onDismiss(dialog); |
|
||||
cancelButton.setOnClickListener(null); |
|
||||
searchEditTextView.removeTextChangedListener(this); |
|
||||
searchViewContainer.setOnClickListener(null); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
private void showRecipientNotFoundView(boolean action) { |
|
||||
if (action) { |
|
||||
if(transferRv.getVisibility()==View.VISIBLE) { |
|
||||
transferRv.setVisibility(View.GONE); |
|
||||
noTransferFoundView.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} else { |
|
||||
if(transferRv.getVisibility()!=View.VISIBLE) { |
|
||||
noTransferFoundView.setVisibility(View.GONE); |
|
||||
transferRv.setVisibility(View.VISIBLE); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void afterTextChanged(Editable s) { |
|
||||
if (sourceOfFundListingRvAdapter != null) { |
|
||||
searchForCountry(s.toString()); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private void searchForCountry(String s) { |
|
||||
if (this.data != null) { |
|
||||
if (s.length() > 0) { |
|
||||
List<SourceOfFund> searchedData = new ArrayList<>(); |
|
||||
for (SourceOfFund item : data) { |
|
||||
if (item.getText().toLowerCase().contains(s.toLowerCase())) { |
|
||||
searchedData.add(item); |
|
||||
} |
|
||||
} |
|
||||
if (searchedData.size() > 0) |
|
||||
showRecipientNotFoundView(false); |
|
||||
else |
|
||||
showRecipientNotFoundView(true); |
|
||||
sourceOfFundListingRvAdapter.setData(searchedData); |
|
||||
|
|
||||
} else { |
|
||||
showRecipientNotFoundView(false); |
|
||||
sourceOfFundListingRvAdapter.setData(this.data); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public void hideKeyboard() { |
|
||||
// Check if no view has focus: |
|
||||
try { |
|
||||
View view = getActivity().getCurrentFocus(); |
|
||||
|
|
||||
InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); |
|
||||
} |
|
||||
catch(Exception ex) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void showKeyBoard(View view) { |
|
||||
try { |
|
||||
InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); |
|
||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); |
|
||||
Log.d("GMEEXCEPTION", "Keyboard shown"); |
|
||||
} catch (NullPointerException e) { |
|
||||
Log.d("GMEEXCEPTION", "Null pointer while showing keyboard"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
public interface SourceOfFundListingListener { |
|
||||
void onSourceOfFundListingSelected(SourceOfFund selectedPrimaryBank); |
|
||||
} |
|
||||
} |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue