Android ResideMenu library, bottom of Fragment has Cropping issue

前端 未结 4 1396
礼貌的吻别
礼貌的吻别 2020-12-20 22:01

https://www.dropbox.com/s/lykyutdlo6386il/nexus%205%202.png?dl=0

This picture is captured by nexus 5. As you can see the gap between top and bottom of screen is diff

4条回答
  •  我在风中等你
    2020-12-20 22:32

    I had this same issue and I solved this by editing a method in ResideMenu library.

    Inside the library, you can acess a java class named "ResideMenu.java".

    Edit the method as like this.

     private void setScaleDirection(int direction){
    
        int screenWidth = getScreenWidth();
        float pivotX;
        float pivotY = getScreenHeight() * 0.5f;
    
        if (direction == DIRECTION_LEFT){
            scrollViewMenu = scrollViewLeftMenu;
            pivotX  = screenWidth * 2.2f;
        }else{
            scrollViewMenu = scrollViewRightMenu;
            pivotX  = screenWidth * -0.5f;
        }
    
        ViewHelper.setPivotX(viewActivity, pivotX);
        ViewHelper.setPivotY(viewActivity, pivotY);
        ViewHelper.setPivotX(imageViewShadow, pivotX);
        ViewHelper.setPivotY(imageViewShadow, pivotY);
        scaleDirection = direction;
    }
    

    Here i made changes to

    pivot x = (screenWidth * 2.2f) instead of (screenWidth * 0.5f).

    try to manage the float value, it will solve your issue.

    Thank you, Happy Coding

提交回复
热议问题