add space after ,

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parneet-guraya 2024-10-23 07:06:42 +05:30
parent 8d76cfa4d9
commit b68256d7f0
No known key found for this signature in database
GPG key ID: 63B807C4B2A9064B
11 changed files with 40 additions and 41 deletions

View file

@ -38,16 +38,16 @@ public class BookmarkLocationsFragment extends DaggerFragment {
private final ActivityResultLauncher<Intent> cameraPickLauncherForResult = private final ActivityResultLauncher<Intent> cameraPickLauncherForResult =
registerForActivityResult(new StartActivityForResult(), registerForActivityResult(new StartActivityForResult(),
result -> { result -> {
contributionController.handleActivityResultWithCallback(requireActivity(),callbacks -> { contributionController.handleActivityResultWithCallback(requireActivity(), callbacks -> {
contributionController.onPictureReturnedFromCamera(result,requireActivity(),callbacks); contributionController.onPictureReturnedFromCamera(result, requireActivity(), callbacks);
}); });
}); });
private final ActivityResultLauncher<Intent> galleryPickLauncherForResult = private final ActivityResultLauncher<Intent> galleryPickLauncherForResult =
registerForActivityResult(new StartActivityForResult(), registerForActivityResult(new StartActivityForResult(),
result -> { result -> {
contributionController.handleActivityResultWithCallback(requireActivity(),callbacks -> { contributionController.handleActivityResultWithCallback(requireActivity(), callbacks -> {
contributionController.onPictureReturnedFromGallery(result,requireActivity(),callbacks); contributionController.onPictureReturnedFromGallery(result, requireActivity(), callbacks);
}); });
}); });
@ -63,7 +63,7 @@ public class BookmarkLocationsFragment extends DaggerFragment {
contributionController.locationPermissionCallback.onLocationPermissionGranted(); contributionController.locationPermissionCallback.onLocationPermissionGranted();
} else { } else {
if (shouldShowRequestPermissionRationale(permission.ACCESS_FINE_LOCATION)) { if (shouldShowRequestPermissionRationale(permission.ACCESS_FINE_LOCATION)) {
contributionController.handleShowRationaleFlowCameraLocation(getActivity(), inAppCameraLocationPermissionLauncher,cameraPickLauncherForResult); contributionController.handleShowRationaleFlowCameraLocation(getActivity(), inAppCameraLocationPermissionLauncher, cameraPickLauncherForResult);
} else { } else {
contributionController.locationPermissionCallback.onLocationPermissionDenied(getActivity().getString(R.string.in_app_camera_location_permission_denied)); contributionController.locationPermissionCallback.onLocationPermissionDenied(getActivity().getString(R.string.in_app_camera_location_permission_denied));
} }
@ -104,7 +104,6 @@ public class BookmarkLocationsFragment extends DaggerFragment {
inAppCameraLocationPermissionLauncher, inAppCameraLocationPermissionLauncher,
galleryPickLauncherForResult, galleryPickLauncherForResult,
cameraPickLauncherForResult cameraPickLauncherForResult
); );
binding.listView.setAdapter(adapter); binding.listView.setAdapter(adapter);
} }

View file

@ -82,7 +82,7 @@ public class ContributionController {
createDialogsAndHandleLocationPermissions(activity, createDialogsAndHandleLocationPermissions(activity,
inAppCameraLocationPermissionLauncher, resultLauncher); inAppCameraLocationPermissionLauncher, resultLauncher);
} else { } else {
initiateCameraUpload(activity,resultLauncher); initiateCameraUpload(activity, resultLauncher);
} }
}, },
R.string.storage_permission_title, R.string.storage_permission_title,
@ -152,7 +152,7 @@ public class ContributionController {
() -> { () -> {
Toast.makeText(activity, activity.getString(toastTextResource), Toast.makeText(activity, activity.getString(toastTextResource),
Toast.LENGTH_LONG).show(); Toast.LENGTH_LONG).show();
initiateCameraUpload(activity,resultLauncher); initiateCameraUpload(activity, resultLauncher);
} }
); );
} }
@ -210,8 +210,8 @@ public class ContributionController {
/** /**
* Initiate gallery picker * Initiate gallery picker
*/ */
public void initiateGalleryPick(final Activity activity,ActivityResultLauncher<Intent> resultLauncher ,final boolean allowMultipleUploads) { public void initiateGalleryPick(final Activity activity, ActivityResultLauncher<Intent> resultLauncher, final boolean allowMultipleUploads) {
initiateGalleryUpload(activity,resultLauncher ,allowMultipleUploads); initiateGalleryUpload(activity, resultLauncher, allowMultipleUploads);
} }
/** /**
@ -221,7 +221,7 @@ public class ContributionController {
setPickerConfiguration(activity, true); setPickerConfiguration(activity, true);
PermissionUtils.checkPermissionsAndPerformAction(activity, PermissionUtils.checkPermissionsAndPerformAction(activity,
() -> FilePicker.openCustomSelector(activity, resultLauncher,0), () -> FilePicker.openCustomSelector(activity, resultLauncher, 0),
R.string.storage_permission_title, R.string.storage_permission_title,
R.string.write_storage_permission_rationale, R.string.write_storage_permission_rationale,
PermissionUtils.PERMISSIONS_STORAGE); PermissionUtils.PERMISSIONS_STORAGE);
@ -234,7 +234,7 @@ public class ContributionController {
private void initiateGalleryUpload(final Activity activity, ActivityResultLauncher<Intent> resultLauncher, private void initiateGalleryUpload(final Activity activity, ActivityResultLauncher<Intent> resultLauncher,
final boolean allowMultipleUploads) { final boolean allowMultipleUploads) {
setPickerConfiguration(activity, 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(); locationBeforeImageCapture = locationManager.getLastLocation();
} }
isInAppCameraUpload = true; isInAppCameraUpload = true;
FilePicker.openCameraForImage(activity, resultLauncher,0); FilePicker.openCameraForImage(activity, resultLauncher, 0);
} }
private boolean isDocumentPhotoPickerPreferred(){ private boolean isDocumentPhotoPickerPreferred(){
@ -270,16 +270,16 @@ public class ContributionController {
if(isDocumentPhotoPickerPreferred()){ if(isDocumentPhotoPickerPreferred()){
FilePicker.onPictureReturnedFromDocuments(result, activity, callbacks); FilePicker.onPictureReturnedFromDocuments(result, activity, callbacks);
} else { } else {
FilePicker.onPictureReturnedFromGallery(result,activity,callbacks); FilePicker.onPictureReturnedFromGallery(result, activity, callbacks);
} }
} }
public void onPictureReturnedFromCustomSelector(ActivityResult result, Activity activity, @NonNull FilePicker.Callbacks 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) { public void onPictureReturnedFromCamera(ActivityResult result, Activity activity, @NonNull FilePicker.Callbacks callbacks) {
FilePicker.onPictureReturnedFromCamera(result,activity,callbacks); FilePicker.onPictureReturnedFromCamera(result, activity, callbacks);
} }
/** /**

View file

@ -101,24 +101,24 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment impl
private final ActivityResultLauncher<Intent> galleryPickLauncherForResult = private final ActivityResultLauncher<Intent> galleryPickLauncherForResult =
registerForActivityResult(new StartActivityForResult(), registerForActivityResult(new StartActivityForResult(),
result -> { result -> {
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> { controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
controller.onPictureReturnedFromGallery(result,requireActivity(),callbacks); controller.onPictureReturnedFromGallery(result, requireActivity(), callbacks);
}); });
}); });
private final ActivityResultLauncher<Intent> customSelectorLauncherForResult = private final ActivityResultLauncher<Intent> customSelectorLauncherForResult =
registerForActivityResult(new StartActivityForResult(), registerForActivityResult(new StartActivityForResult(),
result -> { result -> {
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> { controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
controller.onPictureReturnedFromCustomSelector(result,requireActivity(),callbacks); controller.onPictureReturnedFromCustomSelector(result, requireActivity(), callbacks);
}); });
}); });
private final ActivityResultLauncher<Intent> cameraPickLauncherForResult = private final ActivityResultLauncher<Intent> cameraPickLauncherForResult =
registerForActivityResult(new StartActivityForResult(), registerForActivityResult(new StartActivityForResult(),
result -> { result -> {
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> { controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
controller.onPictureReturnedFromCamera(result,requireActivity(),callbacks); controller.onPictureReturnedFromCamera(result, requireActivity(), callbacks);
}); });
}); });
@ -356,7 +356,7 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment impl
return true; return true;
}); });
binding.fabGallery.setOnClickListener(view -> { binding.fabGallery.setOnClickListener(view -> {
controller.initiateGalleryPick(getActivity(), galleryPickLauncherForResult,true); controller.initiateGalleryPick(getActivity(), galleryPickLauncherForResult, true);
animateFAB(isFabOpen); animateFAB(isFabOpen);
}); });
binding.fabGallery.setOnLongClickListener(view -> { binding.fabGallery.setOnLongClickListener(view -> {
@ -369,7 +369,7 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment impl
* Launch Custom Selector. * Launch Custom Selector.
*/ */
protected void launchCustomSelector() { protected void launchCustomSelector() {
controller.initiateCustomGalleryPickWithPermission(getActivity(),customSelectorLauncherForResult); controller.initiateCustomGalleryPickWithPermission(getActivity(), customSelectorLauncherForResult);
animateFAB(isFabOpen); animateFAB(isFabOpen);
} }

View file

@ -109,7 +109,7 @@ public class FilePicker implements Constants {
* *
* @param type Custom type of your choice, which will be returned with the images * @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); Intent intent = createGalleryIntent(activity, type, openDocumentIntentPreferred);
resultLauncher.launch(intent); resultLauncher.launch(intent);
} }
@ -117,7 +117,7 @@ public class FilePicker implements Constants {
/** /**
* Opens Custom Selector * 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); Intent intent = createCustomSelectorIntent(activity, type);
resultLauncher.launch(intent); resultLauncher.launch(intent);
} }

View file

@ -50,7 +50,7 @@ fun placeAdapterDelegate(
nearbyButtonLayout.cameraButton.setOnClickListener { onCameraClicked(item, inAppCameraLocationPermissionLauncher, cameraPickLauncherForResult) } nearbyButtonLayout.cameraButton.setOnClickListener { onCameraClicked(item, inAppCameraLocationPermissionLauncher, cameraPickLauncherForResult) }
nearbyButtonLayout.cameraButton.setOnLongClickListener { onCameraLongPressed() } nearbyButtonLayout.cameraButton.setOnLongClickListener { onCameraLongPressed() }
nearbyButtonLayout.galleryButton.setOnClickListener { onGalleryClicked(item,galleryPickLauncherForResult) } nearbyButtonLayout.galleryButton.setOnClickListener { onGalleryClicked(item, galleryPickLauncherForResult) }
nearbyButtonLayout.galleryButton.setOnLongClickListener { onGalleryLongPressed() } nearbyButtonLayout.galleryButton.setOnLongClickListener { onGalleryLongPressed() }
bookmarkButtonImage.setOnClickListener { bookmarkButtonImage.setOnClickListener {
val isBookmarked = bookmarkLocationDao.updateBookmarkLocation(item) val isBookmarked = bookmarkLocationDao.updateBookmarkLocation(item)

View file

@ -79,7 +79,7 @@ class CommonPlaceClickActions
} else { } else {
Timber.d("Gallery button tapped. Image title: ${place.getName()}Image desc: ${place.getLongDescription()}") Timber.d("Gallery button tapped. Image title: ${place.getName()}Image desc: ${place.getLongDescription()}")
storeSharedPrefs(place) storeSharedPrefs(place)
contributionController.initiateGalleryPick(activity, galleryPickLauncherForResult,false) contributionController.initiateGalleryPick(activity, galleryPickLauncherForResult, false)
} }
} }

View file

@ -230,24 +230,24 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
private final ActivityResultLauncher<Intent> galleryPickLauncherForResult = private final ActivityResultLauncher<Intent> galleryPickLauncherForResult =
registerForActivityResult(new StartActivityForResult(), registerForActivityResult(new StartActivityForResult(),
result -> { result -> {
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> { controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
controller.onPictureReturnedFromGallery(result,requireActivity(),callbacks); controller.onPictureReturnedFromGallery(result, requireActivity(), callbacks);
}); });
}); });
private final ActivityResultLauncher<Intent> customSelectorLauncherForResult = private final ActivityResultLauncher<Intent> customSelectorLauncherForResult =
registerForActivityResult(new StartActivityForResult(), registerForActivityResult(new StartActivityForResult(),
result -> { result -> {
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> { controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
controller.onPictureReturnedFromCustomSelector(result,requireActivity(),callbacks); controller.onPictureReturnedFromCustomSelector(result, requireActivity(), callbacks);
}); });
}); });
private final ActivityResultLauncher<Intent> cameraPickLauncherForResult = private final ActivityResultLauncher<Intent> cameraPickLauncherForResult =
registerForActivityResult(new StartActivityForResult(), registerForActivityResult(new StartActivityForResult(),
result -> { result -> {
controller.handleActivityResultWithCallback(requireActivity(),callbacks -> { controller.handleActivityResultWithCallback(requireActivity(), callbacks -> {
controller.onPictureReturnedFromCamera(result,requireActivity(),callbacks); controller.onPictureReturnedFromCamera(result, requireActivity(), callbacks);
}); });
}); });
@ -2247,7 +2247,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
if (binding.fabCustomGallery.isShown()) { if (binding.fabCustomGallery.isShown()) {
Timber.d("Gallery button tapped. Place: %s", selectedPlace.toString()); Timber.d("Gallery button tapped. Place: %s", selectedPlace.toString());
storeSharedPrefs(selectedPlace); storeSharedPrefs(selectedPlace);
controller.initiateCustomGalleryPickWithPermission(getActivity(),customSelectorLauncherForResult); controller.initiateCustomGalleryPickWithPermission(getActivity(), customSelectorLauncherForResult);
} }
}); });
} }

View file

@ -90,8 +90,8 @@ public class SettingsFragment extends PreferenceFragmentCompat {
private final ActivityResultLauncher<Intent> cameraPickLauncherForResult = private final ActivityResultLauncher<Intent> cameraPickLauncherForResult =
registerForActivityResult(new StartActivityForResult(), registerForActivityResult(new StartActivityForResult(),
result -> { result -> {
contributionController.handleActivityResultWithCallback(requireActivity(),callbacks -> { contributionController.handleActivityResultWithCallback(requireActivity(), callbacks -> {
contributionController.onPictureReturnedFromCamera(result,requireActivity(),callbacks); contributionController.onPictureReturnedFromCamera(result, requireActivity(), callbacks);
}); });
}); });

View file

@ -106,7 +106,7 @@ class CustomSelectorActivityTest {
@Throws(Exception::class) @Throws(Exception::class)
fun testResultLauncher() { fun testResultLauncher() {
val intent = Mockito.mock(Intent::class.java) val intent = Mockito.mock(Intent::class.java)
val activityResult = ActivityResult(Activity.RESULT_OK,intent) val activityResult = ActivityResult(Activity.RESULT_OK, intent)
val func = val func =
activity.javaClass.getDeclaredMethod( activity.javaClass.getDeclaredMethod(
"onFullScreenDataReceived", "onFullScreenDataReceived",

View file

@ -364,12 +364,12 @@ class UploadMediaDetailFragmentUnitTest {
`when`(latLng.latitude).thenReturn(0.0) `when`(latLng.latitude).thenReturn(0.0)
`when`(latLng.longitude).thenReturn(0.0) `when`(latLng.longitude).thenReturn(0.0)
`when`(uploadItem.gpsCoords).thenReturn(imageCoordinates) `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) val handleResultMethod = UploadMediaDetailFragment::class.java.getDeclaredMethod("onCameraPosition", ActivityResult::class.java)
handleResultMethod.isAccessible = true handleResultMethod.isAccessible = true
handleResultMethod.invoke(fragment,activityResult) handleResultMethod.invoke(fragment, activityResult)
Mockito.verify(presenter, Mockito.times(0)).getImageQuality(0, location, activity) Mockito.verify(presenter, Mockito.times(0)).getImageQuality(0, location, activity)
} }