本文整理汇总了Java中com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.setShadowWidthRes方法的典型用法代码示例。如果您正苦于以下问题:Java SlidingMenu.setShadowWidthRes方法的具体用法?Java SlidingMenu.setShadowWidthRes怎么用?Java SlidingMenu.setShadowWidthRes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jeremyfeinstein.slidingmenu.lib.SlidingMenu
的用法示例。
在下文中一共展示了SlidingMenu.setShadowWidthRes方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
});
}
示例2: 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();
}
});
}
示例3: 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();
}
示例4: 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);
}
示例5: 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);
}
示例6: 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();
}
示例7: 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);
}
示例8: 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);
}
示例9: 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);
}
示例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
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();
}
示例11: 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();
}
示例12: onCreate
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
if (new SpTool(this, SpTool.SP_SETTING).getBoolean("moon", false)) {
BaseApplication.sDefaultImageDrawable = R.drawable.z_iv_default_y;
setTheme(R.style.ActivityThemeMoon);
} else {
BaseApplication.sDefaultImageDrawable = R.drawable.z_iv_default;
setTheme(R.style.ActivityTheme);
}
// set the Above View
if (savedInstanceState != null) {
mFragmentMainHome = (FragmentMainHome) getSupportFragmentManager().getFragment(savedInstanceState, "mFragmentMainHome");
}
if (mFragmentMainHome == null) {
mFragmentMainHome = new FragmentMainHome();
mFragmentMainHome.setArguments(getIntent().getExtras());
}
setContentView(R.layout.activity_main_sliding);
getSupportFragmentManager().beginTransaction()
.replace(R.id.content_frame, mFragmentMainHome)
.commit();
// set the Behind View
setBehindContentView(R.layout.v_layout_sliding_menu);
if (savedInstanceState != null) {
mFragmentSlidingMenu = (FragmentSlidingMenu) this.getSupportFragmentManager().findFragmentById(R.id.menu_frame);
}
if (mFragmentSlidingMenu == null) {
mFragmentSlidingMenu = new FragmentSlidingMenu();
getSupportFragmentManager().beginTransaction()
.replace(R.id.menu_frame, mFragmentSlidingMenu)
.commit();
}
// customize the SlidingMenu
SlidingMenu sm = getSlidingMenu();
sm.setShadowWidthRes(R.dimen.slidingmenu_shadow_width);
sm.setShadowDrawable(R.drawable.v_sliding_menu_shadow);
sm.setBehindOffset(ScreenTools.getScreenParams(this).width * 3 / 10);
sm.setFadeDegree(0.35f);
//设置触摸方式,必须为 TOUCHMODE_FULLSCREEN(全屏可触摸),TOUCHMODE_MARGIN(边缘可触摸),默认 48dp, TOUCHMODE_NONE(不可触摸)三者之一
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
//动画效果
sm.setBehindScrollScale(0.0f);
sm.setBackgroundColor(Color.parseColor("#252525"));
sm.setBehindCanvasTransformer(getTransformer(1));
// getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
示例13: 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);
}
示例14: 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);
}