I'm making a custom 2D map filled with ImageViews using this layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.nkraft.mobiletomblocator.ZoomableScrollView2D
android:id="@+id/scrollView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none" >
<com.nkraft.mobiletomblocator.CustomGridLayout
android:id="@+id/map_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffdedbba" >
<!-- filling this up at run time, maybe a ~300x100 cells -->
</com.nkraft.mobiletomblocator.CustomGridLayout>
</com.nkraft.mobiletomblocator.ZoomableScrollView2D>
<!-- Don't mind below this -->
<LinearLayout
android:id="@+id/popupDialogParent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:padding="30dp" >
<include layout="@layout/custom_toast"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
Where:
ZoomableScrollView2D
is a 2 dimensional scroller w/c can scroll in both direction at the same time and where I attached my pinch zoom effect w/c I have found HERECustomGridLayout
is just a normalGridLayout
that I overrides theonDraw()
to draw other stuff.
After I have set this all up, I get this unexpected output:
before zoom:
after zoom:
How do I maintain the clipping bounds of that CustomGridLayout
after zooming? You know, the one that anyone would expect when zooming.