# BottomBarBackground not respected on on-screen navigation android devices

**URL:** <https://forums.fusetools.com/t/bottombarbackground-not-respected-on-on-screen-navigation-android-devices/4640>\
**Category:** Bug Reports\
**Created:** [March 5, 2016, 6:28pm UTC](https://forums.fusetools.com/t/bottombarbackground-not-respected-on-on-screen-navigation-android-devices/4640 "2016-03-05T18:28:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Costin\_Bereveanu](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/costin_bereveanu/32/628_2.png) [@Costin\_Bereveanu](https://forums.fusetools.com/u/Costin_Bereveanu)\
**Post date:** [March 5, 2016, 6:28pm UTC](https://forums.fusetools.com/t/bottombarbackground-not-respected-on-on-screen-navigation-android-devices/4640/1 "2016-03-05T18:28:59Z")

</div>

On a Sony Z3 compact, which has an on-screen navigation bar, in landscape mode the nav bar is docked to the right. This makes BottomBarBackground be ignored, as it seems to expect the navbar to be at the bottom.

---

<div class="post-metadata">

**Author:** ![kusma](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/kusma/32/595_2.png) [@kusma](https://forums.fusetools.com/u/kusma)\
**Post date:** [March 7, 2016, 3:41pm UTC](https://forums.fusetools.com/t/bottombarbackground-not-respected-on-on-screen-navigation-android-devices/4640/2 "2016-03-07T15:41:38Z")

</div>

Thanks for reporting. We’re already aware of this problem, but unfortunately we don’t have a fix for it yet. We’ll update this thread when we do. Sorry for the inconvenience!

---

<div class="post-metadata">

**Author:** ![Costin\_Bereveanu](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/costin_bereveanu/32/628_2.png) [@Costin\_Bereveanu](https://forums.fusetools.com/u/Costin_Bereveanu)\
**Post date:** [March 7, 2016, 3:47pm UTC](https://forums.fusetools.com/t/bottombarbackground-not-respected-on-on-screen-navigation-android-devices/4640/3 "2016-03-07T15:47:07Z")

</div>

Any way in UX to know that we must compensate for that?

---

<div class="post-metadata">

**Author:** ![kusma](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/kusma/32/595_2.png) [@kusma](https://forums.fusetools.com/u/kusma)\
**Post date:** [March 7, 2016, 4:11pm UTC](https://forums.fusetools.com/t/bottombarbackground-not-respected-on-on-screen-navigation-android-devices/4640/4 "2016-03-07T16:11:32Z")

</div>

It migth be possible to work around this by making a replacement for `BottomBarBackground` in Uno, but I’m not sure how easy this would be…

---

<div class="post-metadata">

**Author:** ![kusma](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/kusma/32/595_2.png) [@kusma](https://forums.fusetools.com/u/kusma)\
**Post date:** [March 7, 2016, 5:29pm UTC](https://forums.fusetools.com/t/bottombarbackground-not-respected-on-on-screen-navigation-android-devices/4640/5 "2016-03-07T17:29:08Z")

</div>

Actually, seems this was easier than I thought:

RightNavigationBarBackground.uno:

```auto
using Uno;
using Fuse;
using Fuse.Controls;
using Uno.Compiler.ExportTargetInterop;

class RightNavigationBarBackground : Control
{
    [ExportCondition("Android")]
    int _navigationBarWidth;

    public RightNavigationBarBackground()
    {
        _navigationBarWidth = getNavBarWidth();
    }

    protected override float2 GetContentSize(LayoutParams lp)
    {
        if defined(Android)
        {
            var width = _navigationBarWidth / Viewport.PointDensity;
            return float2(width, 1);
        }
        return float2(0, 0);
    }

    [Foreign(Language.Java)]
    public int getNavBarWidth()
    @{
        android.content.Context c = @(Activity.Package).@(Activity.Name).GetRootActivity();
        android.content.res.Resources r = c.getResources();

        boolean navigationBarVisible = false;

        int showNavigationBarId = r.getIdentifier("config_showNavigationBar", "bool", "android");
        if (showNavigationBarId > 0)
        {
            navigationBarVisible = r.getBoolean(showNavigationBarId);
        }
        else
        {
            boolean hasMenuKey = android.view.ViewConfiguration.get(c).hasPermanentMenuKey();
            boolean hasBackKey = android.view.KeyCharacterMap.deviceHasKey(android.view.KeyEvent.KEYCODE_BACK);

            navigationBarVisible = !hasMenuKey || !hasBackKey;
        }

        if (navigationBarVisible)
        {
            int navigationBarWidthId = r.getIdentifier("navigation_bar_width", "dimen", "android");
            if (navigationBarWidthId > 0)
                return r.getDimensionPixelSize(navigationBarWidthId);
        }

        return 0;
    @}
}

```

MainView.ux:

```auto
<App Theme="Basic" ClearColor="#eeeeeeff">
    <ClientPanel>
        <DockPanel>
            <WhileWindowLandscape>
                <RightNavigationBarBackground Dock="Right" />
            </WhileWindowLandscape>
            <StackPanel>
                <Button ux:Name="button" Height="100" MaxHeight="600">
                    <Clicked>
                        <Change Target="button.Height" Value="500" Easing="ElasticOut" EasingBack="ElasticIn" Duration="1" DurationBack="1"/>
                    </Clicked>
                </Button>
            </StackPanel>
        </DockPanel>
    </ClientPanel>
</App>

```

So, having dug a bit into this, I feel confident I’ll be able to get this included in an upcoming release. But probably not right away.

---

<div class="post-metadata">

**Author:** ![Costin\_Bereveanu](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/costin_bereveanu/32/628_2.png) [@Costin\_Bereveanu](https://forums.fusetools.com/u/Costin_Bereveanu)\
**Post date:** [March 7, 2016, 5:31pm UTC](https://forums.fusetools.com/t/bottombarbackground-not-respected-on-on-screen-navigation-android-devices/4640/6 "2016-03-07T17:31:51Z")

</div>

Very cool 🙂
