Java Code Examples for com.jeremyfeinstein.slidingmenu.lib.SlidingMenu#setSecondaryShadowDrawable()
The following examples show how to use
com.jeremyfeinstein.slidingmenu.lib.SlidingMenu#setSecondaryShadowDrawable() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainActivity.java From yiim_v2 with GNU General Public License v2.0 | 5 votes |
private void setupSideMenu() { SlidingMenu sm = getSlidingMenu(); setupLeftMenu(); sm.setSecondaryMenu(R.layout.right_menu_frame); sm.setSecondaryShadowDrawable(R.drawable.right_menu_shadow); mRightMenu = new SideMenuFragment(); mRightMenu.setMode(SlidingMenu.RIGHT); // set the Behind View getSupportFragmentManager().beginTransaction() .replace(R.id.right_menu_frame, mRightMenu).commit(); }
Example 2
Source File: HomeActivity.java From Rumble with GNU General Public License v3.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); mTitle = getTitle(); /* sliding menu with both right and left drawer */ slidingMenu = new SlidingMenu(this); slidingMenu.setShadowWidthRes(R.dimen.shadow_width); slidingMenu.setShadowDrawable(R.drawable.shadow); slidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset); slidingMenu.setFadeDegree(0.35f); slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); slidingMenu.setMode(SlidingMenu.LEFT_RIGHT); slidingMenu.setMenu(R.layout.slidingmenu_navigation_drawer); slidingMenu.setSecondaryMenu(R.layout.slidingmenu_network_drawer); slidingMenu.setSecondaryShadowDrawable(R.drawable.shadowright); if (savedInstanceState == null) { mNavigationDrawerFragment = new FragmentNavigationDrawer(); mNetworkDrawerFragment = new FragmentNetworkDrawer(); this.getSupportFragmentManager().beginTransaction() .replace(R.id.navigation_drawer_frame, mNavigationDrawerFragment).commit(); this.getSupportFragmentManager().beginTransaction() .replace(R.id.network_drawer_frame, mNetworkDrawerFragment).commit(); } else { mNavigationDrawerFragment = (FragmentNavigationDrawer) this.getSupportFragmentManager().findFragmentById(R.id.navigation_drawer_frame); mNetworkDrawerFragment = (FragmentNetworkDrawer) this.getSupportFragmentManager().findFragmentById(R.id.network_drawer_frame); } slidingMenu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW); /* * the tablayout for status and chat message with a viewpager. * note that we cannot swipe views with the viewpager as the swipe * gesture is catched by slidingmenu to slide the panel */ TabLayout tabLayout = (TabLayout) findViewById(R.id.home_tab_layout); viewPager = (ViewPager) findViewById(R.id.home_viewpager); pagerAdapter = new HomePagerAdapter(getSupportFragmentManager()); viewPager.setAdapter(pagerAdapter); viewPager.addOnPageChangeListener(onPageChangeListener); tabLayout.setupWithViewPager(viewPager); // little hack to set the icons instead of text notifStatus = renderTabView(this, R.drawable.ic_world, (ViewGroup)tabLayout.getParent()); notifChat = renderTabView(this, R.drawable.ic_forum_white_24dp, (ViewGroup)tabLayout.getParent()); tabLayout.getTabAt(0).setCustomView(notifStatus); tabLayout.getTabAt(1).setCustomView(notifChat); tabLayout.setSelectedTabIndicatorHeight(10); // for notification refreshStatusNotifications(); refreshChatNotifications(); EventBus.getDefault().register(this); }
Example 3
Source File: MainActivity.java From android-kernel-tweaker with GNU General Public License v3.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_container); RootTools.debugMode = false; boolean access = RootTools.isAccessGiven(); boolean busybox = RootTools.isBusyboxAvailable(); if(!access) { showRootWarning(); } if(!busybox) { showBusyBoxWarning(); } mContainer = (FrameLayout) findViewById(R.id.activity_container); mContext = this; mPrefs = PreferenceManager.getDefaultSharedPreferences(this); getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setHomeButtonEnabled(true); View v = this.getLayoutInflater().inflate(R.layout.menu_list, null, false); menulist = (ListView) v.findViewById(R.id.navbarlist); db = new DatabaseHandler(this); vddDb = new VddDatabaseHandler(this); menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT_RIGHT); menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setShadowWidthRes(R.dimen.shadow_width); menu.setShadowDrawable(R.drawable.shadow); //menu.setBehindOffsetRes(R.dimen.slidingmenu_offset); menu.setBehindWidthRes(R.dimen.slidingmenu_offset); menu.setFadeDegree(0.35f); menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); menu.setMenu(v); View vv = this.getLayoutInflater().inflate(R.layout.menu_glossary, null, false); mGlossaryContainer = (FrameLayout) vv.findViewById(R.id.menu_frame); menu.setSecondaryMenu(vv); menu.setSecondaryShadowDrawable(R.drawable.shadow_right); mAdapter = new CustomArrayAdapter( this, R.layout.menu_main_list_item, getResources().getStringArray(R.array.menu_entries), getResources().getStringArray(R.array.menu_descs), getResources().getStringArray(R.array.menu_colors), icons); menulist.setAdapter(mAdapter); menulist.setChoiceMode(ListView.CHOICE_MODE_SINGLE); menulist.setOnItemClickListener(this); colors = getResources().getStringArray(R.array.menu_colors); FragmentTransaction ft = getFragmentManager().beginTransaction(); Fragment prefs = new TimeInState(); CpuGlossaryFragment glo = new CpuGlossaryFragment(); ft.replace(R.id.activity_container,prefs); ft.replace(R.id.menu_frame, glo); ft.commit(); setAppTheme(); mountPartitions(); copyHelpers(); }