diff --git a/res/drawable-xhdpi/avatar.png b/res/drawable-xhdpi/avatar.png
index d3a0bf331..19d79f738 100644
Binary files a/res/drawable-xhdpi/avatar.png and b/res/drawable-xhdpi/avatar.png differ
diff --git a/res/drawable-xhdpi/resizable_cancel_button.png b/res/drawable-xhdpi/resizable_cancel_button.9.png
similarity index 100%
rename from res/drawable-xhdpi/resizable_cancel_button.png
rename to res/drawable-xhdpi/resizable_cancel_button.9.png
diff --git a/res/drawable-xhdpi/resizable_chat_bubble_incoming.png b/res/drawable-xhdpi/resizable_chat_bubble_incoming.9.png
similarity index 100%
rename from res/drawable-xhdpi/resizable_chat_bubble_incoming.png
rename to res/drawable-xhdpi/resizable_chat_bubble_incoming.9.png
diff --git a/res/drawable-xhdpi/resizable_chat_bubble_outgoing.png b/res/drawable-xhdpi/resizable_chat_bubble_outgoing.9.png
similarity index 100%
rename from res/drawable-xhdpi/resizable_chat_bubble_outgoing.png
rename to res/drawable-xhdpi/resizable_chat_bubble_outgoing.9.png
diff --git a/res/drawable/alert.xml b/res/drawable/alert.xml
deleted file mode 100644
index 125848d4c..000000000
--- a/res/drawable/alert.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/res/drawable/button.xml b/res/drawable/button.xml
deleted file mode 100644
index ab6a95baa..000000000
--- a/res/drawable/button.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/res/drawable/call_answer.xml b/res/drawable/call_answer.xml
deleted file mode 100644
index a81d47745..000000000
--- a/res/drawable/call_answer.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/res/drawable/chat_back.xml b/res/drawable/chat_back.xml
deleted file mode 100644
index 80e8f379b..000000000
--- a/res/drawable/chat_back.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/chat_edit.xml b/res/drawable/chat_edit.xml
deleted file mode 100644
index 8722d6690..000000000
--- a/res/drawable/chat_edit.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/chat_new.xml b/res/drawable/chat_new.xml
deleted file mode 100644
index e42e5819c..000000000
--- a/res/drawable/chat_new.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/chat_ok.xml b/res/drawable/chat_ok.xml
deleted file mode 100644
index 3b5a53732..000000000
--- a/res/drawable/chat_ok.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/chat_stop_upload.xml b/res/drawable/chat_stop_upload.xml
deleted file mode 100644
index 623c4ee55..000000000
--- a/res/drawable/chat_stop_upload.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/contact_add_contact.xml b/res/drawable/contact_add_contact.xml
deleted file mode 100644
index bdfe8f4d9..000000000
--- a/res/drawable/contact_add_contact.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/contact_cancel.xml b/res/drawable/contact_cancel.xml
deleted file mode 100644
index c69e447ed..000000000
--- a/res/drawable/contact_cancel.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/contact_delete.xml b/res/drawable/contact_delete.xml
deleted file mode 100644
index 32694f1e5..000000000
--- a/res/drawable/contact_delete.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/contact_edit.xml b/res/drawable/contact_edit.xml
deleted file mode 100644
index 52e3aa964..000000000
--- a/res/drawable/contact_edit.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/contact_ok.xml b/res/drawable/contact_ok.xml
deleted file mode 100644
index 5c3b8eebb..000000000
--- a/res/drawable/contact_ok.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
diff --git a/res/drawable/contacts_add_contact.xml b/res/drawable/contacts_add_contact.xml
deleted file mode 100644
index f5f16757a..000000000
--- a/res/drawable/contacts_add_contact.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/history_delete.xml b/res/drawable/history_delete.xml
deleted file mode 100644
index e284ffd1f..000000000
--- a/res/drawable/history_delete.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/history_edit.xml b/res/drawable/history_edit.xml
deleted file mode 100644
index a2108f74b..000000000
--- a/res/drawable/history_edit.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/history_ok.xml b/res/drawable/history_ok.xml
deleted file mode 100644
index ae9b0b5b1..000000000
--- a/res/drawable/history_ok.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/list_add.xml b/res/drawable/list_add.xml
deleted file mode 100644
index 6424c7cad..000000000
--- a/res/drawable/list_add.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/res/drawable/ok.xml b/res/drawable/ok.xml
deleted file mode 100644
index b50da4366..000000000
--- a/res/drawable/ok.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/play.xml b/res/drawable/play.xml
deleted file mode 100644
index 7835c3562..000000000
--- a/res/drawable/play.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/remove.xml b/res/drawable/remove.xml
deleted file mode 100644
index 4a288620c..000000000
--- a/res/drawable/remove.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/route_bluetooth_off.xml b/res/drawable/route_bluetooth_off.xml
deleted file mode 100644
index 50964a542..000000000
--- a/res/drawable/route_bluetooth_off.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/route_bluetooth_on.xml b/res/drawable/route_bluetooth_on.xml
deleted file mode 100644
index 257dbd2c6..000000000
--- a/res/drawable/route_bluetooth_on.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/route_receiver_off.xml b/res/drawable/route_receiver_off.xml
deleted file mode 100644
index c850ff48e..000000000
--- a/res/drawable/route_receiver_off.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/route_receiver_on.xml b/res/drawable/route_receiver_on.xml
deleted file mode 100644
index 7b6d830f9..000000000
--- a/res/drawable/route_receiver_on.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/route_speaker_off.xml b/res/drawable/route_speaker_off.xml
deleted file mode 100644
index 699fad44f..000000000
--- a/res/drawable/route_speaker_off.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/route_speaker_on.xml b/res/drawable/route_speaker_on.xml
deleted file mode 100644
index 59f0124fb..000000000
--- a/res/drawable/route_speaker_on.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/res/drawable/routes.xml b/res/drawable/routes.xml
deleted file mode 100644
index 227067f91..000000000
--- a/res/drawable/routes.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/res/drawable/toolbar_button.xml b/res/drawable/toolbar_button.xml
new file mode 100644
index 000000000..bda78c65b
--- /dev/null
+++ b/res/drawable/toolbar_button.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/drawable/transfer_call.xml b/res/drawable/transfer_call.xml
deleted file mode 100644
index 68248239d..000000000
--- a/res/drawable/transfer_call.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/res/layout-small/history_detail.xml b/res/layout-small/history_detail.xml
deleted file mode 100644
index a0f4d0e37..000000000
--- a/res/layout-small/history_detail.xml
+++ /dev/null
@@ -1,172 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/layout-small/incall.xml b/res/layout-small/incall.xml
deleted file mode 100644
index c8b9322d5..000000000
--- a/res/layout-small/incall.xml
+++ /dev/null
@@ -1,264 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/layout-sw533dp-land/contact.xml b/res/layout-sw533dp-land/contact.xml
deleted file mode 100644
index 206bf91f5..000000000
--- a/res/layout-sw533dp-land/contact.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/layout/avatar.xml b/res/layout/avatar.xml
deleted file mode 100644
index d28185d34..000000000
--- a/res/layout/avatar.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/layout/history_cell_simple.xml b/res/layout/history_cell_simple.xml
deleted file mode 100644
index e961d8a7d..000000000
--- a/res/layout/history_cell_simple.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/layout/history_simple.xml b/res/layout/history_simple.xml
deleted file mode 100644
index f2569307d..000000000
--- a/res/layout/history_simple.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/org/linphone/HistorySimpleFragment.java b/src/org/linphone/HistorySimpleFragment.java
deleted file mode 100644
index b72d908e6..000000000
--- a/src/org/linphone/HistorySimpleFragment.java
+++ /dev/null
@@ -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 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 missedCalls = new ArrayList();
- 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();
- }
-
- 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;
- }
- }
-}
\ No newline at end of file
diff --git a/src/org/linphone/ui/AvatarWithShadow.java b/src/org/linphone/ui/AvatarWithShadow.java
deleted file mode 100644
index 98e0787e0..000000000
--- a/src/org/linphone/ui/AvatarWithShadow.java
+++ /dev/null
@@ -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);
- }
-}