umano / AndroidSlidingUpPanel

This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.
http://umano.me
Apache License 2.0
9.5k stars 2.26k forks source link

Scroll RecyclerView when panel is at Anchored Point #980

Open markvex20 opened 4 years ago

markvex20 commented 4 years ago

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?

omkar-tenkale commented 4 years ago

This contradicts the default beheviour

Still possible with new commits at https://github.com/hannesa2/AndroidSlidingUpPanel/

U need to set maxexpandedratio or ssomething like that attribute

fail572872916 commented 3 years ago

This contradicts the default beheviour

Still possible with new commits at https://github.com/hannesa2/AndroidSlidingUpPanel/

U need to set maxexpandedratio or ssomething like that attribute

I don't see a property called MaxExpandeDratio in your library