mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	Add forgotten commons link button to fabs
This commit is contained in:
		
							parent
							
								
									8e8472800b
								
							
						
					
					
						commit
						b0a54ca89d
					
				
					 3 changed files with 60 additions and 8 deletions
				
			
		|  | @ -4,19 +4,18 @@ import android.content.Intent; | |||
| import android.graphics.Color; | ||||
| import android.net.Uri; | ||||
| import android.os.Bundle; | ||||
| import android.preference.PreferenceManager; | ||||
| import android.support.annotation.NonNull; | ||||
| import android.support.annotation.Nullable; | ||||
| import android.support.design.widget.BottomSheetBehavior; | ||||
| import android.support.design.widget.CoordinatorLayout; | ||||
| import android.support.design.widget.FloatingActionButton; | ||||
| import android.util.Log; | ||||
| import android.view.KeyEvent; | ||||
| import android.view.LayoutInflater; | ||||
| import android.view.View; | ||||
| import android.view.ViewGroup; | ||||
| import android.view.animation.Animation; | ||||
| import android.view.animation.AnimationUtils; | ||||
| import android.widget.Button; | ||||
| import android.widget.ImageView; | ||||
| import android.widget.LinearLayout; | ||||
| import android.widget.TextView; | ||||
|  | @ -39,7 +38,6 @@ import java.lang.reflect.Type; | |||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import butterknife.BindView; | ||||
| import fr.free.nrw.commons.R; | ||||
| import fr.free.nrw.commons.utils.UriDeserializer; | ||||
| 
 | ||||
|  | @ -59,6 +57,7 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|     private FloatingActionButton fabPlus; | ||||
|     private FloatingActionButton fabCamera; | ||||
|     private FloatingActionButton fabGallery; | ||||
|     private FloatingActionButton fabCommons; | ||||
|     private View transparentView; | ||||
|     private TextView description; | ||||
|     private TextView title; | ||||
|  | @ -71,6 +70,8 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|     private Animation fab_open; | ||||
|     private Animation rotate_forward; | ||||
| 
 | ||||
|     private Place place; | ||||
| 
 | ||||
|     public NearbyMapFragment() { | ||||
|     } | ||||
| 
 | ||||
|  | @ -150,6 +151,7 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|         fabPlus = getActivity().findViewById(R.id.fab_plus); | ||||
|         fabCamera = getActivity().findViewById(R.id.fab_camera); | ||||
|         fabGallery = getActivity().findViewById(R.id.fab_galery); | ||||
|         fabCommons = getActivity().findViewById(R.id.fab_commons_page); | ||||
| 
 | ||||
|         fab_open = AnimationUtils.loadAnimation(getActivity(), R.anim.fab_open); | ||||
|         fab_close = AnimationUtils.loadAnimation(getActivity(),R.anim.fab_close); | ||||
|  | @ -348,6 +350,7 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|     } | ||||
| 
 | ||||
|     private void passInfoToSheet(Place place) { | ||||
|         this.place = place; | ||||
|         wikipediaButton.setEnabled( | ||||
|                 !(place.siteLinks == null || Uri.EMPTY.equals(place.siteLinks.getWikipediaLink()))); | ||||
|         wikipediaButton.setOnClickListener(new View.OnClickListener() { | ||||
|  | @ -366,6 +369,15 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|             } | ||||
|         }); | ||||
| 
 | ||||
|         fabCommons.setEnabled( | ||||
|                 !(place.siteLinks == null || Uri.EMPTY.equals(place.siteLinks.getCommonsLink()))); | ||||
|         fabCommons.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 Log.d("deneme","deneme"); | ||||
|                 openWebView(place.siteLinks.getCommonsLink()); } | ||||
|         }); | ||||
| 
 | ||||
|         directionsButton.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|  | @ -400,16 +412,22 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|             fabPlus.startAnimation(rotate_backward); | ||||
|             fabCamera.startAnimation(fab_close); | ||||
|             fabGallery.startAnimation(fab_close); | ||||
|             fabCommons.startAnimation(fab_close); | ||||
|             fabCamera.setClickable(false); | ||||
|             fabGallery.setClickable(false); | ||||
|             fabCommons.setClickable(false); | ||||
| 
 | ||||
|         } else { | ||||
| 
 | ||||
|             fabPlus.startAnimation(rotate_forward); | ||||
|             fabCamera.startAnimation(fab_open); | ||||
|             fabGallery.startAnimation(fab_open); | ||||
|             fabCommons.startAnimation(fab_open); | ||||
|             fabCamera.setClickable(true); | ||||
|             fabGallery.setClickable(true); | ||||
|             fabCommons.setClickable( | ||||
|                     !(place.siteLinks == null | ||||
|                             || Uri.EMPTY.equals(place.siteLinks.getCommonsLink()))); | ||||
| 
 | ||||
|         } | ||||
| 
 | ||||
|  | @ -421,8 +439,10 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|             fabPlus.startAnimation(rotate_backward); | ||||
|             fabCamera.startAnimation(fab_close); | ||||
|             fabGallery.startAnimation(fab_close); | ||||
|             fabCommons.startAnimation(fab_close); | ||||
|             fabCamera.setClickable(false); | ||||
|             fabGallery.setClickable(false); | ||||
|             fabCommons.setClickable(false); | ||||
|             this.isFabOpen=!isFabOpen; | ||||
|         } | ||||
|     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 neslihanturan
						neslihanturan