Improved layouts + pause fix

This commit is contained in:
Sylvain Berfini 2012-07-25 16:46:45 +02:00
parent d2c387ac42
commit 572bcb8cf4
7 changed files with 52 additions and 35 deletions

View file

@ -14,29 +14,29 @@
<TextView <TextView
android:id="@+id/contactNameOrNumber" android:id="@+id/contactNameOrNumber"
android:layout_width="match_parent" android:layout_width="0dip"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.5" android:layout_weight="1"
android:gravity="center_vertical|left" android:gravity="center_vertical|left"
android:paddingLeft="20dp" android:paddingLeft="20dp"
android:paddingRight="10dp"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="22dp" /> android:textSize="22dp" />
<ImageView <ImageView
android:id="@+id/callStatus" android:id="@+id/callStatus"
android:layout_width="40dp" android:layout_width="30dp"
android:layout_height="40dp" android:layout_height="30dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:src="@drawable/pause_default" /> android:src="@drawable/pause_default" />
<Chronometer <Chronometer
android:id="@+id/callTimer" android:id="@+id/callTimer"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:paddingLeft="10dp"
android:paddingRight="20dp" android:paddingRight="20dp"
android:gravity="center_vertical|right" android:gravity="center_vertical|right"
android:textColor="@android:color/white" android:textColor="@android:color/white"

View file

@ -8,11 +8,10 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:paddingTop="20dp" android:paddingTop="20dp"
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:paddingRight="10dp" android:paddingRight="10dp"
android:layout_weight="0.4"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
@ -35,9 +34,9 @@
<ScrollView <ScrollView
android:id="@+id/chatScrollView" android:id="@+id/chatScrollView"
android:paddingTop="10dp" android:paddingTop="10dp"
android:layout_weight="1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="0dip">
android:layout_weight="0.2" >
<RelativeLayout <RelativeLayout
android:id="@+id/messages" android:id="@+id/messages"
@ -52,8 +51,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="80dp"
android:layout_weight="0.45"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
@ -61,19 +59,19 @@
android:id="@+id/message" android:id="@+id/message"
android:inputType="textMultiLine" android:inputType="textMultiLine"
android:textColor="@android:color/black" android:textColor="@android:color/black"
android:layout_width="match_parent" android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.21"
android:background="@drawable/chat_message_background" android:background="@drawable/chat_message_background"
android:padding="15dp"/> android:padding="15dp"/>
<ImageView <ImageView
android:contentDescription="@string/content_description_send_message" android:contentDescription="@string/content_description_send_message"
android:id="@+id/sendMessage" android:id="@+id/sendMessage"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.79" android:scaleType="centerCrop"
android:scaleType="fitXY" android:adjustViewBounds="true"
android:src="@drawable/chat_send_message" /> android:src="@drawable/chat_send_message" />
</LinearLayout> </LinearLayout>

View file

@ -7,8 +7,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="0.87"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
@ -17,6 +16,8 @@
android:src="@drawable/chat_new" android:src="@drawable/chat_new"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> android:layout_weight="1"/>
<ImageView <ImageView
@ -25,6 +26,8 @@
android:src="@drawable/chat_edit" android:src="@drawable/chat_edit"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> android:layout_weight="1"/>
<ImageView <ImageView
@ -34,6 +37,8 @@
android:visibility="gone" android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> android:layout_weight="1"/>
</LinearLayout> </LinearLayout>
@ -43,7 +48,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:divider="@android:color/darker_gray" android:divider="@android:color/darker_gray"
android:dividerHeight="1dp" android:dividerHeight="1dp" />
android:layout_weight="0.13" />
</LinearLayout> </LinearLayout>

View file

@ -7,8 +7,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="0.87"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
@ -17,6 +16,8 @@
android:src="@drawable/all_contacts" android:src="@drawable/all_contacts"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> android:layout_weight="1"/>
<ImageView <ImageView
@ -25,6 +26,8 @@
android:src="@drawable/linphone_contacts" android:src="@drawable/linphone_contacts"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> android:layout_weight="1"/>
<ImageView <ImageView
@ -33,14 +36,15 @@
android:src="@drawable/new_contact" android:src="@drawable/new_contact"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> android:layout_weight="1"/>
</LinearLayout> </LinearLayout>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:layout_weight="0.13">
<ListView <ListView
android:id="@+id/contactsList" android:id="@+id/contactsList"

View file

@ -7,8 +7,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="0.87"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
@ -17,6 +16,8 @@
android:src="@drawable/history_all" android:src="@drawable/history_all"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> android:layout_weight="1"/>
<ImageView <ImageView
@ -25,6 +26,8 @@
android:src="@drawable/history_missed" android:src="@drawable/history_missed"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> android:layout_weight="1"/>
<ImageView <ImageView
@ -33,6 +36,8 @@
android:src="@drawable/history_edit" android:src="@drawable/history_edit"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> android:layout_weight="1"/>
<ImageView <ImageView
@ -42,6 +47,8 @@
android:visibility="gone" android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> android:layout_weight="1"/>
</LinearLayout> </LinearLayout>
@ -51,7 +58,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:divider="@android:color/darker_gray" android:divider="@android:color/darker_gray"
android:dividerHeight="1dp" android:dividerHeight="1dp" />
android:layout_weight="0.13" />
</LinearLayout> </LinearLayout>

View file

@ -226,9 +226,14 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
throw new IllegalArgumentException("Unknown state " + state); throw new IllegalArgumentException("Unknown state " + state);
} }
String userName = LinphoneManager.getLc().getCurrentCall().getRemoteAddress().getUserName(); if (LinphoneManager.getLc().getCallsNb() == 0) {
String domain = LinphoneManager.getLc().getCurrentCall().getRemoteAddress().getDomain(); return;
String displayName = LinphoneManager.getLc().getCurrentCall().getRemoteAddress().getDisplayName(); }
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
String userName = call.getRemoteAddress().getUserName();
String domain = call.getRemoteAddress().getDomain();
String displayName = call.getRemoteAddress().getDisplayName();
LinphoneAddress address = LinphoneCoreFactoryImpl.instance().createLinphoneAddress("sip:" + userName + "@" + domain); LinphoneAddress address = LinphoneCoreFactoryImpl.instance().createLinphoneAddress("sip:" + userName + "@" + domain);
address.setDisplayName(displayName); address.setDisplayName(displayName);

@ -1 +1 @@
Subproject commit c4bf7958ab6272155547c1f12e06189e1f84275c Subproject commit 46a38951859ad9401d652ca8793b4b12dd4cf6e3