com.mikepenz.materialdrawer.Drawer.getStickyFooterShadow()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(78)

本文整理了Java中com.mikepenz.materialdrawer.Drawer.getStickyFooterShadow()方法的一些代码示例,展示了Drawer.getStickyFooterShadow()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Drawer.getStickyFooterShadow()方法的具体详情如下:
包路径:com.mikepenz.materialdrawer.Drawer
类名称:Drawer
方法名:getStickyFooterShadow

Drawer.getStickyFooterShadow介绍

[英]get the StickyFooter Shadow View if set else NULL
[中]如果设置为NULL,则获取StickyFooter阴影视图

代码示例

代码示例来源:origin: mikepenz/MaterialDrawer

/**
 * helper method to reset to the original drawerContent
 */
public void resetDrawerContent() {
  if (switchedDrawerContent()) {
    //set the new items
    setOnDrawerItemClickListener(originalOnDrawerItemClickListener);
    setOnDrawerItemLongClickListener(originalOnDrawerItemLongClickListener);
    setItems(originalDrawerItems, true);
    getAdapter().withSavedInstanceState(originalDrawerState);
    //remove the references
    originalOnDrawerItemClickListener = null;
    originalOnDrawerItemLongClickListener = null;
    originalDrawerItems = null;
    originalDrawerState = null;
    //if we switch back scroll back to the top
    mDrawerBuilder.mRecyclerView.smoothScrollToPosition(0);
    //show the stickyFooter and it's shadow again
    if (getStickyFooter() != null) {
      getStickyFooter().setVisibility(View.VISIBLE);
    }
    if (getStickyFooterShadow() != null) {
      getStickyFooterShadow().setVisibility(View.VISIBLE);
    }
    //if we currently show the accountHeader selection list make sure to reset this attr
    if (mDrawerBuilder.mAccountHeader != null && mDrawerBuilder.mAccountHeader.mAccountHeaderBuilder != null) {
      mDrawerBuilder.mAccountHeader.mAccountHeaderBuilder.mSelectionListShown = false;
    }
  }
}

代码示例来源:origin: mikepenz/MaterialDrawer

getStickyFooter().setVisibility(View.GONE);
if (getStickyFooterShadow() != null) {
  getStickyFooterShadow().setVisibility(View.GONE);

代码示例来源:origin: FreedomZZQ/YouJoin-Android

/**
 * helper method to reset to the original drawerContent
 */
public void resetDrawerContent() {
  if (switchedDrawerContent()) {
    //set the new items
    setOnDrawerItemClickListener(originalOnDrawerItemClickListener);
    setOnDrawerItemLongClickListener(originalOnDrawerItemLongClickListener);
    setItems(originalDrawerItems, true);
    setSelectionAtPosition(originalDrawerSelection, false);
    //remove the references
    originalOnDrawerItemClickListener = null;
    originalOnDrawerItemLongClickListener = null;
    originalDrawerItems = null;
    originalDrawerSelection = -1;
    //if we switch back scroll back to the top
    mDrawerBuilder.mRecyclerView.smoothScrollToPosition(0);
    //show the stickyFooter and it's shadow again
    if (getStickyFooter() != null) {
      getStickyFooter().setVisibility(View.VISIBLE);
    }
    if (getStickyFooterShadow() != null) {
      getStickyFooterShadow().setVisibility(View.VISIBLE);
    }
    //if we currently show the accountHeader selection list make sure to reset this attr
    if (mDrawerBuilder.mAccountHeader != null && mDrawerBuilder.mAccountHeader.mAccountHeaderBuilder != null) {
      mDrawerBuilder.mAccountHeader.mAccountHeaderBuilder.mSelectionListShown = false;
    }
  }
}

代码示例来源:origin: FreedomZZQ/YouJoin-Android

/**
 * method to switch the drawer content to new elements
 *
 * @param onDrawerItemClickListener
 * @param drawerItems
 * @param drawerSelection
 */
public void switchDrawerContent(@NonNull OnDrawerItemClickListener onDrawerItemClickListener, OnDrawerItemLongClickListener onDrawerItemLongClickListener, @NonNull ArrayList<IDrawerItem> drawerItems, int drawerSelection) {
  //just allow a single switched drawer
  if (!switchedDrawerContent()) {
    //save out previous values
    originalOnDrawerItemClickListener = getOnDrawerItemClickListener();
    originalOnDrawerItemLongClickListener = getOnDrawerItemLongClickListener();
    originalDrawerItems = getDrawerItems();
    originalDrawerSelection = getCurrentSelectedPosition();
  }
  //set the new items
  setOnDrawerItemClickListener(onDrawerItemClickListener);
  setOnDrawerItemLongClickListener(onDrawerItemLongClickListener);
  setItems(drawerItems, true);
  setSelectionAtPosition(drawerSelection, false);
  //hide stickyFooter and it's shadow
  if (getStickyFooter() != null) {
    getStickyFooter().setVisibility(View.GONE);
  }
  if (getStickyFooterShadow() != null) {
    getStickyFooterShadow().setVisibility(View.GONE);
  }
}

相关文章