Search in sources :

Example 6 with NavigationBar

use of com.android.layoutlib.bridge.bars.NavigationBar in project android_frameworks_base by crdroidandroid.

the class Layout method createNavBar.

/**
     * @param isRtl    whether the current locale is an RTL locale.
     * @param isRtlSupported    whether the applications supports RTL (i.e. has supportsRtl=true
     * in the manifest and targetSdkVersion >= 17.
     */
@NonNull
private NavigationBar createNavBar(BridgeContext context, Density density, boolean isRtl, boolean isRtlSupported, int simulatedPlatformVersion) {
    int orientation = mBuilder.mNavBarOrientation;
    int size = mBuilder.mNavBarSize;
    NavigationBar navBar = new NavigationBar(context, density, orientation, isRtl, isRtlSupported, simulatedPlatformVersion);
    boolean isVertical = mBuilder.isNavBarVertical();
    int w = isVertical ? size : MATCH_PARENT;
    int h = isVertical ? MATCH_PARENT : size;
    LayoutParams params = createLayoutParams(w, h);
    params.addRule(isVertical ? ALIGN_PARENT_END : ALIGN_PARENT_BOTTOM);
    navBar.setLayoutParams(params);
    navBar.setId(getId(ID_NAV_BAR));
    return navBar;
}
Also used : NavigationBar(com.android.layoutlib.bridge.bars.NavigationBar) NonNull(android.annotation.NonNull)

Aggregations

NavigationBar (com.android.layoutlib.bridge.bars.NavigationBar)6 NonNull (android.annotation.NonNull)5 Drawable (android.graphics.drawable.Drawable)1 View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 LayoutParams (android.view.ViewGroup.LayoutParams)1 MarginLayoutParams (android.view.ViewGroup.MarginLayoutParams)1 AbsListView (android.widget.AbsListView)1 AdapterView (android.widget.AdapterView)1 ExpandableListView (android.widget.ExpandableListView)1 FrameLayout (android.widget.FrameLayout)1 LinearLayout (android.widget.LinearLayout)1 ListView (android.widget.ListView)1 HardwareConfig (com.android.ide.common.rendering.api.HardwareConfig)1 SessionParams (com.android.ide.common.rendering.api.SessionParams)1 BridgeContext (com.android.layoutlib.bridge.android.BridgeContext)1 FakeActionBar (com.android.layoutlib.bridge.bars.FakeActionBar)1 StatusBar (com.android.layoutlib.bridge.bars.StatusBar)1 TitleBar (com.android.layoutlib.bridge.bars.TitleBar)1 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)1