Open taltstidl opened 9 years ago
@TR4Android : did you commit any changes? where can i use setFloatingActionButtonVisibility()?
@Arash-gm It's not available yet. Sorry for that. Will be coming soon.
Commit 6d0ed126cd94571881a182a4a88cf52cae6e1503 has better handling of the visibility. You have to make sure though that you only use the setFloatingActionButtonVisibility(int visibility)
of the FloatingActionButtonLayout, so the code can still handle the visibility when it has to. The int visibility
must be either View.VISIBLE
, View.INVISIBLE
or View.GONE
as with the normal setVisibility
call.
@Arash-gm Tell me if this fixes your issue. Thanks!
@TR4Android : with replacing new commit , the app crashes on application launch with error on :
Caused by: java.lang.NullPointerException at com.sothree.slidinguppanel.SlidingUpPanelLayout.smoothSlideTo(SlidingUpPanelLayout.java:1297) at com.sothree.slidinguppanel.SlidingUpPanelLayout.smoothToBottom(SlidingUpPanelLayout.java:506) at com.sothree.slidinguppanel.SlidingUpPanelLayout.setPanelHeight(SlidingUpPanelLayout.java:499)
i've also tried just lines of your changes for changing visibility with no success.
@Arash-gm Sorry for that. I'll have a look at this issue tomorrow. I don't know what causes this yet, as it works fine on my phone.
@Arash-gm Could you please provide your configuration so I can reproduce this issue. What are the attributes of the panel? What is the fabs default visibility? What methods are you calling on startup?
@TR4Android : sorry to answering late , the panel attributes are :
<com.sothree.slidinguppanel.FloatingActionButtonLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
xmlns:fab="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
sothree:umanoFabMode="circular_reveal"
android:id="@+id/fabLayout">
<!-- SLIDING UP PANEL -->
<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoDragView="@+id/dragView"
sothree:umanoParalaxOffset="10dp"
sothree:umanoShadowHeight="0dp"
sothree:umanoFadeColor="@color/color_slideup_layout_parallax"
sothree:umanoOverlay="true"
android:background="@android:color/transparent">
and on onViewCreated of my Fragment i call :
slidingLayout.setPanelHeight(1);
slidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
slidingLayout.setDragView(R.id.view_fake_prevent_swipe);
@Arash-gm This issue can probably be solved by adding the attributes for the methods you call when the fragments view is created (something like sothree:umanoPanelHeight="1"
or sothree:umanoInitialState="hidden"
) and deleting those calls. I'll look at this issue further though.
@TR4Android : i've removed run time calls and the NPE error went out , but visibility and detaching doesn't work. and when i touch on FAB spot its getting visible again!
@TR4Android : watching on Layout boundaries , it shows that always FAB panel is out there even it is detached or visibility set to gone.
@Arash-gm Unfortunately I am unable to reproduce this issue in the demo activity. Could you please provide the relevant code so I can check it out? Thanks.
Taken from issue #12. Because this library also handles the visibility in some cases to make sure the Floating Action Button is appearing correctly depending on the panel position, external calls to
setVisibility()
will be overidden. This will probably be done as a custom call to set the Floating Action Button, so the library can still track the visibility when needed (mFloatingActionButtonLayout.setFloatingActionButtonVisibility()
).