Skip to content
Snippets Groups Projects
Commit 573045c9 authored by Alexandre Lision's avatar Alexandre Lision
Browse files

* #29924: ui adjustements

parent c51ccb1a
Branches
Tags
No related merge requests found
...@@ -51,10 +51,11 @@ as that of the covered work. ...@@ -51,10 +51,11 @@ as that of the covered work.
<TextView <TextView
android:id="@+id/empty_list_contact" android:id="@+id/empty_list_contact"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center" android:gravity="center"
android:text="No data" /> android:textSize="40sp"
android:text="No contact found" />
<!-- <TextView --> <!-- <TextView -->
<!-- android:id="@+id/empty_list_starred" --> <!-- android:id="@+id/empty_list_starred" -->
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
android:id="@+id/textField" android:id="@+id/textField"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" /> android:layout_alignParentTop="true"
android:background="@drawable/item_call_selector" />
<LinearLayout <LinearLayout
android:id="@+id/keyboard_choice" android:id="@+id/keyboard_choice"
...@@ -28,7 +29,6 @@ ...@@ -28,7 +29,6 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="123" /> android:text="123" />
<Button <Button
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="ABC" /> android:text="ABC" />
</LinearLayout> </LinearLayout>
<ImageButton <ImageButton
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout 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:background="@color/lighter_gray" android:background="@color/lighter_gray"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="8dp" android:paddingLeft="8dp"
...@@ -12,7 +13,7 @@ ...@@ -12,7 +13,7 @@
style="@style/CallElementList" style="@style/CallElementList"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:drawSelectorOnTop="false" /> android:layout_margin="10dp" />
<TextView <TextView
android:id="@id/android:empty" android:id="@id/android:empty"
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center" android:gravity="center"
android:text="No history" /> android:text="No history"
android:textSize="30sp" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -34,17 +34,23 @@ as that of the covered work. ...@@ -34,17 +34,23 @@ as that of the covered work.
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/lighter_gray" android:background="@color/lighter_gray"
android:orientation="vertical"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="8dp" > android:paddingRight="8dp" >
<RelativeLayout
android:id="@+id/calls_layouts"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_alignParentTop="true"
android:layout_margin="10dp"
android:background="@drawable/item_call_selector" >
<LinearLayout <LinearLayout
android:id="@+id/linear1" android:id="@+id/linear1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@+id/linear2"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:orientation="horizontal" android:layout_alignParentTop="true"
android:weightSum="4" > android:weightSum="4" >
<TextView <TextView
...@@ -65,13 +71,29 @@ as that of the covered work. ...@@ -65,13 +71,29 @@ as that of the covered work.
android:textSize="30sp" /> android:textSize="30sp" />
</LinearLayout> </LinearLayout>
<ListView
android:id="@+id/calls_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/linear1" >
</ListView>
</RelativeLayout>
<RelativeLayout
android:id="@+id/confs_layouts"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="@+id/calls_layouts"
android:layout_margin="10dp"
android:background="@drawable/item_call_selector" >
<LinearLayout <LinearLayout
android:id="@+id/linear2" android:id="@+id/linear2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_centerInParent="true" android:layout_alignParentTop="true"
android:orientation="horizontal"
android:weightSum="4" > android:weightSum="4" >
<TextView <TextView
...@@ -92,13 +114,21 @@ as that of the covered work. ...@@ -92,13 +114,21 @@ as that of the covered work.
android:textSize="30sp" /> android:textSize="30sp" />
</LinearLayout> </LinearLayout>
<ListView
android:id="@+id/confs_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/linear2" >
</ListView>
</RelativeLayout>
<Button <Button
android:id="@+id/access_callactivity" android:id="@+id/access_callactivity"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_below="@+id/confs_layouts"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="134dp"
android:text="Go to current calls" android:text="Go to current calls"
android:visibility="gone" /> android:visibility="gone" />
......
...@@ -179,6 +179,7 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener ...@@ -179,6 +179,7 @@ public class ContactListFragment extends Fragment implements OnQueryTextListener
}); });
list.setOnItemLongClickListener(mItemLongClickListener); list.setOnItemLongClickListener(mItemLongClickListener);
list.setEmptyView(inflatedView.findViewById(R.id.empty_list_contact));
View header = inflater.inflate(R.layout.frag_contact_list_header, null); View header = inflater.inflate(R.layout.frag_contact_list_header, null);
list.addHeaderView(header, null, false); list.addHeaderView(header, null, false);
TACGridView grid = (TACGridView) header.findViewById(R.id.favorites_grid); TACGridView grid = (TACGridView) header.findViewById(R.id.favorites_grid);
......
...@@ -44,6 +44,7 @@ import android.view.View; ...@@ -44,6 +44,7 @@ import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
...@@ -58,6 +59,7 @@ public class HomeFragment extends Fragment { ...@@ -58,6 +59,7 @@ public class HomeFragment extends Fragment {
private Callbacks mCallbacks = sDummyCallbacks; private Callbacks mCallbacks = sDummyCallbacks;
Button access_calls; Button access_calls;
TextView nb_calls, nb_confs; 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. * A dummy implementation of the {@link Callbacks} interface that does nothing. Used only when this fragment is not attached to an activity.
...@@ -106,9 +108,9 @@ public class HomeFragment extends Fragment { ...@@ -106,9 +108,9 @@ public class HomeFragment extends Fragment {
try { try {
HashMap<String, SipCall> calls = (HashMap<String, SipCall>) mCallbacks.getService().getCallList(); HashMap<String, SipCall> calls = (HashMap<String, SipCall>) mCallbacks.getService().getCallList();
HashMap<String, Conference> confs = (HashMap<String, Conference>) mCallbacks.getService().getConferenceList(); HashMap<String, Conference> confs = (HashMap<String, Conference>) mCallbacks.getService().getConferenceList();
Log.i(TAG, "Call size " + calls.size());
nb_calls.setText(""+calls.size()); updateCallList(calls);
nb_confs.setText(""+confs.size()); updateConferenceList(confs);
if(!calls.isEmpty() || !confs.isEmpty()){ if(!calls.isEmpty() || !confs.isEmpty()){
access_calls.setVisibility(View.VISIBLE); access_calls.setVisibility(View.VISIBLE);
...@@ -124,6 +126,15 @@ public class HomeFragment extends Fragment { ...@@ -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 @Override
public void onDetach() { public void onDetach() {
super.onDetach(); super.onDetach();
...@@ -165,6 +176,9 @@ public class HomeFragment extends Fragment { ...@@ -165,6 +176,9 @@ public class HomeFragment extends Fragment {
nb_calls = (TextView) inflatedView.findViewById(R.id.calls_counter); nb_calls = (TextView) inflatedView.findViewById(R.id.calls_counter);
nb_confs = (TextView) inflatedView.findViewById(R.id.confs_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() { access_calls.setOnClickListener(new OnClickListener() {
@Override @Override
......
...@@ -6,6 +6,7 @@ import android.text.TextWatcher; ...@@ -6,6 +6,7 @@ import android.text.TextWatcher;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
...@@ -37,7 +38,8 @@ public class ClearableEditText extends RelativeLayout { ...@@ -37,7 +38,8 @@ public class ClearableEditText extends RelativeLayout {
inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.clearable_edit_text, this, true); inflater.inflate(R.layout.clearable_edit_text, this, true);
edit_text = (EditText) findViewById(R.id.clearable_edit); 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 = (Button) findViewById(R.id.clearable_button_clear);
btn_clear.setVisibility(RelativeLayout.INVISIBLE); btn_clear.setVisibility(RelativeLayout.INVISIBLE);
clearText(); clearText();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment