Following the introduction of volley yesterday, I did some work this morning on how to introduce the Android-pulltorefresh project. SOURCE Project Address: Https://github.com/chrisbanes/Android-PullToRefresh
The main problem with this project is
1. The project structure differs from the structure of the Androidstudio project
2. Reference to the ANDROID-SUPPORT-V4 support library (this problem can only be resolved temporarily to find the following workaround)
The main steps are basically similar to the introduction of volley, but in order to use it, I reassign the entire project source to the project structure under the corresponding Androidstudio, and integrate listfragment and viewpager corresponding code from extras into the project. , and also modifies the r dependency in it.
Here are the steps:
Step 1.
Modify the project structure:
SOURCE Project Structure:
Modified project structure (later I will send the item after modifying the directory)
At the same time I merged the IDs under the Viewpager into the res/ids of the entire project, where only one was defined for the Viewpager ID.
Here is the project after modifying the directory address: Https://github.com/wylhyz/Android-PullToRefresh
Add a Build.gradle file for this dependent project, and then add dependencies that depend on the V4 support library:
The original project relies on the following:
Other follow the volley in the previous article to import the method can be
, so you can use the project.
A simple example to implement on GitHub is:
Results:
Above.
Androidstudio the process of introducing the Android-pulltorefresh Library-as a dependent project