I'm working on a voip/sip based application which is capable of making calls from a dialpad widget which has the four buttons at the bottom
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/ibtn_handsfree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_dialpad_action_button"
android:src="@drawable/selector_handsfree" />
<ImageButton
android:id="@+id/ibtn_headset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_dialpad_action_button"
android:src="@drawable/selector_headset" />
<ImageButton
android:id="@+id/ibtn_copyToDir"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_dialpad_action_button"
android:src="@drawable/selector_copytodir" />
<ImageButton
android:id="@+id/ibtn_keyboard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_dialpad_action_button"
android:src="@drawable/selector_keyboard" />
<ImageButton
android:id="@+id/ibtn_sendkey_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_dialpad_action_button"
android:src="@drawable/selector_send_key_dialer"
/>
</LinearLayout>
- Is it discouraged that I toggle the visibility of any of my layout elements dynamically ? For example if I wish to hide the fourth button, depending on any active call present(which I believe would require an individual and dedicated listener attached).
- If the dynamic changes on the widget layout aren't discouraged, how do I go about doing that ?
Appreciate your thoughts and help.