Open nikolaGithub2018 opened 6 years ago
The anchor view for the particle system is the one that will be used as a parent for the particle system, if you want it to be on the background you need something like this:
<FrameLayout>
<your layout />
</FrameLayout>
And make the FrameLayout be the anchor. I may need to check if the Particle system is added as a child at the end or at the beginning, to be sure, you can have another FrameLayout to be the first child of the FrameLayout and use that one as the anchor
Thanks for fast reply, I really appreciate it. I tried that and it did not work, although I am not sure I understood your post entirely. Would you mind to write the exact constructor call for layout below:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frame_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/linear_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<Button
android:id="@+id/button0"
...
/>
</LinearLayout>
</ScrollView>
</FrameLayout>
Thanks man ;)
Try adding another FrameLayout before the ScrollView and using that one as an anchor, that should work (I mentioned it briefly on my previous comment, I didn't remember how it was implemented 100%)
Great, it works :)
Just call
new ParticleSystem(this, 80, bitmap, 10000, R.id.frame_anim_background)
with this layout:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frame_anim_background">
</FrameLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<Button
android:id="@+id/button0"
...
/>
</LinearLayout>
</ScrollView>
</FrameLayout>
If we have for example, some layout like this: < ScrollView > < LinearLayout > -Button0 -Button1 -Button2 -Button3 ... < / LinearLayout > </ ScrollView >
How to set ParticleSystem constructor which will emit particles behind all those buttons (I need particles to show only in background, not to fall in front of buttons)???
this will not work> ParticleSystem(activity, maxParticles, drawableRedId, timeToLive, idOfLinearLayoutFromExampleAbove)