use of net.osmand.plus.firstusage.FirstUsageWizardFragment in project Osmand by osmandapp.
the class MapActivity method newDownloadIndexes.
// DownloadEvents
@Override
public void newDownloadIndexes() {
FirstUsageWizardFragment wizardFragment = getFirstUsageWizardFragment();
if (wizardFragment != null) {
wizardFragment.newDownloadIndexes();
}
WeakReference<MapContextMenuFragment> fragmentRef = getContextMenu().findMenuFragment();
if (fragmentRef != null) {
fragmentRef.get().newDownloadIndexes();
}
if (dashboardOnMap.isVisible()) {
dashboardOnMap.onNewDownloadIndexes();
}
refreshMap();
}
use of net.osmand.plus.firstusage.FirstUsageWizardFragment in project Osmand by osmandapp.
the class MapActivity method downloadHasFinished.
@Override
public void downloadHasFinished() {
FirstUsageWizardFragment wizardFragment = getFirstUsageWizardFragment();
if (wizardFragment != null) {
wizardFragment.downloadHasFinished();
}
WeakReference<MapContextMenuFragment> fragmentRef = getContextMenu().findMenuFragment();
if (fragmentRef != null) {
fragmentRef.get().downloadHasFinished();
}
if (dashboardOnMap.isVisible()) {
dashboardOnMap.onDownloadHasFinished();
}
refreshMap();
}
use of net.osmand.plus.firstusage.FirstUsageWizardFragment in project Osmand by osmandapp.
the class MapActivity method onRequestPermissionsResult.
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull final int[] grantResults) {
if (grantResults.length > 0) {
OsmandPlugin.onRequestPermissionsResult(requestCode, permissions, grantResults);
MapControlsLayer mcl = mapView.getLayerByClass(MapControlsLayer.class);
if (mcl != null) {
mcl.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
if (requestCode == DownloadActivity.PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE && grantResults.length > 0 && permissions.length > 0 && Manifest.permission.WRITE_EXTERNAL_STORAGE.equals(permissions[0])) {
permissionAsked = true;
permissionGranted = grantResults[0] == PackageManager.PERMISSION_GRANTED;
} else if (requestCode == FirstUsageWizardFragment.FIRST_USAGE_REQUEST_WRITE_EXTERNAL_STORAGE_PERMISSION && grantResults.length > 0 && permissions.length > 0 && Manifest.permission.WRITE_EXTERNAL_STORAGE.equals(permissions[0])) {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
FirstUsageWizardFragment wizardFragment = getFirstUsageWizardFragment();
if (wizardFragment != null) {
wizardFragment.processStoragePermission(grantResults[0] == PackageManager.PERMISSION_GRANTED);
}
}
}, 1);
} else if (requestCode == FirstUsageWizardFragment.FIRST_USAGE_LOCATION_PERMISSION) {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
FirstUsageWizardFragment wizardFragment = getFirstUsageWizardFragment();
if (wizardFragment != null) {
wizardFragment.processLocationPermission(grantResults[0] == PackageManager.PERMISSION_GRANTED);
}
}
}, 1);
}
}
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
use of net.osmand.plus.firstusage.FirstUsageWizardFragment in project Osmand by osmandapp.
the class MapActivity method downloadInProgress.
@Override
public void downloadInProgress() {
FirstUsageWizardFragment wizardFragment = getFirstUsageWizardFragment();
if (wizardFragment != null) {
wizardFragment.downloadInProgress();
}
WeakReference<MapContextMenuFragment> fragmentRef = getContextMenu().findMenuFragment();
if (fragmentRef != null) {
fragmentRef.get().downloadInProgress();
}
if (dashboardOnMap.isVisible()) {
dashboardOnMap.onDownloadInProgress();
}
}
use of net.osmand.plus.firstusage.FirstUsageWizardFragment in project Osmand by osmandapp.
the class MapActivity method isFirstScreenShowing.
public boolean isFirstScreenShowing() {
FirstUsageWelcomeFragment welcomeFragment = (FirstUsageWelcomeFragment) getSupportFragmentManager().findFragmentByTag(FirstUsageWelcomeFragment.TAG);
FirstUsageWizardFragment wizardFragment = (FirstUsageWizardFragment) getSupportFragmentManager().findFragmentByTag(FirstUsageWizardFragment.TAG);
return welcomeFragment != null && !welcomeFragment.isDetached() || wizardFragment != null && !wizardFragment.isDetached();
}
Aggregations