本文整理汇总了Java中com.special.ResideMenu.ResideMenuItem类的典型用法代码示例。如果您正苦于以下问题:Java ResideMenuItem类的具体用法?Java ResideMenuItem怎么用?Java ResideMenuItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResideMenuItem类属于com.special.ResideMenu包,在下文中一共展示了ResideMenuItem类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setUpMenu
import com.special.ResideMenu.ResideMenuItem; //导入依赖的package包/类
private void setUpMenu() {
resideMenu = new ResideMenu(this);
resideMenu.setBackground(R.drawable.menu_background);
resideMenu.attachToActivity(this);
//valid scale factor is between 0.0f and 1.0f. leftmenu'width is 150dip.
resideMenu.setScaleValue(0.6f);
resideMenu.setSwipeDirectionDisable(ResideMenu.DIRECTION_RIGHT);
itemNews = new ResideMenuItem(this, R.drawable.ic_read, R.string.nav_read);
itemWeather = new ResideMenuItem(this, R.drawable.ic_weather, R.string.nav_weather);
itemPass = new ResideMenuItem(this, R.drawable.ic_password, R.string.nav_pass);
itemSchedule = new ResideMenuItem(this, R.drawable.ic_schedule, R.string.nav_schedule);
itemInfo = new ResideMenuItem(this, R.drawable.ic_info, R.string.nav_info);
itemNews.setOnClickListener(this);
itemWeather.setOnClickListener(this);
itemPass.setOnClickListener(this);
itemSchedule.setOnClickListener(this);
itemInfo.setOnClickListener(this);
resideMenu.addMenuItem(itemNews, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemWeather, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemPass, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemSchedule, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemInfo, ResideMenu.DIRECTION_LEFT);
}
开发者ID:SpeedPromise,项目名称:L-Assistant,代码行数:28,代码来源:MainActivity.java
示例2: setUpMenu
import com.special.ResideMenu.ResideMenuItem; //导入依赖的package包/类
private void setUpMenu() {
// attach to current activity;
resideMenu = new ResideMenu(this);
resideMenu.setBackground(R.drawable.menu_bg);
resideMenu.attachToActivity(this);
// resideMenu.setMenuListener(menuListener);
resideMenu.setScaleValue(0.60f);
// create menu items;
itemLibrary = new ResideMenuItem(this, R.drawable.ic_library, this
.getResources().getString(R.string.tab_library));
itemBookshelf = new ResideMenuItem(this, R.drawable.ic_bookshelf, this
.getResources().getString(R.string.tab_bookshelf));
itemWenku8 = new ResideMenuItem(this, R.drawable.ic_wenku8, this
.getResources().getString(R.string.tab_wenku8));
itemSettings = new ResideMenuItem(this, R.drawable.ic_setting, this
.getResources().getString(R.string.tab_setting));
itemLibrary.setOnClickListener(this);
itemBookshelf.setOnClickListener(this);
itemWenku8.setOnClickListener(this);
itemSettings.setOnClickListener(this);
resideMenu.addMenuItem(itemLibrary, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemBookshelf, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemWenku8, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemSettings, ResideMenu.DIRECTION_LEFT);
resideMenu.setSwipeDirectionDisable(ResideMenu.DIRECTION_RIGHT);
}
开发者ID:MewX,项目名称:light-novel-library_Wenku8_Android,代码行数:33,代码来源:MainActivity.java
示例3: setUpMenu
import com.special.ResideMenu.ResideMenuItem; //导入依赖的package包/类
private void setUpMenu() {
// attach to current activity;
resideMenu = new ResideMenu(this);
resideMenu.setBackground(R.drawable.menu_background);
resideMenu.attachToActivity(this);
resideMenu.setMenuListener(menuListener);
// create menu items;
itemHome = new ResideMenuItem(this, R.drawable.icon_home, "Home");
itemProfile = new ResideMenuItem(this, R.drawable.icon_profile, "Profile");
itemCalendar = new ResideMenuItem(this, R.drawable.icon_calendar, "Calendar");
itemSettings = new ResideMenuItem(this, R.drawable.icon_settings, "Settings");
itemHome.setOnClickListener(this);
itemProfile.setOnClickListener(this);
itemCalendar.setOnClickListener(this);
itemSettings.setOnClickListener(this);
resideMenu.addMenuItem(itemHome);
resideMenu.addMenuItem(itemProfile);
resideMenu.addMenuItem(itemCalendar);
resideMenu.addMenuItem(itemSettings);
findViewById(R.id.title_bar_menu).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
resideMenu.openMenu();
}
});
}
开发者ID:eoecn,项目名称:Libraries-for-Android-Developers,代码行数:32,代码来源:MenuActivity.java
示例4: initMenuActivity
import com.special.ResideMenu.ResideMenuItem; //导入依赖的package包/类
/**
* 初始化菜单
*/
private void initMenuActivity() {
// attach to current activity;
resideMenu = new ResideMenu(this);
//禁止手势操作某个菜单方向
resideMenu.setSwipeDirectionDisable(ResideMenu.DIRECTION_RIGHT);
resideMenu.setSwipeDirectionDisable(ResideMenu.DIRECTION_LEFT);
//是否3D效果
resideMenu.setUse3D(false);
//背景图片
resideMenu.setBackground(R.drawable.menu_background);
//必设属性
resideMenu.attachToActivity(this);
//设置菜单的监听事件
resideMenu.setMenuListener(menuListener);
//valid scale factor is between 0.0f and 1.0f. leftmenu'width is 150dip.
//主页面滑动后占屏幕的百分比 0.0f-1.0f
resideMenu.setScaleValue(0.65f);
//创建菜单子项
itemHome = new ResideMenuItem(this, R.drawable.icon_home, "MyScse");
itemProfile = new ResideMenuItem(this, R.drawable.icon_profile, "个人信息");
itemCalendar = new ResideMenuItem(this, R.drawable.icon_calendar, "校园服务");
itemSettings = new ResideMenuItem(this, R.drawable.icon_settings, "设置");
//菜单子项的点击事件
itemHome.setOnClickListener(this);
itemProfile.setOnClickListener(this);
itemCalendar.setOnClickListener(this);
itemSettings.setOnClickListener(this);
//为菜单添加子项 参数(item,Direction)子项 方向ResideMenu.DIRECTION_RIGHT
resideMenu.addMenuItem(itemHome, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemProfile, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemCalendar, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemSettings, ResideMenu.DIRECTION_LEFT);
//实例化fragment
homeFragment = new HomeFragment();
profileFragment = new ProfileFragment();
calenderFragment = new campusFragment();
settingFragment = new SettingsFragment();
}
开发者ID:alicance,项目名称:MyScse-Client,代码行数:46,代码来源:MainActivity.java
示例5: setUpMenuLoader
import com.special.ResideMenu.ResideMenuItem; //导入依赖的package包/类
private void setUpMenuLoader() {
resideMenu = new ResideMenu(mContext);
resideMenu.setBackground(R.drawable.bg2);
resideMenu.attachToActivity(mContext);
resideMenu.setScaleValue(0.6f);
itemHome = new ResideMenuItem(mContext, R.drawable.ic_menu_home,
"Beranda");
itemRadar = new ResideMenuItem(mContext, R.drawable.ic_menu_radar,
"Temukan");
itemAbout = new ResideMenuItem(mContext, R.drawable.ic_menu_about,
"Tentang");
itemHome.setOnClickListener(mContext);
itemRadar.setOnClickListener(mContext);
itemAbout.setOnClickListener(mContext);
resideMenu.addMenuItem(itemHome, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemRadar, ResideMenu.DIRECTION_LEFT);
resideMenu.addMenuItem(itemAbout, ResideMenu.DIRECTION_LEFT);
resideMenu.setSwipeDirectionDisable(ResideMenu.DIRECTION_RIGHT);
resideMenu.setSwipeDirectionDisable(ResideMenu.DIRECTION_LEFT);
findViewById(R.id.title_bar_left_menu).setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View view) {
resideMenu.openMenu(ResideMenu.DIRECTION_LEFT);
}
});
findViewById(R.id.title_bar_right_menu).setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View arg0) {
}
});
}
开发者ID:mnafian,项目名称:OmahNyewo,代码行数:44,代码来源:OmhBaseActivity.java
注:本文中的com.special.ResideMenu.ResideMenuItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论