Show options menu above the action bar

This commit is contained in:
Alexander Sytnyk 2017-11-14 13:56:56 +02:00
parent ddd0b41d2a
commit e852eb809e
2 changed files with 46 additions and 45 deletions

View file

@ -7,6 +7,16 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_toolbar" android:layout_height="@dimen/dashboard_map_toolbar"
@ -30,21 +40,15 @@
android:textColor="@color/color_white" android:textColor="@color/color_white"
android:textSize="@dimen/dialog_header_text_size" android:textSize="@dimen/dialog_header_text_size"
osmand:typeface="@string/font_roboto_medium"/> osmand:typeface="@string/font_roboto_medium"/>
</android.support.v7.widget.Toolbar> </android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="?attr/ctx_menu_info_view_bg">
<!-- Coordinator layout is needed in order to display the snackbar above the bottom navigation --> <!-- Coordinator layout is needed in order to display the snackbar above the bottom navigation -->
<android.support.design.widget.CoordinatorLayout <android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:background="?attr/ctx_menu_info_view_bg">
<net.osmand.plus.LockableViewPager <net.osmand.plus.LockableViewPager
android:id="@+id/map_markers_view_pager" android:id="@+id/map_markers_view_pager"
@ -52,19 +56,14 @@
android:layout_height="match_parent"/> android:layout_height="match_parent"/>
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>
</LinearLayout>
<FrameLayout <FrameLayout
android:id="@+id/menu_container" android:id="@+id/menu_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"/> android:layout_gravity="bottom|center_horizontal"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/shadow_height"
android:layout_gravity="bottom"
android:alpha="0.5"
android:scaleType="fitXY"
android:src="@drawable/bg_shadow_onmap"/>
</FrameLayout> </FrameLayout>
<android.support.design.widget.BottomNavigationView <android.support.design.widget.BottomNavigationView
@ -76,4 +75,5 @@
app:itemIconTint="@color/bottom_navigation_color_selector_light" app:itemIconTint="@color/bottom_navigation_color_selector_light"
app:itemTextColor="@color/bottom_navigation_color_selector_light" app:itemTextColor="@color/bottom_navigation_color_selector_light"
app:menu="@menu/map_markers_bottom_navigation"/> app:menu="@menu/map_markers_bottom_navigation"/>
</LinearLayout> </LinearLayout>

View file

@ -180,7 +180,8 @@ public class OptionsBottomSheetDialogFragment extends BottomSheetDialogFragment
int scrH = AndroidUtils.getScreenHeight(activity); int scrH = AndroidUtils.getScreenHeight(activity);
int stBarH = AndroidUtils.getStatusBarHeight(activity); int stBarH = AndroidUtils.getStatusBarHeight(activity);
int nBarH = AndroidUtils.getNavBarHeight(activity); int nBarH = AndroidUtils.getNavBarHeight(activity);
return scrH - stBarH - nBarH - getResources().getDimensionPixelSize(R.dimen.dashboard_map_toolbar) - AndroidUtils.dpToPx(activity, 56); // 56dp below is height of the bottom navigation view
return scrH - stBarH - nBarH - AndroidUtils.dpToPx(activity, 56);
} }
interface MarkerOptionsFragmentListener { interface MarkerOptionsFragmentListener {