Search in sources :

Example 36 with ExportSettingsType

use of net.osmand.plus.settings.backend.ExportSettingsType in project Osmand by osmandapp.

the class BaseBackupTypesFragment method onCategorySelected.

@Override
public void onCategorySelected(ExportSettingsCategory category, boolean selected) {
    boolean hasItemsToDelete = false;
    SettingsCategoryItems categoryItems = dataList.get(category);
    List<ExportSettingsType> types = categoryItems.getTypes();
    for (ExportSettingsType type : types) {
        List<Object> items = getItemsForType(type);
        hasItemsToDelete |= !Algorithms.isEmpty(items);
        selectedItemsMap.put(type, selected ? items : null);
    }
    if (!selected && hasItemsToDelete) {
        showClearTypesBottomSheet(types);
    }
}
Also used : SettingsCategoryItems(net.osmand.plus.settings.fragments.SettingsCategoryItems) ExportSettingsType(net.osmand.plus.settings.backend.ExportSettingsType)

Aggregations

ExportSettingsType (net.osmand.plus.settings.backend.ExportSettingsType)36 ArrayList (java.util.ArrayList)18 List (java.util.List)10 SettingsCategoryItems (net.osmand.plus.settings.fragments.SettingsCategoryItems)9 ExportSettingsCategory (net.osmand.plus.settings.backend.ExportSettingsCategory)6 View (android.view.View)5 ImageView (android.widget.ImageView)5 TextView (android.widget.TextView)5 File (java.io.File)5 LinkedHashMap (java.util.LinkedHashMap)5 Nullable (androidx.annotation.Nullable)4 HashMap (java.util.HashMap)4 Map (java.util.Map)4 SettingsItem (net.osmand.plus.settings.backend.backup.items.SettingsItem)4 NonNull (androidx.annotation.NonNull)3 EnumMap (java.util.EnumMap)3 ApplicationMode (net.osmand.plus.settings.backend.ApplicationMode)3 SuppressLint (android.annotation.SuppressLint)2 Typeface (android.graphics.Typeface)2 AsyncTask (android.os.AsyncTask)2