mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Add check in SingleUploadFragment for isNearbyUploadf
This commit is contained in:
		
							parent
							
								
									b719491dcf
								
							
						
					
					
						commit
						0401eb781c
					
				
					 2 changed files with 13 additions and 3 deletions
				
			
		|  | @ -99,9 +99,11 @@ public  class      ShareActivity | |||
|     private String title; | ||||
|     private String description; | ||||
|     private Snackbar snackbar; | ||||
|     private boolean duplicateCheckPassed = false; | ||||
| 
 | ||||
|     private String nearbyTitle; | ||||
|     private String nearbyDesc; | ||||
|     private boolean duplicateCheckPassed = false; | ||||
|     private boolean isNearbyUpload = false; | ||||
| 
 | ||||
|     /** | ||||
|      * Called when user taps the submit button. | ||||
|  | @ -201,6 +203,10 @@ public  class      ShareActivity | |||
|         finish(); | ||||
|     } | ||||
| 
 | ||||
|     protected boolean isNearbyUpload() { | ||||
|         return isNearbyUpload; | ||||
|     } | ||||
| 
 | ||||
|     protected String getNearbyTitle() { | ||||
|         return nearbyTitle; | ||||
|     } | ||||
|  | @ -237,6 +243,7 @@ public  class      ShareActivity | |||
|             } | ||||
|             if (intent.hasExtra("isDirectUpload")) { | ||||
|                 Timber.d("This was initiated by a direct upload from Nearby"); | ||||
|                 isNearbyUpload = true; | ||||
| 
 | ||||
|                 SharedPreferences sharedPref = this.getSharedPreferences("Direct Upload", Context.MODE_PRIVATE); | ||||
|                 nearbyTitle = sharedPref.getString("Title", ""); | ||||
|  |  | |||
|  | @ -105,8 +105,10 @@ public class SingleUploadFragment extends DaggerFragment { | |||
| 
 | ||||
|         license = prefs.getString(Prefs.DEFAULT_LICENSE, Prefs.Licenses.CC_BY_SA_3); | ||||
| 
 | ||||
|         boolean isNearbyUpload = ((ShareActivity) getActivity()).isNearbyUpload(); | ||||
| 
 | ||||
|         //TODO: Get this to display title and desc | ||||
|         if (true) { | ||||
|         if (isNearbyUpload) { | ||||
|             String imageTitle = ((ShareActivity) getActivity()).getNearbyTitle(); | ||||
|             String imageDesc = ((ShareActivity) getActivity()).getNearbyDesc(); | ||||
|             titleEdit.setText(imageTitle); | ||||
|  | @ -249,7 +251,8 @@ public class SingleUploadFragment extends DaggerFragment { | |||
|         } | ||||
|         return false; | ||||
|     } | ||||
|      | ||||
| 
 | ||||
|     @SuppressLint("StringFormatInvalid") | ||||
|     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