Update UI contacts/dialer/chatlist and remove old assets
This commit is contained in:
parent
8bdb269a72
commit
cabecb97b2
27 changed files with 666 additions and 206 deletions
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:drawable="@drawable/call_add" />
|
||||
</selector>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@color/button_addContactGrey" />
|
||||
<item android:drawable="@color/button_addContact"/>
|
||||
</selector>
|
|
@ -1,7 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true"
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/backspace_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/backspace_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/backspace_default" />
|
||||
</selector>
|
||||
|
|
5
res/drawable/backspace_disabled.xml
Normal file
5
res/drawable/backspace_disabled.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bitmap
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/backspace_default"
|
||||
android:alpha="0.2" />
|
|
@ -1,9 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/contact_add" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/contact_add" />
|
||||
android:drawable="@drawable/contact_add_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/contact_add" />
|
||||
</selector>
|
5
res/drawable/contact_add_disabled.xml
Normal file
5
res/drawable/contact_add_disabled.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bitmap
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/contact_add"
|
||||
android:alpha="0.2" />
|
|
@ -36,7 +36,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/add_contact" />
|
||||
android:src="@drawable/toolbar_button" />
|
||||
|
||||
<org.linphone.ui.CallButton
|
||||
android:id="@+id/Call"
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_add_contact"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/add_contact_button" />
|
||||
android:src="@drawable/contact_add" />
|
||||
|
||||
<org.linphone.ui.CallButton
|
||||
android:id="@+id/Call"
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/background"
|
||||
android:background="@color/colorH"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_above="@id/footer">
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/status" android:id="@+id/status" />
|
||||
|
||||
<include layout="@layout/setup_toolbar" android:id="@+id/toolbar" />
|
||||
<include layout="@layout/assistant_toolbar" android:id="@+id/toolbar" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/fragmentContainer"
|
|
@ -2,8 +2,7 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:paddingTop="20dp"
|
|
@ -23,11 +23,7 @@
|
|||
<TextView
|
||||
android:id="@+id/toolbar_text"
|
||||
android:text="@string/setup_title"
|
||||
android:textColor="@color/footer_select"
|
||||
android:textSize="28sp"
|
||||
android:textAllCaps="true"
|
||||
android:textStyle="bold"
|
||||
android:paddingLeft="10dp"
|
||||
style="@style/font1"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
|
@ -72,37 +72,6 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_cancel"
|
||||
android:id="@+id/clearFastChatField"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/clean_field_default"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"/>
|
||||
|
||||
<EditText
|
||||
android:textCursorDrawable="@null"
|
||||
android:id="@+id/newFastChat"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/new_fast_chat"
|
||||
android:textColor="@android:color/black"
|
||||
android:background="@drawable/resizable_cancel_button"
|
||||
android:gravity="center"
|
||||
android:layout_toLeftOf="@id/clearFastChatField"
|
||||
android:paddingRight="5dp"
|
||||
android:inputType="textEmailAddress"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/chatList"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<?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"
|
||||
android:layout_height="85dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:background="@drawable/list_selector">
|
||||
|
||||
<ImageView
|
||||
|
@ -19,19 +20,6 @@
|
|||
android:visibility="invisible"
|
||||
android:src="@drawable/list_delete" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/unreadMessages"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_toLeftOf="@id/delete"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/missed_calls_bg"
|
||||
android:adjustViewBounds="true"
|
||||
android:gravity="center"
|
||||
android:textSize="18dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/draft"
|
||||
android:visibility="gone"
|
||||
|
@ -40,41 +28,78 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/text_selected"
|
||||
android:layout_toLeftOf="@id/unreadMessages"
|
||||
android:text="@string/draft"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/draft"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sipUri"
|
||||
android:lines="1"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:fadingEdge="horizontal"
|
||||
android:singleLine="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/text_contrast"
|
||||
android:layout_marginLeft="10dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lastMessage"
|
||||
android:lines="1"
|
||||
android:ellipsize="end"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/text_contrast"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/avatar"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
android:text="09:12"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/contact_picture"
|
||||
style="@style/font2"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sipUri"
|
||||
android:lines="1"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:fadingEdge="horizontal"
|
||||
android:singleLine="true"
|
||||
style="@style/font6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/text_contrast"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/unreadMessages"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:background="@drawable/chat_list_indicator"
|
||||
style="@style/font17"
|
||||
android:gravity="center"
|
||||
android:layout_above="@+id/lastMessage"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lastMessage"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:layout_below="@id/sipUri"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/font11"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/background">
|
||||
android:background="@color/colorH">
|
||||
|
||||
<RelativeLayout
|
||||
android:background="@color/button_addContact"
|
||||
android:id="@+id/AddressBar"
|
||||
android:background="@color/colorF"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
|
@ -27,14 +27,15 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:background="@color/colorF"
|
||||
android:ellipsize="start"
|
||||
android:background="@color/transparent"
|
||||
android:inputType="phone"
|
||||
android:enabled="false"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_toLeftOf="@id/Erase"
|
||||
android:layout_centerVertical="true" />
|
||||
android:layout_centerVertical="true"
|
||||
style="@style/font5"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -46,20 +47,21 @@
|
|||
android:layout_height="60dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/addContact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/add_contact_button"
|
||||
android:focusable="true"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:adjustViewBounds="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/addContact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="center"
|
||||
android:contentDescription="@string/content_description_contacts"
|
||||
android:src="@drawable/contact_add" />
|
||||
android:src="@drawable/contact_add_button" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -72,7 +74,7 @@
|
|||
android:adjustViewBounds="true"
|
||||
android:scaleType="center"
|
||||
android:layout_weight="0.5"
|
||||
android:src="@drawable/call_alt_start" />
|
||||
android:src="@drawable/call_audio_start" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -80,8 +82,8 @@
|
|||
android:contentDescription="@string/content_description_numpad"
|
||||
android:id="@+id/Dialer"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/controls"
|
||||
android:layout_below="@id/AddressBar" />
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
android:contentDescription="@string/content_description_add_contact"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/add_contact"
|
||||
android:src="@drawable/contact_add"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
|
|
117
res/layout/incoming_alt.xml
Normal file
117
res/layout/incoming_alt.xml
Normal file
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/topLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/background">
|
||||
|
||||
<include layout="@layout/status" android:id="@+id/statusBar" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_below="@id/statusBar"
|
||||
android:background="@color/colorF">
|
||||
|
||||
<TextView
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/colorA"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/incoming"
|
||||
android:textAllCaps="true"
|
||||
android:paddingLeft="10dp"
|
||||
android:gravity="center"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:orientation="vertical"
|
||||
android:layout_above="@id/menu">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/incoming_caller_profile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="10dp"
|
||||
android:weightSum="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/incoming_picture"
|
||||
android:layout_width="259dp"
|
||||
android:layout_height="207dp"
|
||||
android:src="@drawable/avatar"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1.30"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_caller_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textAlignment="center"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="28sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/incoming_caller_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="28sp"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<org.linphone.mediastream.video.display.GL2JNIView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/videoSurface"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/accept"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/colorD"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_pause"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/call_audio_start" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/decline"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/footer_select"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_pause"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/call_hangup" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
|
@ -1,23 +0,0 @@
|
|||
<?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="75dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@color/colorE">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|left"
|
||||
android:paddingBottom="20dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="10dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_header"
|
||||
android:text="@string/incoming"
|
||||
android:textSize="26dp" />
|
||||
|
||||
</LinearLayout>
|
|
@ -38,7 +38,7 @@
|
|||
<LinearLayout
|
||||
android:id="@+id/footer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
@ -54,7 +54,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_margin="10dp"
|
||||
android:scaleType="center"
|
||||
android:contentDescription="@string/content_description_history"
|
||||
android:src="@drawable/footer_history" />
|
||||
|
||||
|
@ -91,7 +90,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="center"
|
||||
android:layout_margin="10dp"
|
||||
android:contentDescription="@string/content_description_contacts"
|
||||
android:src="@drawable/footer_contacts" />
|
||||
|
@ -120,7 +118,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="center"
|
||||
android:layout_margin="10dp"
|
||||
android:contentDescription="@string/content_description_contacts"
|
||||
android:src="@drawable/footer_dialer" />
|
||||
|
@ -146,7 +143,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="center"
|
||||
android:layout_margin="10dp"
|
||||
android:contentDescription="@string/content_description_contacts"
|
||||
android:src="@drawable/footer_chat" />
|
||||
|
||||
|
|
|
@ -1,30 +1,289 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TableRow android:layout_weight="1">
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit1" android:text="1" style="@style/DialerDigit" android:background="@drawable/numpad_one" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit2" android:text="2" style="@style/DialerDigit" android:background="@drawable/numpad_two" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit3" android:text="3" style="@style/DialerDigit" android:background="@drawable/numpad_three" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/Digit1"
|
||||
android:text="1"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_one"/>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/Digit2"
|
||||
android:text="2"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_two"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/Digit3"
|
||||
android:text="3"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_three"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow android:layout_weight="1">
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit4" android:text="4" style="@style/DialerDigit" android:background="@drawable/numpad_four" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit5" android:text="5" style="@style/DialerDigit" android:background="@drawable/numpad_five" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit6" android:text="6" style="@style/DialerDigit" android:background="@drawable/numpad_six" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/Digit4"
|
||||
android:text="4"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_four"/>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/Digit5"
|
||||
android:text="5"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_five"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/Digit6"
|
||||
android:text="6"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_six"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow android:layout_weight="1">
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit7" android:text="7" style="@style/DialerDigit" android:background="@drawable/numpad_seven" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit8" android:text="8" style="@style/DialerDigit" android:background="@drawable/numpad_eight" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit9" android:text="9" style="@style/DialerDigit" android:background="@drawable/numpad_nine" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/Digit7"
|
||||
android:text="7"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_seven"/>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/Digit8"
|
||||
android:text="8"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_eight"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/Digit9"
|
||||
android:text="9"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_nine"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow android:layout_weight="1">
|
||||
<org.linphone.ui.Digit android:id="@+id/DigitStar" android:text="*" style="@style/DialerDigit" android:background="@drawable/numpad_star" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<org.linphone.ui.Digit android:id="@+id/Digit00" android:text="0+" style="@style/DialerDigit" android:background="@drawable/numpad_zero" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<org.linphone.ui.Digit android:id="@+id/DigitHash" android:text="#" style="@style/DialerDigit" android:background="@drawable/numpad_sharp" android:soundEffectsEnabled="true" android:layout_margin="10dp"/>
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/DigitStar"
|
||||
android:text="*"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_star"/>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/Digit00"
|
||||
android:text="0"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_zero"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.linphone.ui.Digit
|
||||
android:id="@+id/DigitHash"
|
||||
android:text="#"
|
||||
style="@style/DialerDigit"
|
||||
android:background="@android:color/transparent"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/numpad_sharp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<string name="history_date_format">d MMM</string>
|
||||
<string name="history_detail_date_format">yyyy/MM/dd - HH:mm</string>
|
||||
<string name="messages_date_format">HH:mm d MMM</string>
|
||||
<string name="messages_list_date_format">dd/MM</string>
|
||||
<string name="today_date_format">HH:mm</string>
|
||||
<string name="picture_name_format">linphone-mms-%s.jpg</string>
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<style name="DialerDigit" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:textColor">@android:color/transparent</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
|
|
|
@ -5,4 +5,108 @@
|
|||
<style name="NoTitle" parent="android:Theme.Holo.Light.NoActionBar" />
|
||||
<style name="FullScreen" parent="android:Theme.Holo.Light.NoActionBar.Fullscreen" />
|
||||
|
||||
<style name="font1" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:textColor">@color/colorA</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textSize">30sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font2" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:textColor">@color/colorA</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font3" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:textColor">@color/colorA</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font4" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:textColor">@color/colorB</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textSize">28sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font5" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:textColor">@color/colorC</item>
|
||||
<item name="android:textSize">40sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font6" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:textColor">@color/colorC</item>
|
||||
<item name="android:textSize">28sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font7" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:textColor">@color/colorC</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textSize">26sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font8" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:textColor">@color/colorC</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:textSize">25sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font9" parent="@android:style/TextAppearance.Small">
|
||||
<item name="android:textColor">@color/colorC</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font10" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:textColor">@color/colorD</item>
|
||||
<item name="android:textSize">26sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font11" parent="@android:style/TextAppearance.Small">
|
||||
<item name="android:textColor">@color/colorD</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font12" parent="@android:style/TextAppearance.Small">
|
||||
<item name="android:textColor">@color/colorD</item>
|
||||
<item name="android:textSize">25sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font13" parent="@android:style/TextAppearance.Small">
|
||||
<item name="android:textColor">@color/colorD</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font14" parent="@android:style/TextAppearance.Small">
|
||||
<item name="android:textColor">@color/colorH</item>
|
||||
<item name="android:textSize">32sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font15" parent="@android:style/TextAppearance.Small">
|
||||
<item name="android:textColor">@color/colorH</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:textSize">25sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font16" parent="@android:style/TextAppearance.Small">
|
||||
<item name="android:textColor">@color/colorH</item>
|
||||
<item name="android:textSize">22sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font17" parent="@android:style/TextAppearance.Small">
|
||||
<item name="android:textColor">@color/colorH</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font18" parent="@android:style/TextAppearance.Small">
|
||||
<item name="android:textColor">@color/colorH</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
</style>
|
||||
|
||||
<style name="font19" parent="@android:style/TextAppearance.Medium">
|
||||
<item name="android:textColor">@color/colorD</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:textSize">22sp</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.linphone.core.LinphoneAddress;
|
||||
|
@ -64,9 +66,7 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
private List<String> mConversations, mDrafts;
|
||||
private ListView chatList;
|
||||
private TextView noChatHistory;
|
||||
private ImageView edit, selectAll, deselectAll, delete, newDiscussion;
|
||||
private ImageView clearFastChat;
|
||||
private EditText fastNewChat;
|
||||
private ImageView edit, selectAll, deselectAll, delete, newDiscussion, contactPicture;
|
||||
private boolean isEditMode = false;
|
||||
private boolean useLinphoneStorage;
|
||||
|
||||
|
@ -81,6 +81,7 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
registerForContextMenu(chatList);
|
||||
|
||||
noChatHistory = (TextView) view.findViewById(R.id.noChatHistory);
|
||||
|
||||
|
||||
edit = (ImageView) view.findViewById(R.id.edit);
|
||||
edit.setOnClickListener(this);
|
||||
|
@ -96,12 +97,6 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
|
||||
delete = (ImageView) view.findViewById(R.id.delete);
|
||||
delete.setOnClickListener(this);
|
||||
|
||||
clearFastChat = (ImageView) view.findViewById(R.id.clearFastChatField);
|
||||
clearFastChat.setOnClickListener(this);
|
||||
|
||||
fastNewChat = (EditText) view.findViewById(R.id.newFastChat);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -212,10 +207,10 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
if (id == R.id.clearFastChatField) {
|
||||
/*if (id == R.id.clearFastChatField) {
|
||||
fastNewChat.setText("");
|
||||
}
|
||||
else if (id == R.id.delete) {
|
||||
}*/
|
||||
if (id == R.id.delete) {
|
||||
edit.setVisibility(View.VISIBLE);
|
||||
selectAll.setVisibility(View.GONE);
|
||||
deselectAll.setVisibility(View.GONE);
|
||||
|
@ -241,7 +236,7 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
hideAndDisplayMessageIfNoChat();
|
||||
}
|
||||
else if (id == R.id.new_discussion) {
|
||||
String sipUri = fastNewChat.getText().toString();
|
||||
/*String sipUri = fastNewChat.getText().toString();
|
||||
if (sipUri.equals("")) {
|
||||
LinphoneActivity.instance().displayContacts(true);
|
||||
} else {
|
||||
|
@ -255,7 +250,7 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
sipUri = "sip:" + sipUri;
|
||||
}
|
||||
LinphoneActivity.instance().displayChat(sipUri);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -330,6 +325,38 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String timestampToHumanDate(long timestamp) {
|
||||
try {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTimeInMillis(timestamp);
|
||||
|
||||
SimpleDateFormat dateFormat;
|
||||
if (isToday(cal)) {
|
||||
dateFormat = new SimpleDateFormat(getResources().getString(R.string.today_date_format));
|
||||
} else {
|
||||
dateFormat = new SimpleDateFormat(getResources().getString(R.string.messages_list_date_format));
|
||||
}
|
||||
|
||||
return dateFormat.format(cal.getTime());
|
||||
} catch (NumberFormatException nfe) {
|
||||
return String.valueOf(timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isToday(Calendar cal) {
|
||||
return isSameDay(cal, Calendar.getInstance());
|
||||
}
|
||||
|
||||
private boolean isSameDay(Calendar cal1, Calendar cal2) {
|
||||
if (cal1 == null || cal2 == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) &&
|
||||
cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) &&
|
||||
cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR));
|
||||
}
|
||||
|
||||
class ChatListAdapter extends BaseAdapter {
|
||||
private boolean useNativeAPI;
|
||||
|
@ -380,35 +407,21 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), address);
|
||||
|
||||
String message = "";
|
||||
if (useNativeAPI) {
|
||||
LinphoneChatRoom chatRoom = LinphoneManager.getLc().getOrCreateChatRoom(contact);
|
||||
LinphoneChatMessage[] history = chatRoom.getHistory(20);
|
||||
if (history != null && history.length > 0) {
|
||||
for (int i = history.length - 1; i >= 0; i--) {
|
||||
LinphoneChatMessage msg = history[i];
|
||||
if (msg.getText() != null && msg.getText().length() > 0 && msg.getFileTransferInformation() == null) {
|
||||
message = msg.getText();
|
||||
break;
|
||||
}
|
||||
Long time = null;
|
||||
LinphoneChatRoom chatRoom = LinphoneManager.getLc().getOrCreateChatRoom(contact);
|
||||
LinphoneChatMessage[] history = chatRoom.getHistory(20);
|
||||
if (history != null && history.length > 0) {
|
||||
for (int i = history.length - 1; i >= 0; i--) {
|
||||
LinphoneChatMessage msg = history[i];
|
||||
if (msg.getText() != null && msg.getText().length() > 0 && msg.getFileTransferInformation() == null) {
|
||||
message = msg.getText();
|
||||
time = msg.getTime();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<ChatMessage> messages = LinphoneActivity.instance().getChatMessages(contact);
|
||||
if (messages != null && messages.size() > 0) {
|
||||
int iterator = messages.size() - 1;
|
||||
ChatMessage lastMessage = null;
|
||||
|
||||
while (iterator >= 0) {
|
||||
lastMessage = messages.get(iterator);
|
||||
if (lastMessage.getMessage() == null) {
|
||||
iterator--;
|
||||
} else {
|
||||
iterator = -1;
|
||||
}
|
||||
}
|
||||
message = (lastMessage == null || lastMessage.getMessage() == null) ? "" : lastMessage.getMessage();
|
||||
}
|
||||
}
|
||||
TextView date = (TextView) view.findViewById(R.id.date);
|
||||
date.setText(timestampToHumanDate(time));
|
||||
TextView lastMessageView = (TextView) view.findViewById(R.id.lastMessage);
|
||||
lastMessageView.setText(message);
|
||||
|
||||
|
|
|
@ -41,11 +41,10 @@ import android.widget.RelativeLayout;
|
|||
public class DialerFragment extends Fragment {
|
||||
private static DialerFragment instance;
|
||||
private static boolean isCallTransferOngoing = false;
|
||||
|
||||
public boolean mVisible;
|
||||
|
||||
private AddressText mAddress;
|
||||
private CallButton mCall;
|
||||
private RelativeLayout mAddContact;
|
||||
private ImageView mAddContact;
|
||||
private OnClickListener addContactListener, cancelListener, transferListener;
|
||||
private boolean shouldEmptyAddressField = true;
|
||||
|
||||
|
@ -67,7 +66,7 @@ public class DialerFragment extends Fragment {
|
|||
if (isCallTransferOngoing) {
|
||||
mCall.setImageResource(R.drawable.call_transfer);
|
||||
} else {
|
||||
mCall.setImageResource(R.drawable.add_call);
|
||||
mCall.setImageResource(R.drawable.call_add);
|
||||
}
|
||||
} else {
|
||||
mCall.setImageResource(R.drawable.call_audio_start);
|
||||
|
@ -78,7 +77,7 @@ public class DialerFragment extends Fragment {
|
|||
numpad.setAddressWidget(mAddress);
|
||||
}
|
||||
|
||||
mAddContact = (RelativeLayout) view.findViewById(R.id.addContact);
|
||||
mAddContact = (ImageView) view.findViewById(R.id.addContact);
|
||||
|
||||
addContactListener = new OnClickListener() {
|
||||
@Override
|
||||
|
@ -162,7 +161,7 @@ public class DialerFragment extends Fragment {
|
|||
mCall.setImageResource(R.drawable.call_transfer);
|
||||
mCall.setExternalClickListener(transferListener);
|
||||
} else {
|
||||
mCall.setImageResource(R.drawable.add_call);
|
||||
mCall.setImageResource(R.drawable.call_add);
|
||||
mCall.resetClickListener();
|
||||
}
|
||||
mAddContact.setEnabled(true);
|
||||
|
@ -170,7 +169,6 @@ public class DialerFragment extends Fragment {
|
|||
mAddContact.setOnClickListener(cancelListener);
|
||||
} else {
|
||||
mCall.setImageResource(R.drawable.call_audio_start);
|
||||
//mCall.setAlpha(30);
|
||||
mAddContact.setEnabled(true);
|
||||
//mAddContact.setImageResource(R.drawable.add_contact_button);
|
||||
mAddContact.setOnClickListener(addContactListener);
|
||||
|
@ -179,7 +177,7 @@ public class DialerFragment extends Fragment {
|
|||
}
|
||||
|
||||
public void enableDisableAddContact() {
|
||||
mAddContact.setEnabled(LinphoneManager.getLc().getCallsNb() > 0 || !mAddress.getText().toString().equals(""));
|
||||
mAddContact.setEnabled(LinphoneManager.getLc().getCallsNb() > 0 || !mAddress.getText().toString().equals(""));
|
||||
}
|
||||
|
||||
public void displayTextInAddressBar(String numberOrSipAddress) {
|
||||
|
|
|
@ -347,6 +347,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
displaySettings();
|
||||
break;
|
||||
case 2:
|
||||
displayAssistant();
|
||||
break;
|
||||
case 3:
|
||||
displayAbout();
|
||||
|
@ -728,9 +729,13 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
//settings.setSelected(true);
|
||||
}
|
||||
|
||||
public void displayAssistant() {
|
||||
startActivity(new Intent(LinphoneActivity.this, SetupActivity.class));
|
||||
}
|
||||
|
||||
public boolean displayChatMessageNotification(String address){
|
||||
if(chatFragment != null) {
|
||||
if(chatFragment.getSipUri().equals(address)){
|
||||
if(chatFragment.getSipUri().equals(address)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import android.view.View;
|
|||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
|
@ -36,7 +36,7 @@ public class MenuFragment extends Fragment implements OnClickListener {
|
|||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.setup_menu, container, false);
|
||||
View view = inflater.inflate(R.layout.assistant_menu, container, false);
|
||||
|
||||
createAccount = (Button) view.findViewById(R.id.setup_create_account);
|
||||
createAccount.setOnClickListener(this);
|
||||
|
|
|
@ -63,7 +63,7 @@ public class SetupActivity extends Activity implements OnClickListener {
|
|||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
}
|
||||
|
||||
setContentView(R.layout.setup);
|
||||
setContentView(R.layout.assistant);
|
||||
firstFragment = getResources().getBoolean(R.bool.setup_use_linphone_as_first_fragment) ?
|
||||
SetupFragmentsEnum.LINPHONE_LOGIN : SetupFragmentsEnum.MENU;
|
||||
if (findViewById(R.id.fragmentContainer) != null) {
|
||||
|
|
Loading…
Reference in a new issue