use of net.osmand.plus.settings.backend.ExportSettingsType in project Osmand by osmandapp.
the class BackupTypesFragment method onCategorySelected.
@Override
public void onCategorySelected(ExportSettingsCategory category, boolean selected) {
super.onCategorySelected(category, selected);
SettingsCategoryItems categoryItems = dataList.get(category);
for (ExportSettingsType type : categoryItems.getTypes()) {
backupHelper.getBackupTypePref(type).set(selected);
}
}
use of net.osmand.plus.settings.backend.ExportSettingsType in project Osmand by osmandapp.
the class VersionHistoryFragment method onCategorySelected.
@Override
public void onCategorySelected(ExportSettingsCategory category, boolean selected) {
super.onCategorySelected(category, selected);
SettingsCategoryItems categoryItems = dataList.get(category);
for (ExportSettingsType type : categoryItems.getTypes()) {
backupHelper.getVersionHistoryTypePref(type).set(selected);
}
}
use of net.osmand.plus.settings.backend.ExportSettingsType in project Osmand by osmandapp.
the class ItemViewHolder method getItemIcon.
@Nullable
protected Drawable getItemIcon(@NonNull SettingsItem item) {
if (item instanceof ProfileSettingsItem) {
ProfileSettingsItem profileItem = (ProfileSettingsItem) item;
ApplicationMode mode = profileItem.getAppMode();
return getContentIcon(mode.getIconRes());
}
ExportSettingsType type = ExportSettingsType.getExportSettingsTypeForItem(item);
if (type != null) {
return getContentIcon(type.getIconRes());
}
return null;
}
use of net.osmand.plus.settings.backend.ExportSettingsType in project Osmand by osmandapp.
the class BackupInfo method createFilteredFilesToUpload.
private void createFilteredFilesToUpload(@NonNull OsmandApplication app) {
List<LocalFile> files = new ArrayList<>();
BackupHelper helper = app.getBackupHelper();
for (LocalFile localFile : filesToUpload) {
ExportSettingsType type = localFile.item != null ? ExportSettingsType.getExportSettingsTypeForItem(localFile.item) : null;
if (type != null && helper.getBackupTypePref(type).get()) {
files.add(localFile);
}
}
filteredFilesToUpload = files;
}
use of net.osmand.plus.settings.backend.ExportSettingsType in project Osmand by osmandapp.
the class BackupInfo method createFilteredFilesToDelete.
private void createFilteredFilesToDelete(@NonNull OsmandApplication app) {
List<RemoteFile> files = new ArrayList<>();
BackupHelper helper = app.getBackupHelper();
for (RemoteFile remoteFile : filesToDelete) {
ExportSettingsType exportType = ExportSettingsType.getExportSettingsTypeForRemoteFile(remoteFile);
if (exportType != null && helper.getBackupTypePref(exportType).get()) {
files.add(remoteFile);
}
}
filteredFilesToDelete = files;
}
Aggregations