Android, I am trying to hide a textView when the gridView is scrolling and makes it visible when the user stops scrolling

In the code below, only the method is called onScroll

and the method is onScrollStateChanged

never called, can you help me fix this issue:

mGridView.setOnScrollListener(new OnScrollListener() {

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem,
                int visibleItemCount, int totalItemCount) {

            check_text.setVisibility(View.VISIBLE);

            System.out.println("Inside onScroll");
        }

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {

            if(scrollState == SCROLL_STATE_IDLE)
             {
                check_text.setVisibility(View.VISIBLE);  
                System.out.println("Inside onScrollStateChanged");
             }              
        }
    });

      

+3


source to share





All Articles