Android Sliding Up View

I need to do a sliding view, which should slide at the bottom of the screen when I press the button. It should be displayed at the bottom of the screen, and I need to move / drag it to the center of the screen. The images below explain this better. almost like AndroidSlidingUpPanel from umano, which you can find here :

The problem is that I want the first child (the content of my view - an image, for example) to fill the entire screen, and also want the second child (the actual bottom plan) to appear when I click the button, The images below explain it better. If this cannot be done by changing AndroidSlidingUpPanel, how can I do this? I have never worked with such views. I would really appreciate any advice or help. Thank you very much.

enter image description here

+4
source share
4 answers

To hide or show the panel, you can use

ShowPanel ()

method.

To hide this, try the following:

SlidingUpPanelLayout slidePanel = (SlidingUpPanelLayout) findViewById (R.id.sliding_panel);         slidingPanel.hidePanel();

SlidingUpPanelLayout slidePanel = (SlidingUpPanelLayout) findViewById (R.id.sliding_panel);         slidingPanel.showPanel();

2.0 AndroidSlidingUpPanel (https://github.com/umano/AndroidSlidingUpPanel). , vroid v13, , .

+1

AndroidSlidingUpPanel, :

android:visibility="GONE"

2 ° () .showPane() .hidePane() SlidingUpPanelLayout, / , .

0

https://github.com/Paroca72/sc-widgets

ScSlidingPanel. . RelativeLayout, , . , , .

, .

<!-- Define the container -->
<RelativeLayout
    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"
    tools:context=".MainActivity">

    <!-- Sliding from top -->
    <scapps.com.library.ScSlidingPanel
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true">

            <!-- HERE THE YOUR CONTENT -->
            <!-- or you can load by setLayout method -->

    </scapps.com.library.ScSlidingPanel>

</RelativeLayout>

, , .

. .. setToggleOnTouch() true / , .

0

Source: https://habr.com/ru/post/1527460/


All Articles