当前位置: 首页>>代码示例>>Java>>正文


Java SlidingMenu.setSecondaryShadowDrawable方法代码示例

本文整理汇总了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();
}
 
开发者ID:baiqiantao,项目名称:MainUI,代码行数:22,代码来源:MainActivity3.java

示例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);
}
 
开发者ID:Marlinski,项目名称:Rumble,代码行数:56,代码来源:HomeActivity.java


注:本文中的com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.setSecondaryShadowDrawable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。