本文整理了Java中android.support.v4.widget.DrawerLayout.setDrawerElevation()
方法的一些代码示例,展示了DrawerLayout.setDrawerElevation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DrawerLayout.setDrawerElevation()
方法的具体详情如下:
包路径:android.support.v4.widget.DrawerLayout
类名称:DrawerLayout
方法名:setDrawerElevation
暂无
代码示例来源:origin: shiburagi/Drawer-Behavior
@Override
public void setDrawerElevation(float elevation) {
defaultDrawerElevation = elevation;
super.setDrawerElevation(elevation);
}
代码示例来源:origin: AriesHoo/UIWidget
@Override
protected void initView(Bundle bundle) {
drawerRoot.setScrimColor(Color.argb(30, 0, 0, 0));//背景高亮
drawerRoot.setDrawerElevation(40);//海拔高度
// mContentView.setBackgroundDrawable(null);
GlideManager.loadCircleImg("https://avatars3.githubusercontent.com/u/19605922?v=4&s=460", ivHead);
titleBarDrawer.setImmersible(mContext, isImmersible, isLight);
vHeader = View.inflate(mContext, R.layout.layout_title_header, null);
sBtnImmersible = vHeader.findViewById(R.id.sBtn_immersible);
sBtnLight = vHeader.findViewById(R.id.sBtn_light);
sBtnLine = vHeader.findViewById(R.id.sBtn_line);
lLayoutAlpha = vHeader.findViewById(R.id.lLayout_alpha);
sBarAlpha = vHeader.findViewById(R.id.sBar_alpha);
tvStatusAlpha = vHeader.findViewById(R.id.tv_statusAlpha);
initView();
setDrawerList();
initData();
}
代码示例来源:origin: shiburagi/Drawer-Behavior
private void updateSlideOffset(View drawerView, float slideOffset) {
final int absHorizGravity = getDrawerViewAbsoluteGravity(Gravity.START);
final int childAbsGravity = getDrawerViewAbsoluteGravity(drawerView);
for (int i = 0; i < frameLayout.getChildCount(); i++) {
CardView child = (CardView) frameLayout.getChildAt(i);
Setting setting = settings.get(childAbsGravity);
float adjust = 0;
if (setting != null) {
child.setRadius((int) (setting.radius * slideOffset));
super.setScrimColor(setting.scrimColor);
super.setDrawerElevation(setting.drawerElevation);
float percentage = 1f - setting.percentage;
ViewCompat.setScaleY(child, 1f - percentage * slideOffset);
child.setCardElevation(setting.elevation * slideOffset);
adjust = setting.elevation;
boolean isLeftDrawer = childAbsGravity == absHorizGravity;
float width = isLeftDrawer ?
drawerView.getWidth() + adjust : -drawerView.getWidth() - adjust;
updateSlideOffset(child, setting, width, slideOffset, isLeftDrawer);
} else {
super.setScrimColor(defaultScrimColor);
super.setDrawerElevation(defaultDrawerElevation);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!