AndroidResideMenu icon indicating copy to clipboard operation
AndroidResideMenu copied to clipboard

Left menu over top main view

Open qhu91it opened this issue 8 years ago • 10 comments

Help me. When I change left menu item to other color and I swipe menu show on top like this picture my app

If menu item color is white, left menu is under main view, in this picture icon is white and title is black origin demo

How can set my main view on top of left menu? Thank.

qhu91it avatar Feb 06 '17 09:02 qhu91it

Hello @qhu91it, i am facing the same problem as ur's, please let me know if you find any solution.

idrisbohra avatar May 04 '17 06:05 idrisbohra

Hello @idrisbohra, you need edit in source of library, find func

private void showScrollViewMenu(View scrollViewMenu) {
        if (scrollViewMenu != null && scrollViewMenu.getParent() == null) {
            addView(scrollViewMenu);
        }
}

Change like this, because left and right menu add late and show above main view

private void showScrollViewMenu(View scrollViewMenu) {
        if (scrollViewMenu != null && scrollViewMenu.getParent() == null) {
            addView(scrollViewMenu, 1); // change here
        }
}

qhu91it avatar May 05 '17 13:05 qhu91it

Thanks @qhu91it. I implemented your suggested change and it is working like charm..thank a lot..

idrisbohra avatar May 05 '17 19:05 idrisbohra

@qhu91it Thanks.

Kishanjvaghela avatar May 26 '17 09:05 Kishanjvaghela

Hi, sorry to bother you but i am trying to increase the height of main Menu but can't find way to do that. Please help me out if you know about it. Thank you.

idrisbohra avatar Jul 04 '17 14:07 idrisbohra

You mean height of menu item? Cz whole menu have match parent. So its already have full width.

Kishanjvaghela avatar Jul 04 '17 16:07 Kishanjvaghela

Hi, sorry for mistyping but i am talking about main view. I want to increase the height of main view which is coming over left menu.

idrisbohra avatar Jul 04 '17 17:07 idrisbohra

Hi idrisbohra,

in ResideMenu class

goto method

public void openMenu(final int direction) {

    try {
        setScaleDirection(direction);

        if (direction == DIRECTION_LEFT) {
            rightMenuView.setVisibility(View.GONE);
            leftMenuView.setVisibility(View.VISIBLE);
        } else {
            leftMenuView.setVisibility(View.GONE);
            rightMenuView.setVisibility(View.VISIBLE);
        }

        isOpened = true;

// AnimatorSet scaleDown_activity = buildScaleDownAnimation(viewActivity, mScaleValue, 0.84f); AnimatorSet scaleDown_activity = buildScaleDownAnimation(viewActivity, mScaleValue, 0.68f); AnimatorSet scaleDown_shadow = buildScaleDownAnimation(imageViewShadow, mScaleValue + shadowAdjustScaleX, mScaleValue + shadowAdjustScaleY); AnimatorSet alpha_menu = buildMenuAnimation(scrollViewMenu, 1.0f); scaleDown_shadow.addListener(animationListener); scaleDown_activity.playTogether(scaleDown_shadow); scaleDown_activity.playTogether(alpha_menu); scaleDown_activity.start();

        context.setBlurBackground();

    } catch (Exception e) {
        e.printStackTrace();
    }

    //Blurry.with(context).radius(13).sampling(2).onto((ViewGroup) viewActivity );

    /*Blurry.with(context)
            .radius(10)
            .sampling(2)
            .async()
            .onto(context.getMainContentFrame());*/
}

here is the line AnimatorSet scaleDown_activity = buildScaleDownAnimation(viewActivity, mScaleValue, 0.68f);

change the scale factor between 0 to 1f to change the height.

hamzaahmedkhan avatar Jul 06 '17 08:07 hamzaahmedkhan

Hello @hamzaahmedkhan i already tried this by changing the scale value but this makes the view stretched which is not good.

idrisbohra avatar Jul 07 '17 11:07 idrisbohra

Hi idris, actually you'll have to maintain the balance, this stretching will work for y-axis, for x-axis stretching you'll have to use this method of reside menu.

resideMenu.setScaleValue(0.56f); // for x -axis 0 to 1 range

use this method where you are initializing your Reside menu, like this.

public void setSideMenu(int direction) {
    resideMenu = new ResideMenu(this);
    resideMenu.setBackground(R.drawable.imgbgdark);
    resideMenu.attachToActivity(this);
    resideMenu.setScaleValue(0.56f);
    resideMenu.setShadowVisible(false);
    setMenuItemDirection(direction);
}

hamzaahmedkhan avatar Jul 11 '17 07:07 hamzaahmedkhan