Java Code Examples for android.widget.TextView.postInvalidate()

The following are Jave code examples for showing how to use postInvalidate() of the android.widget.TextView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: RLibrary   File: RExTextView.java   View Source Code Vote up 5 votes
public void onTouchUp(final TextView view) {
    isTouchDown = false;
    downX = -1;
    downY = -1;
    if (enableTouchEffect) {
        view.postInvalidate();//解决在RecyclerView中, 会出现点击背景不消失的BUG
    }
}
 
Example 2
Project: RLibrary   File: RExTextView.java   View Source Code Vote up 5 votes
public void onTouchDown(final TextView view, float x, float y) {
            isTouchDown = true;
            downX = x;
            downY = y;
            if (enableTouchEffect) {
                view.postInvalidate();
            }
//            view.postDelayed(new Runnable() {
//                @Override
//                public void run() {
//                    onTouchUp(view);
//                }
//            }, 300);//300毫秒后,自动取消
        }