Currently, I'm developing pattern lock application. In my application when user enter wrong pattern on that time pattern lock activity delay 30 second. And I am adding one textview on pattern lock activity that can display only text like "Please Wait 30 Seconds". So I want to replace that text "Please Wait 30 Seconds" in to the decrement counter.
Example: 30-29-28-27-----0 (automatically decrement counter value)
Here this my Textview xml:
<TextView
android:id="@+id/txtMessage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Please Wait 30 Seconds"
android:gravity="center"
android:textSize="25dp"
android:textColor="@color/colorAccent"
android:visibility="gone"/>
See android:text="Please Wait 30 Seconds"
where I want to set decrement counter
This my activity code:
private void invalidPattern() {
failedCount ++;
if (failedCount > LIMIT) {
lock9View.setVisibility(View.GONE);
txtMessage.setVisibility(View.VISIBLE);
Animation zoomOutAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.animation);
txtMessage.startAnimation(zoomOutAnimation);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
//reset the failed count
failedCount = 0;
lock9View.setVisibility(View.VISIBLE);
txtMessage.setVisibility(View.GONE);
//Enable the input interface here
}
}, 30000); // 30Sec delay
}
else
{
Log.i("Wrong....", "aa..else.....invalidPattern()");
}
}
So, if anyone know give idea of that.