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;
}
Aggregations