Description
I need to scroll the panel when the panel is in anchored point position (mine is in the 35% of screen)
and also in full screen. I dont care if i can only drag it from the top part of it.
Here is my code:
ACTIVITYMAIN.xml
<?xml version="1.0" encoding="utf-8"?> <com.sothree.slidinguppanel.SlidingUpPanelLayout android:id="@+id/sliding_layout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".activities.MainActivity" app:umanoDragView="@id/dragView" app:umanoScrollableView="@id/recyclerView" android:layout_gravity="bottom" android:gravity="bottom"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <fragment android:name="com.example.fragments.MapFragment" android:id="@+id/mapFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerInParent="true"/> <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/distanceBtn" android:src="@android:drawable/ic_dialog_info" android:layout_margin="@dimen/fab_margin" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </RelativeLayout> <LinearLayout android:id="@+id/dragView" android:layout_width="match_parent" android:layout_height="match_parent" android:clickable="true" android:focusable="false" android:orientation="vertical"> <RelativeLayout android:layout_width="match_parent" android:layout_height="68dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="16sp" android:text="Action"/> </RelativeLayout> <fragment android:name="com.example.fragments.ListFragment" android:id="@+id/fragmentId" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"/> </LinearLayout> </com.sothree.slidinguppanel.SlidingUpPanelLayout>
The first fragment is a map and the second one a list that ill paste the following.
ListFragment.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" tools:context=".fragments.ListFragment"> <RelativeLayout android:layout_marginLeft="20sp" android:layout_weight="6" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Example" android:layout_centerVertical="true"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:layout_marginEnd="40dp" android:text="Example"/> </RelativeLayout> <RelativeLayout android:layout_marginLeft="20sp" android:layout_weight=".4" android:layout_width="match_parent" android:layout_height="match_parent"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical"/> </RelativeLayout> </LinearLayout>
And i have this in my MainActivity.java
SlidingUpPanelLayout slidingLayout = (SlidingUpPanelLayout) findViewById(R.id.sliding_layout); slidingLayout.setAnchorPoint(0.35f);
Any ideas?