Move merge and transfer bar on top of other controls.
This commit is contained in:
parent
886bdcd28a
commit
e82587ae94
2 changed files with 23 additions and 29 deletions
|
@ -7,18 +7,7 @@
|
|||
android:paddingRight="8dp">
|
||||
|
||||
|
||||
<LinearLayout android:id="@+id/conf_control_buttons"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true">
|
||||
<Button android:id="@+id/conf_simple_merge" style="@style/conf_icon_text_button"
|
||||
android:drawableTop="@drawable/conf_merge"
|
||||
android:text="@string/conf_simple_merge_bt_txt"/>
|
||||
<Button android:id="@+id/conf_simple_transfer" style="@style/conf_icon_text_button"
|
||||
android:drawableTop="@drawable/conf_transfer"
|
||||
android:text="@string/conf_simple_transfer_bt_txt" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/conf_header" android:layout_below="@id/conf_control_buttons"
|
||||
<LinearLayout android:id="@+id/conf_header" android:layout_alignParentTop="true"
|
||||
android:orientation="vertical" android:layout_marginBottom="10dip"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
|
@ -60,6 +49,19 @@
|
|||
android:text="@string/show_send_dtmfs_button" android:drawableTop="@drawable/numpad_big" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/conf_advanced_buttons"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content"
|
||||
android:layout_above="@id/conf_terminate_row">
|
||||
<Button android:id="@+id/conf_simple_merge" style="@style/conf_icon_text_button"
|
||||
android:drawableTop="@drawable/conf_merge"
|
||||
android:text="@string/conf_simple_merge_bt_txt"/>
|
||||
<Button android:id="@+id/conf_simple_transfer" style="@style/conf_icon_text_button"
|
||||
android:drawableTop="@drawable/conf_transfer"
|
||||
android:text="@string/conf_simple_transfer_bt_txt" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<ImageView android:id="@+id/incall_picture" android:visibility="gone"
|
||||
android:layout_height="wrap_content" android:layout_width="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
|
@ -74,7 +76,7 @@
|
|||
android:dividerHeight="10dip"
|
||||
android:divider="@android:color/transparent"
|
||||
android:layout_below="@id/conf_header"
|
||||
android:layout_above="@id/conf_terminate_row"
|
||||
android:layout_above="@id/conf_advanced_buttons"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:fadeScrollbars="false"
|
||||
/>
|
||||
|
|
|
@ -146,10 +146,7 @@ public class IncallActivity extends ListActivity implements
|
|||
if (mMultipleCallsLimit > 0) {
|
||||
limitReached = lc().getCallsNb() >= mMultipleCallsLimit;
|
||||
}
|
||||
|
||||
int establishedCallsNb = LinphoneUtils.getRunningOrPausedCalls(lc()).size();
|
||||
boolean hideButton = limitReached || establishedCallsNb == 0;
|
||||
findViewById(R.id.addCall).setVisibility(hideButton? GONE : VISIBLE);
|
||||
findViewById(R.id.addCall).setVisibility(limitReached? View.INVISIBLE : VISIBLE);
|
||||
}
|
||||
|
||||
private void updateDtmfButton() {
|
||||
|
@ -304,11 +301,9 @@ public class IncallActivity extends ListActivity implements
|
|||
showDialog(numpad_dialog_id);
|
||||
break;
|
||||
case R.id.conf_simple_merge:
|
||||
findViewById(R.id.conf_control_buttons).setVisibility(GONE);
|
||||
lc().addAllToConference();
|
||||
break;
|
||||
case R.id.conf_simple_transfer:
|
||||
findViewById(R.id.conf_control_buttons).setVisibility(GONE);
|
||||
LinphoneCall tCall = lc().getCurrentCall();
|
||||
if (tCall != null) {
|
||||
prepareForTransferingExistingOrNewCall(tCall);
|
||||
|
@ -617,22 +612,19 @@ public class IncallActivity extends ListActivity implements
|
|||
|
||||
private Handler mHandler = new Handler();
|
||||
|
||||
private void updateSimpleControlButtons() {
|
||||
private void updateAdvancedButtons() {
|
||||
LinphoneCall activeCall = lc().getCurrentCall();
|
||||
View control = findViewById(R.id.conf_control_buttons);
|
||||
View bar = findViewById(R.id.conf_advanced_buttons);
|
||||
int nonConfCallsNb = LinphoneUtils.countNonConferenceCalls(lc());
|
||||
|
||||
View merge = control.findViewById(R.id.conf_simple_merge);
|
||||
View merge = bar.findViewById(R.id.conf_simple_merge);
|
||||
boolean showMerge = nonConfCallsNb >=2
|
||||
|| (lc().getConferenceSize() > 0 && nonConfCallsNb > 0);
|
||||
merge.setVisibility(showMerge ? VISIBLE : GONE);
|
||||
merge.setEnabled(showMerge);
|
||||
|
||||
View transfer = control.findViewById(R.id.conf_simple_transfer);
|
||||
View transfer = bar.findViewById(R.id.conf_simple_transfer);
|
||||
boolean showTransfer = mAllowTransfers && activeCall != null;
|
||||
transfer.setVisibility(showTransfer ? VISIBLE : GONE);
|
||||
|
||||
boolean showControl = showMerge || showTransfer;
|
||||
control.setVisibility(showControl ? VISIBLE : GONE);
|
||||
transfer.setEnabled(showTransfer);
|
||||
}
|
||||
|
||||
public void onCallStateChanged(final LinphoneCall c, final State s, String m) {
|
||||
|
@ -659,7 +651,7 @@ public class IncallActivity extends ListActivity implements
|
|||
}
|
||||
|
||||
private void recreateActivity() {
|
||||
updateSimpleControlButtons();
|
||||
updateAdvancedButtons();
|
||||
updateCalleeImage();
|
||||
updateSoundLock();
|
||||
updateAddCallButton();
|
||||
|
|
Loading…
Reference in a new issue