本文整理匯總了Java中com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.setSecondaryShadowDrawable方法的典型用法代碼示例。如果您正苦於以下問題:Java SlidingMenu.setSecondaryShadowDrawable方法的具體用法?Java SlidingMenu.setSecondaryShadowDrawable怎麽用?Java SlidingMenu.setSecondaryShadowDrawable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jeremyfeinstein.slidingmenu.lib.SlidingMenu
的用法示例。
在下文中一共展示了SlidingMenu.setSecondaryShadowDrawable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initMenu
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //導入方法依賴的package包/類
private void initMenu() {
SlidingMenu menu = getSlidingMenu();
//����ͨ������
menu.setMode(SlidingMenu.LEFT_RIGHT);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
menu.setShadowWidthRes(R.dimen.shadow_width);
menu.setShadowDrawable(R.drawable.shadow);
menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
menu.setFadeDegree(0.35f);
//���IJ˵�
setBehindContentView(R.layout.menu_left);//���Ҳ��ʹ��ͬһ�����֣�����replace���Ŀؼ���ID������ͬ����֪��Ϊʲô�������������
Fragment leftMenuFragment = new MainTabFragment2("���˵�");
getSupportFragmentManager().beginTransaction().replace(R.id.menu_left, leftMenuFragment).commit();
//�Ҳ�˵�����
menu.setSecondaryShadowDrawable(R.drawable.shadow);//������Դ�ļ�ID�������ұߣ������������˵�����ӰЧ��
menu.setSecondaryMenu(R.layout.menu_right);//�����ұ߲�˵�
Fragment rightMenuFragment = new MainTabFragment2("�Ҳ�˵�");
getSupportFragmentManager().beginTransaction().replace(R.id.menu_right, rightMenuFragment).commit();
}
示例2: onCreate
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //導入方法依賴的package包/類
@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);
}