This question mainly introduces the use of Swipebacklayout
Swipebacklayout support left and right side slide, and swipe up to return to the upper level
Library Resources: Https://github.com/ikew0ng/SwipeBackLayout
Import Process:
1. After downloading, get a compressed package, unzip and import the library inside
2. After the import, you will find that the SRC folder is empty, do not worry. In the project there is a Java folder, the Java folder under the entire file copy to SRC, you can.
3. Although SRC has, but will find the code error. To other projects, the Lib folder including Android-support-v4.jar copy come, will not error
Use:
1. In your own project, import the swipebacklayout library
2. Create a class that inherits Swipebackactivity
3. After running, you can slide back, the default is to slide back to the right, if you want to set the slide in the other direction back, you can set:
Edgeflag = Swipebacklayout.edge_left; Swipe right edgeflag = swipebacklayout.edge_right; Swipe left edgeflag = swipebacklayout.edge_bottom;//up slide Edgeflag = Swipebacklayout.edge_all; Can be slid in 3 directions
4. If the background black screen during the sliding process, it can be resolved as follows:
1) in styles, customize a style to inherit apptheme, and then add a property
<item name= "Android:windowistranslucent" >true</item>
2) in the manifest file, set the theme to a custom style and run it again.
5. If you want to click the return key also has a similar sliding effect, need to rewrite onbackpressed ()
@Overridepublic void onbackpressed () {scrolltofinishactivity ();}
Sliding back swipebacklayout of open source projects