Add small fixes; do not hide status bar with map controls
This commit is contained in:
parent
74d9a7169c
commit
1113894fb3
5 changed files with 12 additions and 9 deletions
|
@ -835,8 +835,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
||||||
}
|
}
|
||||||
boolean night = app.getDaynightHelper().isNightModeForMapControls();
|
boolean night = app.getDaynightHelper().isNightModeForMapControls();
|
||||||
boolean mapTopBar = findViewById(R.id.map_top_bar).getVisibility() == View.VISIBLE;
|
boolean mapTopBar = findViewById(R.id.map_top_bar).getVisibility() == View.VISIBLE;
|
||||||
boolean markerTopBar = mapLayers.getMapMarkersLayer() != null
|
boolean markerTopBar = findViewById(R.id.map_markers_top_bar).getVisibility() == View.VISIBLE;
|
||||||
&& mapLayers.getMapMarkersLayer().getWidgetsFactory().isTopBarVisible();
|
|
||||||
if (mapTopBar) {
|
if (mapTopBar) {
|
||||||
colorId = night ? R.color.status_bar_route_dark : R.color.status_bar_route_light;
|
colorId = night ? R.color.status_bar_route_dark : R.color.status_bar_route_light;
|
||||||
} else if (markerTopBar) {
|
} else if (markerTopBar) {
|
||||||
|
|
|
@ -383,7 +383,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
|
||||||
@Override
|
@Override
|
||||||
public int getStatusBarColorId() {
|
public int getStatusBarColorId() {
|
||||||
if (fullScreen || !portrait) {
|
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;
|
return R.color.status_bar_transparent_gradient;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v4.app.FragmentPagerAdapter;
|
import android.support.v4.app.FragmentPagerAdapter;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v4.content.FileProvider;
|
import android.support.v4.content.FileProvider;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
|
@ -419,6 +420,9 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
||||||
);
|
);
|
||||||
|
|
||||||
toolbar = (Toolbar) view.findViewById(R.id.toolbar);
|
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.setNavigationIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_arrow_back));
|
||||||
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
|
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
|
||||||
toolbar.setNavigationOnClickListener(
|
toolbar.setNavigationOnClickListener(
|
||||||
|
|
|
@ -812,7 +812,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
|
||||||
boolean processed = hideVisibleMenues();
|
boolean processed = hideVisibleMenues();
|
||||||
processed |= menu.onSingleTapOnMap();
|
processed |= menu.onSingleTapOnMap();
|
||||||
if (!processed && activity.getMyApplication().getSettings().MAP_EMPTY_STATE_ALLOWED.get()) {
|
if (!processed && activity.getMyApplication().getSettings().MAP_EMPTY_STATE_ALLOWED.get()) {
|
||||||
activity.getMapLayers().getMapControlsLayer().switchMapControlsVisibility(true);
|
activity.getMapLayers().getMapControlsLayer().switchMapControlsVisibility();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -658,7 +658,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
|
|
||||||
public void showMapControls() {
|
public void showMapControls() {
|
||||||
mapActivity.findViewById(R.id.MapHudButtonsOverlay).setVisibility(View.VISIBLE);
|
mapActivity.findViewById(R.id.MapHudButtonsOverlay).setVisibility(View.VISIBLE);
|
||||||
AndroidUtils.showSystemUI(mapActivity);
|
// AndroidUtils.showSystemUI(mapActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideMapControls() {
|
public void hideMapControls() {
|
||||||
|
@ -674,7 +674,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
return mapActivity.findViewById(R.id.MapHudButtonsOverlay).getVisibility() == View.VISIBLE;
|
return mapActivity.findViewById(R.id.MapHudButtonsOverlay).getVisibility() == View.VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void switchMapControlsVisibility(boolean switchSystemUiVisibility) {
|
public void switchMapControlsVisibility() {
|
||||||
if (app.getRoutingHelper().isFollowingMode() || app.getRoutingHelper().isPauseNavigation()
|
if (app.getRoutingHelper().isFollowingMode() || app.getRoutingHelper().isPauseNavigation()
|
||||||
|| mapActivity.getMeasurementToolFragment() != null
|
|| mapActivity.getMeasurementToolFragment() != null
|
||||||
|| mapActivity.getPlanRouteFragment() != null
|
|| mapActivity.getPlanRouteFragment() != null
|
||||||
|
@ -683,9 +683,9 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
}
|
}
|
||||||
if (isMapControlsVisible()) {
|
if (isMapControlsVisible()) {
|
||||||
hideMapControls();
|
hideMapControls();
|
||||||
if (switchSystemUiVisibility) {
|
// if (switchSystemUiVisibility) {
|
||||||
AndroidUtils.hideSystemUI(mapActivity);
|
// AndroidUtils.hideSystemUI(mapActivity);
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
showMapControls();
|
showMapControls();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue