I just started learning android development (and Java for that matter), and was trying to modify the Sliding Drawer widget. I notice going through the code I find lines like
Why is "getBottom() - getTop()" used instead of getHeight()? Also, why do they create a variable specifically for childHeight when one already exists (mHandleHeight)?
Edit: Mostly answered my own question - in the code, getHeight() is simply bottom - top, so yes it's the same. Note that the snippet above is slightly different from the basic slidingDrawer code because 'mTop' and 'mBottom' are not available to us mere mortals and have to be replaced to get the widget to work
Code:
final int childHeight = mHandleHeight;
int height = getBottom() - getTop() - childHeight - mTopOffset;
Why is "getBottom() - getTop()" used instead of getHeight()? Also, why do they create a variable specifically for childHeight when one already exists (mHandleHeight)?
Edit: Mostly answered my own question - in the code, getHeight() is simply bottom - top, so yes it's the same. Note that the snippet above is slightly different from the basic slidingDrawer code because 'mTop' and 'mBottom' are not available to us mere mortals and have to be replaced to get the widget to work
