Я создал галерею GridView
миниатюр изображений и хочу, чтобы приложение показывало выбранный эскиз в полном размере на следующем экране (во весь экран).
У меня есть изображение в полном размере,поэтому мне не нужно изменять его размер, но проблема в том, что flipper не перевернется.
Мой onItemSelected
метод выглядит следующим образом:
public void onItemSelected(AdapterView<?> adapterView,
View view, int i, long l) {
if (gridLayout.isActivated()) {
fullImage.setImageBitmap(
downloadImage(listOfImages.get(i).getImgURLs()[1].getUrl()));
flipper.showNext();
}
}
и основной.xml вот так:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/lLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
<ViewFlipper android:id="@+id/details"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/oneImageLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
<Button android:id="@+id/flipMeBack"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Flip Me!"
/>
<ImageView android:id="@+id/wholeImage"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/> </LinearLayout>
</ViewFlipper>
</LinearLayout>