Search in sources :

Example 1 with LocationProvidersDisabledDialog

use of org.odk.collect.android.fragments.dialogs.LocationProvidersDisabledDialog in project collect by opendatakit.

the class FormEntryActivity method displayUIFor.

/**
 * Displays UI representing the given background location message, if there is one.
 */
private void displayUIFor(@Nullable BackgroundLocationManager.BackgroundLocationMessage backgroundLocationMessage) {
    if (backgroundLocationMessage == null) {
        return;
    }
    if (backgroundLocationMessage == BackgroundLocationManager.BackgroundLocationMessage.PROVIDERS_DISABLED) {
        new LocationProvidersDisabledDialog().show(getSupportFragmentManager(), LocationProvidersDisabledDialog.LOCATION_PROVIDERS_DISABLED_DIALOG_TAG);
        return;
    }
    String snackBarText;
    if (backgroundLocationMessage.isMenuCharacterNeeded()) {
        snackBarText = String.format(getString(backgroundLocationMessage.getMessageTextResourceId()), "⋮");
    } else {
        snackBarText = getString(backgroundLocationMessage.getMessageTextResourceId());
    }
    SnackbarUtils.showLongSnackbar(findViewById(R.id.llParent), snackBarText);
}
Also used : LocationProvidersDisabledDialog(org.odk.collect.android.fragments.dialogs.LocationProvidersDisabledDialog)

Aggregations

LocationProvidersDisabledDialog (org.odk.collect.android.fragments.dialogs.LocationProvidersDisabledDialog)1