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

Zoom feature #3

Closed
ahmetcj4 opened this issue Mar 4, 2018 · 11 comments
Closed

Zoom feature #3

ahmetcj4 opened this issue Mar 4, 2018 · 11 comments

Comments

@ahmetcj4
Copy link

ahmetcj4 commented Mar 4, 2018

Hello.

I like the library but it is in early stages of development. It would be very good if the view has also zooming capabilities.

Thank you so much for this library.

@GregorBlock
Copy link
Contributor

is already on the todo list, thanks 👍

@mohamedhamdy27
Copy link

mohamedhamdy27 commented Mar 13, 2018

any news ?

@DennisBlock
Copy link
Contributor

We currently don't have much time to work on the features and are fixing only critical bugs, so we don't have an ETA for this. Maybe someone else is ready to implement this before we get to it. Contributions are always welcome.

@webserveis
Copy link

Try combine with this library https://github.com/natario1/ZoomLayout

@ProgFroz
Copy link

Tried to combine, did not work. The tree was not displayed anymore at all.

@RaviUmraliya
Copy link

RaviUmraliya commented Jul 27, 2018

any news about zoom out feature?
or can we show full tree at the same time on screen if tree will be large??

@GregorBlock
Copy link
Contributor

we're working on it

@GregoryIwanek
Copy link

GregoryIwanek commented Oct 5, 2018

@ProgFroz about ZoomLayout: I took a look on it and reason you didn't see anything rendered was graphView width/height is considered zero by ZoomLayout.

Ugly solution would be adding wrapper parent layout on top of GraphView.
Problem is, we would like to have parent's width and height as wrap_content, so it could adjust size to child GraphView, but it doesn't work as well. Anyway, fixed width and height works.
It has to be width and height bigger than what would be width and height of GraphView after adding all nodes to it.
Scroll of GraphView doesn't work in that configuration, but since parent height/widht are bigger, then it's not a problem since ZoomLayout has scroll and we can position by zooming in/out what part of graph we want to see.
Something like this.

<com.otaliastudios.zoom.ZoomLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="@color/md_red_600"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbars="vertical|horizontal"
    app:overScrollHorizontal="true"
    app:overScrollVertical="true"
    app:overPinchable="true"
    app:horizontalPanEnabled="true"
    app:verticalPanEnabled="true"
    app:zoomEnabled="true"
    app:minZoom="1.0"
    app:minZoomType="zoom"
    app:maxZoom="50.0"
    app:maxZoomType="zoom"
    app:hasClickableChildren="false">
    
    <FrameLayout
        android:layout_width="2000dp"
        android:layout_height="2000dp"
        android:padding="56dp"
        android:background="@color/md_green_400">
        
        <de.blox.graphview.GraphView
            android:id="@+id/gv_technologies"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@color/md_blue_600"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
    </FrameLayout>
</com.otaliastudios.zoom.ZoomLayout>```

where result would be:
red - zoom layout
green - wrapper with padding
blue - graph view
![screenshot_1538725191](https://user-images.githubusercontent.com/13487803/46522747-eac74900-c883-11e8-9949-d07fdd92515e.png)
![screenshot_1538725198](https://user-images.githubusercontent.com/13487803/46522775-fc105580-c883-11e8-9fdd-db9eadad507a.png)
![screenshot_1538725225](https://user-images.githubusercontent.com/13487803/46522777-ffa3dc80-c883-11e8-8c41-ce9d42a3015b.png)

Consider this as hack to make it work. You can use that till zoom is implemented in this lib.

@DennisBlock
Copy link
Contributor

Zoom feature added in version 0.4.0. We're using ZoomLayout internally, so use the attributes from ZoomLayout to adjust the zoom.

@NadeemRawther
Copy link

Okay can we change colour of each node according to data from server

@GregorBlock
Copy link
Contributor

@NadeemRawther use the adapter for node customizations.

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

No branches or pull requests

10 participants