mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	Fix conflicts
This commit is contained in:
		
							parent
							
								
									df884c8f79
								
							
						
					
					
						commit
						0da8b93ebb
					
				
					 3 changed files with 180 additions and 0 deletions
				
			
		|  | @ -3,9 +3,14 @@ package fr.free.nrw.commons.nearby; | ||||||
| import android.graphics.Color; | import android.graphics.Color; | ||||||
| import android.net.Uri; | import android.net.Uri; | ||||||
| import android.os.Bundle; | import android.os.Bundle; | ||||||
|  | import android.preference.PreferenceManager; | ||||||
|  | import android.support.design.widget.BottomSheetBehavior; | ||||||
|  | import android.support.design.widget.FloatingActionButton; | ||||||
| import android.view.LayoutInflater; | import android.view.LayoutInflater; | ||||||
| import android.view.View; | import android.view.View; | ||||||
| import android.view.ViewGroup; | import android.view.ViewGroup; | ||||||
|  | import android.view.animation.Animation; | ||||||
|  | import android.view.animation.AnimationUtils; | ||||||
| 
 | 
 | ||||||
| import com.google.gson.Gson; | import com.google.gson.Gson; | ||||||
| import com.google.gson.GsonBuilder; | import com.google.gson.GsonBuilder; | ||||||
|  | @ -32,6 +37,11 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | ||||||
|     private MapView mapView; |     private MapView mapView; | ||||||
|     private List<NearbyBaseMarker> baseMarkerOptions; |     private List<NearbyBaseMarker> baseMarkerOptions; | ||||||
|     private fr.free.nrw.commons.location.LatLng curLatLng; |     private fr.free.nrw.commons.location.LatLng curLatLng; | ||||||
|  |     private View bottomSheetList; | ||||||
|  |     private View bottomSheetDetails; | ||||||
|  |     private BottomSheetBehavior bottomSheetListBehavior; | ||||||
|  |     private BottomSheetBehavior bottomSheetDetailsBehavior; | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|     public NearbyMapFragment() { |     public NearbyMapFragment() { | ||||||
|     } |     } | ||||||
|  | @ -40,6 +50,7 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | ||||||
|     public void onCreate(Bundle savedInstanceState) { |     public void onCreate(Bundle savedInstanceState) { | ||||||
|         super.onCreate(savedInstanceState); |         super.onCreate(savedInstanceState); | ||||||
|         Bundle bundle = this.getArguments(); |         Bundle bundle = this.getArguments(); | ||||||
|  |         initViews(); | ||||||
|         Gson gson = new GsonBuilder() |         Gson gson = new GsonBuilder() | ||||||
|                 .registerTypeAdapter(Uri.class, new UriDeserializer()) |                 .registerTypeAdapter(Uri.class, new UriDeserializer()) | ||||||
|                 .create(); |                 .create(); | ||||||
|  | @ -73,6 +84,16 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | ||||||
|         return mapView; |         return mapView; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     private void initViews() { | ||||||
|  |         bottomSheetList = getActivity().findViewById(R.id.bottom_sheet); | ||||||
|  |         bottomSheetListBehavior = BottomSheetBehavior.from(bottomSheetList); | ||||||
|  |         bottomSheetDetails = getActivity().findViewById(R.id.bottom_sheet_details); | ||||||
|  |         bottomSheetDetailsBehavior = BottomSheetBehavior.from(bottomSheetDetails); | ||||||
|  |         bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); | ||||||
|  |         //moreInfo = getActivity().findViewById(R.id.more_info_bar); | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     private void setupMapView(Bundle savedInstanceState) { |     private void setupMapView(Bundle savedInstanceState) { | ||||||
|         MapboxMapOptions options = new MapboxMapOptions() |         MapboxMapOptions options = new MapboxMapOptions() | ||||||
|                 .styleUrl(Style.OUTDOORS) |                 .styleUrl(Style.OUTDOORS) | ||||||
|  |  | ||||||
|  | @ -64,6 +64,8 @@ | ||||||
|                 /> |                 /> | ||||||
|     </RelativeLayout> |     </RelativeLayout> | ||||||
|         <include layout="@layout/bottom_sheet_nearby" /> |         <include layout="@layout/bottom_sheet_nearby" /> | ||||||
|  |         <include layout="@layout/bottom_sheet_details" android:id="@+id/bottom_sheet_details" /> | ||||||
|  | 
 | ||||||
|     </android.support.design.widget.CoordinatorLayout> |     </android.support.design.widget.CoordinatorLayout> | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										157
									
								
								app/src/main/res/layout/bottom_sheet_details.xml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										157
									
								
								app/src/main/res/layout/bottom_sheet_details.xml
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,157 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
|  |     android:layout_width="match_parent" | ||||||
|  |     android:layout_height="wrap_content" | ||||||
|  |     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
|  |     android:orientation="vertical" | ||||||
|  |     android:background="@color/cardview_light_background" | ||||||
|  |     app:layout_behavior="@string/bottom_sheet_behavior" | ||||||
|  |     app:behavior_peekHeight="128dp" | ||||||
|  |     app:behavior_hideable="true" | ||||||
|  |     > | ||||||
|  | 
 | ||||||
|  |     <LinearLayout | ||||||
|  |         android:layout_width="match_parent" | ||||||
|  |         android:layout_height="72dp" | ||||||
|  |         android:layout_marginVertical="8dp" | ||||||
|  |         android:gravity="center_vertical" | ||||||
|  | 
 | ||||||
|  |         > | ||||||
|  | 
 | ||||||
|  |         <ImageView | ||||||
|  |             android:id="@+id/icon" | ||||||
|  |             android:layout_width="40dp" | ||||||
|  |             android:layout_height="40dp" | ||||||
|  |             android:layout_marginLeft="16dp" | ||||||
|  |             android:src="@drawable/ic_launcher"> | ||||||
|  |         </ImageView> | ||||||
|  | 
 | ||||||
|  |         <LinearLayout | ||||||
|  |             android:layout_width="match_parent" | ||||||
|  |             android:layout_height="wrap_content" | ||||||
|  |             android:orientation="vertical" | ||||||
|  |             android:layout_marginLeft="16dp" | ||||||
|  |             android:layout_marginRight="16dp"> | ||||||
|  | 
 | ||||||
|  |             <TextView | ||||||
|  |                 android:id="@+id/label" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:textSize="16sp" | ||||||
|  |                 android:text="Denemeler" /> | ||||||
|  | 
 | ||||||
|  |             <TextView | ||||||
|  |                 android:id="@+id/label2" | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:textSize="14sp" | ||||||
|  |                 android:text="Denemeler" /> | ||||||
|  |         </LinearLayout> | ||||||
|  |     </LinearLayout> | ||||||
|  |     <View | ||||||
|  |         android:layout_width="match_parent" | ||||||
|  |         android:layout_height="1dp" | ||||||
|  |         android:layout_marginTop="7dp" | ||||||
|  |         android:layout_marginBottom="8dp" | ||||||
|  |         android:background="@android:color/darker_gray"/> | ||||||
|  |     <LinearLayout | ||||||
|  |         android:layout_width="match_parent" | ||||||
|  |         android:layout_height="wrap_content" | ||||||
|  |         android:orientation="horizontal" | ||||||
|  |         > | ||||||
|  | 
 | ||||||
|  |         <LinearLayout | ||||||
|  |             android:id="@+id/directionsButton" | ||||||
|  |             android:layout_width="0dp" | ||||||
|  |             android:layout_height="wrap_content" | ||||||
|  |             android:layout_weight="1" | ||||||
|  |             android:padding="16dp" | ||||||
|  |             android:clickable="true" | ||||||
|  |             android:orientation="vertical" | ||||||
|  |             > | ||||||
|  |             <ImageView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_gravity="center_horizontal" | ||||||
|  |                 app:srcCompat="@drawable/ic_directions_black_48dp" /> | ||||||
|  |             <TextView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:paddingTop="8dp" | ||||||
|  |                 android:layout_gravity="center_horizontal" | ||||||
|  |                 android:text="DIRECTIONS" | ||||||
|  |                 /> | ||||||
|  |         </LinearLayout> | ||||||
|  |         <LinearLayout | ||||||
|  |             android:id="@+id/wikidataButton" | ||||||
|  |             android:layout_width="0dp" | ||||||
|  |             android:layout_height="wrap_content" | ||||||
|  |             android:layout_weight="1" | ||||||
|  |             android:padding="16dp" | ||||||
|  |             android:clickable="true" | ||||||
|  |             android:orientation="vertical" | ||||||
|  |             > | ||||||
|  |             <ImageView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_gravity="center_horizontal" | ||||||
|  |                 app:srcCompat="@drawable/ic_wikidata_logo_48dp" /> | ||||||
|  |             <TextView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:paddingTop="8dp" | ||||||
|  |                 android:layout_gravity="center_horizontal" | ||||||
|  |                 android:text="WIKI DATA" | ||||||
|  |                 /> | ||||||
|  |         </LinearLayout> | ||||||
|  | 
 | ||||||
|  |         <LinearLayout | ||||||
|  |             android:id="@+id/wikipediaButton" | ||||||
|  |             android:layout_width="0dp" | ||||||
|  |             android:layout_height="wrap_content" | ||||||
|  |             android:layout_weight="1" | ||||||
|  |             android:padding="16dp" | ||||||
|  |             android:clickable="true" | ||||||
|  |             android:orientation="vertical" | ||||||
|  |             > | ||||||
|  |             <ImageView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:layout_gravity="center_horizontal" | ||||||
|  |                 app:srcCompat="@drawable/ic_wikipedia_logo_48dp" | ||||||
|  |                 /> | ||||||
|  |             <TextView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:paddingTop="8dp" | ||||||
|  |                 android:layout_gravity="center_horizontal" | ||||||
|  |                 android:text="WIKIPEDIA" | ||||||
|  | 
 | ||||||
|  |                 /> | ||||||
|  |         </LinearLayout> | ||||||
|  |     </LinearLayout> | ||||||
|  |     <View | ||||||
|  |         android:layout_width="match_parent" | ||||||
|  |         android:layout_height="1dp" | ||||||
|  |         android:layout_marginTop="7dp" | ||||||
|  |         android:layout_marginBottom="8dp" | ||||||
|  |         android:background="@android:color/darker_gray"/> | ||||||
|  |     <TextView | ||||||
|  |         android:id="@+id/description" | ||||||
|  |         android:layout_width="match_parent" | ||||||
|  |         android:layout_height="wrap_content" | ||||||
|  |         android:layout_marginLeft="72dp" | ||||||
|  |         android:layout_marginRight="16dp" | ||||||
|  |         android:layout_marginBottom="16dp" | ||||||
|  |         android:textSize="16sp" | ||||||
|  |         android:text="Description Description Description | ||||||
|  | Description Description Description | ||||||
|  | Description Description Description | ||||||
|  | " /> | ||||||
|  | 
 | ||||||
|  |     <FrameLayout | ||||||
|  |         android:id="@+id/container_sheet" | ||||||
|  |         android:layout_width="match_parent" | ||||||
|  |         android:layout_height="wrap_content"></FrameLayout> | ||||||
|  | 
 | ||||||
|  | </LinearLayout> | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 neslihanturan
						neslihanturan