Scrollview и ImageView в Android Studio (медленная загрузка многих изображений)

Итак, я делал приложение, и в его части я хотел иметь изображения с текстовыми описаниями. Я реализовал прокрутку с текстовыми и графическими изображениями. Работает, но загружается очень медленно. Я уменьшил размер изображений, так что они составляют примерно 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>

person Pat    schedule 25.09.2016    source источник
comment
Это может помочь вам stackoverflow.com/a/35222639/1443888   -  person Singh    schedule 25.09.2016
comment
Вы должны лениво загружать изображения. checkout stackoverflow.com/questions/541966/< /а> . Лично я предпочитаю этот ответ.   -  person Neeraj    schedule 25.09.2016