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

Inconsistent layout for different Android device density (or OS version) #32

Closed
zahid-arbisoft opened this issue Jun 12, 2018 · 1 comment

Comments

@zahid-arbisoft
Copy link

zahid-arbisoft commented Jun 12, 2018

I have a image view in child and for 420dpi device it is showing perfect centered vertical in the zoomlayout.

Same code on 560dpi device moves image to top (almost 80dp) behind a view on top of the screen. Image size is 1360 x 910.

Can you give me some hint, i want to fix it myself.

Devices used:

Update
This issue could be because of OS version. Nexus 6P emulator (API 26) has no issue. Nexus 6P emulator (API 23) has the issue.

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="10">

    <com.otaliastudios.zoom.ZoomLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="6"
        android:background="@color/colorAccent"
        app:maxZoom="3.0"
        app:minZoom="1.0">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:src="@drawable/img"/>
        </LinearLayout>

    </com.example.syed.draganddrop.engine.ZoomLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="4"
        android:background="@android:color/darker_gray">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:textColor="@android:color/white"/>
    </LinearLayout>

</LinearLayout>
@zahid-arbisoft zahid-arbisoft changed the title Inconsistent Layout for different Android device density Inconsistent layout for different Android device density Jun 12, 2018
@zahid-arbisoft zahid-arbisoft changed the title Inconsistent layout for different Android device density Inconsistent layout for different Android device density (or OS version) Jun 12, 2018
@natario1
Copy link
Owner

I think this was fixed by #62

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

2 participants