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

View file

@ -21,12 +21,13 @@
android:textColor="@android:color/white"
android:textSize="22dp" />
<LinearLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.1"
android:orientation="vertical"
android:paddingTop="30dip">
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="30dip" >
<org.linphone.ui.AvatarWithShadow
android:id="@+id/incoming_picture"

View file

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

View file

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