mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-11-04 08:43:52 +01:00 
			
		
		
		
	Clean up DirectNearbyUpload constructor
This commit is contained in:
		
							parent
							
								
									82e9ffbdb8
								
							
						
					
					
						commit
						5a0a8c6019
					
				
					 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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -410,7 +410,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();
 | 
			
		||||
        });
 | 
			
		||||
| 
						 | 
				
			
			@ -418,7 +418,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();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -429,7 +429,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