mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Pass nearby Title and Desc to SingleUploadFragment
This commit is contained in:
		
							parent
							
								
									565e61c0d1
								
							
						
					
					
						commit
						b719491dcf
					
				
					 2 changed files with 19 additions and 8 deletions
				
			
		|  | @ -99,6 +99,8 @@ public  class      ShareActivity | |||
|     private String title; | ||||
|     private String description; | ||||
|     private Snackbar snackbar; | ||||
|     private String nearbyTitle; | ||||
|     private String nearbyDesc; | ||||
|     private boolean duplicateCheckPassed = false; | ||||
| 
 | ||||
|     /** | ||||
|  | @ -199,6 +201,14 @@ public  class      ShareActivity | |||
|         finish(); | ||||
|     } | ||||
| 
 | ||||
|     protected String getNearbyTitle() { | ||||
|         return nearbyTitle; | ||||
|     } | ||||
| 
 | ||||
|     protected String getNearbyDesc() { | ||||
|         return nearbyDesc; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onCreate(Bundle savedInstanceState) { | ||||
|         super.onCreate(savedInstanceState); | ||||
|  | @ -229,11 +239,9 @@ public  class      ShareActivity | |||
|                 Timber.d("This was initiated by a direct upload from Nearby"); | ||||
| 
 | ||||
|                 SharedPreferences sharedPref = this.getSharedPreferences("Direct Upload", Context.MODE_PRIVATE); | ||||
|                 String imageTitle = sharedPref.getString("Title", ""); | ||||
|                 String imageDesc = sharedPref.getString("Desc", ""); | ||||
|                 Timber.d("In ShareActivity, image title: " + imageTitle + " and image desc: " + imageDesc); | ||||
| 
 | ||||
| 
 | ||||
|                 nearbyTitle = sharedPref.getString("Title", ""); | ||||
|                 nearbyDesc = sharedPref.getString("Desc", ""); | ||||
|                 Timber.d("In ShareActivity, image title: " + nearbyTitle + " and image desc: " + nearbyDesc); | ||||
|             } | ||||
|             mimeType = intent.getType(); | ||||
|         } | ||||
|  |  | |||
|  | @ -1,5 +1,6 @@ | |||
| package fr.free.nrw.commons.upload; | ||||
| 
 | ||||
| import android.annotation.SuppressLint; | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import android.content.SharedPreferences; | ||||
|  | @ -106,8 +107,10 @@ public class SingleUploadFragment extends DaggerFragment { | |||
| 
 | ||||
|         //TODO: Get this to display title and desc | ||||
|         if (true) { | ||||
|             titleEdit.setText(""); | ||||
|             descEdit.setText(""); | ||||
|             String imageTitle = ((ShareActivity) getActivity()).getNearbyTitle(); | ||||
|             String imageDesc = ((ShareActivity) getActivity()).getNearbyDesc(); | ||||
|             titleEdit.setText(imageTitle); | ||||
|             descEdit.setText(imageDesc); | ||||
|         } | ||||
| 
 | ||||
|         // check if this is the first time we have uploaded | ||||
|  | @ -246,7 +249,7 @@ public class SingleUploadFragment extends DaggerFragment { | |||
|         } | ||||
|         return false; | ||||
|     } | ||||
| 
 | ||||
|      | ||||
|     private void setLicenseSummary(String license) { | ||||
|         licenseSummaryView.setText(getString(R.string.share_license_summary, getString(Utils.licenseNameFor(license)))); | ||||
|     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 misaochan
						misaochan