Set what layout to slide in sliding menu

399 views Asked by At

I have integrated admob ads in my android application. I'm using jfeinstein's sliding menu, so when I slide it, adview slides with it too. How can I make it stick on the screen, no matter of sliding menu state? If there is no such function, what do I need to edit in library? This is what I want(as you can see, ad sticks in place):

image

Layout:

<com.google.ads.AdView
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    android:id="@+id/adview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    ads:adSize="BANNER"
    ads:adUnitId="ID"
    ads:loadAdOnCreate="true" />

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_above="@+id/adview" >
    ...
</ScrollView>

    // sliding menu
    slidingMenu = new SlidingMenu(this);
    slidingMenu.setMode(SlidingMenu.LEFT);
    slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
    //slidingMenu.setShadowWidthRes(R.dimen.slidingmenu_shadow_width);
    //slidingMenu.setShadowDrawable(R.drawable.slidingmenu_shadow);
    slidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
    slidingMenu.setFadeDegree(0.35f);
    slidingMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
    slidingMenu.setMenu(R.layout.slidingmenu);
    fragment = new SlidingMenuFragment();
    FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
    fragmentTransaction.add(R.id.slidingmenu, fragment);
    fragmentTransaction.commit();
0

There are 0 answers