Crowton + Sliding Overlay Menu

I use SlidingMenu and Crouton , but I found that the sliding menu overlaps the hoop notification

crouton and slidingmenu overlap

I would report a problem on github, but I don't know where this error is.

Cyril Mottier mentions in his Assignment of an article about notifications in the layout the presence of 3 contexts, the left menu with the context in itself, Thus, the notification will be displayed with the rest of the content.

enter image description here

Since SlidingMenu and Crouton use the Activity Context, this may just not be fixed. We can easily call

Crouton.cancelAllCroutons(); 

before displaying SlidingMenu, but I like the Prixing highlight feature.

We hope that the authors of the library may demand a mistake or shed light on it.

Thanks!

EDIT:

I use SlidingMenu, creating an object and binding it to activity

 private void configureSideMenu() { mSlidingMenu = new SlidingMenu(this); mSlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); mSlidingMenu.setFadeDegree(0.35f); mSlidingMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); mSlidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset); mSlidingMenu.setMenu(R.layout.menu_frame); getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame, new MySideMenuFragment()).commit(); } 

And Crouton, I assume that there is only one way to use it.

  Crouton.showText(this, R.string.error_not_logged_in, Style.ALERT); 

If this is the same action for both cases

+8
android slidingmenu crouton
source share
1 answer

You can easily attach Crouton to a specific ViewGroup .

All you have to do is call Crouton.makeText(Activity, CharSequence, Style, ViewGroup) , Crouton.make(...) or Crouton.show(...) .

Created Crouton then joins the ViewGroup and will exit with it as a parent when opening SlidingMenu .

So, when you create Crouton from Fragment

 Crouton.showText(this, R.string.error_not_logged_in, Style.ALERT, (ViewGroup) getView()); 

Otherwise, you can add it to any ViewGroup (even by resource ID), although I recommend having a FrameLayout to attach Crouton to.

+6
source share

All Articles