Merge remote-tracking branch 'origin/fix_osmand_live_p1' into fix_osmand_live_p1

This commit is contained in:
Vitaliy 2021-03-29 22:21:29 +03:00
commit 9f9374438e
3 changed files with 5 additions and 14 deletions

View file

@ -29,7 +29,6 @@ import androidx.appcompat.content.res.AppCompatResources;
import androidx.cardview.widget.CardView; import androidx.cardview.widget.CardView;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.core.view.MenuItemCompat; import androidx.core.view.MenuItemCompat;
import androidx.fragment.app.Fragment;
import net.osmand.AndroidUtils; import net.osmand.AndroidUtils;
import net.osmand.Collator; import net.osmand.Collator;
@ -426,11 +425,6 @@ public class UpdatesIndexFragment extends OsmAndListFragment implements Download
return LiveUpdatesFragment.getMapsToUpdate(listAdapter.mapsList, settings); return LiveUpdatesFragment.getMapsToUpdate(listAdapter.mapsList, settings);
} }
@Override
public Fragment currentFragment() {
return this;
}
@ColorRes @ColorRes
public static int getDefaultIconColorId(boolean nightMode) { public static int getDefaultIconColorId(boolean nightMode) {
return nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light; return nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light;

View file

@ -131,7 +131,11 @@ public class LiveUpdatesFragment extends BaseOsmAndDialogFragment implements OnL
} }
}); });
} else if (countEnabled > 1) { } else if (countEnabled > 1) {
LiveUpdatesUpdateAllBottomSheet.showInstance(fragmentManager, listener.currentFragment()); Fragment target = null;
if (listener instanceof Fragment) {
target = (Fragment) listener;
}
LiveUpdatesUpdateAllBottomSheet.showInstance(fragmentManager, target);
} }
} }
} }
@ -650,11 +654,6 @@ public class LiveUpdatesFragment extends BaseOsmAndDialogFragment implements OnL
return getMapsToUpdate(adapter.mapsList, settings); return getMapsToUpdate(adapter.mapsList, settings);
} }
@Override
public Fragment currentFragment() {
return this;
}
@Override @Override
public boolean onUpdateLocalIndex(String fileName, boolean newValue, final Runnable callback) { public boolean onUpdateLocalIndex(String fileName, boolean newValue, final Runnable callback) {
int frequencyId = preferenceUpdateFrequency(fileName, settings).get(); int frequencyId = preferenceUpdateFrequency(fileName, settings).get();

View file

@ -278,7 +278,5 @@ public class LiveUpdatesHelper {
void processFinish(); void processFinish();
List<LocalIndexInfo> getMapsToUpdate(); List<LocalIndexInfo> getMapsToUpdate();
Fragment currentFragment();
} }
} }