diff --git a/res/layout/frag_contact_list.xml b/res/layout/frag_contact_list.xml index 8193cde485304be4eabb81445570a0769476dcb4..7c1d1f4a150374626dd98eec41966c5f01e75c96 100644 --- a/res/layout/frag_contact_list.xml +++ b/res/layout/frag_contact_list.xml @@ -51,10 +51,11 @@ as that of the covered work. <TextView android:id="@+id/empty_list_contact" android:layout_width="match_parent" - android:layout_height="40dp" + android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center" - android:text="No data" /> + android:textSize="40sp" + android:text="No contact found" /> <!-- <TextView --> <!-- android:id="@+id/empty_list_starred" --> diff --git a/res/layout/frag_dialing.xml b/res/layout/frag_dialing.xml index 9bda4089ec8e40ffc97207eb9d8a189aab68be0b..4f5b9c58d7b2d38dfaddeda0801b98ac573c56bc 100644 --- a/res/layout/frag_dialing.xml +++ b/res/layout/frag_dialing.xml @@ -10,7 +10,8 @@ android:id="@+id/textField" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_alignParentTop="true" /> + android:layout_alignParentTop="true" + android:background="@drawable/item_call_selector" /> <LinearLayout android:id="@+id/keyboard_choice" @@ -28,7 +29,6 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" - android:text="123" /> <Button @@ -37,8 +37,6 @@ android:layout_height="match_parent" android:layout_weight="1" android:text="ABC" /> - - </LinearLayout> <ImageButton diff --git a/res/layout/frag_history.xml b/res/layout/frag_history.xml index fd39a03d92bc97871637b913341e87be56f64a0e..52598c8366d4fedd36e2c8f29a2b92d80fde7361 100644 --- a/res/layout/frag_history.xml +++ b/res/layout/frag_history.xml @@ -2,6 +2,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="@color/lighter_gray" android:orientation="vertical" android:paddingLeft="8dp" @@ -12,7 +13,7 @@ style="@style/CallElementList" android:layout_width="match_parent" android:layout_height="match_parent" - android:drawSelectorOnTop="false" /> + android:layout_margin="10dp" /> <TextView android:id="@id/android:empty" @@ -20,6 +21,7 @@ android:layout_height="match_parent" android:layout_gravity="center" android:gravity="center" - android:text="No history" /> + android:text="No history" + android:textSize="30sp" /> </LinearLayout> \ No newline at end of file diff --git a/res/layout/frag_home.xml b/res/layout/frag_home.xml index ab471c5a04cfe341b0fc621d6c0b9ba5e17faeaa..77086343808d99e6db184cf24bdf1f2a559889f0 100644 --- a/res/layout/frag_home.xml +++ b/res/layout/frag_home.xml @@ -34,71 +34,101 @@ as that of the covered work. android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/lighter_gray" - android:orientation="vertical" android:paddingLeft="8dp" android:paddingRight="8dp" > - <LinearLayout - android:id="@+id/linear1" + <RelativeLayout + android:id="@+id/calls_layouts" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_above="@+id/linear2" - android:layout_alignParentLeft="true" - android:orientation="horizontal" - android:weightSum="4" > + android:layout_height="100dp" + android:layout_alignParentTop="true" + android:layout_margin="10dp" + android:background="@drawable/item_call_selector" > - <TextView - android:id="@+id/calls_counter" - android:layout_width="0dp" + <LinearLayout + android:id="@+id/linear1" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:text="0" - android:textSize="40sp" /> + android:layout_alignParentLeft="true" + android:layout_alignParentTop="true" + android:weightSum="4" > + + <TextView + android:id="@+id/calls_counter" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:gravity="center" + android:text="0" + android:textSize="40sp" /> + + <TextView + android:id="@+id/textView2" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="3" + android:text="Calls" + android:textSize="30sp" /> + </LinearLayout> - <TextView - android:id="@+id/textView2" - android:layout_width="0dp" + <ListView + android:id="@+id/calls_list" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="3" - android:text="Calls" - android:textSize="30sp" /> - </LinearLayout> + android:layout_alignParentBottom="true" + android:layout_below="@+id/linear1" > + </ListView> + </RelativeLayout> - <LinearLayout - android:id="@+id/linear2" + <RelativeLayout + android:id="@+id/confs_layouts" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_centerInParent="true" - android:orientation="horizontal" - android:weightSum="4" > + android:layout_height="100dp" + android:layout_below="@+id/calls_layouts" + android:layout_margin="10dp" + android:background="@drawable/item_call_selector" > - <TextView - android:id="@+id/confs_counter" - android:layout_width="0dp" + <LinearLayout + android:id="@+id/linear2" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:text="0" - android:textSize="40sp" /> + android:layout_alignParentLeft="true" + android:layout_alignParentTop="true" + android:weightSum="4" > + + <TextView + android:id="@+id/confs_counter" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:gravity="center" + android:text="0" + android:textSize="40sp" /> + + <TextView + android:id="@+id/textView4" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="3" + android:text="Conferences" + android:textSize="30sp" /> + </LinearLayout> - <TextView - android:id="@+id/textView4" - android:layout_width="0dp" + <ListView + android:id="@+id/confs_list" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="3" - android:text="Conferences" - android:textSize="30sp" /> - </LinearLayout> + android:layout_alignParentBottom="true" + android:layout_below="@+id/linear2" > + </ListView> + </RelativeLayout> <Button android:id="@+id/access_callactivity" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentBottom="true" + android:layout_below="@+id/confs_layouts" android:layout_centerHorizontal="true" - android:layout_marginBottom="134dp" android:text="Go to current calls" android:visibility="gone" /> diff --git a/src/com/savoirfairelinux/sflphone/fragments/ContactListFragment.java b/src/com/savoirfairelinux/sflphone/fragments/ContactListFragment.java index 360d2ca3d4dc73cf33fc82116c5a94117e01d0e6..0fffad6d65fc9bae64eee5fb7ca49bab507e497a 100644 --- a/src/com/savoirfairelinux/sflphone/fragments/ContactListFragment.java +++ b/src/com/savoirfairelinux/sflphone/fragments/ContactListFragment.java @@ -179,6 +179,7 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener }); list.setOnItemLongClickListener(mItemLongClickListener); + list.setEmptyView(inflatedView.findViewById(R.id.empty_list_contact)); View header = inflater.inflate(R.layout.frag_contact_list_header, null); list.addHeaderView(header, null, false); TACGridView grid = (TACGridView) header.findViewById(R.id.favorites_grid); diff --git a/src/com/savoirfairelinux/sflphone/fragments/HomeFragment.java b/src/com/savoirfairelinux/sflphone/fragments/HomeFragment.java index 77282e57bab72be1fbe9c9e976006bba3550a6e1..888a92f5ff9844ee59e539a2fd7d7775bdd6b4ed 100644 --- a/src/com/savoirfairelinux/sflphone/fragments/HomeFragment.java +++ b/src/com/savoirfairelinux/sflphone/fragments/HomeFragment.java @@ -44,6 +44,7 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.Button; +import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; @@ -58,6 +59,7 @@ public class HomeFragment extends Fragment { private Callbacks mCallbacks = sDummyCallbacks; Button access_calls; TextView nb_calls, nb_confs; + ListView list_calls, list_confs; /** * A dummy implementation of the {@link Callbacks} interface that does nothing. Used only when this fragment is not attached to an activity. @@ -106,10 +108,10 @@ public class HomeFragment extends Fragment { try { HashMap<String, SipCall> calls = (HashMap<String, SipCall>) mCallbacks.getService().getCallList(); HashMap<String, Conference> confs = (HashMap<String, Conference>) mCallbacks.getService().getConferenceList(); - Log.i(TAG, "Call size " + calls.size()); - nb_calls.setText(""+calls.size()); - nb_confs.setText(""+confs.size()); - + + updateCallList(calls); + updateConferenceList(confs); + if(!calls.isEmpty() || !confs.isEmpty()){ access_calls.setVisibility(View.VISIBLE); } else { @@ -124,6 +126,15 @@ public class HomeFragment extends Fragment { } + private void updateConferenceList(HashMap<String, Conference> confs) { + nb_confs.setText(""+confs.size()); + } + + private void updateCallList(HashMap<String, SipCall> calls) { + nb_calls.setText(""+calls.size()); + + } + @Override public void onDetach() { super.onDetach(); @@ -165,6 +176,9 @@ public class HomeFragment extends Fragment { nb_calls = (TextView) inflatedView.findViewById(R.id.calls_counter); nb_confs = (TextView) inflatedView.findViewById(R.id.confs_counter); + list_calls = (ListView) inflatedView.findViewById(R.id.calls_list); + list_confs = (ListView) inflatedView.findViewById(R.id.confs_list); + access_calls.setOnClickListener(new OnClickListener() { @Override diff --git a/src/com/savoirfairelinux/sflphone/views/ClearableEditText.java b/src/com/savoirfairelinux/sflphone/views/ClearableEditText.java index ff1efdb11ccf245997e5aeab6528e9beb1ee453e..652a9205abaca5a951a3c276ef009e8f3d09b795 100644 --- a/src/com/savoirfairelinux/sflphone/views/ClearableEditText.java +++ b/src/com/savoirfairelinux/sflphone/views/ClearableEditText.java @@ -6,6 +6,7 @@ import android.text.TextWatcher; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; +import android.view.inputmethod.EditorInfo; import android.widget.Button; import android.widget.EditText; import android.widget.RelativeLayout; @@ -37,7 +38,8 @@ public class ClearableEditText extends RelativeLayout { inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.clearable_edit_text, this, true); edit_text = (EditText) findViewById(R.id.clearable_edit); - + edit_text.setSingleLine(); + edit_text.setImeOptions(EditorInfo.IME_ACTION_DONE); btn_clear = (Button) findViewById(R.id.clearable_button_clear); btn_clear.setVisibility(RelativeLayout.INVISIBLE); clearText();