diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashErrorFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashErrorFragment.java index 9ce91ffe28..71a239076c 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashErrorFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashErrorFragment.java @@ -18,9 +18,13 @@ import android.widget.TextView; import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; +import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.Version; +import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.OsmandActionBarActivity; +import net.osmand.plus.dashboard.tools.DashFragmentData; +import net.osmand.plus.dialogs.ErrorBottomSheetDialog; import net.osmand.plus.helpers.FontCache; import java.io.File; @@ -33,7 +37,14 @@ import java.text.MessageFormat; public class DashErrorFragment extends DashBaseFragment { public static final String TAG = "DASH_ERROR_FRAGMENT"; - + public static final DashFragmentData.ShouldShowFunction SHOULD_SHOW_FUNCTION = + new DashFragmentData.ShouldShowFunction() { + // If settings null. No changes in setting will be made. + @Override + public boolean shouldShow(OsmandSettings settings, MapActivity activity, String tag) { + return ErrorBottomSheetDialog.shouldShow(settings, activity); + } + }; private DismissListener dismissCallback; @Override diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java index 6d9b6d5111..8acc38661c 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java @@ -72,13 +72,12 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks { public static final String SHOULD_SHOW = "should_show"; private static final DashFragmentData.ShouldShowFunction rateUsShouldShow = new DashRateUsFragment.RateUsShouldShow(); - private static final DashFragmentData.ShouldShowFunction errorShouldShow = new ErrorShouldShow(); private final DashFragmentData[] fragmentsData = new DashFragmentData[]{ new DashFragmentData(DashRateUsFragment.TAG, DashRateUsFragment.class, rateUsShouldShow, 0, null), new DashFragmentData(DashErrorFragment.TAG, DashErrorFragment.class, - errorShouldShow, 30, null), + DashErrorFragment.SHOULD_SHOW_FUNCTION, 30, null), new DashFragmentData(DashNavigationFragment.TAG, DashNavigationFragment.class, DashNavigationFragment.SHOULD_SHOW_FUNCTION, 40, null), new DashFragmentData(DashWaypointsFragment.TAG, DashWaypointsFragment.class, @@ -932,15 +931,4 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks { return settings.registerBooleanPreference(SHOULD_SHOW + tag, true).makeGlobal().get(); } } - - private static class ErrorShouldShow extends DashFragmentData.ShouldShowFunction { - // If settings null. No changes in setting will be made. - @Override - public boolean shouldShow(OsmandSettings settings, MapActivity activity, String tag) { - return activity.getMyApplication().getAppInitializer() - .checkPreviousRunsForExceptions(activity, settings != null); - } - } - - } diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ErrorBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/dialogs/ErrorBottomSheetDialog.java index 4e08aa029c..51cda5c308 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ErrorBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ErrorBottomSheetDialog.java @@ -28,9 +28,6 @@ import net.osmand.plus.helpers.FontCache; import java.io.File; import java.text.MessageFormat; -/** - * Created by GaidamakUA on 11/13/15. - */ public class ErrorBottomSheetDialog extends BottomSheetDialogFragment { @Nullable @Override