Comments (7)
Hi @gregacucnik ,
Thank you for your reporting!
I'll check this issue, please wait.
from recyclertablayout.
@gregacucnik
Sadly enough, I can't reproduce this bug.
Would you please tell me the program that reproduces this bug?
from recyclertablayout.
This occurs on Nexus 5 running Marshmallow 6.0.1 (and 6.0). I tried old Samsung S3 with 4.3 and it works correctly.
In Activity onCreate i set RecyclerTabLayout with custom adapter and current item is in the middle of all possible items (51 items, the middle one is 25).
from recyclertablayout.
@gregacucnik Sorry for late response. I still can't reproduce this bug.
Is it possible that you show the source code ?
from recyclertablayout.
I cant send you the source code because its part of a massive project.
Im trying to alter your demo to get the bug to occur but i also cant do it.
I can give your more directions:
- im using Fragments with an custom FragmentStatePagerAdapter
- i use setupWithAdapter method
- after everything is initialized i set current item to the middle (something like your demo Years)
- Tab Layout scroll is disabled
- In the onCreateViewHolder i alter each item width in order to set have specific number of items visible in the Tab Layout
I found that the problem is in the onCreateViewHolder where i change the item width. If i remove this code Tab Layout is scrolled correctly (setAutoMeasureEnabled is also removed). However it doesnt happen in your demo.
Here is the approximate code:
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.layout_custom_view01_tab, parent, false);
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
layoutParams.width = parent.getWidth() / 3;
view.setLayoutParams(layoutParams);
return new ViewHolder(view);
}
Currently, I dont have time to investigate why this happens. It seems that is has something to do with measuring layout (maybe also connected with fragments).
from recyclertablayout.
@gregacucnik Thank you for your detailed information!
from recyclertablayout.
I can't reproduce with support library 26.0.1 on Nexus 5 running Marshmallow 6.0.1.
If you have had this issue yet, please open this issue again.
from recyclertablayout.
Related Issues (20)
- 4.4.4color invalid HOT 4
- How to set different tabwidth for every Tab. HOT 1
- about current position
- tab多行 HOT 7
- Swiping Left HOT 1
- Swipe left not change title color, version 1.4.0 HOT 6
- Any way to center tabs? HOT 1
- Text Size
- Text Size HOT 1
- how to set all Infinite selected tab? HOT 2
- how to custom viewPager HOT 1
- What if i dont want tabs all text capital HOT 3
- How does it work with FragmentPagerAdapter? HOT 4
- 1.5.0 problem with fragmentsstateadapter
- Indicator disapears after setting cutom tabBackground
- android.view.InflateException: Binary XML file line #19: Binary XML file line #19 HOT 4
- textview lines = 1
- How can i make adapter to load Another fragment ?
- Initial tab indicator is wrong with FragmentStatePagerAdapter
- Invalid indicator position
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 recyclertablayout.