Sliding status bar + better incall options

This commit is contained in:
Sylvain Berfini 2012-07-18 13:03:37 +02:00
parent 0d9a0c1fb3
commit 8a84b10332
29 changed files with 1598 additions and 389 deletions

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/options_add_over_alt" />
<item android:state_enabled="false"
android:drawable="@drawable/options_add_disabled_alt" />
<item
android:drawable="@drawable/options_add_default_alt" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/options_over_alt" />
<item android:state_enabled="false"
android:drawable="@drawable/options_disabled_alt" />
<item android:state_selected="true"
android:drawable="@drawable/options_selected_alt" />
<item
android:drawable="@drawable/options_default_alt" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,191 +1,191 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:orientation="vertical" >
<fragment android:name="org.linphone.StatusFragment" <FrameLayout
android:id="@+id/status"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content">
<RelativeLayout <LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1">
<LinearLayout
android:id="@+id/fragmentContainer" android:id="@+id/fragmentContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingTop="20dp"
android:orientation="horizontal" /> android:orientation="horizontal" />
<ImageView <fragment android:name="org.linphone.StatusFragment"
android:id="@+id/switchCamera" android:id="@+id/status"
android:visibility="gone" android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:layout_alignParentLeft="true" </FrameLayout>
android:layout_alignParentTop="true"
android:contentDescription="@string/content_description_switch_camera"
android:src="@drawable/switch_camera" />
<LinearLayout
android:id="@+id/menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.5">
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<ImageView
android:id="@+id/transfer"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/options_transfer"
android:scaleType="fitXY"
android:layout_weight="0.25" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.5">
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<ImageView
android:id="@+id/addCall"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/options_add_call"
android:scaleType="fitXY"
android:layout_weight="0.25" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.5">
<ImageView
android:contentDescription="@string/content_description_switch_video"
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:scaleType="fitXY"
android:src="@drawable/video_off" />
<ImageView
android:contentDescription="@string/content_description_toggle_micro"
android:id="@+id/micro"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/micro_on"
android:scaleType="fitXY"
android:layout_weight="0.25"/>
<ImageView
android:contentDescription="@string/content_description_toggle_speaker"
android:id="@+id/speaker"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/speaker_off"
android:scaleType="fitXY"
android:layout_weight="0.25"/>
<ImageView
android:id="@+id/options"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/options"
android:scaleType="fitXY"
android:layout_weight="0.25" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="75dp"
android:orientation="horizontal"
android:layout_weight="0.5">
<ImageView
android:contentDescription="@string/content_description_pause"
android:id="@+id/pause"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/pause_off"
android:scaleType="fitXY"
android:layout_weight="0.3"/>
<ImageView
android:contentDescription="@string/content_description_hang_up"
android:id="@+id/hangUp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/hangup"
android:scaleType="fitXY"
android:layout_weight="0.3"/>
<ImageView
android:contentDescription="@string/content_description_numpad"
android:id="@+id/dialer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/dialer_alt"
android:scaleType="fitXY"
android:layout_weight="0.3"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout> <ImageView
android:id="@+id/switchCamera"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:contentDescription="@string/content_description_switch_camera"
android:src="@drawable/switch_camera" />
<LinearLayout
android:id="@+id/menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.5">
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<ImageView
android:id="@+id/transfer"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/options_transfer"
android:scaleType="fitXY"
android:layout_weight="0.25" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.5">
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<View
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:visibility="invisible"/>
<ImageView
android:id="@+id/addCall"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/options_add_call_alt"
android:scaleType="fitXY"
android:layout_weight="0.25" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.5">
<ImageView
android:contentDescription="@string/content_description_switch_video"
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_weight="0.25"
android:scaleType="fitXY"
android:src="@drawable/video_off" />
<ImageView
android:contentDescription="@string/content_description_toggle_micro"
android:id="@+id/micro"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/micro_on"
android:scaleType="fitXY"
android:layout_weight="0.25"/>
<ImageView
android:contentDescription="@string/content_description_toggle_speaker"
android:id="@+id/speaker"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/speaker_off"
android:scaleType="fitXY"
android:layout_weight="0.25"/>
<ImageView
android:id="@+id/options"
android:layout_width="match_parent"
android:layout_height="75dp"
android:src="@drawable/options"
android:scaleType="fitXY"
android:layout_weight="0.25" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="75dp"
android:orientation="horizontal"
android:layout_weight="0.5">
<ImageView
android:contentDescription="@string/content_description_pause"
android:id="@+id/pause"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/pause_off"
android:scaleType="fitXY"
android:layout_weight="0.3"/>
<ImageView
android:contentDescription="@string/content_description_hang_up"
android:id="@+id/hangUp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/hangup"
android:scaleType="fitXY"
android:layout_weight="0.3"/>
<ImageView
android:contentDescription="@string/content_description_numpad"
android:id="@+id/dialer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/dialer_alt"
android:scaleType="fitXY"
android:layout_weight="0.3"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>

View file

@ -1,127 +1,115 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent">
<!-- <ImageView <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:id="@+id/tutorial"/> --> android:layout_alignParentTop="true">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:id="@+id/fragmentContainer"
android:layout_height="match_parent" android:layout_width="match_parent"
android:weightSum="6" android:layout_height="match_parent"
android:orientation="vertical"> android:paddingTop="20dp"
android:paddingBottom="75dp"
<fragment android:name="org.linphone.StatusFragment" android:orientation="horizontal" />
<fragment android:name="org.linphone.StatusFragment"
android:id="@+id/status" android:id="@+id/status"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</FrameLayout>
<LinearLayout
android:id="@+id/menu"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:layout_weight="0.2">
<LinearLayout <ImageView
android:id="@+id/fragmentContainer" android:contentDescription="@string/content_description_history"
android:id="@+id/history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/history" />
<TextView
android:id="@+id/missedCalls"
android:layout_width="25dp"
android:layout_height="25dp"
android:gravity="center"
android:textSize="20dp"
android:visibility="gone"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="@drawable/missed_calls_bg" />
</RelativeLayout>
<ImageView
android:contentDescription="@string/content_description_contacts"
android:id="@+id/contacts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/contacts" />
<ImageView
android:contentDescription="@string/content_description_dialer"
android:id="@+id/dialer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/dialer" />
<ImageView
android:contentDescription="@string/content_description_settings"
android:id="@+id/settings"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/settings" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2">
<ImageView
android:contentDescription="@string/content_description_chat"
android:id="@+id/chat"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingBottom="75dp" android:layout_weight="0.2"
android:orientation="horizontal" /> android:scaleType="fitXY"
android:src="@drawable/chat" />
<LinearLayout <TextView
android:id="@+id/menu" android:id="@+id/missedChats"
android:layout_width="match_parent" android:layout_width="25dp"
android:layout_height="90dp" android:layout_height="25dp"
android:layout_alignParentBottom="true" android:gravity="center"
android:orientation="horizontal"> android:textSize="20dp"
android:visibility="gone"
<RelativeLayout android:layout_alignParentTop="true"
android:layout_width="match_parent" android:layout_alignParentRight="true"
android:layout_height="wrap_content" android:background="@drawable/missed_calls_bg" />
android:layout_weight="0.2">
</RelativeLayout>
<ImageView
android:contentDescription="@string/content_description_history"
android:id="@+id/history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/history" />
<TextView
android:id="@+id/missedCalls"
android:layout_width="25dp"
android:layout_height="25dp"
android:gravity="center"
android:textSize="20dp"
android:visibility="gone"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="@drawable/missed_calls_bg" />
</RelativeLayout>
<ImageView
android:contentDescription="@string/content_description_contacts"
android:id="@+id/contacts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/contacts" />
<ImageView
android:contentDescription="@string/content_description_dialer"
android:id="@+id/dialer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/dialer" />
<ImageView
android:contentDescription="@string/content_description_settings"
android:id="@+id/settings"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/settings" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2">
<ImageView
android:contentDescription="@string/content_description_chat"
android:id="@+id/chat"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:scaleType="fitXY"
android:src="@drawable/chat" />
<TextView
android:id="@+id/missedChats"
android:layout_width="25dp"
android:layout_height="25dp"
android:gravity="center"
android:textSize="20dp"
android:visibility="gone"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="@drawable/missed_calls_bg" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </RelativeLayout>

View file

@ -1,40 +1,78 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout
xmlns:linphone="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:orientation="horizontal" > android:orientation="vertical">
<org.linphone.ui.SlidingDrawer
android:id="@+id/statusBar"
linphone:direction="topToBottom"
android:layout_width="fill_parent"
android:layout_height="80dp"
linphone:handle="@+id/handle"
linphone:content="@+id/content">
<RelativeLayout
android:id="@id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/menu_exit" />
</RelativeLayout>
<RelativeLayout
android:id="@id/handle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <ImageView
android:id="@+id/statusText" android:layout_width="match_parent"
android:text="@string/status_not_connected" android:layout_height="20dp"
android:layout_width="wrap_content" android:scaleType="fitXY"
android:layout_height="wrap_content" /> android:src="@drawable/statebar_background"/>
<ImageView <TextView
android:contentDescription="@string/content_description_led" android:id="@+id/statusText"
android:id="@+id/statusLed" android:text="@string/status_not_connected"
android:paddingLeft="5dp" android:layout_width="wrap_content"
android:src="@drawable/led_disconnected" android:layout_height="wrap_content" />
android:layout_toRightOf="@id/statusText"
android:layout_width="wrap_content" <ImageView
android:layout_height="wrap_content" /> android:contentDescription="@string/content_description_led"
android:id="@+id/statusLed"
<ImageView android:paddingLeft="5dp"
android:contentDescription="@string/content_description_call_quality" android:src="@drawable/led_disconnected"
android:id="@+id/callQuality" android:layout_toRightOf="@id/statusText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="17dp" android:layout_height="wrap_content" />
android:src="@drawable/call_quality_indicator_0"
android:layout_centerHorizontal="true" <ImageView
android:visibility="gone" /> android:contentDescription="@string/content_description_call_quality"
android:id="@+id/callQuality"
<ImageView android:layout_width="wrap_content"
android:contentDescription="@string/content_description_encryption" android:layout_height="20dp"
android:id="@+id/encryption" android:src="@drawable/call_quality_indicator_0"
android:layout_width="wrap_content" android:layout_centerHorizontal="true"
android:layout_height="17dp" android:visibility="gone" />
android:src="@drawable/security_pending"
android:visibility="gone" <ImageView
android:layout_alignParentRight="true" /> android:contentDescription="@string/content_description_encryption"
android:id="@+id/encryption"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:src="@drawable/security_pending"
android:visibility="gone"
android:layout_alignParentRight="true" />
</RelativeLayout>
</org.linphone.ui.SlidingDrawer>
</RelativeLayout> </RelativeLayout>

15
res/values/attrs.xml Normal file
View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="direction">
<enum name="rightToLeft" value="0" />
<enum name="bottomToTop" value="1" />
<enum name="leftToRight" value="2" />
<enum name="topToBottom" value="3" />
</attr>
<declare-styleable name="SlidingDrawer">
<attr name="handle" format="reference" />
<attr name="content" format="reference" />
<attr name="direction" />
</declare-styleable>
</resources>

View file

@ -11,6 +11,7 @@
<bool name="hide_accounts">false</bool> <bool name="hide_accounts">false</bool>
<bool name="useFirstLoginActivity">false</bool> <bool name="useFirstLoginActivity">false</bool>
<bool name="disable_animations">false</bool> <bool name="disable_animations">false</bool>
<bool name="lock_statusbar">false</bool>
<bool name="only_display_username_if_unknown">true</bool> <bool name="only_display_username_if_unknown">true</bool>
<bool name="show_full_remote_address_on_incoming_call">true</bool> <bool name="show_full_remote_address_on_incoming_call">true</bool>
<bool name="display_messages_time">true</bool> <!-- Used to show the time of each message arrival --> <bool name="display_messages_time">true</bool> <!-- Used to show the time of each message arrival -->

View file

@ -436,30 +436,13 @@ public class InCallActivity extends FragmentActivity implements
private void hideOrDisplayCallOptions() { private void hideOrDisplayCallOptions() {
if (addCall.getVisibility() == View.VISIBLE) { if (addCall.getVisibility() == View.VISIBLE) {
options.setImageResource(R.drawable.options);
if (getResources().getBoolean(R.bool.disable_animations)) { if (getResources().getBoolean(R.bool.disable_animations)) {
transfer.setVisibility(View.GONE); transfer.setVisibility(View.GONE);
addCall.setVisibility(View.GONE); addCall.setVisibility(View.GONE);
} else { } else {
final Animation animAddCall = AnimationUtils.loadAnimation(this, R.anim.slide_out_top_to_bottom); Animation anim = AnimationUtils.loadAnimation(this, R.anim.slide_out_left_to_right);
animAddCall.setAnimationListener(new AnimationListener() { anim.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
addCall.setVisibility(View.GONE);
}
});
Animation animTransfer = AnimationUtils.loadAnimation(this, R.anim.slide_out_top_to_bottom);
animTransfer.setAnimationListener(new AnimationListener() {
@Override @Override
public void onAnimationStart(Animation animation) { public void onAnimationStart(Animation animation) {
@ -473,21 +456,23 @@ public class InCallActivity extends FragmentActivity implements
@Override @Override
public void onAnimationEnd(Animation animation) { public void onAnimationEnd(Animation animation) {
transfer.setVisibility(View.GONE); transfer.setVisibility(View.GONE);
addCall.startAnimation(animAddCall); addCall.setVisibility(View.GONE);
} }
}); });
transfer.startAnimation(animTransfer); transfer.startAnimation(anim);
addCall.startAnimation(anim);
} }
} else { } else {
if (getResources().getBoolean(R.bool.disable_animations)) { if (getResources().getBoolean(R.bool.disable_animations)) {
transfer.setVisibility(View.VISIBLE); transfer.setVisibility(View.VISIBLE);
addCall.setVisibility(View.VISIBLE); addCall.setVisibility(View.VISIBLE);
options.setImageResource(R.drawable.options_alt);
} else { } else {
final Animation animTransfer = AnimationUtils.loadAnimation(this, R.anim.slide_in_bottom_to_top); Animation anim = AnimationUtils.loadAnimation(this, R.anim.slide_in_right_to_left);
animTransfer.setAnimationListener(new AnimationListener() { anim.setAnimationListener(new AnimationListener() {
@Override @Override
public void onAnimationStart(Animation animation) { public void onAnimationStart(Animation animation) {
transfer.setVisibility(View.VISIBLE);
} }
@Override @Override
@ -497,27 +482,13 @@ public class InCallActivity extends FragmentActivity implements
@Override @Override
public void onAnimationEnd(Animation animation) { public void onAnimationEnd(Animation animation) {
} options.setImageResource(R.drawable.options_alt);
}); transfer.setVisibility(View.VISIBLE);
Animation animAddCall = AnimationUtils.loadAnimation(this, R.anim.slide_in_bottom_to_top);
animAddCall.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
addCall.setVisibility(View.VISIBLE); addCall.setVisibility(View.VISIBLE);
} }
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
transfer.startAnimation(animTransfer);
}
}); });
addCall.startAnimation(animAddCall); transfer.startAnimation(anim);
addCall.startAnimation(anim);
} }
} }
} }

View file

@ -206,24 +206,20 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
private void changeFragment(Fragment newFragment, FragmentsAvailable newFragmentType, boolean withoutAnimation) { private void changeFragment(Fragment newFragment, FragmentsAvailable newFragmentType, boolean withoutAnimation) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
if (currentFragment.shouldAddToBackStack()) { if (!withoutAnimation && !getResources().getBoolean(R.bool.disable_animations) && currentFragment.shouldAnimate()) {
if (!withoutAnimation && !getResources().getBoolean(R.bool.disable_animations) && currentFragment.shouldAnimate()) { if (newFragmentType.isRightOf(currentFragment)) {
if (newFragmentType.isRightOf(currentFragment)) { transaction.setCustomAnimations(R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left, R.anim.slide_in_left_to_right, R.anim.slide_out_left_to_right);
transaction.setCustomAnimations(R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left, R.anim.slide_in_left_to_right, R.anim.slide_out_left_to_right); } else {
} else { transaction.setCustomAnimations(R.anim.slide_in_left_to_right, R.anim.slide_out_left_to_right, R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left);
transaction.setCustomAnimations(R.anim.slide_in_left_to_right, R.anim.slide_out_left_to_right, R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left);
}
} }
}
try {
getSupportFragmentManager().popBackStack(newFragmentType.toString(), FragmentManager.POP_BACK_STACK_INCLUSIVE); getSupportFragmentManager().popBackStack(newFragmentType.toString(), FragmentManager.POP_BACK_STACK_INCLUSIVE);
transaction.addToBackStack(newFragmentType.toString()); } catch (java.lang.IllegalStateException e) {
}
else {
try {
getSupportFragmentManager().popBackStack("Add to back stack", FragmentManager.POP_BACK_STACK_INCLUSIVE);
} catch (java.lang.IllegalStateException e) {
}
} }
transaction.addToBackStack(newFragmentType.toString());
transaction.replace(R.id.fragmentContainer, newFragment); transaction.replace(R.id.fragmentContainer, newFragment);
transaction.commitAllowingStateLoss(); transaction.commitAllowingStateLoss();
@ -658,6 +654,9 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
return true; return true;
} }
} }
if (keyCode == KeyEvent.KEYCODE_MENU && statusFragment != null) {
statusFragment.openOrCloseStatusBar();
}
return super.onKeyDown(keyCode, event); return super.onKeyDown(keyCode, event);
} }
} }

View file

@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCore.MediaEncryption; import org.linphone.core.LinphoneCore.MediaEncryption;
import org.linphone.core.LinphoneCore.RegistrationState; import org.linphone.core.LinphoneCore.RegistrationState;
import org.linphone.ui.SlidingDrawer;
import android.app.Activity; import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
@ -40,6 +41,7 @@ public class StatusFragment extends Fragment {
private Handler refreshHandler = new Handler(); private Handler refreshHandler = new Handler();
private TextView statusText; private TextView statusText;
private ImageView statusLed, callQuality, encryption; private ImageView statusLed, callQuality, encryption;
private SlidingDrawer drawer;
private Runnable mCallQualityUpdater; private Runnable mCallQualityUpdater;
private boolean isInCall, isAttached = false; private boolean isInCall, isAttached = false;
@ -54,6 +56,8 @@ public class StatusFragment extends Fragment {
callQuality = (ImageView) view.findViewById(R.id.callQuality); callQuality = (ImageView) view.findViewById(R.id.callQuality);
encryption = (ImageView) view.findViewById(R.id.encryption); encryption = (ImageView) view.findViewById(R.id.encryption);
drawer = (SlidingDrawer) view.findViewById(R.id.statusBar);
return view; return view;
} }
@ -84,6 +88,18 @@ public class StatusFragment extends Fragment {
isAttached = false; isAttached = false;
} }
public void openOrCloseStatusBar() {
if (getResources().getBoolean(R.bool.lock_statusbar)) {
return;
}
if (getResources().getBoolean(R.bool.disable_animations)) {
drawer.toggle();
} else {
drawer.animateToggle();
}
}
public void registrationStateChanged(final RegistrationState state) { public void registrationStateChanged(final RegistrationState state) {
if (!isAttached) if (!isAttached)
return; return;
@ -173,6 +189,14 @@ public class StatusFragment extends Fragment {
// We are obviously connected // We are obviously connected
statusLed.setImageResource(R.drawable.led_connected); statusLed.setImageResource(R.drawable.led_connected);
statusText.setText(getString(R.string.status_connected)); statusText.setText(getString(R.string.status_connected));
if (drawer != null) {
drawer.lock();
}
} else {
if (drawer != null && !getResources().getBoolean(R.bool.lock_statusbar)) {
drawer.unlock();
}
} }
} }

File diff suppressed because it is too large Load diff