mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Remove show list FAB, since using multple fabs is not recommended. Use list button in menu instead
This commit is contained in:
		
							parent
							
								
									7c81873c64
								
							
						
					
					
						commit
						fac1fa0b80
					
				
					 5 changed files with 14 additions and 42 deletions
				
			
		|  | @ -56,8 +56,6 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|     LinearLayout bottomSheet; | ||||
|     @BindView(R.id.bottom_sheet_details) | ||||
|     LinearLayout bottomSheetDetails; | ||||
|     @BindView(R.id.fab_list) | ||||
|     FloatingActionButton fabList; | ||||
|     @BindView(R.id.transparentView) | ||||
|     View transparentView; | ||||
| 
 | ||||
|  | @ -85,8 +83,6 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|         bundle = new Bundle(); | ||||
| 
 | ||||
|         initBottomSheetBehaviour(); | ||||
|         initFabList(); | ||||
| 
 | ||||
|         initDrawer(); | ||||
|     } | ||||
| 
 | ||||
|  | @ -129,16 +125,6 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|         bottomSheetBehaviorForDetails.setState(BottomSheetBehavior.STATE_HIDDEN); | ||||
|     } | ||||
| 
 | ||||
|     private void initFabList() { | ||||
|         fabList.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 bottomSheetBehaviorForDetails.setState(BottomSheetBehavior.STATE_HIDDEN); | ||||
|                 bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean onCreateOptionsMenu(Menu menu) { | ||||
|         MenuInflater inflater = getMenuInflater(); | ||||
|  | @ -155,6 +141,10 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|                 lockNearbyView(false); | ||||
|                 refreshView(true); | ||||
|                 return true; | ||||
|             case R.id.action_display_list: | ||||
|                 bottomSheetBehaviorForDetails.setState(BottomSheetBehavior.STATE_HIDDEN); | ||||
|                 bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); | ||||
|                 return true; | ||||
|             default: | ||||
|                 return super.onOptionsItemSelected(item); | ||||
|         } | ||||
|  | @ -412,11 +402,6 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|     } | ||||
| 
 | ||||
|     public void prepareViewsForSheetPosition(int bottomSheetState) { | ||||
|         if (bottomSheetState >= BottomSheetBehavior.STATE_COLLAPSED) { | ||||
|             fabList.show(); | ||||
|         } | ||||
|         else if (bottomSheetState == BottomSheetBehavior.STATE_EXPANDED) { | ||||
|             fabList.hide(); | ||||
|         } | ||||
|         // TODO | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -56,7 +56,6 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|     private LinearLayout wikipediaButton; | ||||
|     private LinearLayout wikidataButton; | ||||
|     private LinearLayout directionsButton; | ||||
|     private FloatingActionButton fabList; | ||||
|     private FloatingActionButton fabPlus; | ||||
|     private FloatingActionButton fabCamera; | ||||
|     private FloatingActionButton fabGallery; | ||||
|  | @ -148,7 +147,6 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|         bottomSheetDetailsBehavior = BottomSheetBehavior.from(bottomSheetDetails); | ||||
|         bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); | ||||
| 
 | ||||
|         fabList = getActivity().findViewById(R.id.fab_list); | ||||
|         fabPlus = getActivity().findViewById(R.id.fab_plus); | ||||
|         fabCamera = getActivity().findViewById(R.id.fab_camera); | ||||
|         fabGallery = getActivity().findViewById(R.id.fab_galery); | ||||
|  | @ -309,21 +307,18 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
| 
 | ||||
|         switch (bottomSheetState) { | ||||
|             case (BottomSheetBehavior.STATE_COLLAPSED): | ||||
|                 if (!fabList.isShown()) fabList.show(); | ||||
|                 closeFabs(isFabOpen); | ||||
|                 if (!fabPlus.isShown()) showFAB(); | ||||
|                 this.getView().requestFocus(); | ||||
|                 moreInfo.setVisibility(View.VISIBLE); | ||||
|                 break; | ||||
|             case (BottomSheetBehavior.STATE_EXPANDED): | ||||
|                 if (fabList.isShown()) fabList.hide(); | ||||
|                 this.getView().requestFocus(); | ||||
|                 moreInfo.setVisibility(View.VISIBLE); | ||||
|                 break; | ||||
|             case (BottomSheetBehavior.STATE_HIDDEN): | ||||
|                 transparentView.setClickable(false); | ||||
|                 transparentView.setAlpha(0); | ||||
|                 if (!fabList.isShown()) fabList.show(); | ||||
|                 closeFabs(isFabOpen); | ||||
|                 hideFAB(); | ||||
|                 this.getView().requestFocus(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 neslihanturan
						neslihanturan