I have a GridView that can contain NxM Custom Items (actually memes)
The problem i'm facing is, when i try to save a bitmap from those images, it gets cropped to the image is rendered on screen, because not visible images or portions of images are null space.
(if there's a way to actually capture those images without resizing the grid please let me know).
so what i want to do right now is to resize the grid to fit available screen height.
here's part of my Main Layout:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:id="@+id/rlMemeHolder"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_below="@id/ads_banner"
android:layout_above="@+id/relativeLayout">
<GridView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_marginStart="25dp"
android:layout_marginEnd="25dp"
android:id="@+id/meme_grid"
android:layout_centerInParent="true">
</GridView>
</RelativeLayout>
on my Activity OnCreate, i insert a ZoomView (from pl.polidea.ZoomView) like this:
//Setting the ZoomView from ZoomView.jar library
zoomView = new ZoomView(this);
rlMemeHolder = (RelativeLayout)findViewById(R.id.rlMemeHolder);
rlMemeHolder.removeView(grvMemes);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.MATCH_PARENT);
params.addRule(RelativeLayout.CENTER_IN_PARENT);
zoomView.setLayoutParams(params);
zoomView.setMaxZoom(4);
rlMemeHolder.addView(zoomView);
FrameLayout.LayoutParams params2 = new FrameLayout.LayoutParams(ActionBar.LayoutParams.WRAP_CONTENT, ActionBar.LayoutParams.WRAP_CONTENT);
params2.gravity = Gravity.CENTER;
params2.setMargins(50,0,50,0);
grvMemes.setLayoutParams(params2);
zoomView.addView(grvMemes);
NOTE: i have tried setting the gridView's height as MATCH_PARENT, no luck, it keeps being able to scroll when overflow. (i want all the grid to fit on screen)