Java Code Examples for com.jeremyfeinstein.slidingmenu.lib.SlidingMenu#setBehindWidth()
The following examples show how to use
com.jeremyfeinstein.slidingmenu.lib.SlidingMenu#setBehindWidth() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SlidingMenuSampleActivity.java From android-opensource-library-56 with Apache License 2.0 | 5 votes |
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sliding_menu_sample); final SlidingMenu menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT); menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setBehindWidth(getResources().getDimensionPixelSize( R.dimen.menu_width)); menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); menu.setMenu(R.layout.sliding_menu); menu.setOnOpenedListener(new OnOpenedListener() { @Override public void onOpened() { // メニューが開かれた時に呼び出される } }); menu.setOnClosedListener(new OnClosedListener() { @Override public void onClosed() { // メニューが閉じた時に呼び出される } }); initializeMenuLayout(menu); new Handler().postDelayed(new Runnable() { @Override public void run() { menu.showMenu(true); } }, 4000); }
Example 2
Source File: SubCategoryActivity.java From wallpaper with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); currentPageSubLatest = 0; currentPageSubRecommended = 0; currentPageHottest = 0; currentPage = 0; isFromRefreshDataSubLatest = true; isFromRefreshDataSubRecommended = true; isFromRefreshDataHottest = true; latestGroups = new ArrayList<Group>(); recommendedGroups = new ArrayList<Group>(); hottestGroups = new ArrayList<Group>(); setContentView(R.layout.activity_subcategory); subcategory_title_textview = (TextView) findViewById(R.id.subcategory_title_textview); subcategoryBackImage = (ImageView) findViewById(R.id.subcategory_back_image); subcategoryBackImage.setOnClickListener(this); pager = (ViewPager) findViewById(R.id.pager); pager.setOffscreenPageLimit(2); fragments = new ArrayList<Fragment>(); SubLatestFragment sublatestFragment = new SubLatestFragment(); SubRecommendedFragment subrecommendedFragment = new SubRecommendedFragment(); HottestFragment hottestfragment = new HottestFragment(); fragments.add(sublatestFragment); fragments.add(subrecommendedFragment); fragments.add(hottestfragment); latestButton = (RadioButton) findViewById(R.id.radio_sub_latest); latestButton.setOnClickListener(this); recommendedButton = (RadioButton) findViewById(R.id.radio_sub_recommended); recommendedButton.setOnClickListener(this); hottestButton = (RadioButton) findViewById(R.id.radio_hottest); hottestButton.setOnClickListener(this); mAdapter = new ViewPagerAdapter(getSupportFragmentManager(), fragments); pager.setAdapter(mAdapter); menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT); menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setShadowWidthRes(R.dimen.shadow_width); menu.setShadowDrawable(R.drawable.slidingmenu_shadow); menu.setBehindOffsetRes(R.dimen.slidingmenu_offset); menu.setFadeDegree(0.35f); menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); menu.setMenu(R.layout.layout_menu); menu.setMode(SlidingMenu.LEFT); menu.setMenu(R.layout.layout_menu); long screenWidth = WallWrapperEnvConfigure.getScreenWidth(); menu.setBehindWidth((int) (screenWidth * 0.7)); pager.setOnPageChangeListener(this); menuListView = (ListView) menu.getMenu().findViewById(R.id.menu_listview); menuListView.setAdapter(new MenuListViewAdapter(this)); menuListView.setOnItemClickListener(this); }
Example 3
Source File: MainActivity.java From wallpaper with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); UmengUpdateAgent.update(this); currentPageLatest = 0; currentPageRecommended = 0; currentPage = 0; isFromRefreshData = true; isFromRefreshDataRecommended = true; latestGroups = new ArrayList<Group>(); recommendedGroups = new ArrayList<Group>(); setContentView(R.layout.activity_main); pager = (ViewPager) findViewById(R.id.main_pager); pager.setOffscreenPageLimit(2); fragments = new ArrayList<Fragment>(); menuImageView = (ImageView) findViewById(R.id.main_menu_imageView); menuImageView.setOnClickListener(this);// 菜单点击 searchImageView = (ImageView) findViewById(R.id.main_search_imageview); searchImageView.setOnClickListener(this);// 搜索点击 recommendedButton = (RadioButton) findViewById(R.id.main_recommended_radio); recommendedButton.setOnClickListener(this); latestButton = (RadioButton) findViewById(R.id.main_latest_radio); latestButton.setOnClickListener(this); categoryButton = (RadioButton) findViewById(R.id.main_category_radio); categoryButton.setOnClickListener(this); LatestFragment latestFragment = new LatestFragment(); RecommendedFragment recommendedFragment = new RecommendedFragment(); CategoryFragment categoryFragment = new CategoryFragment(); categoryFragment.setCategoryFragmentListener(this); fragments.add(latestFragment); fragments.add(recommendedFragment); fragments.add(categoryFragment); mAdapter = new ViewPagerAdapter(getSupportFragmentManager(), fragments); pager.setAdapter(mAdapter); pager.setOnPageChangeListener(this); menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT); menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setShadowWidthRes(R.dimen.shadow_width); menu.setShadowDrawable(R.drawable.slidingmenu_shadow); menu.setBehindOffsetRes(R.dimen.slidingmenu_offset); menu.setFadeDegree(0.35f); menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); menu.setMenu(R.layout.layout_menu); menu.setMode(SlidingMenu.LEFT); menu.setMenu(R.layout.layout_menu); long screenWidth = WallWrapperEnvConfigure.getScreenWidth(); menu.setBehindWidth((int) (screenWidth * 0.7)); menuListView = (ListView) menu.getMenu().findViewById(R.id.menu_listview); menuListView.setAdapter(new MenuListViewAdapter(this)); menuListView.setOnItemClickListener(this); }
Example 4
Source File: SubCategoryActivity.java From wallpaper with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); currentPageSubLatest = 0; currentPageSubRecommended = 0; currentPageHottest = 0; currentPage = 0; isFromRefreshDataSubLatest = true; isFromRefreshDataSubRecommended = true; isFromRefreshDataHottest = true; latestGroups = new ArrayList<Group>(); recommendedGroups = new ArrayList<Group>(); hottestGroups = new ArrayList<Group>(); setContentView(R.layout.activity_subcategory); subcategory_title_textview = (TextView) findViewById(R.id.subcategory_title_textview); subcategoryBackImage = (ImageView) findViewById(R.id.subcategory_back_image); subcategoryBackImage.setOnClickListener(this); pager = (ViewPager) findViewById(R.id.pager); pager.setOffscreenPageLimit(2); fragments = new ArrayList<Fragment>(); SubLatestFragment sublatestFragment = new SubLatestFragment(); SubRecommendedFragment subrecommendedFragment = new SubRecommendedFragment(); HottestFragment hottestfragment = new HottestFragment(); fragments.add(sublatestFragment); fragments.add(subrecommendedFragment); fragments.add(hottestfragment); latestButton = (RadioButton) findViewById(R.id.radio_sub_latest); latestButton.setOnClickListener(this); recommendedButton = (RadioButton) findViewById(R.id.radio_sub_recommended); recommendedButton.setOnClickListener(this); hottestButton = (RadioButton) findViewById(R.id.radio_hottest); hottestButton.setOnClickListener(this); mAdapter = new ViewPagerAdapter(getSupportFragmentManager(), fragments); pager.setAdapter(mAdapter); menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT); menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setShadowWidthRes(R.dimen.shadow_width); menu.setShadowDrawable(R.drawable.slidingmenu_shadow); menu.setBehindOffsetRes(R.dimen.slidingmenu_offset); menu.setFadeDegree(0.35f); menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); menu.setMenu(R.layout.layout_menu); menu.setMode(SlidingMenu.LEFT); menu.setMenu(R.layout.layout_menu); long screenWidth = WallWrapperEnvConfigure.getScreenWidth(); menu.setBehindWidth((int) (screenWidth * 0.7)); pager.setOnPageChangeListener(this); menuListView = (ListView) menu.getMenu().findViewById(R.id.menu_listview); menuListView.setAdapter(new MenuListViewAdapter(this)); menuListView.setOnItemClickListener(this); }
Example 5
Source File: MainActivity.java From wallpaper with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); UmengUpdateAgent.update(this); currentPageLatest = 0; currentPageRecommended = 0; currentPage = 0; isFromRefreshData = true; isFromRefreshDataRecommended = true; latestGroups = new ArrayList<Group>(); recommendedGroups = new ArrayList<Group>(); setContentView(R.layout.activity_main); pager = (ViewPager) findViewById(R.id.main_pager); pager.setOffscreenPageLimit(2); fragments = new ArrayList<Fragment>(); menuImageView = (ImageView) findViewById(R.id.main_menu_imageView); menuImageView.setOnClickListener(this);// 菜单点击 searchImageView = (ImageView) findViewById(R.id.main_search_imageview); searchImageView.setOnClickListener(this);// 搜索点击 recommendedButton = (RadioButton) findViewById(R.id.main_recommended_radio); recommendedButton.setOnClickListener(this); latestButton = (RadioButton) findViewById(R.id.main_latest_radio); latestButton.setOnClickListener(this); categoryButton = (RadioButton) findViewById(R.id.main_category_radio); categoryButton.setOnClickListener(this); LatestFragment latestFragment = new LatestFragment(); RecommendedFragment recommendedFragment = new RecommendedFragment(); CategoryFragment categoryFragment = new CategoryFragment(); categoryFragment.setCategoryFragmentListener(this); fragments.add(latestFragment); fragments.add(recommendedFragment); fragments.add(categoryFragment); mAdapter = new ViewPagerAdapter(getSupportFragmentManager(), fragments); pager.setAdapter(mAdapter); pager.setOnPageChangeListener(this); menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT); menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setShadowWidthRes(R.dimen.shadow_width); menu.setShadowDrawable(R.drawable.slidingmenu_shadow); menu.setBehindOffsetRes(R.dimen.slidingmenu_offset); menu.setFadeDegree(0.35f); menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); menu.setMenu(R.layout.layout_menu); menu.setMode(SlidingMenu.LEFT); menu.setMenu(R.layout.layout_menu); long screenWidth = WallWrapperEnvConfigure.getScreenWidth(); menu.setBehindWidth((int) (screenWidth * 0.7)); menuListView = (ListView) menu.getMenu().findViewById(R.id.menu_listview); menuListView.setAdapter(new MenuListViewAdapter(this)); menuListView.setOnItemClickListener(this); }