Итак, я делал приложение, и в его части я хотел иметь изображения с текстовыми описаниями. Я реализовал прокрутку с текстовыми и графическими изображениями. Работает, но загружается очень медленно. Я уменьшил размер изображений, так что они составляют примерно 50-150 КБ каждое. Есть ли программный способ, которым я могу заставить изображения загружаться только тогда, когда вы находитесь на экране, и в противном случае они удаляются из памяти?
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:textSize="25dp"
android:text="Common Vascular Clamps:"
android:textStyle="bold"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:textSize="25dp"
android:text="Profundas"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:adjustViewBounds="true"
android:src="@drawable/vascular_clamps_profundas"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:textSize="25dp"
android:text="Small Debakeys"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:adjustViewBounds="true"
android:src="@drawable/vascular_clamps_small_debakeys"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:textSize="25dp"
android:text="Large Debakeys"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:adjustViewBounds="true"
android:src="@drawable/vascular_clamps_large_debakeys"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:textSize="25dp"
android:text="Curved Debakeys"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:adjustViewBounds="true"
android:src="@drawable/vascular_clamps_curved_debakey"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:textSize="25dp"
android:text="Satinskies"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:adjustViewBounds="true"
android:src="@drawable/vascular_clamps_statinskies"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:textSize="25dp"
android:text="Angled Forgarties"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:adjustViewBounds="true"
android:src="@drawable/vascular_clamps_angled_fogarties"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:textSize="25dp"
android:text="Straight Forgarties"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:adjustViewBounds="true"
android:src="@drawable/vascular_clamps_straight_fogarty"/>
</LinearLayout>
</ScrollView>