Search in sources :

Example 6 with TitleBar

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

the class Layout method createTitleBar.

@NonNull
private TitleBar createTitleBar(BridgeContext context, String title, int simulatedPlatformVersion) {
    TitleBar titleBar = new TitleBar(context, title, simulatedPlatformVersion);
    LayoutParams params = createLayoutParams(MATCH_PARENT, mBuilder.mTitleBarSize);
    if (mBuilder.hasStatusBar() && mBuilder.solidBars()) {
        params.addRule(BELOW, getId(ID_STATUS_BAR));
    }
    if (mBuilder.isNavBarVertical() && mBuilder.solidBars()) {
        params.addRule(START_OF, getId(ID_NAV_BAR));
    }
    titleBar.setLayoutParams(params);
    titleBar.setId(getId(ID_TITLE_BAR));
    return titleBar;
}
Also used : TitleBar(com.android.layoutlib.bridge.bars.TitleBar) NonNull(android.annotation.NonNull)

Aggregations

TitleBar (com.android.layoutlib.bridge.bars.TitleBar)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 NavigationBar (com.android.layoutlib.bridge.bars.NavigationBar)1 StatusBar (com.android.layoutlib.bridge.bars.StatusBar)1 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)1