當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。