OP got a response. But for someone who wants this effect, you can use SlidingPaneLayout . It is intended for this purpose.
In the XML file:
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@id/mainFrame" style="@style/MP.mainFrame" > <LinearLayout style="@style/searchLayout"> <android.support.v4.widget.NestedScrollView style="@style/MP"> <LinearLayout style="@style/MP.verticalLinearLayout"> </LinearLayout> </android.support.v4.widget.NestedScrollView> </LinearLayout> <FrameLayout style="@style/MP.mainLayout"> <LinearLayout android:id="@id/fragmentContainer" style="@style/MP.fragmentContainer"/> <android.support.v7.widget.Toolbar style="@style/toolbar"> <ir.tooskar.excomponents.ExtendedTextView android:id="@id/appTitle" style="@style/WC.appTitle"/> <ir.tooskar.excomponents.ExtendedTextView android:id="@id/appBarSearchIcon" style="@style/WC.appBarSearchIcon"/> </android.support.v7.widget.Toolbar> </FrameLayout>
There are two panels, left and right, that stick together and thus move together. For me, the left panel is the main panel, and the switching icon is hidden on the right to display it. (View from id appBarSearchIcon ).
Remember that there is one view group called SlidingPaneLayout , which has only two children: Left and Right . >.
And an important role in the activity:
slidingPaneLayout = (SlidingPaneLayout) findViewById(R.id.mainFrame); // Sets a color for covering left pane(Main Pane) slidingPaneLayout.setSliderFadeColor(ContextCompat.getColor(context, R.color.searchPaneFadeColor)); // The listener for Opening the Right pane(Hidden pane) findViewById(R.id.appBarSearchIcon).setOnClickListener(new OnClickListener() { @Override public void onClick(View view){ slidingPaneLayout.openPane(); } });
Closing the right pane is done using the API, just like Navigation Drawer.
Arash Jul 23 '17 at 7:43 2017-07-23 07:43
source share