Without any sample code, I can't give any examples specific to your project. However, setting android:enabled="false"
in your layout file for the Stop image button will inflate the layout with the Stop image button disabled by default.
As for representing disabled states, you can use drawable selectors. So let's say you have a file at res/drawable/stop_state.xml
:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:drawable="@drawable/stop_disabled" />
<item android:drawable="@drawable/stop_enabled" />
</selector>
In the layout containing your ImageButton, you would set the android:drawable
property to this drawable e.g.
android:drawable="@drawable/stop_state"
Likewise, make a drawable selector for your record button, and manage the enabled states within your activity using .setEnabled(boolean)
based on if your app is currently recording.