Changed the way to check if a view is empty, fixed some strings, fixed fastscroller alignment.

This commit is contained in:
Karim Abou Zeid 2015-06-10 15:27:45 +02:00
commit 8ba0c72037
43 changed files with 185 additions and 204 deletions

View file

@ -91,11 +91,11 @@ public class FastScroller extends FrameLayout {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
mHandle.setPressed(true);
mInitialBarHeight = mBar.getHeight();
mInitialBarHeight = getBarHeight();
mLastPressedYAdjustedToInitial = event.getY() + mHandle.getY() + mBar.getY();
} else if (event.getActionMasked() == MotionEvent.ACTION_MOVE) {
float newHandlePressedY = event.getY() + mHandle.getY() + mBar.getY();
int barHeight = mBar.getHeight();
int barHeight = getBarHeight();
float newHandlePressedYAdjustedToInitial =
newHandlePressedY + (mInitialBarHeight - barHeight);
@ -218,7 +218,7 @@ public class FastScroller extends FrameLayout {
int verticalScrollRange = mRecyclerView.computeVerticalScrollRange()
+ mRecyclerView.getPaddingBottom();
int barHeight = mBar.getHeight();
int barHeight = getBarHeight();
float ratio = (float) scrollOffset / (verticalScrollRange - barHeight);
int calculatedHandleHeight = (int) ((float) barHeight / verticalScrollRange * barHeight);
@ -245,4 +245,8 @@ public class FastScroller extends FrameLayout {
}
}
}
private int getBarHeight() {
return mBar.getHeight();
}
}