Status Update
Comments
je...@gmail.com <je...@gmail.com> #2
To be clear, when you say jump pages, do you mean recyclerview is scrolling down, or is viewpager scrolling across multiple fragments?
A repro / sample project demonstrating the issue would definitely be helpful here.
em...@unito.it <em...@unito.it> #3
You also mentioned alph09 in the title, but alpha07 in the comment - could you specify which version of viewpager and paging you are using?
do...@google.com <do...@google.com> #4
Ah sorry I see that you have used both here, still could you specify which version of viewpager you are using as well?
ro...@gmail.com <ro...@gmail.com> #5
View Pager 2 : - implementation "androidx.viewpager2:viewpager2:1.0.0"
Paging 3 : - implementation "androidx.paging:paging-runtime-ktx:3.0.0-alpha09"
Example
Attached Video Explanation
When i click slowly on previous button it swipe single page, but if i click quickly multiple times on previous button it start scrolling more than we click and it's not stopping until we click on viewpager.
va...@mylittleadventure.com <va...@mylittleadventure.com> #6
lc...@fmlogistic.com <lc...@fmlogistic.com> #7
Haven't forgotten this - this is on my queue, just that my queue is quite long :)
ma...@gmail.com <ma...@gmail.com> #8
ss...@gmail.com <ss...@gmail.com> #9
This looks like a weird race scenario where the smooth scroll behavior in RV / ViewPager is attempting to do an animated scroll to an absolute position, but Paging is able to PREPEND items to the front of the list faster than the animation can scroll there.
I noticed that you're attempting to enablePlaceholders to mitigate this by telling Paging the total item count, but you never pass a value for placeholdersBefore / After in the initial result on REFRESH. This will prevent Paging understanding how many placeholder items there are in the list. This is probably something Paging should check for, but the proper solution to this ticket should probably be some kind of relative scrolling behavior on RecyclerView or ViewPager, however I expect boundary cases to be quite annoying to deal with there.
gs...@gmail.com <gs...@gmail.com> #10
I'm closing this out since it's not a Paging issue, but I'm happy to continue the thread here to help you get a working solution.
The first thing to try would be to return some positive value for placeholdersBefore
and placeholdersAfter
in PagingSource.load()
when LoadParams
is of type LoadParams.Refresh
. From here you'll need to know what the total number of items you want to show in your ViewPager is and add that boundary check to your next / previous buttons.
gc...@mcnmena.com <gc...@mcnmena.com> #11
Can you please explain how to access placeholdersBefore in pagingsource.load() method. Where i find the proper documentation of this method...
Thanks
st...@gmail.com <st...@gmail.com> #12
val adapter = viewpageradapter()
adapter.snapshot(). placeholdersBefore
But this is not assigned because of val.
So can you please guide me, what i am doing wrong
Thanks
ge...@gmail.com <ge...@gmail.com> #13
Placeholders are a count of the number of not-yet-loaded items in the dataset, which is returned by PagingSource.load()
in LoadResult.Page(...)
re...@kaaman.in <re...@kaaman.in> #14
ca...@gmail.com <ca...@gmail.com> #15
You just need to set
be...@gmail.com <be...@gmail.com> #16
LoadResult.Page(
data = data,
prevKey = if (data.isEmpty()) null else position - 1,
nextKey = if (data.isEmpty()) null else position + 1,
itemsBefore = position
)
I passed position in itemsbefore
I get the error
java.lang.IllegalArgumentException: itemsBefore cannot be negative
So what i am doing actually wrong?
and what value need to pass in itemsBefore and itemsAfter?
ra...@gmail.com <ra...@gmail.com> #17
You want to pass in the number of items in the full dataset that appear before the first item in data
to itemsBefore
and number of items that appear after the last item in data
to itemsAfter
So if you had these items in your db: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
A sample LoadResult.Page
with itemsBefore
and itemsAfter
set would be:
LoadResult.Page(
data = listOf(4, 5),
prevKey = 3,
nextKey = 6,
itemsBefore = 4,
itemsAfter = 4
)
It doesn't make sense to pass a negative number to itemsBefore
because it implies you've loaded data that shouldn't exist.
mr...@gmail.com <mr...@gmail.com> #18
whenever i set itemsbefore or itemsafter it show me null value
[Deleted User] <[Deleted User]> #19
Also i updated the logic inside here as well as library to stable version.
ac...@gmail.com <ac...@gmail.com> #20
l....@vargroup.it <l....@vargroup.it> #21
je...@gmail.com <je...@gmail.com> #22
MySQL 8 has been around for nearly 3 years!
ad...@gmail.com <ad...@gmail.com> #23
fm...@fmlogistic.com <fm...@fmlogistic.com> #24
ra...@gmail.com <ra...@gmail.com> #25
[Deleted User] <[Deleted User]> #26
da...@semantic-visions.com <da...@semantic-visions.com> #27
[Deleted User] <[Deleted User]> #28
sk...@ctepl.com <sk...@ctepl.com> #29
jo...@gmail.com <jo...@gmail.com> #30
m....@blue-focus.com <m....@blue-focus.com> #31
th...@gmail.com <th...@gmail.com> #32
fr...@fmlogistic.com <fr...@fmlogistic.com> #33
me...@gmail.com <me...@gmail.com> #34
Work around using ProxySQL not applicable.
MySQL 8 has been around for a while now...
ge...@k2labs.net <ge...@k2labs.net> #35
+1
ca...@gmail.com <ca...@gmail.com> #36
an...@gmail.com <an...@gmail.com> #37
mi...@gmail.com <mi...@gmail.com> #38
[Deleted User] <[Deleted User]> #39
mu...@gmail.com <mu...@gmail.com> #40
pk...@gmail.com <pk...@gmail.com> #41
sp...@gmail.com <sp...@gmail.com> #42
[Deleted User] <[Deleted User]> #43
a....@re-play.ch <a....@re-play.ch> #44
+1
[Deleted User] <[Deleted User]> #45
ym...@gmail.com <ym...@gmail.com> #46
gm...@sislogica.com <gm...@sislogica.com> #47
sc...@fairmounttire.com <sc...@fairmounttire.com> #48
ll...@fmlogistic.com <ll...@fmlogistic.com> #49
kn...@google.com <kn...@google.com>
ym...@gmail.com <ym...@gmail.com> #50
gs...@gmail.com <gs...@gmail.com> #51
rm...@google.com <rm...@google.com> #52
We're actively working on updating our MySQL driver to support connecting to MySQL 8. Updating this driver affects not only Data Studio but also several other Google products and services, and requires applying and validating several patches, so we appreciate your patience as we work through this. We anticipate a few more weeks to complete this work and roll out the driver update.
os...@mexrentacar.com <os...@mexrentacar.com> #53
I have a new mysql version (8.0) and my data studios can not connect with that server
ki...@adopstar.com <ki...@adopstar.com> #54
av...@gmail.com <av...@gmail.com> #55
ca...@weroad.com <ca...@weroad.com> #56
jf...@gmail.com <jf...@gmail.com> #57
zl...@google.com <zl...@google.com> #58
MySQL 8 should be supported now. Please check. Thanks.
ac...@servehcp.com <ac...@servehcp.com> #59
ge...@k2labs.net <ge...@k2labs.net> #60
gs...@gmail.com <gs...@gmail.com> #61
Bravo, team! 👏
Description
I just upgrade MySQL on Cloud SQL to version 8 and I need to visualize data of this on Data Studio. However, the current connector does not work for Mysql 8.0.
So could GCP help us on this issue, it's urgent to us.
Thank you very much.