mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 11:31:33 +01:00
Improve scrolling behavior of the MoveList area
Move the margin between the move list and the button row to the button row container, so that the margin does not interfere with the calculation in MoveListView.onMeasure(). Adjusted the MoveListView content size so that the last row can be scrolled to a position where the previous line is completely hidden.
This commit is contained in:
parent
9fbf7ff212
commit
c19a3b3777
|
@ -139,12 +139,13 @@ public class MoveListView extends View {
|
|||
|
||||
int height = 0;
|
||||
if (layout != null) {
|
||||
height = layout.getLineCount() * getLineHeight();
|
||||
int nLines = layout.getLineCount();
|
||||
height = nLines * getLineHeight();
|
||||
ViewParent p = getParent();
|
||||
if (p != null)
|
||||
p = p.getParent();
|
||||
if (p instanceof MyRelativeLayout)
|
||||
height += -getLineHeight() + ((MyRelativeLayout)p).getNewHeight();
|
||||
height = getLineStartY(nLines - 1) + ((MyRelativeLayout)p).getNewHeight();
|
||||
}
|
||||
switch (MeasureSpec.getMode(heightMeasureSpec)) {
|
||||
case MeasureSpec.UNSPECIFIED:
|
||||
|
|
|
@ -42,7 +42,8 @@
|
|||
android:id="@+id/buttons"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/custom3Button"
|
||||
|
@ -91,8 +92,7 @@
|
|||
<ScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginTop="4dp">
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<view
|
||||
class="org.petero.droidfish.view.MoveListView"
|
||||
|
|
Loading…
Reference in New Issue
Block a user