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


Java SlidingMenu.setTouchModeAbove方法代码示例

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


在下文中一共展示了SlidingMenu.setTouchModeAbove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createUsersSlidingMenu

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
/**
 * Setup current users {@link SlidingMenu}
 */

private void createUsersSlidingMenu()
{
    // configure the SlidingMenu
    mCurrentUsers_SlidingMenu = new SlidingMenu(MainActivity.this);
    mCurrentUsers_SlidingMenu.setMode(SlidingMenu.RIGHT);
    //mCurrentUsers_SlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
    mCurrentUsers_SlidingMenu.setShadowWidthRes(R.dimen.shadow_width);
    mCurrentUsers_SlidingMenu.setShadowDrawable(new ColorDrawable(getResources().getColor(R.color.transparentGrey)));
    mCurrentUsers_SlidingMenu.setBehindWidthRes(R.dimen.sliding_menu_width);
    mCurrentUsers_SlidingMenu.setFadeDegree(0.35f);
    mCurrentUsers_SlidingMenu.attachToActivity(MainActivity.this, SlidingMenu.SLIDING_CONTENT);
    mCurrentUsers_SlidingMenu.setMenu(R.layout.users_slideout);
    mCurrentUsers_SlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
    mCurrentUsers_SlidingMenu.setOnOpenedListener(new SlidingMenu.OnOpenedListener()
    {
        @Override
        public void onOpened()
        {
            TutorialStuff.showUsersTutorial(MainActivity.this);
        }
    });
}
 
开发者ID:HueToYou,项目名称:ChatExchange-old,代码行数:27,代码来源:MainActivity.java

示例2: onCreate

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	//ȥ��������,������setContentView֮ǰ����
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	setContentView(R.layout.activity_main);
	
	//�����
       setBehindContentView(R.layout.left_menu);
       SlidingMenu slidingMenu = getSlidingMenu();
       //����ȫ��������ʾ�����
       slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
       //������ĻԤ�����
       WindowManager wm = this.getWindowManager();
       int width = wm.getDefaultDisplay().getWidth();
       slidingMenu.setBehindOffset(width*3/5);
       
       initFragment();
}
 
开发者ID:unique5954,项目名称:zhbj74,代码行数:20,代码来源:MainActivity.java

示例3: initSlideMenu

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void initSlideMenu() {
        setBehindContentView(R.layout.menu_home);
        //获取到slidingMenu对象
        SlidingMenu slidingMenu = getSlidingMenu();
        slidingMenu.setMode(SlidingMenu.RIGHT);
        slidingMenu.setShadowWidthRes(R.dimen.shadow_width);
        slidingMenu.setShadowDrawable(R.drawable.shadow);

        //设置为全屏拉出菜单
        slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
        //设置菜单拉出后剩余屏幕宽度
//让侧拉菜单充满屏幕的四分之三
        int menuWidth=getWitdh();
        slidingMenu.setBehindOffset(menuWidth);
        slidingMenu.setOnCloseListener(new SlidingMenu.OnCloseListener() {
            @Override
            public void onClose() {
                Log.d("changecity", "菜单关闭");
                mFragWether.refreshData();
                mFragSlideMenu.stopAlarmMusic();
            }
        });
    }
 
开发者ID:JoeSteven,项目名称:Moring-Alarm,代码行数:24,代码来源:HomeActivity.java

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

示例5: onCreate

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_main);
        setBehindContentView(R.layout.left_menu);// 设置侧边栏
        SlidingMenu slidingMenu = getSlidingMenu();//获取侧边栏对象
        slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);// 设置全屏触摸
        slidingMenu.setBehindOffset(280);// 设置预留屏幕的宽度

//        setBehindContentView(R.layout.left_menu);// 设置侧边栏布局
//
//        SlidingMenu slidingMenu = getSlidingMenu();// 获取侧边栏对象
//        slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);// 设置全屏触摸
//
//        slidingMenu.setSecondaryMenu(R.layout.right_menu);// 设置右侧边栏
//        slidingMenu.setMode(SlidingMenu.LEFT_RIGHT);// 设置展现模式
//
//        slidingMenu.setBehindOffset(100);// 设置预留屏幕的宽度

        initFragment();

    }
 
开发者ID:FireB1ack,项目名称:ZhiHuiBeiJing,代码行数:24,代码来源:MainActivity.java

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

示例7: prepareMenu

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
/**
 * 准备侧滑菜单
 */
private void prepareMenu() {
    mSlidingMenu = new SlidingMenu(mContext);
    mSlidingMenu.setMode(SlidingMenu.LEFT);
    mSlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
    mSlidingMenu.setShadowWidth(0);
    mSlidingMenu.setBehindOffset((int) (SizeUtils.getScreenWidthPx(mContext) * 0.5));
    mSlidingMenu.setFadeDegree(0.0f);
    mSlidingMenu.setBehindScrollScale(0.0f);
    mSlidingMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);

    // 为侧滑菜单设置布局
    View view = View.inflate(mContext, R.layout.slidingmenu_profile, null);
    mSlidingMenu.setMenu(view);

    mPortraitView = view.findViewById(R.id.ll_slidingmenu_profile_portrait_layout);
    mPortraitImageView = (SimpleDraweeView) view.findViewById(R.id.sdv_slidingmenu_profile_portrait_image);
    mNicknameTextView = (TextView) view.findViewById(R.id.tv_slidingmenu_profile_nickname);
    mCollectionView = view.findViewById(R.id.rl_slidingmenu_profile_collection_layout);
    mCommentView = view.findViewById(R.id.rl_slidingmenu_profile_comment_layout);
    mClearCacheView = view.findViewById(R.id.rl_slidingmenu_profile_clear_cache_layout);
    mChangModeView = view.findViewById(R.id.rl_slidingmenu_profile_change_mode_layout);
    mFeedbackView = view.findViewById(R.id.rl_slidingmenu_profile_feekback_layout);
    mCommendView = view.findViewById(R.id.rl_slidingmenu_profile_commend_layout);
    mAboutView = view.findViewById(R.id.rl_slidingmenu_profile_aboutme_layout);

    mPortraitView.setOnClickListener(this);
    mCollectionView.setOnClickListener(this);
    mCommentView.setOnClickListener(this);
    mClearCacheView.setOnClickListener(this);
    mChangModeView.setOnClickListener(this);
    mFeedbackView.setOnClickListener(this);
    mCommendView.setOnClickListener(this);
    mAboutView.setOnClickListener(this);

}
 
开发者ID:6ag,项目名称:LiuAGeAndroid,代码行数:39,代码来源:MainActivity.java

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

示例9: setSlidingMenuEnable

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
/**
 * ����������
 * @param enable
 */
protected void setSlidingMenuEnable(boolean enable) {
	//��ȡ���������
	MainActivity  mainUI = (MainActivity) mActivity; 
	SlidingMenu slidingMenu = mainUI.getSlidingMenu();
	if(enable){
		slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
	}else{
		slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
	}
}
 
开发者ID:unique5954,项目名称:zhbj74,代码行数:15,代码来源:NewsMenuDetailPager.java

示例10: initSlidingMenu

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void initSlidingMenu() {
    slidingMenu = new SlidingMenu(this);
    slidingMenu.setMode(SlidingMenu.LEFT); //侧边栏从哪边出
    slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);//从哪边可以拖动,fullscreen表示全屏都可以拖动,margin表示一定区域内可拖动
    slidingMenu.setBehindOffset(200);//菜单弹出后内容显示多少
    slidingMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
    slidingMenu.setMenu(R.layout.menu_sliding_layout);
}
 
开发者ID:ting4937,项目名称:AndroidUtils,代码行数:9,代码来源:MainActivity.java

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

示例12: setSlidingMenuEnable

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
/**
 * 设置侧边栏开启或关闭
 * 各个子页面所使用的方法
 * @param enable
 */
public void setSlidingMenuEnable(boolean enable){
	MainActivity mainUi = (MainActivity) mActivity;
	SlidingMenu slidingMenu = mainUi.getSlidingMenu();
	
	if(enable){
		slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
	}else{
		slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
	}
	
}
 
开发者ID:zhangxiaomenglin,项目名称:PalmCampus,代码行数:17,代码来源:BasePager.java

示例13: onPageSelected

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onPageSelected(int arg0) {
	System.out.println("onPageSelected:"+arg0);
	
	MainActivity mainUi = (MainActivity) mActivity;
	SlidingMenu slidingMenu = mainUi.getSlidingMenu();
	
	if(arg0 == 0){// 只有在第一个页面(北京), 侧边栏才允许出来
		slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
	}else{
		slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
	}
	
	
}
 
开发者ID:zhangxiaomenglin,项目名称:PalmCampus,代码行数:16,代码来源:NewsMenuDetailPager.java

示例14: onCreate

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

	setBehindContentView(R.layout.left_menu);// 设置侧边栏
	SlidingMenu slidingMenu = getSlidingMenu();// 获取侧边栏对象
	slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);// 设置全屏触摸

	int width = getWindowManager().getDefaultDisplay().getWidth();// 获取屏幕宽度
	slidingMenu.setBehindOffset(width * 200 / 320); // 设置预留屏幕的宽度

	initFragment();
}
 
开发者ID:zhangxiaomenglin,项目名称:PalmCampus,代码行数:16,代码来源:MainActivity.java

示例15: setSlidingMenuEnable

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
/**
 * 设置侧边栏开启或关闭
 *
 * @param enable
 */
public void setSlidingMenuEnable(boolean enable) {
    MainActivity mainUi = (MainActivity) mActivity;

    SlidingMenu slidingMenu = mainUi.getSlidingMenu();

    if (enable) {
        slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
    } else {
        slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
    }
}
 
开发者ID:FireB1ack,项目名称:ZhiHuiBeiJing,代码行数:17,代码来源:BasePager.java


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