mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-30 22:34:02 +01:00
add space after ,
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parent
8d76cfa4d9
commit
b68256d7f0
11 changed files with 40 additions and 41 deletions
|
|
@ -38,16 +38,16 @@ public class BookmarkLocationsFragment extends DaggerFragment {
|
|||
private final ActivityResultLauncher<Intent> cameraPickLauncherForResult =
|
||||
registerForActivityResult(new StartActivityForResult(),
|
||||
result -> {
|
||||
contributionController.handleActivityResultWithCallback(requireActivity(),callbacks -> {
|
||||
contributionController.onPictureReturnedFromCamera(result,requireActivity(),callbacks);
|
||||
contributionController.handleActivityResultWithCallback(requireActivity(), callbacks -> {
|
||||
contributionController.onPictureReturnedFromCamera(result, requireActivity(), callbacks);
|
||||
});
|
||||
});
|
||||
|
||||
private final ActivityResultLauncher<Intent> galleryPickLauncherForResult =
|
||||
registerForActivityResult(new StartActivityForResult(),
|
||||
result -> {
|
||||
contributionController.handleActivityResultWithCallback(requireActivity(),callbacks -> {
|
||||
contributionController.onPictureReturnedFromGallery(result,requireActivity(),callbacks);
|
||||
contributionController.handleActivityResultWithCallback(requireActivity(), callbacks -> {
|
||||
contributionController.onPictureReturnedFromGallery(result, requireActivity(), callbacks);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ public class BookmarkLocationsFragment extends DaggerFragment {
|
|||
contributionController.locationPermissionCallback.onLocationPermissionGranted();
|
||||
} else {
|
||||
if (shouldShowRequestPermissionRationale(permission.ACCESS_FINE_LOCATION)) {
|
||||
contributionController.handleShowRationaleFlowCameraLocation(getActivity(), inAppCameraLocationPermissionLauncher,cameraPickLauncherForResult);
|
||||
contributionController.handleShowRationaleFlowCameraLocation(getActivity(), inAppCameraLocationPermissionLauncher, cameraPickLauncherForResult);
|
||||
} else {
|
||||
contributionController.locationPermissionCallback.onLocationPermissionDenied(getActivity().getString(R.string.in_app_camera_location_permission_denied));
|
||||
}
|
||||
|
|
@ -104,7 +104,6 @@ public class BookmarkLocationsFragment extends DaggerFragment {
|
|||
inAppCameraLocationPermissionLauncher,
|
||||
galleryPickLauncherForResult,
|
||||
cameraPickLauncherForResult
|
||||
|
||||
);
|
||||
binding.listView.setAdapter(adapter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class ContributionController {
|
|||
createDialogsAndHandleLocationPermissions(activity,
|
||||
inAppCameraLocationPermissionLauncher, resultLauncher);
|
||||
} else {
|
||||
initiateCameraUpload(activity,resultLauncher);
|
||||
initiateCameraUpload(activity, resultLauncher);
|
||||
}
|
||||
},
|
||||
R.string.storage_permission_title,
|
||||
|
|
@ -152,7 +152,7 @@ public class ContributionController {
|
|||
() -> {
|
||||
Toast.makeText(activity, activity.getString(toastTextResource),
|
||||
Toast.LENGTH_LONG).show();
|
||||
initiateCameraUpload(activity,resultLauncher);
|
||||
initiateCameraUpload(activity, resultLauncher);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -210,8 +210,8 @@ public class ContributionController {
|
|||
/**
|
||||
* Initiate gallery picker
|
||||
*/
|
||||
public void initiateGalleryPick(final Activity activity,ActivityResultLauncher<Intent> resultLauncher ,final boolean allowMultipleUploads) {
|
||||
initiateGalleryUpload(activity,resultLauncher ,allowMultipleUploads);
|
||||
public void initiateGalleryPick(final Activity activity, ActivityResultLauncher<Intent> resultLauncher, final boolean allowMultipleUploads) {
|
||||
initiateGalleryUpload(activity, resultLauncher, allowMultipleUploads);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -221,7 +221,7 @@ public class ContributionController {
|
|||
setPickerConfiguration(activity, true);
|
||||
|
||||
PermissionUtils.checkPermissionsAndPerformAction(activity,
|
||||
() -> FilePicker.openCustomSelector(activity, resultLauncher,0),
|
||||
() -> FilePicker.openCustomSelector(activity, resultLauncher, 0),
|
||||
R.string.storage_permission_title,
|
||||
R.string.write_storage_permission_rationale,
|
||||
PermissionUtils.PERMISSIONS_STORAGE);
|
||||
|
|
@ -234,7 +234,7 @@ public class ContributionController {
|
|||
private void initiateGalleryUpload(final Activity activity, ActivityResultLauncher<Intent> resultLauncher,
|
||||
final boolean allowMultipleUploads) {
|
||||
setPickerConfiguration(activity, allowMultipleUploads);
|
||||
FilePicker.openGallery(activity, resultLauncher,0, isDocumentPhotoPickerPreferred());
|
||||
FilePicker.openGallery(activity, resultLauncher, 0, isDocumentPhotoPickerPreferred());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -257,7 +257,7 @@ public class ContributionController {
|
|||
locationBeforeImageCapture = locationManager.getLastLocation();
|
||||
}
|
||||
isInAppCameraUpload = true;
|
||||
FilePicker.openCameraForImage(activity, resultLauncher,0);
|
||||
FilePicker.openCameraForImage(activity, resultLauncher, 0);
|
||||
}
|
||||
|
||||
private boolean isDocumentPhotoPickerPreferred(){
|
||||
|
|
@ -270,16 +270,16 @@ public class ContributionController {
|
|||
if(isDocumentPhotoPickerPreferred()){
|
||||
FilePicker.onPictureReturnedFromDocuments(result, activity, callbacks);
|
||||
} else {
|
||||
FilePicker.onPictureReturnedFromGallery(result,activity,callbacks);
|
||||
FilePicker.onPictureReturnedFromGallery(result, activity, callbacks);
|
||||
}
|
||||
}
|
||||
|
||||
public void onPictureReturnedFromCustomSelector(ActivityResult result, Activity activity, @NonNull FilePicker.Callbacks callbacks) {
|
||||
FilePicker.onPictureReturnedFromCustomSelector(result,activity,callbacks);
|
||||
FilePicker.onPictureReturnedFromCustomSelector(result, activity, callbacks);
|
||||
}
|
||||
|
||||
public void onPictureReturnedFromCamera(ActivityResult result, Activity activity, @NonNull FilePicker.Callbacks callbacks) {
|
||||
FilePicker.onPictureReturnedFromCamera(result,activity,callbacks);
|
||||
FilePicker.onPictureReturnedFromCamera(result, activity, callbacks);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -101,24 +101,24 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment impl
|
|||
private final ActivityResultLauncher<Intent> galleryPickLauncherForResult =
|
||||
registerForActivityResult(new StartActivityForResult(),
|
||||
result -> {
|
||||
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> {
|
||||
controller.onPictureReturnedFromGallery(result,requireActivity(),callbacks);
|
||||
controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
|
||||
controller.onPictureReturnedFromGallery(result, requireActivity(), callbacks);
|
||||
});
|
||||
});
|
||||
|
||||
private final ActivityResultLauncher<Intent> customSelectorLauncherForResult =
|
||||
registerForActivityResult(new StartActivityForResult(),
|
||||
result -> {
|
||||
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> {
|
||||
controller.onPictureReturnedFromCustomSelector(result,requireActivity(),callbacks);
|
||||
controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
|
||||
controller.onPictureReturnedFromCustomSelector(result, requireActivity(), callbacks);
|
||||
});
|
||||
});
|
||||
|
||||
private final ActivityResultLauncher<Intent> cameraPickLauncherForResult =
|
||||
registerForActivityResult(new StartActivityForResult(),
|
||||
result -> {
|
||||
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> {
|
||||
controller.onPictureReturnedFromCamera(result,requireActivity(),callbacks);
|
||||
controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
|
||||
controller.onPictureReturnedFromCamera(result, requireActivity(), callbacks);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -356,7 +356,7 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment impl
|
|||
return true;
|
||||
});
|
||||
binding.fabGallery.setOnClickListener(view -> {
|
||||
controller.initiateGalleryPick(getActivity(), galleryPickLauncherForResult,true);
|
||||
controller.initiateGalleryPick(getActivity(), galleryPickLauncherForResult, true);
|
||||
animateFAB(isFabOpen);
|
||||
});
|
||||
binding.fabGallery.setOnLongClickListener(view -> {
|
||||
|
|
@ -369,7 +369,7 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment impl
|
|||
* Launch Custom Selector.
|
||||
*/
|
||||
protected void launchCustomSelector() {
|
||||
controller.initiateCustomGalleryPickWithPermission(getActivity(),customSelectorLauncherForResult);
|
||||
controller.initiateCustomGalleryPickWithPermission(getActivity(), customSelectorLauncherForResult);
|
||||
animateFAB(isFabOpen);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ class CustomSelectorActivity :
|
|||
* When data will be send from full screen mode, it will be passed to fragment
|
||||
*/
|
||||
private fun onFullScreenDataReceived(result: ActivityResult){
|
||||
if (result.resultCode == Activity.RESULT_OK) {
|
||||
if (result.resultCode == Activity.RESULT_OK) {
|
||||
val selectedImages: ArrayList<Image> =
|
||||
result.data!!
|
||||
.getParcelableArrayListExtra(CustomSelectorConstants.NEW_SELECTED_IMAGES)!!
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class FilePicker implements Constants {
|
|||
*
|
||||
* @param type Custom type of your choice, which will be returned with the images
|
||||
*/
|
||||
public static void openGallery(Activity activity,ActivityResultLauncher<Intent> resultLauncher,int type, boolean openDocumentIntentPreferred) {
|
||||
public static void openGallery(Activity activity, ActivityResultLauncher<Intent> resultLauncher, int type, boolean openDocumentIntentPreferred) {
|
||||
Intent intent = createGalleryIntent(activity, type, openDocumentIntentPreferred);
|
||||
resultLauncher.launch(intent);
|
||||
}
|
||||
|
|
@ -117,7 +117,7 @@ public class FilePicker implements Constants {
|
|||
/**
|
||||
* Opens Custom Selector
|
||||
*/
|
||||
public static void openCustomSelector(Activity activity,ActivityResultLauncher<Intent> resultLauncher,int type) {
|
||||
public static void openCustomSelector(Activity activity, ActivityResultLauncher<Intent> resultLauncher, int type) {
|
||||
Intent intent = createCustomSelectorIntent(activity, type);
|
||||
resultLauncher.launch(intent);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ fun placeAdapterDelegate(
|
|||
nearbyButtonLayout.cameraButton.setOnClickListener { onCameraClicked(item, inAppCameraLocationPermissionLauncher, cameraPickLauncherForResult) }
|
||||
nearbyButtonLayout.cameraButton.setOnLongClickListener { onCameraLongPressed() }
|
||||
|
||||
nearbyButtonLayout.galleryButton.setOnClickListener { onGalleryClicked(item,galleryPickLauncherForResult) }
|
||||
nearbyButtonLayout.galleryButton.setOnClickListener { onGalleryClicked(item, galleryPickLauncherForResult) }
|
||||
nearbyButtonLayout.galleryButton.setOnLongClickListener { onGalleryLongPressed() }
|
||||
bookmarkButtonImage.setOnClickListener {
|
||||
val isBookmarked = bookmarkLocationDao.updateBookmarkLocation(item)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class CommonPlaceClickActions
|
|||
} else {
|
||||
Timber.d("Gallery button tapped. Image title: ${place.getName()}Image desc: ${place.getLongDescription()}")
|
||||
storeSharedPrefs(place)
|
||||
contributionController.initiateGalleryPick(activity, galleryPickLauncherForResult,false)
|
||||
contributionController.initiateGalleryPick(activity, galleryPickLauncherForResult, false)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,24 +230,24 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
private final ActivityResultLauncher<Intent> galleryPickLauncherForResult =
|
||||
registerForActivityResult(new StartActivityForResult(),
|
||||
result -> {
|
||||
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> {
|
||||
controller.onPictureReturnedFromGallery(result,requireActivity(),callbacks);
|
||||
controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
|
||||
controller.onPictureReturnedFromGallery(result, requireActivity(), callbacks);
|
||||
});
|
||||
});
|
||||
|
||||
private final ActivityResultLauncher<Intent> customSelectorLauncherForResult =
|
||||
registerForActivityResult(new StartActivityForResult(),
|
||||
result -> {
|
||||
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> {
|
||||
controller.onPictureReturnedFromCustomSelector(result,requireActivity(),callbacks);
|
||||
controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
|
||||
controller.onPictureReturnedFromCustomSelector(result, requireActivity(), callbacks);
|
||||
});
|
||||
});
|
||||
|
||||
private final ActivityResultLauncher<Intent> cameraPickLauncherForResult =
|
||||
registerForActivityResult(new StartActivityForResult(),
|
||||
result -> {
|
||||
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> {
|
||||
controller.onPictureReturnedFromCamera(result,requireActivity(),callbacks);
|
||||
controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
|
||||
controller.onPictureReturnedFromCamera(result, requireActivity(), callbacks);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -2247,7 +2247,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
if (binding.fabCustomGallery.isShown()) {
|
||||
Timber.d("Gallery button tapped. Place: %s", selectedPlace.toString());
|
||||
storeSharedPrefs(selectedPlace);
|
||||
controller.initiateCustomGalleryPickWithPermission(getActivity(),customSelectorLauncherForResult);
|
||||
controller.initiateCustomGalleryPickWithPermission(getActivity(), customSelectorLauncherForResult);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ public class SettingsFragment extends PreferenceFragmentCompat {
|
|||
private final ActivityResultLauncher<Intent> cameraPickLauncherForResult =
|
||||
registerForActivityResult(new StartActivityForResult(),
|
||||
result -> {
|
||||
contributionController.handleActivityResultWithCallback(requireActivity(),callbacks -> {
|
||||
contributionController.onPictureReturnedFromCamera(result,requireActivity(),callbacks);
|
||||
contributionController.handleActivityResultWithCallback(requireActivity(), callbacks -> {
|
||||
contributionController.onPictureReturnedFromCamera(result, requireActivity(), callbacks);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class CustomSelectorActivityTest {
|
|||
@Throws(Exception::class)
|
||||
fun testResultLauncher() {
|
||||
val intent = Mockito.mock(Intent::class.java)
|
||||
val activityResult = ActivityResult(Activity.RESULT_OK,intent)
|
||||
val activityResult = ActivityResult(Activity.RESULT_OK, intent)
|
||||
val func =
|
||||
activity.javaClass.getDeclaredMethod(
|
||||
"onFullScreenDataReceived",
|
||||
|
|
|
|||
|
|
@ -364,12 +364,12 @@ class UploadMediaDetailFragmentUnitTest {
|
|||
`when`(latLng.latitude).thenReturn(0.0)
|
||||
`when`(latLng.longitude).thenReturn(0.0)
|
||||
`when`(uploadItem.gpsCoords).thenReturn(imageCoordinates)
|
||||
val activityResult = ActivityResult(Activity.RESULT_OK,intent)
|
||||
val activityResult = ActivityResult(Activity.RESULT_OK, intent)
|
||||
|
||||
val handleResultMethod = UploadMediaDetailFragment::class.java.getDeclaredMethod("onCameraPosition", ActivityResult::class.java)
|
||||
handleResultMethod.isAccessible = true
|
||||
|
||||
handleResultMethod.invoke(fragment,activityResult)
|
||||
handleResultMethod.invoke(fragment, activityResult)
|
||||
Mockito.verify(presenter, Mockito.times(0)).getImageQuality(0, location, activity)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue