More recently, the company has added a new requirement to the need to develop apps to return to the previous page when adding the right swipe to the Android page. I just know this demand, feel a bit of a pit, maybe design there recently contacted the client or iOS swipe can return to the previous level of effect, so ...
Previously did not contact the Android sliding back open Source library, so still look for Baidu ...
And then found it on GitHub. Swipebacklayout;github Address: Https://github.com/ikew0ng/SwipeBackLayout
First, let's take a look at this open source project, and don't worry about getting started, take a look at the project first.
Project requirements: To use this open-source class library, introduce the latest V4 package into your project
Next, let's look at how to use it. Look at the documentation for the project (some people don't like the official documentation, so it's easy to make a variety of problems)
Use the first step: Introduce the Swipebacklayout class library into your project, this you can choose to introduce the source code of the Project class library or if you use Android Studio development then add the following references in Gradle:
The second step is to inherit swipebackactivity from the activity class that you want to use to return to the previous level of the page, and then use it in Setcontentview () in the OnCreate method, and then call Getswipebacklayout () method to get the swipebacklayout, and then you can set the direction of the slide. At first I thought it was complete, but when I ran and slid, I found that the following page was a black screen. It feels weird ...
Later, one look at the document found that the last step was missing.
The third step, in the project res->values->styles the following increase this sentence: <item name= "Android:windowistranslucent" >true</item>
Finally, your project is connected to the swipebacklayout ...
iOS-like sliding back to the top level, swipebacklayout-android sliding back to class library