Comments (10)
I can't reproduce this behavior on my devices. Which library version and which device are you using?
from material-intro.
I'm using SNAPSHOT of material-intro.
Regards
,
Akshay Chordiya
On Mon, Mar 7, 2016 at 8:11 PM, Heinrich Reimer [email protected]
wrote:
I can't reproduce this behavior on my devices. Which library version and
which device are you using?—
Reply to this email directly or view it on GitHub
#20 (comment)
.
from material-intro.
For me, it doesn't show the startup two times, but he is right with recreation. The FragmentManager normally cares about retaining Fragments, etc. This is broken with this library, which means Fragments are recreated each rotation, and that wastes power and CPU cycles.
I think it will be pretty difficult adding proper fragment retaining support, but it will be worth it ;D
from material-intro.
Fun fact: if you rotate the device, the Fragments get recreated, but onCreateView doesn't get called, means permissionGranted is false, and doesn't get true, means you can't go forward anymore after rotation.
from material-intro.
Sadly, my fix doesn't fix the problem of my last comment. So we definitely need to rewrite the IntroActivity for proper instance saving and restoring support.
from material-intro.
I switched from using FragmentPagerAdapter
to using FragmentStatePagerAdapter
in e6fe290. This should keep Fragment
s in memory. I have to look into restoring pager position though.
from material-intro.
The main issue is that the displayed Fragment
is the old one loaded from FragmentManager
and the code that checks if users are allowed to go to the next page is the new one returned because onCreate()
gets called on IntroActivity
from material-intro.
We could either try to detect if an old but matching Fragment
is already existing in FragmentManager
in SlideAdapter.addSlide()
. But that would require us to save a unique ID with every Slide
which I don't like as it's extra effort for developers implementing this library ...
... or we simply don't use Fragment
retaining at all but instead create every Fragment again after an orientation change. That's not a problem in particular as the fragments used in an intro won't be very complicated and thus the recreation process would not take too much time...
from material-intro.
(Accidentially closed the issue. Sorry for that!)
from material-intro.
Finally found a solution for the first approach without requiring an ID. Needs some polishing and will be a breaking change so stay tuned for a fix soon.
from material-intro.
Related Issues (20)
- Button doesn't adjust its size depending on length of text
- Glitch when moving from slide without button to slide with button
- NullPointerException
- Could not find com.heinrichreimersoftware:material-intro:x.y.z. HOT 1
- Could not find com.heinrichreimersoftware:material-intro:x.y.z. HOT 1
- Freeze when switching Activity HOT 8
- Slider cannot open screens HOT 2
- A slide can be skipped even if navigation is blocked HOT 1
- Null object reference on customization setButtonBackVisible(true);
- Crashes due resource not found exception below API 23
- Mention that "Databinding = true" is necessary for using custom slides(fragmentslide)
- Crash due to NPE
- Continuous Lagging when swiping
- java.lang.ClassNotFoundException
- RTL support
- Glitch when moving from slide without button to slide with button
- Lag when swipe
- java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity
- Rotation HOT 1
- Resource Not Found: mi_ic_skip, mi_ic_previous, mi_ic_next, mi_ic_finish
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 material-intro.