Search in sources :

Example 1 with LocationActivity

use of org.telegram.ui.LocationActivity in project Telegram-FOSS by Telegram-FOSS-Team.

the class FragmentContextView method openSharingLocation.

private void openSharingLocation(final LocationController.SharingLocationInfo info) {
    if (info == null || !(fragment.getParentActivity() instanceof LaunchActivity)) {
        return;
    }
    LaunchActivity launchActivity = ((LaunchActivity) fragment.getParentActivity());
    launchActivity.switchToAccount(info.messageObject.currentAccount, true);
    LocationActivity locationActivity = new LocationActivity(2);
    locationActivity.setMessageObject(info.messageObject);
    final long dialog_id = info.messageObject.getDialogId();
    locationActivity.setDelegate((location, live, notify, scheduleDate) -> SendMessagesHelper.getInstance(info.messageObject.currentAccount).sendMessage(location, dialog_id, null, null, null, null, notify, scheduleDate));
    launchActivity.presentFragment(locationActivity);
}
Also used : LocationActivity(org.telegram.ui.LocationActivity) LaunchActivity(org.telegram.ui.LaunchActivity)

Aggregations

LaunchActivity (org.telegram.ui.LaunchActivity)1 LocationActivity (org.telegram.ui.LocationActivity)1