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


Java SlidingMenu.setBehindOffsetRes方法代码示例

本文整理汇总了Java中com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.setBehindOffsetRes方法的典型用法代码示例。如果您正苦于以下问题:Java SlidingMenu.setBehindOffsetRes方法的具体用法?Java SlidingMenu.setBehindOffsetRes怎么用?Java SlidingMenu.setBehindOffsetRes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jeremyfeinstein.slidingmenu.lib.SlidingMenu的用法示例。


在下文中一共展示了SlidingMenu.setBehindOffsetRes方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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_main);
    // configure the SlidingMenu
    SlidingMenu menu = new SlidingMenu(this);
    menu.setMode(SlidingMenu.LEFT);
    // 设置触摸屏幕的模式
    menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
    menu.setShadowWidthRes(R.dimen.shadow_width);
    menu.setShadowDrawable(R.color.colorPrimary);

    // 设置滑动菜单视图的宽度
    menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
    // 设置渐入渐出效果的值
    menu.setFadeDegree(0.35f);
    /**
     * SLIDING_WINDOW will include the Title/ActionBar in the content
     * section of the SlidingMenu, while SLIDING_CONTENT does not.
     */
    menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
    //为侧滑菜单设置布局
    menu.setMenu(R.layout.layout_left_menu);
}
 
开发者ID:hongyang51,项目名称:SlidingMenu4Studio,代码行数:25,代码来源:MainActivity.java

示例3: initSlidingMenu

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void initSlidingMenu(Bundle savedInstanceState) {
    // check if the content frame contains the menu frame
    if (findViewById(R.id.menu_frame) == null) {
        setBehindContentView(R.layout.menu_frame);
        getSlidingMenu().setSlidingEnabled(true);
        getSlidingMenu()
                .setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
    } else {
        // add a dummy view
        View v = new View(this);
        setBehindContentView(v);
        getSlidingMenu().setSlidingEnabled(false);
        getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
    }

    // 设置主界面Fragment视图内容
    if (savedInstanceState != null)
        mContent = getSupportFragmentManager().getFragment(
                savedInstanceState, "mContent");
    if (mContent == null)
        mContent = new GlanceMainFragment();

    getSupportFragmentManager().beginTransaction()
            .replace(R.id.content_frame, mContent).commit();

    // set the Behind View Fragment
    getSupportFragmentManager().beginTransaction()
            .replace(R.id.menu_frame, new MainMenuFragment()).commit();

    // 设置滑动菜单的属性值
    SlidingMenu sm = getSlidingMenu();
    sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
    sm.setShadowWidthRes(R.dimen.shadow_width);
    sm.setShadowDrawable(R.drawable.shadow);
    sm.setBehindScrollScale(0.25f);
    sm.setFadeDegree(0.25f);
}
 
开发者ID:Datatellit,项目名称:xlight_android_native,代码行数:38,代码来源:SlidingMenuMainActivity.java

示例4: setSlidingMenu

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void setSlidingMenu() {
    menu = new SlidingMenu(this);
    menu.setMode(SlidingMenu.LEFT);
    // 设置触摸屏幕的模式
    menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
    menu.setBehindScrollScale(1.0f);
    // 设置滑动菜单视图的宽度
    menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
    // 设置渐入渐出效果的值
    menu.setFadeDegree(0);
    menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
    //为侧滑菜单设置布局
    menu.setMenu(menuView);
}
 
开发者ID:ChenTianSaber,项目名称:DailyZhiHu,代码行数:15,代码来源:HomePagerActivity.java

示例5: onCreate

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	setTitle(R.string.attach);

	// set the Above View
	setContentView(R.layout.content_frame);
	getSupportFragmentManager()
	.beginTransaction()
	.replace(R.id.content_frame, new SampleListFragment())
	.commit();

	// configure the SlidingMenu
	menu = new SlidingMenu(this);
	menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
	menu.setShadowWidthRes(R.dimen.shadow_width);
	menu.setShadowDrawable(R.drawable.shadow);
	menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
	menu.setFadeDegree(0.35f);
	menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
	menu.setMenu(R.layout.menu_frame);
	getSupportFragmentManager()
	.beginTransaction()
	.replace(R.id.menu_frame, new SampleListFragment())
	.commit();
}
 
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:28,代码来源:AttachExample.java

示例6: initSlideMenu

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void initSlideMenu() {
	setBehindContentView(createFrameLayout(FRAGMENT_LEFT_MANU_ID));
	SlidingMenu mSlidingMenu = getSlidingMenu();
	mSlidingMenu.setMode(SlidingMenu.LEFT);
	mSlidingMenu.setShadowWidthRes(R.dimen.shadow_width);
	mSlidingMenu.setShadowDrawable(null);
	mSlidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
	mSlidingMenu.setFadeDegree(0.35f);
	mSlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
	mSlidingMenu.setBehindScrollScale(0.0f);
}
 
开发者ID:wangcantian,项目名称:Mobile-Office,代码行数:12,代码来源:MainActivity.java

示例7: onCreate

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	bus.register(this);
	ActionBar actionBar = getActionBar();
	actionBar.setCustomView(R.layout.custom_actionbar);
	listName = (TextView) actionBar.getCustomView().findViewById(R.id.viewListNameActionBar);
	actionBar.setDisplayShowCustomEnabled(true);
	actionBar.setDisplayHomeAsUpEnabled(false);
	actionBar.setHomeButtonEnabled(true);

	setContentView(R.layout.main);
	setBehindContentView(R.layout.task_lists);
	
	SlidingMenu sm = getSlidingMenu();
	sm.setShadowWidthRes(R.dimen.shadow_width);
	sm.setShadowDrawable(R.drawable.shadow);
	sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
	sm.setFadeDegree(0.35f);
	sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
	setSlidingActionBarEnabled(false);
	
	actionBar.setIcon(R.drawable.ic_drawer);
	actionBar.show();
	
	View view = getLayoutInflater().inflate(R.layout.about_dialog, null);
	AlertDialog.Builder builder = new AlertDialog.Builder(this);
	builder.setView(view).setTitle(getResources().getString(R.string.menu_item_about)).setPositiveButton(android.R.string.ok, null);
	aboutDialog = builder.create();

       Intent intent = getIntent();
       if (Intent.ACTION_SEARCH.equals(intent.getAction()))
           handleSearchIntent(intent);
       if (Intent.ACTION_SEND.equals(intent.getAction()) && intent.getType() != null
               && "text/plain".equals(intent.getType()))
           handleSendText(intent);
}
 
开发者ID:danielebufarini,项目名称:Reminders,代码行数:38,代码来源:Reminders.java

示例8: onCreate

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	setTitle(mTitleRes);
	

	// seta o menu lateral
	setBehindContentView(R.layout.menu_1);
	if (savedInstanceState == null) {
		FragmentTransaction t = this.getSupportFragmentManager().beginTransaction();
		mFrag = new Left_Menu();
		t.replace(R.id.menu_frame, mFrag);
		t.commit();
	} else {
		mFrag = (Fragment)this.getSupportFragmentManager().findFragmentById(R.id.menu_frame);
	}

	// customizando o menu, sombras, dimensões
	SlidingMenu sm = getSlidingMenu();
	sm.setShadowWidthRes(R.dimen.shadow_width);
	sm.setShadowDrawable(R.drawable.shadow);
	sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
	sm.setFadeDegree(0.35f);
	sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);

	getActionBar().setDisplayHomeAsUpEnabled(true);
}
 
开发者ID:Paulocajr,项目名称:IPRJapp,代码行数:29,代码来源:BaseActivity.java

示例9: onCreate

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setTitle(R.string.responsive_ui);

	setContentView(R.layout.responsive_content_frame);

	// check if the content frame contains the menu frame
	if (findViewById(R.id.menu_frame) == null) {
		setBehindContentView(R.layout.menu_frame);
		getSlidingMenu().setSlidingEnabled(true);
		getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
		// show home as up so we can toggle
		getSupportActionBar().setDisplayHomeAsUpEnabled(true);
	} else {
		// add a dummy view
		View v = new View(this);
		setBehindContentView(v);
		getSlidingMenu().setSlidingEnabled(false);
		getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
	}

	// set the Above View Fragment
	if (savedInstanceState != null)
		mContent = getSupportFragmentManager().getFragment(savedInstanceState, "mContent");
	if (mContent == null)
		mContent = new BirdGridFragment(0);	
	getSupportFragmentManager()
	.beginTransaction()
	.replace(R.id.content_frame, mContent)
	.commit();

	// set the Behind View Fragment
	getSupportFragmentManager()
	.beginTransaction()
	.replace(R.id.menu_frame, new BirdMenuFragment())
	.commit();

	// customize the SlidingMenu
	SlidingMenu sm = getSlidingMenu();
	sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
	sm.setShadowWidthRes(R.dimen.shadow_width);
	sm.setShadowDrawable(R.drawable.shadow);
	sm.setBehindScrollScale(0.25f);
	sm.setFadeDegree(0.25f);

	// show the explanation dialog
	if (savedInstanceState == null)
		new AlertDialog.Builder(this)
		.setTitle(R.string.what_is_this)
		.setMessage(R.string.responsive_explanation)
		.show();
}
 
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:54,代码来源:ResponsiveUIActivity.java

示例10: onCreate

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setTitle(R.string.responsive_ui);

	setContentView(R.layout.responsive_content_frame);

	// check if the content frame contains the menu frame
	if (findViewById(R.id.menu_frame) == null) {
		setBehindContentView(R.layout.menu_frame);
		getSlidingMenu().setSlidingEnabled(true);
		getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
		// show home as up so we can toggle
		getActionBar().setDisplayHomeAsUpEnabled(true);
	} else {
		// add a dummy view
		View v = new View(this);
		setBehindContentView(v);
		getSlidingMenu().setSlidingEnabled(false);
		getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
	}

	// set the Above View Fragment
	if (savedInstanceState != null)
		mContent = getSupportFragmentManager().getFragment(savedInstanceState, "mContent");
	if (mContent == null)
		mContent = new BirdGridFragment(0);	
	getSupportFragmentManager()
	.beginTransaction()
	.replace(R.id.content_frame, mContent)
	.commit();

	// set the Behind View Fragment
	getSupportFragmentManager()
	.beginTransaction()
	.replace(R.id.menu_frame, new BirdMenuFragment())
	.commit();

	// customize the SlidingMenu
	SlidingMenu sm = getSlidingMenu();
	sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
	sm.setShadowWidthRes(R.dimen.shadow_width);
	sm.setShadowDrawable(R.drawable.shadow);
	sm.setBehindScrollScale(0.25f);
	sm.setFadeDegree(0.25f);

	// show the explanation dialog
	if (savedInstanceState == null)
		new AlertDialog.Builder(this)
		.setTitle(R.string.what_is_this)
		.setMessage(R.string.responsive_explanation)
		.show();
}
 
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:54,代码来源:ResponsiveUIActivity.java

示例11: 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

示例12: initsm

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void initsm() {
	// set the Behind View
	setBehindContentView(R.layout.menu_frame);

	getSupportFragmentManager().beginTransaction()
			.replace(R.id.menu_frame, new LeftBottomFragment()).commit();
	
	
	
	//getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame, new LeftBottomFragment(), "TAG").commit();

	// customize the SlidingMenu
	SlidingMenu sm = getSlidingMenu();
	sm.setShadowWidthRes(R.dimen.shadow_width);
	sm.setShadowDrawable(R.drawable.shadow);
	sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
	sm.setFadeDegree(0.35f);
	sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
	
	
	
}
 
开发者ID:leerduo,项目名称:travelinfo,代码行数:23,代码来源:MainActivity.java


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