mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	Insert image name and desc into shared preference
This commit is contained in:
		
							parent
							
								
									4b83037299
								
							
						
					
					
						commit
						6605eb070c
					
				
					 1 changed files with 16 additions and 7 deletions
				
			
		|  | @ -1,6 +1,8 @@ | |||
| package fr.free.nrw.commons.nearby; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import android.content.SharedPreferences; | ||||
| import android.graphics.Color; | ||||
| import android.net.Uri; | ||||
| import android.os.Bundle; | ||||
|  | @ -394,17 +396,24 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|         description.setText(place.getLongDescription()); | ||||
|         title.setText(place.name.toString()); | ||||
|         distance.setText(place.distance.toString()); | ||||
|          | ||||
| 
 | ||||
|         fabCamera.setOnClickListener(view -> { | ||||
|                 //TODO: Change this to activate camera upload (see ContributionsListFragment). Insert shared preference. | ||||
|                 Timber.d("Image title: " + place.getName() + "Image desc: " + place.getLongDescription()); | ||||
|                 openWebView(place.siteLinks.getWikidataLink()); | ||||
|             //TODO: Change this to activate camera upload (see ContributionsListFragment). Insert shared preference. | ||||
|             Timber.d("Image title: " + place.getName() + "Image desc: " + place.getLongDescription()); | ||||
| 
 | ||||
|             SharedPreferences sharedPref = getActivity().getPreferences(Context.MODE_PRIVATE); | ||||
|             SharedPreferences.Editor editor = sharedPref.edit(); | ||||
|             editor.putString("Title", place.getName()); | ||||
|             editor.putString("Desc", place.getLongDescription()); | ||||
|             editor.apply(); | ||||
| 
 | ||||
|             openWebView(place.siteLinks.getWikidataLink()); | ||||
|         }); | ||||
| 
 | ||||
|         fabGallery.setOnClickListener(view -> { | ||||
|                 //TODO: Change this to activate gallery upload (see ContributionsListFragment). Insert shared preference. | ||||
|                 Timber.d("Image title: " + place.getName() + "Image desc: " + place.getLongDescription()); | ||||
|                 openWebView(place.siteLinks.getWikidataLink()); | ||||
|             //TODO: Change this to activate gallery upload (see ContributionsListFragment). Insert shared preference. | ||||
|             Timber.d("Image title: " + place.getName() + "Image desc: " + place.getLongDescription()); | ||||
|             openWebView(place.siteLinks.getWikidataLink()); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 misaochan
						misaochan