Add small fixes; do not hide status bar with map controls

This commit is contained in:
Alexander Sytnyk 2017-11-07 13:44:38 +02:00
parent 74d9a7169c
commit 1113894fb3
5 changed files with 12 additions and 9 deletions

View file

@ -835,8 +835,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
}
boolean night = app.getDaynightHelper().isNightModeForMapControls();
boolean mapTopBar = findViewById(R.id.map_top_bar).getVisibility() == View.VISIBLE;
boolean markerTopBar = mapLayers.getMapMarkersLayer() != null
&& mapLayers.getMapMarkersLayer().getWidgetsFactory().isTopBarVisible();
boolean markerTopBar = findViewById(R.id.map_markers_top_bar).getVisibility() == View.VISIBLE;
if (mapTopBar) {
colorId = night ? R.color.status_bar_route_dark : R.color.status_bar_route_light;
} else if (markerTopBar) {

View file

@ -383,7 +383,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
@Override
public int getStatusBarColorId() {
if (fullScreen || !portrait) {
return nightMode ? R.color.status_bar_dark : R.color.status_bar_route_light;
return nightMode ? R.color.actionbar_dark_color : R.color.status_bar_route_light;
}
return R.color.status_bar_transparent_gradient;
}

View file

@ -15,6 +15,7 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.FileProvider;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AlertDialog;
@ -419,6 +420,9 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
);
toolbar = (Toolbar) view.findViewById(R.id.toolbar);
if (!app.getSettings().isLightContent()) {
toolbar.setBackgroundColor(ContextCompat.getColor(mapActivity, R.color.actionbar_dark_color));
}
toolbar.setNavigationIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_arrow_back));
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(

View file

@ -812,7 +812,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
boolean processed = hideVisibleMenues();
processed |= menu.onSingleTapOnMap();
if (!processed && activity.getMyApplication().getSettings().MAP_EMPTY_STATE_ALLOWED.get()) {
activity.getMapLayers().getMapControlsLayer().switchMapControlsVisibility(true);
activity.getMapLayers().getMapControlsLayer().switchMapControlsVisibility();
}
return false;
}

View file

@ -658,7 +658,7 @@ public class MapControlsLayer extends OsmandMapLayer {
public void showMapControls() {
mapActivity.findViewById(R.id.MapHudButtonsOverlay).setVisibility(View.VISIBLE);
AndroidUtils.showSystemUI(mapActivity);
// AndroidUtils.showSystemUI(mapActivity);
}
public void hideMapControls() {
@ -674,7 +674,7 @@ public class MapControlsLayer extends OsmandMapLayer {
return mapActivity.findViewById(R.id.MapHudButtonsOverlay).getVisibility() == View.VISIBLE;
}
public void switchMapControlsVisibility(boolean switchSystemUiVisibility) {
public void switchMapControlsVisibility() {
if (app.getRoutingHelper().isFollowingMode() || app.getRoutingHelper().isPauseNavigation()
|| mapActivity.getMeasurementToolFragment() != null
|| mapActivity.getPlanRouteFragment() != null
@ -683,9 +683,9 @@ public class MapControlsLayer extends OsmandMapLayer {
}
if (isMapControlsVisible()) {
hideMapControls();
if (switchSystemUiVisibility) {
AndroidUtils.hideSystemUI(mapActivity);
}
// if (switchSystemUiVisibility) {
// AndroidUtils.hideSystemUI(mapActivity);
// }
} else {
showMapControls();
}