android scroll and see details like whatsup

167 views Asked by At

Place some icon like down arrow so that user can know there is some details are shown below in android.

enter image description here

after scrolled page end, scroll arrow will be gone.

1

There are 1 answers

0
Balachandar On
 scrollView1.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {

         public void onScrollChanged() {

           int scrollViewHeight = scrollView1.getChildAt(0).getHeight();


           Log.e("scrollVIEW_height", "SCROLL" + scrollViewHeight);

           double size = 0;

           DisplayMetrics dm = mContext.getResources().getDisplayMetrics();

           float screenWidth = dm.widthPixels / dm.xdpi;

           float screenHeight = dm.heightPixels / dm.ydpi;

           float i = dm.heightPixels;

           Log.e("height in i", "" + i);

           double heightininch = Math.sqrt(Math.pow(screenHeight, 2));

           Log.e("height in inch", "" + heightininch);

           size = Math.sqrt(Math.pow(screenWidth, 2) + Math.pow(screenHeight, 2));

           Log.e("screen", "" + size);

           if (size >= 6) {

             if (scrollViewHeight >= (int)i) {

               DownIndicator.setVisibility(View.VISIBLE);

               // TopIndicator.setVisibility(View.VISIBLE);

             }
           }
        }
    });