InQBarna / TableFixHeaders

Android library that implements a table with fixed headers.
Apache License 2.0
818 stars 300 forks source link

how to add pull to refresh loading #46

Open pangff opened 10 years ago

pangff commented 10 years ago

I want add an pull down to refresh loading header and pull up to load more loading footer. the loading header should between the first lock head and first data row, the loading footer should blow the last data row. Please give me a help.

BraisGabin commented 10 years ago

The overScroll is a big feature. Right now I don't know what would be the better way to do it.

I have no plans to implement it in the short term so I accept PR.

Related: #28

SheldonX commented 10 years ago

You could change the on touch event like this here and handle the on touch event in the activity you want to add pull to refresh loading and handle the pulling in the activity

case MotionEvent.ACTION_MOVE: { final int x2 = (int) event.getRawX(); final int y2 = (int) event.getRawY(); final int diffX = currentX - x2; final int diffY = currentY - y2; currentX = x2; currentY = y2; if (scrollX + diffX == 0 && diffX != 0) { // Log.e("getthetop", "yes"); return false; } else { scrollBy(diffX, diffY); } break; }