Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree Center issue #24

Closed
sagar24v opened this issue Dec 4, 2018 · 16 comments
Closed

Tree Center issue #24

sagar24v opened this issue Dec 4, 2018 · 16 comments

Comments

@sagar24v
Copy link

sagar24v commented Dec 4, 2018

I am not able to display tree in center of view, also not able to scroll in center
device-2018-12-04-144344

@thuijssoon
Copy link

Hi @sagar24v,

It's impossible to provide help without seeing any code. Could you maybe post some of the layout files that you use?

@yagneshb
Copy link

yagneshb commented Dec 5, 2018

1912409171.pdf

Here is the xml code of the activity, please check it.
The tree should be with in the white box in the screenshot described above, but by default it fits in the whole screen view, rather than in bounded view.

Hi @sagar24v,

It's impossible to provide help without seeing any code. Could you maybe post some of the layout files that you use?

@sagar24v
Copy link
Author

sagar24v commented Dec 6, 2018

1912409171.pdf

Here is the xml code of the activity, please check it.
The tree should be with in the white box in the screenshot described above, but by default it fits in the whole screen view, rather than in bounded view.

Hi @sagar24v,
It's impossible to provide help without seeing any code. Could you maybe post some of the layout files that you use?

Any update?, how can i fix this issue

@DennisBlock
Copy link
Contributor

I just tested it with your layout and it works just fine. Which version of GraphView do you use?

@sagar24v
Copy link
Author

sagar24v commented Dec 6, 2018

0.4.2

@DennisBlock
Copy link
Contributor

Can you upload a complete working sample with this issue? I tried a few changes, but everything works as expected, so it's easier to for us to check.

@sagar24v
Copy link
Author

sagar24v commented Dec 7, 2018

Can you upload a complete working sample with this issue? I tried a few changes, but everything works as expected, so it's easier to for us to check.

I Am using graphview in fragment, so i attach this fragment class can you check it and update me
TreeFragment : http://dpaste.com/0J5B0ET

@sagar24v
Copy link
Author

sagar24v commented Dec 7, 2018

Can you upload a complete working sample with this issue? I tried a few changes, but everything works as expected, so it's easier to for us to check.

I Am using graphview in fragment, so i attach this fragment class can you check it and update me
TreeFragment : http://dpaste.com/0J5B0ET

Hello Bro any Update? i need to solve this issue today on may app

@GregorBlock
Copy link
Contributor

Your code snipped seems okay, but we can't execute it to test it out and replicate the issue. We need a fully functional minimal working sample with the issue so we can try to fix it. Just delete everything (in a new project) that doesn't need to be there for displaying the misplaced tree. A repository here on GitHub would be perfect. You can delete it afterwards.

@sagar24v
Copy link
Author

sagar24v commented Dec 7, 2018

My code working fine with Android Oreo API level 27 but not working in below version can you check it. attach screenshot from oreo
image
i also add my sample code pls check in all device :
Fdemo.zip

@DennisBlock
Copy link
Contributor

Yes, it seems to be a problem with different OS versions/API levels, but it's not an issue with GraphView but with ZoomLayout (the underlying zoom engine). I found an issue with the same problem here and here.

@sagar24v
Copy link
Author

sagar24v commented Dec 8, 2018

So How i Solve this issue? it is possible to remove zoom feature from graphview?

@sagar24v
Copy link
Author

sagar24v commented Dec 10, 2018

So How i Solve this issue? it is possible to remove zoom feature from graphview?

is it possible to fix this issue?

@sagar24v
Copy link
Author

Any Update?

@DennisBlock
Copy link
Contributor

I found the issue and created a PR in ZoomLayout. This should fix it. I can't say when it will be merged so I found a simple workaround for you in the meantime.

public class WorkaroundGraphView extends GraphView {
    int[] viewLocation = new int[2];

    public WorkaroundGraphView(Context context) {
        super(context);
    }

    public WorkaroundGraphView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public WorkaroundGraphView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public void onUpdate(ZoomEngine helper, Matrix matrix) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N && getChildCount() > 0) {
            final View childAt = getChildAt(0);
            childAt.getLocationInWindow(viewLocation);
            matrix.postTranslate(viewLocation[0], viewLocation[1]);
        }
        super.onUpdate(helper, matrix);
    }
}

Just use this class instead of the normal GraphView until the fix is merged.

@sagar24v
Copy link
Author

sagar24v commented Dec 12, 2018

Thanks brother issue is Fix Now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants