mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Clean up DirectNearbyUpload constructor
This commit is contained in:
		
							parent
							
								
									6134cf4d14
								
							
						
					
					
						commit
						9446427d0d
					
				
					 2 changed files with 3 additions and 8 deletions
				
			
		|  | @ -19,17 +19,13 @@ import static android.content.pm.PackageManager.PERMISSION_GRANTED; | |||
| 
 | ||||
| public class DirectUpload { | ||||
| 
 | ||||
|     private String title; | ||||
|     private String desc; | ||||
|     private ContributionController controller; | ||||
|     private Fragment fragment; | ||||
|     private SharedPreferences prefs; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     DirectUpload(String title, String desc, Fragment fragment, ContributionController controller, SharedPreferences prefs) { | ||||
|         this.title = title; | ||||
|         this.desc = desc; | ||||
|     DirectUpload(Fragment fragment, ContributionController controller, SharedPreferences prefs) { | ||||
|         this.fragment = fragment; | ||||
|         this.controller = controller; | ||||
|         this.prefs = prefs; | ||||
|  |  | |||
|  | @ -407,7 +407,7 @@ public class NearbyMapFragment extends DaggerFragment { | |||
|         fabCamera.setOnClickListener(view -> { | ||||
|             Timber.d("Camera button tapped. Image title: " + place.getName() + "Image desc: " + place.getLongDescription()); | ||||
|             controller = new ContributionController(this); | ||||
|             DirectUpload directUpload = new DirectUpload(place.getName(), place.getLongDescription(), this, controller, prefs); | ||||
|             DirectUpload directUpload = new DirectUpload(this, controller, prefs); | ||||
|             storeSharedPrefs(); | ||||
|             directUpload.initiateCameraUpload(); | ||||
|         }); | ||||
|  | @ -415,7 +415,7 @@ public class NearbyMapFragment extends DaggerFragment { | |||
|         fabGallery.setOnClickListener(view -> { | ||||
|             Timber.d("Gallery button tapped. Image title: " + place.getName() + "Image desc: " + place.getLongDescription()); | ||||
|             controller = new ContributionController(this); | ||||
|             DirectUpload directUpload = new DirectUpload(place.getName(), place.getLongDescription(), this, controller, prefs); | ||||
|             DirectUpload directUpload = new DirectUpload(this, controller, prefs); | ||||
|             storeSharedPrefs(); | ||||
|             directUpload.initiateGalleryUpload(); | ||||
|         }); | ||||
|  | @ -423,7 +423,6 @@ public class NearbyMapFragment extends DaggerFragment { | |||
| 
 | ||||
|     void storeSharedPrefs() { | ||||
|         SharedPreferences.Editor editor = directPrefs.edit(); | ||||
| 
 | ||||
|         editor.putString("Title", place.getName()); | ||||
|         editor.putString("Desc", place.getLongDescription()); | ||||
|         editor.apply(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 misaochan
						misaochan