In the project, a viewpager + fragment slide page flip is performed, and the test on the simulator and Xiaomi mobile phone is also normal. However, when I switched to a screen test of over 4.7, I found that the slide always failed.
Because the default sliding policy of the system is that the page is displayed only when the user slides more than half a screen. After finding many methods on the Internet, the system fails. I thought it was because I used viewpagerindicator. Then viewpagerindicatorCodeAfter deletion, there was no improvement. In fact, viewpager's sliding paging root viewpagerindicator had no semi-gross relationship. All are managed by the system.
Then I tried to rewrite the ontouch and setonpagechangelistener methods. Although they can achieve the desired effect, they did not inherit the system animation. The setcurrentindex () method is ugly. I don't want to rewrite pageradapter either. After finding n examples on the internet, I found that some examples slide abnormally smoothly, and there is no difference in the analysis code, and the code I wrote is also exceptionally smooth after I copied it, this proves that it is not a problem with the code written by brother.
After a day of struggle, I finally thought about the V4 support package problem? However, the two jar extension packages use V4. After trying to replace the V4 extension package, the problem is solved !!!
That is to say, the reason why viewpager does not slide smoothly on the big screen and cannot flip the page because Google modified the viewpager slide policy in the V4 package, the simplest way is to replace it with the old V4 package!
The old V4 package is attached below. I just want to say that Google is so bad. If I modify the V4 package, I will not say anything... This small bug has been ruined for two days... but it will also cause some problems, that is, the old V4 package lacks some new methods. This requires you to weigh the costs of your project.
Http://download.csdn.net/detail/h3c4lenovo/5786767