android.support.v4.widget.DrawerLayout.findViewById()方法的使用及代码示例

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

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

DrawerLayout.findViewById介绍

暂无

代码示例

代码示例来源:origin: palaima/DebugDrawer

sliderLayout = drawerLayout.findViewById(R.id.dd_slider_layout);
debugView = sliderLayout.findViewById(R.id.dd_debug_view);

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

/**
 * get the container frameLayout of the current drawer
 *
 * @return
 */
public FrameLayout getContent() {
  if (mContentView == null && this.mDrawerBuilder.mDrawerLayout != null) {
    mContentView = (FrameLayout) this.mDrawerBuilder.mDrawerLayout.findViewById(R.id.content_layout);
  }
  return mContentView;
}

代码示例来源:origin: powerpoint45/Lucid-Browser

/**
 * @return Webview that is curently being displayed
 */
public CustomWebView getFocussedWebView(){
  if (drawerLayout!=null){
    return drawerLayout.findViewById(R.id.web_holder).findViewById(R.id.browser_page);
  }
  return null;
}

代码示例来源:origin: stackoverflow.com

final DrawerLayout drawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
final View navigation = ((NavigationDrawer)drawerLayout.findViewById(R.id.navigation_drawer));

if(drawerLayout.isDrawerOpen(navigation)) drawerLayout.closeDrawer(navigation);
else drawerLayout.openDrawer(navigation);

代码示例来源:origin: stackoverflow.com

private void drawerHandler(DrawerLayout drawer)
{
  if (drawer.isDrawerOpen(GravityCompat.START)) {
    drawer.closeDrawer(GravityCompat.START);
  }
  else {
    drawer.openDrawer(GravityCompat.START);
  }
  TextView userFullName = (TextView) drawer.findViewById(R.id.tv_userFullName);
  if(userFullName != null)
  {
    userFullName.setText(FacebookAndGoogle.getFullName());
  }
  ImageButton userPic = (ImageButton) drawer.findViewById(R.id.ib_userPic);
  if(userPic != null)
  {
    userPic.setImageBitmap(RoundedImageView.getCroppedBitmap(FacebookAndGoogle.getProfilePic(), 240));
  }
}

代码示例来源:origin: doc-rj/smartcard-reader

mParentItem = drawerLayout.findViewById(resId);
mParentItem.setActivated(true);
drawerLayout.setDrawerListener(mDrawerToggle);
View appSelect = drawerLayout.findViewById(R.id.app_select);
View batchSelect = drawerLayout.findViewById(R.id.batch_select);
View emvRead = drawerLayout.findViewById(R.id.emv_read);
View apps = drawerLayout.findViewById(R.id.apps);
View settings = drawerLayout.findViewById(R.id.settings);

代码示例来源:origin: Wilm0r/giggity

public void updateNavDrawer() {
  /* Show currently selected view */
  for (int v : VIEWS) {
    if (curView == v) {
      drawerLayout.findViewById(v).setBackgroundResource(R.drawable.menu_gradient);
    } else {
      drawerLayout.findViewById(v).setBackgroundResource(R.color.light);
    }
  }
  if (sched == null) {
    Log.e("updateNavDrawer", "Called before critical was loaded?");
    return;
  }
  drawerLayout.findViewById(R.id.tracks).setVisibility(
      sched.getTracks() != null ? View.VISIBLE : View.GONE);
  drawerLayout.findViewById(R.id.change_day).setVisibility(
      !viewer.multiDay() && (sched.getDays().size() > 1) ? View.VISIBLE : View.GONE);
  drawerLayout.findViewById(R.id.show_hidden).setBackgroundResource(
      showHidden ? R.drawable.menu_gradient : R.color.light);
  /* TimeTable extends the action bar with "tabs" and will have its own shadow. */
  app.setShadow(getActionBar(), !viewer.extendsActionBar());
}

代码示例来源:origin: stackoverflow.com

ListView actContent = (ListView) fullLayout.findViewById(R.id.drawer);
getLayoutInflater().inflate(layoutResID, actContent, true); // Setting    the    content  of layout your  provided  to the  act_content frame
super.setContentView(fullLayout);

代码示例来源:origin: Wilm0r/giggity

public void finishNavDrawer() {
  if (sched == null) {
    Log.e("finishNavDrawer", "Called before critical was loaded?");
    return;
  }
  LinkedList<Date> days = sched.getDays();
  TextView dr = (TextView) drawerLayout.findViewById(R.id.date_range);
  dr.setText(Giggity.dateRange(days.getFirst(), days.getLast()));
  if (sched.getLinks() != null) {
    ViewGroup menu = (LinearLayout) drawerLayout.findViewById(R.id.menu);
    View sep = menu.findViewById(R.id.custom_sep);
    sep.setVisibility(View.VISIBLE);
    for (final Schedule.Link link : sched.getLinks()) {
      TextView item = (TextView) getLayoutInflater().inflate(R.layout.burger_menu_item, null);
      item.setText(link.getTitle());
      item.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
          openLink(link, true);
          drawerLayout.closeDrawers();
        }
      });
      menu.addView(item, menu.indexOfChild(sep));
    }
  }
}

代码示例来源:origin: stackoverflow.com

mDrawerList = (ListView)fullLayout.findViewById(R.id.drawer_list);
fullLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED,mFilterList);
fullLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
fullLayout.setDrawerListener(mDrawerToggle);
actContent= (FrameLayout) fullLayout.findViewById(R.id.act_content);
getLayoutInflater().inflate(layoutResID, actContent, true); // Setting the content of layout your provided to the act_content frame

代码示例来源:origin: listenzz/AndroidNavigation

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  View root = inflater.inflate(R.layout.nav_fragment_drawer, container, false);
  drawerLayout = root.findViewById(R.id.drawer);
  drawerLayout.addDrawerListener(this);
  if (savedInstanceState != null) {
    minDrawerMargin = savedInstanceState.getInt(MIN_DRAWER_MARGIN_KEY, 64);
    maxDrawerWidth = savedInstanceState.getInt(MAX_DRAWER_WIDTH_KEY);
  }
  FrameLayout menuLayout = drawerLayout.findViewById(R.id.drawer_menu);
  ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) menuLayout.getLayoutParams();
  int screenWidth = AppUtils.getScreenWidth(requireContext());
  int margin1 = AppUtils.dp2px(requireContext(), minDrawerMargin);
  if (margin1 > screenWidth) {
    margin1 = screenWidth;
  } else if (margin1 < 0) {
    margin1 = 0;
  }
  if (maxDrawerWidth <= 0 || maxDrawerWidth > screenWidth) {
    maxDrawerWidth = screenWidth;
  }
  int margin2 = screenWidth - AppUtils.dp2px(requireContext(), maxDrawerWidth);
  int margin = Math.max(margin1, margin2);
  layoutParams.rightMargin = margin - AppUtils.dp2px(requireContext(), 64);
  return root;
}

代码示例来源:origin: powerpoint45/Lucid-Browser

drawerLayout = (DrawerLayout) inflater.inflate(R.layout.main, null);
contentFrame = drawerLayout.findViewById(R.id.content_frame);
browserListView = drawerLayout.findViewById(R.id.right_drawer);
toolbar = drawerLayout.findViewById(R.id.toolbar);

代码示例来源:origin: stackoverflow.com

FrameLayout activityContainer = (FrameLayout) fullView.findViewById(R.id.frame);
getLayoutInflater().inflate(layoutResID, activityContainer, true);
toolbar = (Toolbar) fullView.findViewById(R.id.tool_bar);

代码示例来源:origin: NordicSemiconductor/Android-nRF-Toolbox

setupPluginsInDrawer((ViewGroup) drawer.findViewById(R.id.plugin_container));

代码示例来源:origin: stackoverflow.com

R.layout.drawer_activity, null);
FrameLayout layout = (FrameLayout) mDrawerLayout
    .findViewById(R.id.content_frame);
layout.addView(view);
super.setContentView(mDrawerLayout);

代码示例来源:origin: wasdennnoch/AndroidN-ify

ViewGroup content = (ViewGroup) XposedHelpers.getObjectField(activity, "mContent");
mDrawerLayout = (DrawerLayout) inflater.inflate(ResourceUtils.getInstance(activity).getLayout(R.layout.settings_with_drawer), content, false);
Toolbar toolbar = (Toolbar) mDrawerLayout.findViewById(R.id.action_bar);
activity.setActionBar(toolbar);
ActionBar actionBar = activity.getActionBar();
int index = parent.indexOfChild(content);
parent.removeView(content);
((FrameLayout) mDrawerLayout.findViewById(R.id.content_frame)).addView(content);
parent.addView(mDrawerLayout, index);
mDrawerAdapter = new SettingsDrawerAdapter(activity);

代码示例来源:origin: trezor/trezor-android

this.drawerContent = (ScrimInsetsScrollView)drawerLayout.findViewById(R.id.drawer_content);

相关文章