I'm working on application that want show a long-width image as below to the user.
user can drag image to the right or left, to see entire image or use Gyro-Sensor instead.
so, i used HorizontalScrollView in android with layout code below to achive want i want
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="net.appersian.android.wod.MainActivity"
android:background="#000"
>
<HorizontalScrollView
android:id="@+id/scrollContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:fillViewport="true"
android:measureAllChildren="false"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="none" >
<ImageView
android:id="@+id/scrollView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/panorama_ph" />
</HorizontalScrollView>
this code works great on High-end device like Nexus 5 but the problem is started when i test the app on Nexus S(512MB ram) on android 4.2! image is not shown and in logcat, i get continusly this error:
09-09 13:58:27.539: W/OpenGLRenderer(7925): Bitmap too large to be uploaded into a texture (6759x1136, max=2048x2048)
i don't know either how to implement this effect without Horizontalscrollview or how to fix the problem! can anyone help me to fix this problem?