本文整理汇总了Java中com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper类的典型用法代码示例。如果您正苦于以下问题:Java SlidingActivityHelper类的具体用法?Java SlidingActivityHelper怎么用?Java SlidingActivityHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SlidingActivityHelper类属于com.jeremyfeinstein.slidingmenu.lib.app包,在下文中一共展示了SlidingActivityHelper类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doSthBeforeSetView
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper; //导入依赖的package包/类
@Override
protected void doSthBeforeSetView(Bundle savedInstanceState) {
super.doSthBeforeSetView(savedInstanceState);
mContext = this;
mActivity = this;
immergeColor = DayNightHelper.getInstance(this).isDay() ? R.color.colorPrimary : R.color.dark_gray;
mHelper = new SlidingActivityHelper(this);
mHelper.onCreate(savedInstanceState);
setSlidingActionBarEnabled(false);
//这里借用了SlidingMenu的setBehindContentView方法来设置一个透明菜单
View behindView = new View(this);
behindView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
behindView.setBackgroundColor(getResources().getColor(android.R.color.transparent));
setBehindContentView(behindView);
mSlidingMenu = getSlidingMenu();
//设置阴影宽度为10个px
mSlidingMenu.setShadowWidth(10);
//设置阴影
mSlidingMenu.setShadowDrawable(slide_shadow);
//设置下面的布局,也就是我们上面定义的透明菜单离右边屏幕边缘的距离为0,也就是滑动开以后菜单会全屏幕显示
mSlidingMenu.setBehindOffset(0);
mSlidingMenu.setFadeDegree(0.35f);
//菜单打开监听,因为菜单打开后我们要finish掉当前的Activity
mSlidingMenu.setOnOpenedListener(this);
//设置手势滑动方向,因为我们要实现微信那种右滑动的效果,这里设置成SlidingMenu.LEFT模式
mSlidingMenu.setMode(SlidingMenu.LEFT);
//因为微信是只有边缘滑动,我们设置成TOUCHMODE_MARGIN模式,如果你想要全屏幕滑动,只需要把这个改成TOUCHMODE_FULLSCREEN就OK了
mSlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
setSlidingMargin(40f);
}
示例2: onCreate
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHelper = new SlidingActivityHelper(this);
mHelper.onCreate(savedInstanceState);
setBehindContentView(R.layout.hidden_fragment_frame);
setContentView(R.layout.long_layout);
}
示例3: onCreate
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
mHelper = new SlidingActivityHelper(this);
mHelper.onCreate(savedInstanceState);
}
示例4: onCreate
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
mHelper = new SlidingActivityHelper(this);
mHelper.onCreate(savedInstanceState);
//这里借用了SlidingMenu的setBehindContentView方法来设置一个透明菜单
View behindView = new View(this);
behindView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
behindView.setBackgroundColor(getResources().getColor(android.R.color.transparent));
setBehindContentView(behindView);
mSlidingMenu = getSlidingMenu();
mSlidingMenu.setBackgroundColor(getResources().getColor(android.R.color.transparent));
//设置阴影宽度为10个px
mSlidingMenu.setShadowWidth(0);
mSlidingMenu.setFadeDegree(0);
mSlidingMenu.setFadeEnabled(false);
//设置阴影
// mSlidingMenu.setShadowDrawable(R.drawable.slide_shadow);
//设置下面的布局,也就是我们上面定义的透明菜单离右边屏幕边缘的距离为0,也就是滑动开以后菜单会全屏幕显示
mSlidingMenu.setBehindOffset(0);
mSlidingMenu.setFadeEnabled(false);
//菜单打开监听,因为菜单打开后我们要finish掉当前的Activity
mSlidingMenu.setOnOpenedListener(this);
mSlidingMenu.setOnOpenListener(new SlidingMenu.OnOpenListener() {
@Override
public void onOpen() {
//
Log.e("打开菜单","菜单打开了");
}
});
//设置手势滑动方向,因为我们要实现微信那种右滑动的效果,这里设置成SlidingMenu.LEFT模式
mSlidingMenu.setMode(SlidingMenu.LEFT);
//因为微信是只有边缘滑动,我们设置成TOUCHMODE_MARGIN模式,如果你想要全屏幕滑动,只需要把这个改成TOUCHMODE_FULLSCREEN就OK了
mSlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
mSlidingMenu.setSlidingEnabled(isDragEnabled());
super.onCreate(savedInstanceState);
}
示例5: onCreate
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHelper = new SlidingActivityHelper(this);
mHelper.onCreate(savedInstanceState);
}