mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	Merge branch 'master' of https://github.com/commons-app/apps-android-commons
This commit is contained in:
		
						commit
						a458b8ad06
					
				
					 149 changed files with 2572 additions and 1220 deletions
				
			
		|  | @ -45,6 +45,7 @@ public class Contribution extends Media { | |||
|     private long transferred; | ||||
|     private String decimalCoords; | ||||
|     private boolean isMultiple; | ||||
|     private String wikiDataEntityId; | ||||
| 
 | ||||
|     public Contribution(Uri contentUri, String filename, Uri localUri, String imageUrl, Date timestamp, | ||||
|                         int state, long dataLength, Date dateUploaded, long transferred, | ||||
|  | @ -222,4 +223,17 @@ public class Contribution extends Media { | |||
| 
 | ||||
|         throw new RuntimeException("Unrecognized license value: " + license); | ||||
|     } | ||||
| 
 | ||||
|     public String getWikiDataEntityId() { | ||||
|         return wikiDataEntityId; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * When the corresponding wikidata entity is known as in case of nearby uploads, it can be set | ||||
|      * using the setter method | ||||
|      * @param wikiDataEntityId | ||||
|      */ | ||||
|     public void setWikiDataEntityId(String wikiDataEntityId) { | ||||
|         this.wikiDataEntityId = wikiDataEntityId; | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -90,7 +90,7 @@ public class ContributionController { | |||
|         fragment.startActivityForResult(pickImageIntent, SELECT_FROM_GALLERY); | ||||
|     } | ||||
| 
 | ||||
|     public void handleImagePicked(int requestCode, Intent data, boolean isDirectUpload) { | ||||
|     public void handleImagePicked(int requestCode, Intent data, boolean isDirectUpload, String wikiDataEntityId) { | ||||
|         FragmentActivity activity = fragment.getActivity(); | ||||
|         Timber.d("handleImagePicked() called with onActivityResult()"); | ||||
|         Intent shareIntent = new Intent(activity, ShareActivity.class); | ||||
|  | @ -102,9 +102,6 @@ public class ContributionController { | |||
|                 shareIntent.setType(activity.getContentResolver().getType(imageData)); | ||||
|                 shareIntent.putExtra(EXTRA_STREAM, imageData); | ||||
|                 shareIntent.putExtra(EXTRA_SOURCE, SOURCE_GALLERY); | ||||
|                 if (isDirectUpload) { | ||||
|                     shareIntent.putExtra("isDirectUpload", true); | ||||
|                 } | ||||
|                 break; | ||||
|             case SELECT_FROM_CAMERA: | ||||
|                 //FIXME: Find out appropriate mime type | ||||
|  | @ -113,9 +110,6 @@ public class ContributionController { | |||
|                 shareIntent.setType("image/jpeg"); | ||||
|                 shareIntent.putExtra(EXTRA_STREAM, lastGeneratedCaptureUri); | ||||
|                 shareIntent.putExtra(EXTRA_SOURCE, SOURCE_CAMERA); | ||||
|                 if (isDirectUpload) { | ||||
|                     shareIntent.putExtra("isDirectUpload", true); | ||||
|                 } | ||||
| 
 | ||||
|                 break; | ||||
|             default: | ||||
|  | @ -123,6 +117,10 @@ public class ContributionController { | |||
|         } | ||||
|         Timber.i("Image selected"); | ||||
|         try { | ||||
|             shareIntent.putExtra("isDirectUpload", isDirectUpload); | ||||
|             if (wikiDataEntityId != null && !wikiDataEntityId.equals("")) { | ||||
|                 shareIntent.putExtra("wikiDataEntityId", wikiDataEntityId); | ||||
|             } | ||||
|             activity.startActivity(shareIntent); | ||||
|         } catch (SecurityException e) { | ||||
|             Timber.e(e, "Security Exception"); | ||||
|  |  | |||
|  | @ -127,7 +127,7 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment { | |||
|         if (resultCode == RESULT_OK) { | ||||
|             Timber.d("OnActivityResult() parameters: Req code: %d Result code: %d Data: %s", | ||||
|                     requestCode, resultCode, data); | ||||
|             controller.handleImagePicked(requestCode, data, false); | ||||
|             controller.handleImagePicked(requestCode, data, false, null); | ||||
|         } else { | ||||
|             Timber.e("OnActivityResult() parameters: Req code: %d Result code: %d Data: %s", | ||||
|                     requestCode, resultCode, data); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 misaochan
						misaochan