SpecialCyCi / AndroidResideMenu

The idea of ResideMenu is from Dribbble 1 and 2. It has come true and run in iOS devices. iOS ResideMenu This project is the RefsideMenu Android version. The visual effect is partly referred to iOS version of ResideMenu. And thanks to the authors for the above idea and contribution.
MIT License
2.85k stars 1.1k forks source link

Left menu over top main view #123

Open qhu91it opened 7 years ago

qhu91it commented 7 years ago

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.

idrisbohra commented 7 years ago

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

qhu91it commented 7 years ago

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
        }
}
idrisbohra commented 7 years ago

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

Kishanjvaghela commented 7 years ago

@qhu91it Thanks.

idrisbohra commented 7 years ago

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.

Kishanjvaghela commented 7 years ago

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

idrisbohra commented 7 years ago

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.

hamzaahmedkhan commented 7 years ago

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.

idrisbohra commented 7 years ago

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

hamzaahmedkhan commented 7 years ago

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);
}