Created
December 29, 2020 07:36
-
-
Save virendersran01/e37a009f88afaa58482d1ea11d6453f6 to your computer and use it in GitHub Desktop.
Temp Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inputProofNumber1.getEditText().addTextChangedListener(new TextWatcher() { | |
@Override | |
public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
Log.d(TAG, "beforeTextChanged: "+s); | |
} | |
@Override | |
public void onTextChanged(CharSequence s, int start, int before, int count) { | |
Log.d(TAG, "onTextChanged: "+s); | |
} | |
private Timer timer=new Timer(); | |
private final long DELAY = 1000; // milliseconds | |
@Override | |
public void afterTextChanged(Editable s) {//{"Aadhaar Card", "PAN", "Passport", "Voter ID", "Driving License"}; | |
Log.d(TAG, "afterTextChanged: Proof Type :: "+textSelectProofType1.getText().toString()); | |
Log.d(TAG, "afterTextChanged: "+s); | |
Log.d(TAG, "afterTextChanged: ProofId :: "+applicantProofId1); | |
timer.cancel(); | |
timer = new Timer(); | |
timer.schedule( | |
new TimerTask() { | |
@Override | |
public void run() { | |
// TODO: do what you need here (refresh list) | |
Log.d(TAG, "afterTextChanged: "+s); | |
// you will probably need to use runOnUiThread(Runnable action) for some specific actions (e.g. manipulating views) | |
// if (s.length() >= 9){ | |
// if (textSelectProofType1.getText().toString().equals(proofType[2])){ | |
// saveUpdateApplicantProof1(applicantProofId1, textSelectProofType1.getText().toString(), inputProofNumber1.getEditText().getText().toString()); | |
// } | |
// } | |
// if (s.length() == 10){ | |
// if (textSelectProofType1.getText().toString().equals(proofType[1])){ | |
// saveUpdateApplicantProof1(applicantProofId1, textSelectProofType1.getText().toString(), inputProofNumber1.getEditText().getText().toString()); | |
// } | |
// if (textSelectProofType1.getText().toString().equals(proofType[2])){ | |
// saveUpdateApplicantProof1(applicantProofId1, textSelectProofType1.getText().toString(), inputProofNumber1.getEditText().getText().toString()); | |
// } | |
// if (textSelectProofType1.getText().toString().equals(proofType[3])){ | |
// saveUpdateApplicantProof1(applicantProofId1, textSelectProofType1.getText().toString(), inputProofNumber1.getEditText().getText().toString()); | |
// } | |
// } | |
// | |
// if (s.length() == 12){ | |
// if (textSelectProofType1.getText().toString().equals(proofType[0])){ | |
// saveUpdateApplicantProof1(applicantProofId1, textSelectProofType1.getText().toString(), inputProofNumber1.getEditText().getText().toString()); | |
// } | |
// } | |
// | |
// if (s.length() == 16){ | |
// if (textSelectProofType1.getText().toString().equals(proofType[4])){ | |
// saveUpdateApplicantProof1(applicantProofId1, textSelectProofType1.getText().toString(), inputProofNumber1.getEditText().getText().toString()); | |
// } | |
// } | |
} | |
}, | |
DELAY | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment