Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. private void initSlidingMenu()
  2. {
  3. // configure the SlidingMenu
  4. menu = new SlidingMenu(this);
  5. menu.setMode(SlidingMenu.LEFT);
  6. menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
  7. menu.setShadowWidthRes(R.dimen.shadow_width);
  8. // menu.setShadowDrawable(R.drawable.shadoew);
  9. menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
  10. // menu.setFadeDegree(0.35f);
  11. menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
  12. menu.setMenu(R.layout.menu_main_sliding);
  13. }
  14.  
  15. switch (slideStyle) {
  16. case SLIDING_WINDOW:
  17. mActionbarOverlay = false;
  18. ViewGroup decor = (ViewGroup) activity.getWindow().getDecorView();
  19. ViewGroup decorChild = (ViewGroup) decor.getChildAt(0);
  20. // save ActionBar themes that have transparent assets
  21. decorChild.setBackgroundResource(background);
  22. decor.removeView(decorChild);
  23. decor.addView(this);
  24. setContent(decorChild);
  25. break;
  26. case SLIDING_CONTENT:
  27. mActionbarOverlay = actionbarOverlay;
  28. // take the above view out of
  29. ViewGroup contentParent = (ViewGroup)activity.findViewById(android.R.id.content);
  30. View content = contentParent.getChildAt(0);
  31. contentParent.removeView(content);
  32. contentParent.addView(this);
  33. setContent(content);
  34. // save people from having transparent backgrounds
  35. if (content.getBackground() == null)
  36. content.setBackgroundResource(background);
  37. break;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement