Some improvements for tablets

This commit is contained in:
Sylvain Berfini 2012-08-27 12:32:57 +02:00
parent 6438e7251b
commit f597d81225
7 changed files with 228 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 B

After

Width:  |  Height:  |  Size: 596 B

View file

@ -8,7 +8,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_gravity="center">
<!-- focusable/focusableInTouchMode are set to true to prevent the keyboard to be displayed automatically -->
<org.linphone.ui.AddressText
android:id="@+id/Adress"

View file

@ -4,16 +4,71 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- Hack to adjust perfectly on every screen the bottom of the fragment with the curved menu -->
<LinearLayout
android:id="@+id/mark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/mark"
android:visibility="invisible" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/mark"
android:visibility="invisible" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:adjustViewBounds="true"
android:scaleType="fitEnd"
android:src="@drawable/dialer"
android:visibility="invisible" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/mark"
android:visibility="invisible" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/mark"
android:visibility="invisible" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/mark"
android:layout_alignParentTop="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingBottom="70dp"
android:paddingTop="20dp">
<LinearLayout
@ -127,6 +182,7 @@
android:textSize="20dp"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View file

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Hack to adjust perfectly on every screen the bottom of the fragment with the curved menu -->
<LinearLayout
android:id="@+id/mark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/mark"
android:visibility="invisible" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/mark"
android:visibility="invisible" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:adjustViewBounds="true"
android:scaleType="fitEnd"
android:src="@drawable/dialer"
android:visibility="invisible" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/mark"
android:visibility="invisible" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/mark"
android:visibility="invisible" />
</LinearLayout>
<ListView
android:id="@android:id/list"
android:listSelector="@drawable/list_selector"
android:cacheColorHint="@color/transparent"
android:layout_above="@id/mark"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2" >
<ImageView
android:id="@+id/history"
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/missedCalls"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/missed_calls_bg"
android:gravity="center"
android:textSize="20dp"
android:visibility="gone" />
</RelativeLayout>
<ImageView
android:id="@+id/contacts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_contacts"
android:scaleType="fitXY"
android:src="@drawable/contacts" />
<ImageView
android:id="@+id/dialer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_dialer"
android:scaleType="fitEnd"
android:src="@drawable/dialer" />
<ImageView
android:id="@+id/settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_settings"
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:id="@+id/chat"
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/missedChats"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/missed_calls_bg"
android:gravity="center"
android:textSize="20dp"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View file

@ -51,12 +51,12 @@ public class DialerFragment extends Fragment {
Bundle savedInstanceState) {
instance = this;
View view = inflater.inflate(R.layout.dialer, container, false);
mAddress = (AddressText) view.findViewById(R.id.Adress);
mAddress.setDialerFragment(this);
EraseButton erase = (EraseButton) view.findViewById(R.id.Erase);
erase.setAddressWidget(mAddress);
erase.requestFocus();
mCall = (CallButton) view.findViewById(R.id.Call);
mCall.setAddressWidget(mAddress);
@ -71,8 +71,9 @@ public class DialerFragment extends Fragment {
}
AddressAware numpad = (AddressAware) view.findViewById(R.id.Dialer);
if (numpad != null)
if (numpad != null) {
numpad.setAddressWidget(mAddress);
}
mAddContact = (ImageView) view.findViewById(R.id.addContact);

View file

@ -124,7 +124,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
}
setContentView(R.layout.main);
instance = this;
instance = this;
initButtons();
currentFragment = FragmentsAvailable.DIALER;
@ -171,6 +171,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
changeCurrentFragment(newFragmentType, extras, false);
}
@SuppressWarnings("incomplete-switch")
private void changeCurrentFragment(FragmentsAvailable newFragmentType, Bundle extras, boolean withoutAnimation) {
if (newFragmentType == currentFragment && newFragmentType != FragmentsAvailable.CHAT) {
return;
@ -438,6 +439,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
chat.setSelected(false);
}
@SuppressWarnings("incomplete-switch")
public void selectMenu(FragmentsAvailable menuToSelect) {
currentFragment = menuToSelect;
resetSelection();

View file

@ -603,6 +603,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
} else {
FileInputStream fis = new FileInputStream(uriString);
mRingerPlayer.setDataSource(fis.getFD());
fis.close();
}
} catch (IOException e) {
Log.e(e, "Cannot set ringtone");