mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	Addition: Pull down to refresh in nearby activity (#1164)
* added pull down to refresh in nearby activity * Requested changes made
This commit is contained in:
		
							parent
							
								
									9aceaca95d
								
							
						
					
					
						commit
						a7a2b51ceb
					
				
					 2 changed files with 15 additions and 5 deletions
				
			
		|  | @ -10,6 +10,7 @@ import android.preference.PreferenceManager; | |||
| import android.support.annotation.NonNull; | ||||
| import android.support.v4.app.Fragment; | ||||
| import android.support.v4.app.FragmentTransaction; | ||||
| import android.support.v4.widget.SwipeRefreshLayout; | ||||
| import android.support.v7.app.AlertDialog; | ||||
| import android.view.Menu; | ||||
| import android.view.MenuInflater; | ||||
|  | @ -60,7 +61,7 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|     private NearbyActivityMode viewMode; | ||||
|     private Disposable placesDisposable; | ||||
|     private boolean lockNearbyView; //Determines if the nearby places needs to be refreshed | ||||
| 
 | ||||
|     @BindView(R.id.swipe_container) SwipeRefreshLayout swipeLayout; | ||||
|     @Override | ||||
|     protected void onCreate(Bundle savedInstanceState) { | ||||
|         super.onCreate(savedInstanceState); | ||||
|  | @ -70,6 +71,13 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|         bundle = new Bundle(); | ||||
|         initDrawer(); | ||||
|         initViewState(); | ||||
|         swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { | ||||
|             @Override | ||||
|             public void onRefresh() { | ||||
|                 lockNearbyView(false); | ||||
|                 refreshView(true); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     private void initViewState() { | ||||
|  | @ -309,7 +317,7 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|         } else { | ||||
|             setListFragment(); | ||||
|         } | ||||
| 
 | ||||
|         swipeLayout.setRefreshing(false); | ||||
|         hideProgressBar(); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Balakrishnan S
						Balakrishnan S