本文整理汇总了Java中com.slidingmenu.lib.SlidingMenu.setFadeDegree方法的典型用法代码示例。如果您正苦于以下问题:Java SlidingMenu.setFadeDegree方法的具体用法?Java SlidingMenu.setFadeDegree怎么用?Java SlidingMenu.setFadeDegree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.slidingmenu.lib.SlidingMenu
的用法示例。
在下文中一共展示了SlidingMenu.setFadeDegree方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configSlidingMenu
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void configSlidingMenu(boolean phone) {
SlidingMenu slidingMenu = getSlidingMenu();
slidingMenu.setShadowWidthRes(R.dimen.shadow_width);
slidingMenu.setShadowDrawable(R.drawable.shadow);
if (phone)
slidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
else
slidingMenu.setBehindOffset(Utility.getScreenWidth());
slidingMenu.setFadeDegree(0.35f);
slidingMenu.setOnPageScrollListener(new SlidingMenu.OnPageScrollListener() {
@Override
public void onPageScroll() {
LongClickableLinkMovementMethod.getInstance().setLongClickable(false);
(getFriendsTimeLineFragment()).clearActionMode();
}
});
slidingMenu.setOnClosedListener(new SlidingMenu.OnClosedListener() {
@Override
public void onClosed() {
LongClickableLinkMovementMethod.getInstance().setLongClickable(true);
LocalBroadcastManager.getInstance(MainTimeLineActivity.this).sendBroadcast(new Intent(AppEventAction.SLIDING_MENU_CLOSED_BROADCAST));
}
});
}
示例2: onCreate
import com.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();
}
示例3: onCreate
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle(mTitleRes);
// set the Behind View
setBehindContentView(R.layout.menu_frame);
FragmentTransaction t = this.getSupportFragmentManager().beginTransaction();
mFrag = new SampleListFragment();
t.replace(R.id.menu_frame, mFrag);
t.commit();
// customize the SlidingMenu
SlidingMenu sm = getSlidingMenu();
// Test
sm.setSecondaryMenu(R.layout.properties);
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);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
示例4: onCreate
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// set the Behind View
setBehindContentView(R.layout.menu_frame);
FragmentTransaction t = this.getSupportFragmentManager()
.beginTransaction();
mFrag = new LeftMenuFragment();
t.replace(R.id.menu_frame, mFrag);
t.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);
}
示例5: configSlidingMenu
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void configSlidingMenu(boolean phone) {
SlidingMenu slidingMenu = getSlidingMenu();
slidingMenu.setShadowWidthRes(R.dimen.shadow_width);
slidingMenu.setShadowDrawable(R.drawable.shadow_slidingmenu);
if (phone) {
slidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
} else {
slidingMenu.setBehindOffset(Utility.getScreenWidth());
}
slidingMenu.setFadeDegree(0.35f);
slidingMenu.setOnPageScrollListener(new SlidingMenu.OnPageScrollListener() {
@Override
public void onPageScroll() {
LongClickableLinkMovementMethod.getInstance().setLongClickable(false);
(getFriendsTimeLineFragment()).clearActionMode();
(getFavFragment()).clearActionMode();
(getCommentsTimeLineFragment()).clearActionMode();
(getMentionsTimeLineFragment()).clearActionMode();
(getMyProfileFragment()).clearActionMode();
if (GlobalContext.getInstance().getAccountBean().isBlack_magic()) {
(getSearchFragment()).clearActionMode();
(getDMFragment()).clearActionMode();
}
}
});
slidingMenu.setOnClosedListener(new SlidingMenu.OnClosedListener() {
@Override
public void onClosed() {
LongClickableLinkMovementMethod.getInstance().setLongClickable(true);
LocalBroadcastManager.getInstance(MainTimeLineActivity.this)
.sendBroadcast(new Intent(AppEventAction.SLIDING_MENU_CLOSED_BROADCAST));
}
});
}
示例6: setupMenu
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void setupMenu() {
menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
menu.setFadeDegree(0.35f);
menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
menu.setOnOpenListener(new OnOpenListener() {
@Override
public void onOpen() {
if (confManager != null) {
adapter = new ArrayAdapter<String>(MainActivity.this,
R.layout.slidingmenu);
ListView l = new ListView(MainActivity.this);
final List<MenuItem<?>> m = confManager.getMenuActions();
for (int i = 0; i < m.size(); i++) {
adapter.add(m.get(i).getKey());
}
// for (MenuItem<?> s : m) {
// adapter.add(s.getKey());
// }
l.setAdapter(adapter);
l.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent,
View view, int position, long id) {
menu.showContent();
confManager.menuClick(m.get(position).getValue());
// loadControllerUrl(m.get(position).getValue(),
// true);
}
});
menu.setMenu(l);
}
}
});
}
示例7: configSlidingMenu
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void configSlidingMenu() {
SlidingMenu sm = getSlidingMenu();
sm.setShadowWidth(20);
sm.setShadowDrawable(R.drawable.shadow);
sm.setBehindOffset(80);
sm.setFadeDegree(0.35f);
// 设置slding menu的几种手势模式
// TOUCHMODE_FULLSCREEN 全屏模式,在content页面中,滑动,可以打开sliding menu
// TOUCHMODE_MARGIN 边缘模式,在content页面中,如果想打开slding ,你需要在屏幕边缘滑动才可以打开slding
// menu
// TOUCHMODE_NONE 自然是不能通过手势打开啦
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
}
示例8: onCreate
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
mMenu = new SlidingMenu(this);
mMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
mMenu.setBehindScrollScale(1f);
mMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
mMenu.setFadeEnabled(true);
mMenu.setFadeDegree(0.35f);
mMenu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
mMenu.setMenu(R.layout.sliding_menu_frame);
mMenu.setOnOpenedListener(new SlidingMenu.OnOpenedListener() {
@Override
public void onOpened() {
TopFragment fragment = (TopFragment) getSupportFragmentManager().findFragmentById(R.id.top_content);
if(fragment != null) {
fragment.onMenuOpen();
}
}
});
MenuFragment menuFragment = new MenuFragment();
menuFragment.setListener(mMenuListener);
getSupportFragmentManager().beginTransaction().replace(R.id.sliding_menu, menuFragment)
.commit();
mMenu.setContent(R.layout.actvy_top);
if(getIntent() != null) {
int page = getIntent().getIntExtra(Const.Intent.SwitchPage, TopFragmentType.NearAppoint.getValue());
change(TopFragmentType.find(page), getIntent().getExtras());
} else {
change(TopFragmentType.NearAppoint, null);
}
upgrade();
}
示例9: onCreate
import com.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();
}
示例10: onCreate
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHelper = new SlidingActivityHelper(this);
mHelper.onCreate(savedInstanceState);
setBehindContentView(R.layout.menu_frame);
if (checkLogin())
return;
navigateToFeed();
FragmentTransaction ft = this.getSupportFragmentManager()
.beginTransaction();
mNotificationFragment = MenuFragment.newInstance();
ft.replace(R.id.menu_frame, mNotificationFragment);
ft.commit();
SlidingMenu sm = getSlidingMenu();
sm.setShadowWidthRes(R.dimen.shadow_width);
sm.setShadowDrawable(R.drawable.slide_shadow);
sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
sm.setAboveOffsetRes(R.dimen.slidingmenu_offset);
sm.setFadeDegree(0.3f);
sm.setOnOpenedListener(mNotificationFragment);
sm.setOnClosedListener(mNotificationFragment);
sm.setMode(SlidingMenu.RIGHT);
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
setContentView(R.layout.main_activity);
}
示例11: onCreate
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
// set the Above View
if (savedInstanceState != null)
mContent = getSupportFragmentManager().getFragment(savedInstanceState, "mContent");
if (mContent == null)
mContent = new MainPageFragment();
// set the Above View
setContentView(R.layout.fragment_content);
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, mContent)
.commit();
// set the Behind View(Menu)
setBehindContentView(R.layout.fragment_menu);
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.menu_frame, new MenuFragment())
.commit();
// customize the SlidingMenu
SlidingMenu sm = getSlidingMenu();
sm.setFadeDegree(1.0f);
sm.setMode(SlidingMenu.RIGHT);//Direction of the menu
sm.setBehindWidth(250);
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
}
示例12: initializeMenu
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
private void initializeMenu() {
setBehindContentView(R.layout.hidden_menu);
SlidingMenu menu = getSlidingMenu();
menu.invalidate();
menu.setBehindWidthRes(R.dimen.menu_offset);
menu.setFadeDegree(0.35f);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
}
示例13: onCreate
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
// WindowManager.LayoutParams.FLAG_FULLSCREEN);
SysApplication.getInstance().addActivity(this); // �����ٶ��������this
setContentView(R.layout.paychart);
// set the Behind View
setBehindContentView(R.layout.frame_menu);
SystemBarTintManager mTintManager;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
setTranslucentStatus(true);
}
mTintManager = new SystemBarTintManager(this);
mTintManager.setStatusBarTintEnabled(true);
mTintManager.setStatusBarTintResource(R.color.fragment2);
payDAO = new PayDAO(PayChart.this);
KindDatap = new ArrayList<KindData>();
ptypeDAO = new PtypeDAO(PayChart.this);
incomeDAO = new IncomeDAO(PayChart.this);
itypeDAO = new ItypeDAO(PayChart.this);
FragmentTransaction fragmentTransaction = getFragmentManager()
.beginTransaction();
MenuFragment menuFragment = new MenuFragment();
fragmentTransaction.replace(R.id.menu, menuFragment);
fragmentTransaction.commit();
// customize the SlidingMenu
SlidingMenu sm = getSlidingMenu();
sm.setMode(SlidingMenu.LEFT);
sm.setShadowWidth(50);
sm.setShadowDrawable(R.drawable.shadow);
sm.setBehindOffset(260);
sm.setFadeDegree(0.4f);
// ����slding menu�ļ�������ģʽ
// TOUCHMODE_FULLSCREEN ȫ��ģʽ����contentҳ���У����������Դ�sliding menu
// TOUCHMODE_MARGIN ��Եģʽ����contentҳ���У�������slding ,����Ҫ����Ļ��Ե�����ſ��Դ�slding
// menu
// TOUCHMODE_NONE ��Ȼ�Dz���ͨ�����ƴ���
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
// ʹ�����Ϸ�icon�ɵ㣬������onOptionsItemSelected����ſ��Լ�����R.id.home
// getActionBar().setDisplayHomeAsUpEnabled(true);
initView();
}
示例14: onCreate
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
menu = new SlidingMenu(this);
setContentView(R.layout.activity_main);
SharedPreferences config = getSharedPreferences("config", Activity.MODE_PRIVATE);
Editor edit = config.edit();
edit.putInt("versionCode", DirverInformations.versionCode(this)).commit();
edit.putBoolean("isFirst", false).commit();
button[0]=(ImageView)findViewById(R.id.main_button_11);
button[1]=(ImageView)findViewById(R.id.main_button_12);
button[2]=(ImageView)findViewById(R.id.main_button_13);
button[3]=(ImageView)findViewById(R.id.main_button_21);
button[4]=(ImageView)findViewById(R.id.main_button_22);
button[5]=(ImageView)findViewById(R.id.main_button_23);
button[6]=(ImageView)findViewById(R.id.main_button_31);
button[7]=(ImageView)findViewById(R.id.main_button_32);
for(int i=0;i<button.length;i++){
button[i].setOnClickListener(new ButtonListener(i));
}
// ��ʼ��ҳ��
double weight = DirverInformations.weight(this);
Log.v("tag", "weight is "+weight);
double height = (weight/56.0)*36.0;
Log.v("tag", "height is"+height);
height_sub=(int)height+1;
Log.v("tag", "height_sub is"+height_sub);
slidingmenu_weight=(int)(weight/2);
Log.v("tag", "slidingmenu_weight is"+slidingmenu_weight);
initViews();
initDots();
menu.setMode(SlidingMenu.RIGHT);//���ò˵���λ��
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);//���ò˵���������ʽ
menu.setShadowWidthRes(R.dimen.shadow_width);
menu.setShadowDrawable(R.drawable.shadow);//�˵�����ʱ��Ӱ����
menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
menu.setBehindWidth(slidingmenu_weight);//�˵����
menu.setFadeDegree(0.35f);
menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
menu.setMenu(R.layout.slidingmenu_layout);//��Ӳ˵�
menuinit();
/*
Button testbutton=(Button)findViewById(R.id.main_slidingmenu_button);
testbutton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Log.v("tag", "ttt");
Toast.makeText(MainActivity.this,"����˰�ť", Toast.LENGTH_SHORT).show();
}
});*/
}
示例15: onCreate
import com.slidingmenu.lib.SlidingMenu; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.e("test", "responsiveUIActivity on create...........");
instance = this;
setContentView(R.layout.responsive_content_frame);
if (getSupportActionBar() != null)
getSupportActionBar().hide();
ClientSocket client = new ClientSocket(this);
if (client.socket != null)
Log.e("test", "client.socket != null...................");
else
Log.e("test", "client.socket == null...................");
// 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_NONE/* TOUCHMODE_FULLSCREEN */);
// show home as up so we can toggle
if (getSupportActionBar() != null)
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 MessageFragment()/* BirdGridFragment(0) */;
getSupportFragmentManager().beginTransaction()
.replace(R.id.content_frame, mContent).commit();
// set the Behind View Fragment
getSupportFragmentManager().beginTransaction()
.replace(R.id.menu_frame, new MenuFragment()).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);
shared = new SharedPreferencesUtil(this);
Log.e("test", "userinfo.dbid ::" + UserInfo.db_id);
MessageInfo.groupMap = shared.readGroupMapFromShared(UserInfo.db_id
+ "_" + YIKUAIR_GROUP);
}