Status Update
Comments
ry...@google.com <ry...@google.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.
al...@peerstreet.com <al...@peerstreet.com> #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?
he...@marmistastones.com <he...@marmistastones.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?
bn...@gmail.com <bn...@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.
br...@gmail.com <br...@gmail.com> #6
gu...@gmail.com <gu...@gmail.com> #7
Haven't forgotten this - this is on my queue, just that my queue is quite long :)
ja...@gmail.com <ja...@gmail.com> #8
la...@praqma.io <la...@praqma.io> #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.
ry...@google.com <ry...@google.com>
la...@praqma.io <la...@praqma.io> #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.
is...@gmail.com <is...@gmail.com> #11
Can you please explain how to access placeholdersBefore in pagingsource.load() method. Where i find the proper documentation of this method...
Thanks
gu...@gmail.com <gu...@gmail.com> #12
ek...@google.com <ek...@google.com>
la...@praqma.io <la...@praqma.io> #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(...)
aj...@gmail.com <aj...@gmail.com> #14
la...@gmail.com <la...@gmail.com> #15
You just need to set
ri...@gmail.com <ri...@gmail.com>
[Deleted User] <[Deleted User]> #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?
st...@webrepublic.ch <st...@webrepublic.ch> #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.
se...@supple.kr <se...@supple.kr> #18
whenever i set itemsbefore or itemsafter it show me null value
re...@erkol.cz <re...@erkol.cz> #19
Also i updated the logic inside here as well as library to stable version.
gr...@gmail.com <gr...@gmail.com> #20
ja...@gmail.com <ja...@gmail.com> #21
pr...@gmail.com <pr...@gmail.com> #22
The testing process is a bit tedious because publishing a draft of an add-on takes some time and is not trivial to figure out (make sure your appscript.json manifest's oauth scopes match project scopes!) but it does work.
bu...@gmail.com <bu...@gmail.com> #23
an...@gmail.com <an...@gmail.com> #24
to...@gmail.com <to...@gmail.com> #25
br...@gmail.com <br...@gmail.com> #26
mj...@mattjanssen.com <mj...@mattjanssen.com> #27
na...@flex.io <na...@flex.io> #28
ro...@gmail.com <ro...@gmail.com> #29
vi...@gmail.com <vi...@gmail.com> #30
al...@gmail.com <al...@gmail.com> #31
di...@gmail.com <di...@gmail.com> #32
mi...@gmail.com <mi...@gmail.com> #33
[Deleted User] <[Deleted User]> #34
jo...@quantified.co <jo...@quantified.co> #35
jo...@storetrials.com <jo...@storetrials.com> #36
ka...@alizent.com <ka...@alizent.com> #37
je...@yahoo.com <je...@yahoo.com> #38
sh...@gmail.com <sh...@gmail.com> #39
cj...@cynic.net <cj...@cynic.net> #40
For anybody about to add a "+1" comment: please don't; it just annoys subscribers to the issue and reduces the chance of getting a fix because it makes people want to unsusbscribe. Star the issue instead if you want to increase the count of people who want it fixed.
lu...@gmail.com <lu...@gmail.com> #41
pv...@gmail.com <pv...@gmail.com> #42
cm...@gmail.com <cm...@gmail.com> #43
**Please update the documentation as requested by comment 23.
My "best" work around that doesn't require versioning the addon (which is a pain for development and incremental testing) is to
a) add the project to a sheet via Run->Test as add-on...
b) open the test sheet's script (Tools -> Script Editor).
c) cut and paste code from one project (add on) to the other (sheet's script) as I develop and test.
It is cumbersome, but it works without having the add on have versioning bloat whilst under development.
ko...@plarium.com <ko...@plarium.com> #44
ch...@flyweight.io <ch...@flyweight.io> #45
kt...@factset.com <kt...@factset.com> #46
le...@gmail.com <le...@gmail.com> #47
co...@gmail.com <co...@gmail.com> #48
to...@ejoy.io <to...@ejoy.io> #49
ja...@gmail.com <ja...@gmail.com> #50
[Deleted User] <[Deleted User]> #51
iv...@gmail.com <iv...@gmail.com> #52
la...@gmail.com <la...@gmail.com> #53
ma...@roche.com <ma...@roche.com> #54
al...@apptweak.com <al...@apptweak.com> #55
we...@logicsheet.co <we...@logicsheet.co> #56
mi...@kvantic.com <mi...@kvantic.com> #57
ma...@roche.com <ma...@roche.com> #58
sp...@gmail.com <sp...@gmail.com> #59
ki...@gmail.com <ki...@gmail.com> #60
se...@itaware.eu <se...@itaware.eu> #61
ja...@seibert.group <ja...@seibert.group> #62
+1
an...@easyclt.com.br <an...@easyclt.com.br> #63
+1
bz...@gmail.com <bz...@gmail.com> #64
ch...@shihankhan.com <ch...@shihankhan.com> #65
lu...@aeco.cloud <lu...@aeco.cloud> #66
ry...@payableapps.com <ry...@payableapps.com> #67
[Deleted User] <[Deleted User]> #68
jb...@gmail.com <jb...@gmail.com> #69
c....@gmail.com <c....@gmail.com> #70
ad...@gmail.com <ad...@gmail.com> #71
an...@pipai.co <an...@pipai.co> #72
sh...@modlr.co <sh...@modlr.co> #73
na...@baselines.cloud <na...@baselines.cloud> #74
na...@qualtir.com <na...@qualtir.com> #75
be...@timewise-analytics.com <be...@timewise-analytics.com> #76
am...@gmail.com <am...@gmail.com> #77
ja...@gro-intelligence.com <ja...@gro-intelligence.com> #78
bi...@gmail.com <bi...@gmail.com> #79
ro...@gmail.com <ro...@gmail.com> #80
me...@gmail.com <me...@gmail.com> #81
da...@gmail.com <da...@gmail.com> #82
av...@gmail.com <av...@gmail.com> #83
dm...@gmail.com <dm...@gmail.com> #84
br...@gmail.com <br...@gmail.com> #85
wi...@clarity.global <wi...@clarity.global> #86
al...@gmail.com <al...@gmail.com> #87
a....@gmail.com <a....@gmail.com> #88
sn...@gmail.com <sn...@gmail.com> #89
su...@gmail.com <su...@gmail.com> #90
al...@dust.tt <al...@dust.tt> #91
But seems like Google doesn't really care about issue tracker, it's not the first one I see with no answer for years
Description
"Test as add-on" in Google sheets activates menus and allows for sidebars, but custom functions don't get linked.
Attempting to use a function results in a #NAME error.
Please provide a small sample script that reliably reproduces the issue.
The sample should run as-is or with minimal setup, without external
dependencies.
/**
* Multiplies the input value by 2.
*
* @param {number} input The value to multiply.
* @return The input multiplied by 2.
* @customfunction
*/
function MYFUNC(num) {
return num * 2;
}
What steps will reproduce the problem?
1. Create new apps script project with the above code
2. Publish -> Test as addon
3. Connect to sheet in activated state
4. Enter =MYFUNC(5) into a cell
What is the expected output? What do you see instead?
Expected: 10
Actual: #NAME
What is the project key (found under "File > Project properties")? The
project key does not give the Apps Script team access to your source
code or data. We use it to look up debug information about your script.
M_ZKkpclk4ynwZjPHxEN7NqaZ4aZnzWxY
To subsequent readers: If you are also experiencing this issue, please
click the star next to the issue number. We prioritize issues with the
most stars.