Allow using the location picker with approximate location.
This commit is contained in:
parent
c0fe156897
commit
b9d5fb54c3
1 changed files with 10 additions and 6 deletions
|
@ -413,13 +413,17 @@ public class AttachmentManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void selectLocation(Fragment fragment, int requestCode, @ColorInt int chatColor) {
|
public static void selectLocation(Fragment fragment, int requestCode, @ColorInt int chatColor) {
|
||||||
|
if (Permissions.hasAny(fragment.requireContext(), Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)) {
|
||||||
|
PlacePickerActivity.startActivityForResultAtCurrentLocation(fragment, requestCode, chatColor);
|
||||||
|
} else {
|
||||||
Permissions.with(fragment)
|
Permissions.with(fragment)
|
||||||
.request(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
|
.request(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||||
.ifNecessary()
|
.ifNecessary()
|
||||||
.withPermanentDenialDialog(fragment.getString(R.string.AttachmentManager_signal_requires_location_information_in_order_to_attach_a_location))
|
.withPermanentDenialDialog(fragment.getString(R.string.AttachmentManager_signal_requires_location_information_in_order_to_attach_a_location))
|
||||||
.onAllGranted(() -> PlacePickerActivity.startActivityForResultAtCurrentLocation(fragment, requestCode, chatColor))
|
.onSomeGranted((permissions) -> PlacePickerActivity.startActivityForResultAtCurrentLocation(fragment, requestCode, chatColor))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void selectGif(Fragment fragment, int requestCode, RecipientId id, MessageSendType sendType, boolean isForMms, CharSequence textTrimmed) {
|
public static void selectGif(Fragment fragment, int requestCode, RecipientId id, MessageSendType sendType, boolean isForMms, CharSequence textTrimmed) {
|
||||||
Intent intent = new Intent(fragment.requireContext(), GiphyActivity.class);
|
Intent intent = new Intent(fragment.requireContext(), GiphyActivity.class);
|
||||||
|
|
Loading…
Add table
Reference in a new issue