Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
frameworks_base
Commits
20d6caf8
Commit
20d6caf8
authored
12 years ago
by
Jean-Baptiste Queru
Committed by
android code review
12 years ago
Browse files
Options
Download
Plain Diff
Merge "Fix issue #13366. Take account of stackFromBottom in computeVerticalScrollOffset()."
parents
0cf34218
bbf7b4cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
core/java/android/widget/GridView.java
core/java/android/widget/GridView.java
+6
-1
No files found.
core/java/android/widget/GridView.java
View file @
20d6caf8
...
...
@@ -2095,8 +2095,13 @@ public class GridView extends AbsListView {
int
height
=
view
.
getHeight
();
if
(
height
>
0
)
{
final
int
numColumns
=
mNumColumns
;
final
int
whichRow
=
mFirstPosition
/
numColumns
;
final
int
rowCount
=
(
mItemCount
+
numColumns
-
1
)
/
numColumns
;
// In case of stackFromBottom the calculation of whichRow needs
// to take into account that counting from the top the first row
// might not be entirely filled.
final
int
oddItemsOnFirstRow
=
isStackFromBottom
()
?
((
rowCount
*
numColumns
)
-
mItemCount
)
:
0
;
final
int
whichRow
=
(
mFirstPosition
+
oddItemsOnFirstRow
)
/
numColumns
;
return
Math
.
max
(
whichRow
*
100
-
(
top
*
100
)
/
height
+
(
int
)
((
float
)
mScrollY
/
getHeight
()
*
rowCount
*
100
),
0
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment