Comments (19)
Fix should be here: #219
from dpadrecyclerview.
@tyrel-carlson that's exactly what I did in #219
I plan to release this soon
from dpadrecyclerview.
Thanks for the feedback. I will make focusOutFront and focusOutBack enabled by default in the next release.
Regarding the grid focus, I think that makes sense, I will open a new issue and solve that as well
from dpadrecyclerview.
FYI, I have fixed it using recycler.setSmoothScrollMaxPendingMoves(0)
from dpadrecyclerview.
Hi @tyrel-carlson. Which version of the library are you using? Please give me the entire configuration of your adapter and number of rows/columns that have a section header. This is a continuation of this issue, right? #210
from dpadrecyclerview.
Hi @tyrel-carlson. Which version of the library are you using? Please give me the entire configuration of your adapter and number of rows/columns that have a section header. This is a continuation of this issue, right? #210
I'm using the latest version 1.3.0-alpha03
. I suggest including a new fragment using SpanSizeLookup
in the sample project. That would be a good practice to have it to detect any issues.
from dpadrecyclerview.
Could you do me a favor and check https://github.com/rubensousa/DpadRecyclerView/pull/219/files#diff-50cbcf55268ef507b233dc6a02a723b8ada87fc2f470ff8e834534ee090be7f8 and the branch span_size_focus
? You can checkout the project on your machine and help me with testing that it's working as you expected
from dpadrecyclerview.
Sure, I will check it
from dpadrecyclerview.
I have tested the branch. Grids > Span Headers
works fine on my emulator.
from dpadrecyclerview.
@tyrel-carlson thanks! I will add some UI tests and then ship the release
from dpadrecyclerview.
Released in 1.3.0-alpha04
. Please try it out
from dpadrecyclerview.
Did you change any dependencies in this release? After syncing I get some errors on my dispatchKeyEvent
overridden functions in other files.
from dpadrecyclerview.
@tyrel-carlson yes, I updated RecyclerView
to the latest version. They added an override to dispatchKeyEvent
with nullable annotation: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java;l=1977
from dpadrecyclerview.
@tyrel-carlson was everything fine with the newest version?
from dpadrecyclerview.
I'm going to update to the newest version soon. I will update you once I've tested the changes.
from dpadrecyclerview.
I've tested new version, I can confirm that reported bugs are fixed, but there are two more issues there:
- when we have one item in a row and the right cells of the item is empty, right arrow will move the focus to second item on the next row. for example lets say we have this view:
[0 ] -> header
[1][ ][ ][ ] -> first row
[2 ] -> header
[3][4][ ][ ] -> second row
when we move right from position = 1, it focuses item with position = 4
- the other issue is when I go up from first row, it won't focus the parent which is the top menu, I'm not sure if this behavior should be the default one.
I have fixed both of these issue, but you may want to fix them as well.
from dpadrecyclerview.
when we have one item in a row and the right cells of the item is empty, right arrow will move the focus to second item on the next row. for example lets say we have this view:
What's your expected state in that scenario? Would you prefer to not focus position 4? The default focus search from the system kicks-in when there's no focusable view at the focus direction, in that case the system finds position 4 because it's at the right side of position 1.
the other issue is when I go up from first row, it won't focus the parent which is the top menu, I'm not sure if this behavior should be the default one.
Are you using these?
Please try setFocusOutAllowed(throughFront = true, throughBack = false)
and let me know if it works
from dpadrecyclerview.
I have used setFocusOutAllowed(throughFront = true, throughBack = false)
and that works fine. thanks
for the other issue, I expect the focus to remain unchanged, since there is no cell at the right of the cell. here is the code I'm using to prevent this behavior:
View.FOCUS_RIGHT -> {
// Prevent unusual focus movement if the right cell is empty
val nextPosition = currentPosition + 1
if (getSpanIndex(nextPosition, spanCount) <= currentSpanIndex) currentPosition else nextPosition
}
and also I see if we move right from other columns (second or third column for example) focus remains unchanged. So there should be same behavior for all movements to the right.
from dpadrecyclerview.
@tyrel-carlson both fixes are now available in 1.3.0-beta01
from dpadrecyclerview.
Related Issues (20)
- Allow skipping layout requests during scroll
- Expose ViewHolder focus state
- Add support for custom parent alignment based on ViewHolder position
- Add support for linear circular focus
- Gridrecyclerview with height 0.5 of the screen height - alignment problem (last row cut off) HOT 14
- First item of first row is smaller then all the others HOT 4
- Fast scrolling - loosing focus when having images from an url in the items HOT 21
- Scrolling issue when loading images in onBindViewHolder HOT 9
- Scroll a nested recyclerview to a specific item (without focussing it) HOT 3
- Bug: DpadSpanSizeLookup's getSpanSize function is being called infinitely after removing an item HOT 8
- Bug: Last row not getting focused while using DpadSpanSizeLookup HOT 1
- Focus does not leave DpadRecyclerView in some cases when using Compose HOT 1
- Do not allow focusing other rows if grids are incomplete
- how to center scroll like CenterLayoutManager in horizontal HOT 1
- OnViewFocused is not called for parent RecyclerView if child does not attach a listener
- DpadRecyclerView shouldn't lose focus if adapter is cleared
- Nested Child recycler view onCreate called every time during parent recycler view scroll. HOT 9
- Incorrect predictive animation after adapter changes
- java.lang.IllegalStateException: Cannot call removeView(At) within removeView(At)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dpadrecyclerview.