Update assets
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 669 B After Width: | Height: | Size: 669 B |
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
|
@ -1,7 +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="@drawable/button_alert_background_over" />
|
||||
<item
|
||||
android:drawable="@drawable/button_alert_background_default" />
|
||||
</selector>
|
|
@ -1,7 +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="@drawable/button_background_over" />
|
||||
<item
|
||||
android:drawable="@drawable/button_background_default" />
|
||||
</selector>
|
|
@ -1,7 +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="@drawable/call_answer_over" />
|
||||
<item
|
||||
android:drawable="@drawable/call_answer_default" />
|
||||
</selector>
|
|
@ -1,8 +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="@drawable/chat_back_over" />
|
||||
<item
|
||||
android:drawable="@drawable/chat_back_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/chat_edit_over" />
|
||||
<item
|
||||
android:drawable="@drawable/chat_edit_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/chat_new_over" />
|
||||
<item
|
||||
android:drawable="@drawable/chat_new_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/chat_ok_over" />
|
||||
<item
|
||||
android:drawable="@drawable/chat_ok_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/chat_stop_upload_over" />
|
||||
<item
|
||||
android:drawable="@drawable/chat_stop_upload_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/contact_add_over" />
|
||||
<item
|
||||
android:drawable="@drawable/contact_add_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/contact_cancel_over" />
|
||||
<item
|
||||
android:drawable="@drawable/contact_cancel_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/contact_delete_over" />
|
||||
<item
|
||||
android:drawable="@drawable/contact_delete_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/contact_edit_over" />
|
||||
<item
|
||||
android:drawable="@drawable/contact_edit_default" />
|
||||
</selector>
|
||||
|
|
@ -1,10 +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="@drawable/contact_ok_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/contact_ok_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/contact_ok_default" />
|
||||
</selector>
|
||||
|
|
@ -1,9 +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="@drawable/contacts_add_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/contacts_add_over" />
|
||||
<item
|
||||
android:drawable="@drawable/contacts_add_default" />
|
||||
</selector>
|
|
@ -1,8 +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="@drawable/history_delete_over" />
|
||||
<item
|
||||
android:drawable="@drawable/history_delete_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/history_edit_over" />
|
||||
<item
|
||||
android:drawable="@drawable/history_edit_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/history_ok_over" />
|
||||
<item
|
||||
android:drawable="@drawable/history_ok_default" />
|
||||
</selector>
|
||||
|
|
@ -1,7 +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="@drawable/list_add_over" />
|
||||
<item
|
||||
android:drawable="@drawable/list_add_default" />
|
||||
</selector>
|
|
@ -1,8 +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="@drawable/ok_over" />
|
||||
<item
|
||||
android:drawable="@drawable/ok_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/play_over" />
|
||||
<item
|
||||
android:drawable="@drawable/play_default" />
|
||||
</selector>
|
||||
|
|
@ -1,8 +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="@drawable/call_state_delete_over" />
|
||||
<item
|
||||
android:drawable="@drawable/call_state_delete_default" />
|
||||
</selector>
|
||||
|
|
@ -1,9 +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="@drawable/routes_bluetooth_off_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/routes_bluetooth_off_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/routes_bluetooth_off_default" />
|
||||
</selector>
|
|
@ -1,9 +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="@drawable/routes_bluetooth_on_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/routes_bluetooth_on_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/routes_bluetooth_on_default" />
|
||||
</selector>
|
|
@ -1,9 +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="@drawable/routes_phone_off_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/routes_phone_off_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/routes_phone_off_default" />
|
||||
</selector>
|
|
@ -1,9 +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="@drawable/routes_phone_on_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/routes_phone_on_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/routes_phone_on_default" />
|
||||
</selector>
|
|
@ -1,9 +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="@drawable/routes_speaker_off_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/routes_speaker_off_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/routes_speaker_off_default" />
|
||||
</selector>
|
|
@ -1,9 +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="@drawable/routes_speaker_on_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/routes_speaker_on_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/routes_speaker_on_default" />
|
||||
</selector>
|
|
@ -1,12 +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="@drawable/routes_over" />
|
||||
<item android:state_selected="true"
|
||||
android:drawable="@drawable/routes_selected" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/routes_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/routes_default" />
|
||||
</selector>
|
||||
|
9
res/drawable/toolbar_button.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?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/footer_select" />
|
||||
<item android:state_selected="true"
|
||||
android:drawable="@color/footer_button" />
|
||||
<item
|
||||
android:drawable="@color/footer_button" />
|
||||
</selector>
|
|
@ -1,9 +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="@drawable/transfer_call_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/transfer_call_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/transfer_call_default" />
|
||||
</selector>
|
|
@ -1,172 +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="match_parent"
|
||||
android:background="@drawable/background"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
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" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contactName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/text_contrast" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contactAddress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/text_contrast" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/logRow"
|
||||
android:paddingTop="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/callDirection"
|
||||
android:paddingLeft="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@color/text_contrast" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
android:paddingRight="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@color/text_contrast" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_toLeftOf="@id/date"
|
||||
android:layout_toRightOf="@id/callDirection"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@color/text_contrast" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="20dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/callBackRow"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_dial_back"
|
||||
android:id="@+id/dialBack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/button"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/call"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/chatRow"
|
||||
android:layout_below="@id/callBackRow"
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_chat"
|
||||
android:id="@+id/chat"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/button"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/chat"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/addContactRow"
|
||||
android:layout_below="@id/chatRow"
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_add_contact"
|
||||
android:id="@+id/addToContacts"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/button"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/add_to_contacts"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,264 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/topLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res/org.linphone">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentTop="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/fragmentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/calls"
|
||||
android:paddingTop="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/status"
|
||||
android:name="org.linphone.StatusFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout="@layout/status" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/switchCamera"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_switch_camera"
|
||||
android:layout_marginTop="20dp"
|
||||
android:visibility="invisible"
|
||||
android:src="@drawable/switch_camera" />
|
||||
|
||||
<org.linphone.ui.Numpad
|
||||
android:id="@+id/numpad"
|
||||
android:background="@drawable/dialer_alt_background"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:gravity="right"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right|bottom"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right|bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/routeBluetooth"
|
||||
android:visibility="invisible"
|
||||
android:background="@drawable/route_bluetooth_off"
|
||||
android:text="@string/button_bluetooth"
|
||||
android:gravity="center"
|
||||
android:paddingTop="40dp"
|
||||
android:textColor="@drawable/text_incall_button_color"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/routeReceiver"
|
||||
android:visibility="invisible"
|
||||
android:background="@drawable/route_receiver_off"
|
||||
android:text="@string/button_receiver"
|
||||
android:gravity="center"
|
||||
android:paddingTop="40dp"
|
||||
android:textColor="@drawable/text_incall_button_color"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/routeSpeaker"
|
||||
android:visibility="invisible"
|
||||
android:background="@drawable/route_speaker_off"
|
||||
android:text="@string/button_speaker"
|
||||
android:gravity="center"
|
||||
android:paddingTop="40dp"
|
||||
android:textColor="@drawable/text_incall_button_color"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right|bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transfer"
|
||||
android:background="@drawable/options_transfer"
|
||||
android:text="@string/button_transfer"
|
||||
android:gravity="center"
|
||||
android:paddingTop="40dp"
|
||||
android:visibility="invisible"
|
||||
android:textColor="@drawable/text_incall_button_color"
|
||||
android:layout_width="wrap_content"
|
||||
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="40dp"
|
||||
android:textColor="@drawable/text_incall_button_color"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/video"
|
||||
android:background="@drawable/video_off"
|
||||
android:text="@string/button_video"
|
||||
android:gravity="center"
|
||||
android:paddingTop="45dp"
|
||||
android:textColor="@drawable/text_incall_button_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/videoInProgress"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/micro"
|
||||
android:background="@drawable/micro_on"
|
||||
android:text="@string/button_micro"
|
||||
android:gravity="center"
|
||||
android:paddingTop="45dp"
|
||||
android:textColor="@drawable/text_incall_button_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/speaker"
|
||||
android:background="@drawable/speaker_off"
|
||||
android:text="@string/button_speaker"
|
||||
android:gravity="center"
|
||||
android:paddingTop="45dp"
|
||||
android:textColor="@drawable/text_incall_button_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/audioRoute"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/routes"
|
||||
android:text="@string/button_route"
|
||||
android:gravity="center"
|
||||
android:paddingTop="45dp"
|
||||
android:textColor="@drawable/text_incall_button_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/options"
|
||||
android:background="@drawable/options"
|
||||
android:text="@string/button_options"
|
||||
android:gravity="center"
|
||||
android:paddingTop="45dp"
|
||||
android:textColor="@drawable/text_incall_button_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/black"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pause"
|
||||
android:contentDescription="@string/content_description_pause"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/pause_off" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conference"
|
||||
android:contentDescription="@string/content_description_conference"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/conference" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hangUp"
|
||||
android:contentDescription="@string/content_description_hang_up"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.97"
|
||||
android:background="@drawable/hangup" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialer"
|
||||
android:contentDescription="@string/content_description_dialer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/dialer_alt" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
|
@ -1,82 +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="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_delete"
|
||||
android:id="@+id/deleteContact"
|
||||
android:background="@drawable/contact_delete"
|
||||
android:text="@string/delete_contact"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20dp"
|
||||
android:textColor="@drawable/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_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"/>
|
||||
|
||||
</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="@color/text_contrast" />
|
||||
|
||||
</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>
|
|
@ -1,29 +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="wrap_content"
|
||||
android:layout_height="75dp"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/avatar_shadow_left" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/picture"
|
||||
android:layout_width="75dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:scaleType="fitEnd"
|
||||
android:src="@drawable/unknown_small" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/avatar_shadow_right" />
|
||||
|
||||
</LinearLayout>
|
|
@ -1,75 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_selector"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/separator"
|
||||
android:paddingLeft="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/numpad_background_top"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_call_direction"
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_weight="0.9"
|
||||
android:src="@drawable/call_status_incoming"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sipUri"
|
||||
android:lines="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:fadingEdge="horizontal"
|
||||
android:singleLine="true"
|
||||
android:layout_weight="0.2"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/text_contrast"
|
||||
android:layout_marginLeft="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.9"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_detail"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:src="@drawable/list_detail" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.9"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_delete"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:src="@drawable/list_delete"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,120 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
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"
|
||||
android:background="@drawable/toolsbar_background">
|
||||
|
||||
<TextView
|
||||
android:contentDescription="@string/content_description_delete"
|
||||
android:id="@+id/deleteAll"
|
||||
android:background="@drawable/history_delete"
|
||||
android:text="@string/button_delete_all"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20dp"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@drawable/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_all_calls"
|
||||
android:id="@+id/allCalls"
|
||||
android:background="@drawable/history_all"
|
||||
android:text="@string/button_all_call"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20dp"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@drawable/text_switch_button_color"
|
||||
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_missed_calls"
|
||||
android:id="@+id/missedCalls"
|
||||
android:background="@drawable/history_missed"
|
||||
android:text="@string/button_missed_call"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20dp"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@drawable/text_switch_button_color"
|
||||
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_edit"
|
||||
android:id="@+id/edit"
|
||||
android:background="@drawable/history_edit"
|
||||
android:text="@string/button_edit"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20dp"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@drawable/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_validate"
|
||||
android:id="@+id/ok"
|
||||
android:background="@drawable/history_ok"
|
||||
android:text="@string/button_ok"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20dp"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@drawable/text_button"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/historyList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:divider="@android:color/darker_gray"
|
||||
android:cacheColorHint="@color/transparent"
|
||||
android:dividerHeight="1dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noCallHistory"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/no_call_history"
|
||||
android:textColor="@drawable/text_color"
|
||||
android:textAppearance="@android:style/TextAppearance.Large"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noMissedCallHistory"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/no_missed_call_history"
|
||||
android:textColor="@drawable/text_color"
|
||||
android:textAppearance="@android:style/TextAppearance.Large"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,436 +0,0 @@
|
|||
package org.linphone;
|
||||
/*
|
||||
HistoryFragment.java
|
||||
Copyright (C) 2012 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.linphone.core.CallDirection;
|
||||
import org.linphone.core.LinphoneAddress;
|
||||
import org.linphone.core.LinphoneCallLog;
|
||||
import org.linphone.core.LinphoneCallLog.CallStatus;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.app.Fragment;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.ContextMenu.ContextMenuInfo;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.Animation.AnimationListener;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
public class HistorySimpleFragment extends Fragment implements OnClickListener, OnItemClickListener {
|
||||
private ListView historyList;
|
||||
private LayoutInflater mInflater;
|
||||
private TextView allCalls, missedCalls, edit, ok, deleteAll, noCallHistory, noMissedCallHistory;
|
||||
private boolean onlyDisplayMissedCalls, isEditMode;
|
||||
private List<LinphoneCallLog> mLogs;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
mInflater = inflater;
|
||||
View view = inflater.inflate(R.layout.history_simple, container, false);
|
||||
|
||||
noCallHistory = (TextView) view.findViewById(R.id.noCallHistory);
|
||||
noMissedCallHistory = (TextView) view.findViewById(R.id.noMissedCallHistory);
|
||||
|
||||
historyList = (ListView) view.findViewById(R.id.historyList);
|
||||
historyList.setOnItemClickListener(this);
|
||||
registerForContextMenu(historyList);
|
||||
|
||||
deleteAll = (TextView) view.findViewById(R.id.deleteAll);
|
||||
deleteAll.setOnClickListener(this);
|
||||
deleteAll.setVisibility(View.INVISIBLE);
|
||||
|
||||
allCalls = (TextView) view.findViewById(R.id.allCalls);
|
||||
allCalls.setOnClickListener(this);
|
||||
|
||||
missedCalls = (TextView) view.findViewById(R.id.missedCalls);
|
||||
missedCalls.setOnClickListener(this);
|
||||
|
||||
allCalls.setEnabled(false);
|
||||
onlyDisplayMissedCalls = false;
|
||||
|
||||
edit = (TextView) view.findViewById(R.id.edit);
|
||||
edit.setOnClickListener(this);
|
||||
|
||||
ok = (TextView) view.findViewById(R.id.ok);
|
||||
ok.setOnClickListener(this);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
private void removeNotMissedCallsFromLogs() {
|
||||
if (onlyDisplayMissedCalls) {
|
||||
List<LinphoneCallLog> missedCalls = new ArrayList<LinphoneCallLog>();
|
||||
for (LinphoneCallLog log : mLogs) {
|
||||
if (log.getStatus() == CallStatus.Missed) {
|
||||
missedCalls.add(log);
|
||||
}
|
||||
}
|
||||
mLogs = missedCalls;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hideHistoryListAndDisplayMessageIfEmpty() {
|
||||
removeNotMissedCallsFromLogs();
|
||||
if (mLogs.isEmpty()) {
|
||||
if (onlyDisplayMissedCalls) {
|
||||
noMissedCallHistory.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
noCallHistory.setVisibility(View.VISIBLE);
|
||||
}
|
||||
historyList.setVisibility(View.GONE);
|
||||
return true;
|
||||
} else {
|
||||
noCallHistory.setVisibility(View.GONE);
|
||||
noMissedCallHistory.setVisibility(View.GONE);
|
||||
historyList.setVisibility(View.VISIBLE);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
LinphoneActivity.instance().selectMenu(FragmentsAvailable.HISTORY);
|
||||
|
||||
if (getResources().getBoolean(R.bool.show_statusbar_only_on_dialer)) {
|
||||
LinphoneActivity.instance().hideStatusBar();
|
||||
}
|
||||
}
|
||||
|
||||
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
||||
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
|
||||
historyList.setAdapter(new CallHistoryAdapter(getActivity()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
|
||||
super.onCreateContextMenu(menu, v, menuInfo);
|
||||
menu.add(0, v.getId(), 0, getString(R.string.delete));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onContextItemSelected(MenuItem item) {
|
||||
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
|
||||
LinphoneCallLog log = mLogs.get(info.position);
|
||||
LinphoneManager.getLc().removeCallLog(log);
|
||||
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
||||
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
|
||||
historyList.setAdapter(new CallHistoryAdapter(getActivity()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
if (id == R.id.allCalls) {
|
||||
allCalls.setEnabled(false);
|
||||
missedCalls.setEnabled(true);
|
||||
onlyDisplayMissedCalls = false;
|
||||
|
||||
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
||||
}
|
||||
else if (id == R.id.missedCalls) {
|
||||
allCalls.setEnabled(true);
|
||||
missedCalls.setEnabled(false);
|
||||
onlyDisplayMissedCalls = true;
|
||||
}
|
||||
else if (id == R.id.ok) {
|
||||
edit.setVisibility(View.VISIBLE);
|
||||
ok.setVisibility(View.GONE);
|
||||
hideDeleteAllButton();
|
||||
isEditMode = false;
|
||||
}
|
||||
else if (id == R.id.edit) {
|
||||
edit.setVisibility(View.GONE);
|
||||
ok.setVisibility(View.VISIBLE);
|
||||
showDeleteAllButton();
|
||||
isEditMode = true;
|
||||
}
|
||||
else if (id == R.id.deleteAll) {
|
||||
LinphoneManager.getLc().clearCallLogs();
|
||||
mLogs = new ArrayList<LinphoneCallLog>();
|
||||
}
|
||||
|
||||
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
|
||||
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapter, View view, int position, long id) {
|
||||
if (isEditMode) {
|
||||
LinphoneCallLog log = mLogs.get(position);
|
||||
LinphoneManager.getLc().removeCallLog(log);
|
||||
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
||||
if (!hideHistoryListAndDisplayMessageIfEmpty()) {
|
||||
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
|
||||
}
|
||||
} else {
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
LinphoneCallLog log = mLogs.get(position);
|
||||
LinphoneAddress address;
|
||||
if (log.getDirection() == CallDirection.Incoming) {
|
||||
address = log.getFrom();
|
||||
} else {
|
||||
address = log.getTo();
|
||||
}
|
||||
LinphoneActivity.instance().setAddresGoToDialerAndCall(address.asStringUriOnly(), address.getDisplayName(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void hideDeleteAllButton() {
|
||||
if (deleteAll == null || deleteAll.getVisibility() != View.VISIBLE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (LinphoneActivity.instance().isAnimationDisabled()) {
|
||||
deleteAll.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
Animation animation = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_out_right_to_left);
|
||||
animation.setAnimationListener(new AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
deleteAll.setVisibility(View.INVISIBLE);
|
||||
animation.setAnimationListener(null);
|
||||
}
|
||||
});
|
||||
deleteAll.startAnimation(animation);
|
||||
}
|
||||
}
|
||||
|
||||
private void showDeleteAllButton() {
|
||||
if (deleteAll == null || deleteAll.getVisibility() == View.VISIBLE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (LinphoneActivity.instance().isAnimationDisabled()) {
|
||||
deleteAll.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
Animation animation = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_in_left_to_right);
|
||||
animation.setAnimationListener(new AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
deleteAll.setVisibility(View.VISIBLE);
|
||||
animation.setAnimationListener(null);
|
||||
}
|
||||
});
|
||||
deleteAll.startAnimation(animation);
|
||||
}
|
||||
}
|
||||
|
||||
class CallHistoryAdapter extends BaseAdapter {
|
||||
private Bitmap missedCall, outgoingCall, incomingCall;
|
||||
|
||||
CallHistoryAdapter(Context aContext) {
|
||||
missedCall = BitmapFactory.decodeResource(getResources(), R.drawable.call_status_missed);
|
||||
|
||||
if (!onlyDisplayMissedCalls) {
|
||||
outgoingCall = BitmapFactory.decodeResource(getResources(), R.drawable.call_status_outgoing);
|
||||
incomingCall = BitmapFactory.decodeResource(getResources(), R.drawable.call_status_incoming);
|
||||
}
|
||||
}
|
||||
public int getCount() {
|
||||
return mLogs.size();
|
||||
}
|
||||
|
||||
public Object getItem(int position) {
|
||||
return mLogs.get(position);
|
||||
}
|
||||
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
private String timestampToHumanDate(Calendar cal) {
|
||||
SimpleDateFormat dateFormat;
|
||||
if (isToday(cal)) {
|
||||
return getString(R.string.today);
|
||||
} else if (isYesterday(cal)) {
|
||||
return getString(R.string.yesterday);
|
||||
} else {
|
||||
dateFormat = new SimpleDateFormat(getResources().getString(R.string.history_date_format));
|
||||
}
|
||||
|
||||
return dateFormat.format(cal.getTime());
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
private boolean isToday(Calendar cal) {
|
||||
return isSameDay(cal, Calendar.getInstance());
|
||||
}
|
||||
|
||||
private boolean isYesterday(Calendar cal) {
|
||||
Calendar yesterday = Calendar.getInstance();
|
||||
yesterday.roll(Calendar.DAY_OF_MONTH, -1);
|
||||
return isSameDay(cal, yesterday);
|
||||
}
|
||||
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View view = null;
|
||||
if (convertView != null) {
|
||||
view = convertView;
|
||||
} else {
|
||||
view = mInflater.inflate(R.layout.history_cell_simple, parent,false);
|
||||
}
|
||||
|
||||
final LinphoneCallLog log = mLogs.get(position);
|
||||
long timestamp = log.getTimestamp();
|
||||
final LinphoneAddress address;
|
||||
|
||||
TextView contact = (TextView) view.findViewById(R.id.sipUri);
|
||||
contact.setSelected(true); // For automated horizontal scrolling of long texts
|
||||
|
||||
ImageView detail = (ImageView) view.findViewById(R.id.detail);
|
||||
ImageView delete = (ImageView) view.findViewById(R.id.delete);
|
||||
ImageView callDirection = (ImageView) view.findViewById(R.id.icon);
|
||||
|
||||
TextView separator = (TextView) view.findViewById(R.id.separator);
|
||||
Calendar logTime = Calendar.getInstance();
|
||||
logTime.setTimeInMillis(timestamp);
|
||||
separator.setText(timestampToHumanDate(logTime));
|
||||
|
||||
if (position > 0) {
|
||||
LinphoneCallLog previousLog = mLogs.get(position-1);
|
||||
long previousTimestamp = previousLog.getTimestamp();
|
||||
Calendar previousLogTime = Calendar.getInstance();
|
||||
previousLogTime.setTimeInMillis(previousTimestamp);
|
||||
|
||||
if (isSameDay(previousLogTime, logTime)) {
|
||||
separator.setVisibility(View.GONE);
|
||||
} else {
|
||||
separator.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
separator.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (log.getDirection() == CallDirection.Incoming) {
|
||||
address = log.getFrom();
|
||||
if (log.getStatus() == CallStatus.Missed) {
|
||||
callDirection.setImageBitmap(missedCall);
|
||||
} else {
|
||||
callDirection.setImageBitmap(incomingCall);
|
||||
}
|
||||
} else {
|
||||
address = log.getTo();
|
||||
callDirection.setImageBitmap(outgoingCall);
|
||||
}
|
||||
|
||||
Contact c = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), address);
|
||||
String displayName = null;
|
||||
final String sipUri = address.asStringUriOnly();
|
||||
if(c != null){
|
||||
displayName = c.getName();
|
||||
}
|
||||
|
||||
if (displayName == null) {
|
||||
if (getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
|
||||
contact.setText(address.getUserName());
|
||||
} else {
|
||||
contact.setText(sipUri);
|
||||
}
|
||||
} else {
|
||||
if (getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(address.getDisplayName())) {
|
||||
contact.setText(displayName);
|
||||
} else {
|
||||
contact.setText(sipUri);
|
||||
}
|
||||
}
|
||||
view.setTag(sipUri);
|
||||
|
||||
if (isEditMode) {
|
||||
delete.setVisibility(View.VISIBLE);
|
||||
detail.setVisibility(View.GONE);
|
||||
} else {
|
||||
delete.setVisibility(View.GONE);
|
||||
detail.setVisibility(View.VISIBLE);
|
||||
detail.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
LinphoneActivity.instance().displayHistoryDetail(sipUri, log);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
package org.linphone.ui;
|
||||
/*
|
||||
AvatarWithShadow.java
|
||||
Copyright (C) 2012 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
import org.linphone.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
public class AvatarWithShadow extends LinearLayout {
|
||||
private ImageView contactPicture;
|
||||
|
||||
public AvatarWithShadow(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.AvatarWithShadow);
|
||||
int pictureResId = array.getResourceId(R.styleable.AvatarWithShadow_picture, 0);
|
||||
array.recycle();
|
||||
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.avatar, this);
|
||||
contactPicture = (ImageView) view.findViewById(R.id.picture);
|
||||
contactPicture.setImageResource(pictureResId);
|
||||
}
|
||||
|
||||
public ImageView getView() {
|
||||
return contactPicture;
|
||||
}
|
||||
|
||||
public void setImageBitmap(Bitmap bitmap) {
|
||||
contactPicture.setImageBitmap(bitmap);
|
||||
}
|
||||
|
||||
public void setImageResource(int res) {
|
||||
contactPicture.setImageResource(res);
|
||||
}
|
||||
}
|