Hide transfer button if not allowed + fixes

This commit is contained in:
Sylvain Berfini 2012-07-24 10:40:43 +02:00
parent d2325290ef
commit 6db9cffc82
18 changed files with 34 additions and 14 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View file

@ -44,7 +44,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="70dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal" > android:orientation="horizontal" >
@ -96,7 +96,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="70dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal" > android:orientation="horizontal" >

View file

@ -25,8 +25,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.1" android:layout_weight="0.1"
android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="30dip"> android:paddingTop="30dip" >
<org.linphone.ui.AvatarWithShadow <org.linphone.ui.AvatarWithShadow
android:id="@+id/incoming_picture" android:id="@+id/incoming_picture"

View file

@ -61,7 +61,7 @@ public class InCallActivity extends FragmentActivity implements
private StatusFragment status; private StatusFragment status;
private AudioCallFragment audioCallFragment; private AudioCallFragment audioCallFragment;
private VideoCallFragment videoCallFragment; private VideoCallFragment videoCallFragment;
private boolean isSpeakerEnabled = false, isMicMuted = false, isVideoEnabled; private boolean isSpeakerEnabled = false, isMicMuted = false, isVideoEnabled, isTransferAllowed;
private LinearLayout mControlsLayout; private LinearLayout mControlsLayout;
@Override @Override
@ -70,6 +70,7 @@ public class InCallActivity extends FragmentActivity implements
setContentView(R.layout.incall); setContentView(R.layout.incall);
isVideoEnabled = getIntent().getExtras() != null && getIntent().getExtras().getBoolean("VideoEnabled"); isVideoEnabled = getIntent().getExtras() != null && getIntent().getExtras().getBoolean("VideoEnabled");
isTransferAllowed = getResources().getBoolean(R.bool.allow_transfers);
if (findViewById(R.id.fragmentContainer) != null) { if (findViewById(R.id.fragmentContainer) != null) {
initUI(); initUI();
@ -135,6 +136,10 @@ public class InCallActivity extends FragmentActivity implements
switchCamera.setOnClickListener(this); switchCamera.setOnClickListener(this);
mControlsLayout = (LinearLayout) findViewById(R.id.menu); mControlsLayout = (LinearLayout) findViewById(R.id.menu);
if (!isTransferAllowed) {
addCall.setImageResource(R.drawable.options_add_call);
}
} }
private void enableAndRefreshInCallActions() { private void enableAndRefreshInCallActions() {
@ -426,7 +431,9 @@ public class InCallActivity extends FragmentActivity implements
if (addCall.getVisibility() == View.VISIBLE) { if (addCall.getVisibility() == View.VISIBLE) {
options.setImageResource(R.drawable.options); options.setImageResource(R.drawable.options);
if (getResources().getBoolean(R.bool.disable_animations)) { if (getResources().getBoolean(R.bool.disable_animations)) {
if (isTransferAllowed) {
transfer.setVisibility(View.GONE); transfer.setVisibility(View.GONE);
}
addCall.setVisibility(View.GONE); addCall.setVisibility(View.GONE);
} else { } else {
Animation anim = AnimationUtils.loadAnimation(this, R.anim.slide_out_left_to_right); Animation anim = AnimationUtils.loadAnimation(this, R.anim.slide_out_left_to_right);
@ -443,16 +450,22 @@ public class InCallActivity extends FragmentActivity implements
@Override @Override
public void onAnimationEnd(Animation animation) { public void onAnimationEnd(Animation animation) {
if (isTransferAllowed) {
transfer.setVisibility(View.GONE); transfer.setVisibility(View.GONE);
}
addCall.setVisibility(View.GONE); addCall.setVisibility(View.GONE);
} }
}); });
if (isTransferAllowed) {
transfer.startAnimation(anim); transfer.startAnimation(anim);
}
addCall.startAnimation(anim); addCall.startAnimation(anim);
} }
} else { } else {
if (getResources().getBoolean(R.bool.disable_animations)) { if (getResources().getBoolean(R.bool.disable_animations)) {
if (isTransferAllowed) {
transfer.setVisibility(View.VISIBLE); transfer.setVisibility(View.VISIBLE);
}
addCall.setVisibility(View.VISIBLE); addCall.setVisibility(View.VISIBLE);
options.setImageResource(R.drawable.options_alt); options.setImageResource(R.drawable.options_alt);
} else { } else {
@ -471,11 +484,15 @@ public class InCallActivity extends FragmentActivity implements
@Override @Override
public void onAnimationEnd(Animation animation) { public void onAnimationEnd(Animation animation) {
options.setImageResource(R.drawable.options_alt); options.setImageResource(R.drawable.options_alt);
if (isTransferAllowed) {
transfer.setVisibility(View.VISIBLE); transfer.setVisibility(View.VISIBLE);
}
addCall.setVisibility(View.VISIBLE); addCall.setVisibility(View.VISIBLE);
} }
}); });
if (isTransferAllowed) {
transfer.startAnimation(anim); transfer.startAnimation(anim);
}
addCall.startAnimation(anim); addCall.startAnimation(anim);
} }
} }

View file

@ -616,7 +616,9 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
@Override @Override
public void run() { public void run() {
isInCallLayout = false; isInCallLayout = false;
if (dialerFragment != null) {
((DialerFragment) dialerFragment).resetLayout(); ((DialerFragment) dialerFragment).resetLayout();
}
if (LinphoneManager.getLc().getCallsNb() > 0) { if (LinphoneManager.getLc().getCallsNb() > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0]; LinphoneCall call = LinphoneManager.getLc().getCalls()[0];