How to display custom password character with some delay like EditText control

EswaranEswaran INMember ✭✭

I have created a custom control by inheriting the EditText control. My requirements are to display the custom password character and when typing there should be some delay like EditText when setting the input type. I have achieved the custom password character displaying but I am unable to achieve the second requirement. I tried to achieve the second requirement by using PostDelay. When typing a single character I can have some delay before it changes to password character but when typing multiple characters fastly I cant able to achieve the requirement similar to edit text control. I have attached the sample in the below link: https://github.com/Eswaran17392/CustomSamples/blob/master/CustomEditbox.zip. Anyone, please suggest me how to achieve the delay similar to EditText. For applying delay, I used below code snippet:

if(ShowPasswordDelay)
{
Java.Lang.Runnable runnable = new Java.Lang.Runnable(() =>
{
this.Text = value;
});
if (handler != null)
{
handler.RemoveCallbacks(runnable);
handler = null;
this.Text = value;
}

if (handler == null)
handler = new Handler();
handler.PostDelayed(runnable, 1000);
}
else
{
this.Text = value;
}

Sign In or Register to comment.