Hide topbar

This commit is contained in:
PavelRatushny 2017-10-02 15:24:58 +03:00
parent 23010da7a2
commit f1c42f6d2b
3 changed files with 246 additions and 242 deletions

View file

@ -238,6 +238,11 @@
android:layout_weight="1"
android:orientation="vertical">
<FrameLayout
android:id="@+id/map_top_bar_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/map_top_bar"
android:layout_width="fill_parent"
@ -379,6 +384,8 @@
</LinearLayout>
</FrameLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/widget_top_bar"
android:layout_width="match_parent"

View file

@ -8,6 +8,11 @@
<!-- TOP ROW -->
<FrameLayout
android:id="@+id/map_top_bar_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/map_top_bar"
android:layout_width="fill_parent"
@ -149,6 +154,8 @@
</LinearLayout>
</FrameLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/widget_top_bar"
android:layout_width="match_parent"

View file

@ -452,26 +452,16 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
}
private void updateWidgetsAndTopbarsVisibility(boolean visible) {
updateVisibility(mapActivity.findViewById(R.id.map_markers_top_bar_layout), visible);
int visibility = visible ? View.VISIBLE : View.GONE;
mapActivity.findViewById(R.id.map_top_bar_layout).setVisibility(visibility);
mapActivity.findViewById(R.id.map_markers_top_bar_layout).setVisibility(visibility);
TopToolbarController controller = mapActivity.getTopToolbarController();
if (controller != null && controller.getType() != TopToolbarControllerType.CONTEXT_MENU) {
updateVisibility(mapActivity.findViewById(R.id.widget_top_bar), visible);
mapActivity.findViewById(R.id.widget_top_bar).setVisibility(visibility);
}
updateVisibility(mapActivity.findViewById(R.id.map_left_widgets_panel), visible);
updateVisibility(mapActivity.findViewById(R.id.map_right_widgets_panel), visible);
}
public boolean updateVisibility(View v, boolean visible) {
if (visible != (v.getVisibility() == View.VISIBLE)) {
if (visible) {
v.setVisibility(View.VISIBLE);
} else {
v.setVisibility(View.GONE);
}
v.invalidate();
return true;
}
return false;
mapActivity.findViewById(R.id.map_center_info).setVisibility(visibility);
mapActivity.findViewById(R.id.map_left_widgets_panel).setVisibility(visibility);
mapActivity.findViewById(R.id.map_right_widgets_panel).setVisibility(visibility);
}
// timeout in msec