Fix video port issue + improved tablet UI

This commit is contained in:
Sylvain Berfini 2012-10-22 15:51:38 +02:00
parent e3bbc52db6
commit 5c68a7e513
48 changed files with 405 additions and 47 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 4 KiB

View file

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:linphone="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:contentDescription="@string/content_description_edit"
android:id="@+id/editContact"
android:background="@drawable/contact_edit"
android:text="@string/button_edit"
android:gravity="center"
android:paddingTop="20dp"
android:textColor="@color/text_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/>
<!-- <TextView
android:contentDescription="@string/content_description_add_contact"
android:id="@+id/newContact"
android:background="@drawable/contact_add_contact"
android:text="@string/button_add_contact"
android:gravity="center"
android:paddingTop="20dp"
android:textColor="@color/text_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_weight="1"/> -->
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:gravity="center"
android:orientation="horizontal">
<org.linphone.ui.AvatarWithShadow
android:id="@+id/contactPicture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
linphone:picture="@drawable/unknown_small" />
<TextView
android:id="@+id/contactName"
android:paddingLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/black" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableLayout
android:id="@+id/controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchColumns="*"
android:paddingTop="20dp"/>
</ScrollView>
</LinearLayout>

View file

@ -42,6 +42,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_marginBottom="150dp"
android:layout_centerInParent="true" />
<RelativeLayout
@ -50,11 +51,13 @@
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_gravity="bottom"
android:gravity="bottom"
android:orientation="horizontal" >
<TextView
android:id="@+id/video"
@ -85,7 +88,7 @@
android:textColor="@drawable/text_incall_button_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/options"
android:background="@drawable/options"
@ -97,26 +100,28 @@
android:layout_height="wrap_content" />
<TextView
android:id="@+id/addCall"
android:background="@drawable/options_add_call_alt"
android:text="@string/button_add_call"
android:gravity="center"
android:paddingTop="50dp"
android:textColor="@drawable/text_incall_button_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
android:id="@+id/addCall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/options_add_call_alt"
android:visibility="gone"
android:gravity="center"
android:paddingTop="45dp"
android:text="@string/button_add_call"
android:textColor="@drawable/text_incall_button_color" />
<TextView
android:id="@+id/transfer"
android:background="@drawable/options_transfer"
android:text="@string/button_transfer"
android:gravity="center"
android:paddingTop="50dp"
android:textColor="@drawable/text_incall_button_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
android:id="@+id/transfer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/options_transfer"
android:visibility="gone"
android:gravity="center"
android:paddingTop="45dp"
android:text="@string/button_transfer"
android:textColor="@drawable/text_incall_button_color" />
</LinearLayout>

View file

@ -142,10 +142,6 @@
android:contentDescription="@string/content_description_dialer"
android:scaleType="fitXY"
android:src="@drawable/dialer" />
<include layout="@layout/menu_settings_button" />
<include layout="@layout/menu_about_settings_button" />
<include layout="@layout/menu_about_chat_button" />
@ -169,6 +165,10 @@
android:visibility="gone" />
</RelativeLayout>
<include layout="@layout/menu_settings_button" />
<include layout="@layout/menu_about_settings_button" />
</LinearLayout>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/about_chat"
android:visibility="gone"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_weight="0.2"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_about"
android:scaleType="fitXY"
android:src="@drawable/about_chat" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textColor="@drawable/text_color"
android:text="@string/button_about"
android:textSize="18dp" />
</RelativeLayout>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/about_settings"
android:visibility="gone"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_weight="0.2"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_about"
android:scaleType="fitXY"
android:src="@drawable/about_settings" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textColor="@drawable/text_color"
android:text="@string/button_about"
android:textSize="18dp" />
</RelativeLayout>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/chat"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_chat"
android:scaleType="fitXY"
android:src="@drawable/chat" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textColor="@drawable/text_color"
android:text="@string/button_chat"
android:textSize="18dp" />
</RelativeLayout>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/contacts"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_weight="0.2"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_contacts"
android:scaleType="fitXY"
android:src="@drawable/contacts" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:paddingLeft="20dp"
android:textColor="@drawable/text_color"
android:text="@string/button_contacts"
android:textSize="18dp" />
</RelativeLayout>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/history"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_history"
android:scaleType="fitXY"
android:src="@drawable/history" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:paddingLeft="50dp"
android:textColor="@drawable/text_color"
android:text="@string/button_history"
android:textSize="18dp" />
</RelativeLayout>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/settings"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_weight="0.2"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_about"
android:scaleType="fitXY"
android:src="@drawable/settings" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:paddingLeft="50dp"
android:textColor="@drawable/text_color"
android:text="@string/button_settings"
android:textSize="18dp" />
</RelativeLayout>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/setup_back"
android:visibility="gone"
android:layout_weight="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:contentDescription="@string/content_description_back"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/setup_back"
android:adjustViewBounds="true"
android:scaleType="fitXY" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:paddingTop="20dp"
android:textSize="18dp"
android:textColor="@drawable/text_color"
android:text="@string/button_setup_back" />
</RelativeLayout>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/setup_cancel"
android:layout_weight="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:contentDescription="@string/content_description_cancel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/setup_cancel"
android:adjustViewBounds="true"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:paddingTop="20dp"
android:textSize="18dp"
android:textColor="@drawable/text_color"
android:text="@string/button_setup_cancel" />
</RelativeLayout>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/setup_next"
android:layout_weight="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:contentDescription="@string/content_description_next"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/setup_next"
android:adjustViewBounds="true"
android:scaleType="fitXY" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:paddingTop="20dp"
android:textSize="18dp"
android:textColor="@drawable/text_color"
android:text="@string/button_setup_next" />
</RelativeLayout>

View file

@ -44,6 +44,9 @@
<bool name="forbid_self_call">false</bool>
<bool name="disable_chat">false</bool>
<string name="default_audio_port">7078</string>
<string name="default_video_port">9078</string>
<string name="about_bugreport_email">linphone-android@belledonne-communications.com</string>
</resources>

View file

@ -79,7 +79,7 @@
android:key="@string/pref_audio_port_key"
android:title="@string/pref_audio_port_title"
android:summary="@string/pref_audio_port_description"
android:defaultValue="7078"
android:defaultValue="@string/default_audio_port"
android:layout="@layout/hidden"/>
<PreferenceScreen
@ -191,7 +191,7 @@
<EditTextPreference
android:key="@string/pref_video_port_key"
android:title="@string/pref_video_port_title"
android:defaultValue="9078"
android:defaultValue="@string/default_video_port"
android:summary="@string/pref_video_port_description"
android:layout="@layout/hidden"/>

View file

@ -258,6 +258,8 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
if (pictureUri != null) {
LinphoneUtils.setImagePictureFromUri(view.getContext(), contactPicture.getView(), Uri.parse(pictureUri), R.drawable.unknown_small);
} else {
contactPicture.setImageResource(R.drawable.unknown_small);
}
messagesScrollView.post(new Runnable() {

View file

@ -73,7 +73,9 @@ public class ContactFragment extends Fragment implements OnClickListener {
editContact = (TextView) view.findViewById(R.id.editContact);
editContact.setOnClickListener(this);
newContact = (TextView) view.findViewById(R.id.newContact);
newContact.setOnClickListener(this);
if (newContact != null) {
newContact.setOnClickListener(this);
}
return view;
}

View file

@ -219,11 +219,19 @@ public class LinphoneActivity extends FragmentActivity implements
}
private void hideStatusBar() {
if (Version.isXLargeScreen(this)) {
return;
}
findViewById(R.id.status).setVisibility(View.GONE);
findViewById(R.id.fragmentContainer).setPadding(0, 0, 0, 0);
}
private void showStatusBar() {
if (Version.isXLargeScreen(this)) {
return;
}
findViewById(R.id.status).setVisibility(View.VISIBLE);
if (statusFragment != null && !statusFragment.isVisible()) {
// Hack to ensure statusFragment is visible after coming back to
@ -526,22 +534,16 @@ public class LinphoneActivity extends FragmentActivity implements
return;
}
LinphoneAddress lAddress = LinphoneCoreFactory.instance()
.createLinphoneAddress(sipUri);
Uri uri = LinphoneUtils.findUriPictureOfContactAndSetDisplayName(
lAddress, getContentResolver());
LinphoneAddress lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
Uri uri = LinphoneUtils.findUriPictureOfContactAndSetDisplayName(lAddress, getContentResolver());
String displayName = lAddress.getDisplayName();
String pictureUri = uri == null ? null : uri.toString();
if (currentFragment == FragmentsAvailable.CHATLIST
|| currentFragment == FragmentsAvailable.CHAT) {
Fragment fragment2 = getSupportFragmentManager().findFragmentById(
R.id.fragmentContainer2);
if (fragment2 != null && fragment2.isVisible()
&& currentFragment == FragmentsAvailable.CHAT) {
if (currentFragment == FragmentsAvailable.CHATLIST || currentFragment == FragmentsAvailable.CHAT) {
Fragment fragment2 = getSupportFragmentManager().findFragmentById(R.id.fragmentContainer2);
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.CHAT) {
ChatFragment chatFragment = (ChatFragment) fragment2;
chatFragment.changeDisplayedChat(sipUri, displayName,
pictureUri);
chatFragment.changeDisplayedChat(sipUri, displayName, pictureUri);
} else {
Bundle extras = new Bundle();
extras.putString("SipUri", sipUri);
@ -1363,8 +1365,11 @@ public class LinphoneActivity extends FragmentActivity implements
return true;
}
} else {
int backStackEntryCount = getSupportFragmentManager()
.getBackStackEntryCount();
if (Version.isXLargeScreen(this)) {
return true;
}
int backStackEntryCount = getSupportFragmentManager().getBackStackEntryCount();
if (backStackEntryCount <= 1) {
showStatusBar();
}

View file

@ -648,8 +648,8 @@ public final class LinphoneManager implements LinphoneCoreListener {
private void readAndSetAudioAndVideoPorts() throws NumberFormatException {
int aPortStart, aPortEnd, vPortStart, vPortEnd;
aPortStart = aPortEnd = 7078;
vPortStart = vPortEnd = 9078;
aPortStart = aPortEnd = Integer.parseInt(getString(R.string.default_audio_port));
vPortStart = vPortEnd = Integer.parseInt(getString(R.string.default_video_port));
String audioPort = getPrefString(R.string.pref_audio_port_key, String.valueOf(aPortStart));
String videoPort = getPrefString(R.string.pref_video_port_key, String.valueOf(vPortStart));
@ -667,7 +667,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
vPortStart = Integer.parseInt(videoPort.split("-")[0]);
vPortEnd = Integer.parseInt(videoPort.split("-")[1]);
} else {
vPortStart = vPortEnd = Integer.parseInt(audioPort);
vPortStart = vPortEnd = Integer.parseInt(videoPort);
}
if (aPortStart >= aPortEnd) {