Я создал Fart SoundBoard для своего приложения. Я очень новичок в разработке, и это мое первое приложение. У меня есть несколько кнопок, которые воспроизводят звук при нажатии с помощью метода onClick button_sound.start. Как показать вращающийся индикатор выполнения только тогда, когда мой звук воспроизводится через xml? Вот мой код:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@raw/nuke"
android:padding="8dp">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Click a button to play a fart!"
android:textColor="#FF0000"
android:textSize="24dp" />
<SeekBar
android:id="@+id/sbVolume1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/ranfart"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Random Fart"
android:textColor="#0B0B61"
android:textSize="21dp" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Fart 1"
android:layout_weight="50"
android:textSize="21dp"
android:id="@+id/fart1"
android:textColor="#0B0B61"/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Fart 2"
android:layout_weight="50"
android:textSize="21dp"
android:id="@+id/fart2"
android:textColor="#0B0B61"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>
Как сделать загрузочный прогресс только во время воспроизведения звука?
А также, как я могу сделать вращающийся индикатор выполнения ONTOP моей кнопки? (не выше, не ниже, но ONTOP?