diff --git a/res/drawable-xhdpi/dialer_alt_back_selected.png b/res/drawable-xhdpi/dialer_alt_back_selected.png new file mode 100644 index 000000000..312b2dafb Binary files /dev/null and b/res/drawable-xhdpi/dialer_alt_back_selected.png differ diff --git a/res/drawable/call_alt_start_button.xml b/res/drawable/call_alt_start_button.xml new file mode 100644 index 000000000..17ffbfa7c --- /dev/null +++ b/res/drawable/call_alt_start_button.xml @@ -0,0 +1,10 @@ + + + + + + + diff --git a/res/drawable/call_back_button.xml b/res/drawable/call_back_button.xml new file mode 100644 index 000000000..52be7fde1 --- /dev/null +++ b/res/drawable/call_back_button.xml @@ -0,0 +1,10 @@ + + + + + + + diff --git a/res/drawable/dialer_back_button.xml b/res/drawable/dialer_back_button.xml new file mode 100644 index 000000000..1fb47483b --- /dev/null +++ b/res/drawable/dialer_back_button.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/res/layout/chatlist.xml b/res/layout/chatlist.xml index 6edc8f567..f45f77614 100644 --- a/res/layout/chatlist.xml +++ b/res/layout/chatlist.xml @@ -20,6 +20,16 @@ android:layout_alignParentLeft="true" android:padding="15dp"/> + + mConversations, mDrafts; private ListView chatList; private TextView noChatHistory; - private ImageView edit, selectAll, deselectAll, delete, newDiscussion, contactPicture, cancel; + private ImageView edit, selectAll, deselectAll, delete, newDiscussion, contactPicture, cancel, backInCall; private RelativeLayout editList, topbar; private boolean isEditMode = false; @@ -104,6 +104,9 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte deselectAll = (ImageView) view.findViewById(R.id.deselect_all); deselectAll.setOnClickListener(this); + backInCall = (ImageView) view.findViewById(R.id.back_in_call); + backInCall.setOnClickListener(this); + delete = (ImageView) view.findViewById(R.id.delete); delete.setOnClickListener(this); return view; @@ -196,6 +199,12 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte public void onResume() { super.onResume(); + if (LinphoneManager.getLc().getCallsNb() > 0) { + backInCall.setVisibility(View.VISIBLE); + } else { + backInCall.setVisibility(View.GONE); + } + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(LinphoneActivity.instance()); boolean updateNeeded = prefs.getBoolean(getString(R.string.pref_first_time_linphone_chat_storage), true); updateNeeded = updateNeeded && !isVersionUsingNewChatStorage(); @@ -266,6 +275,11 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte public void onClick(View v) { int id = v.getId(); + if (id == R.id.back_in_call) { + LinphoneActivity.instance().resetClassicMenuLayoutAndGoBackToCallIfStillRunning(); + return; + } + if (id == R.id.select_all) { deselectAll.setVisibility(View.VISIBLE); selectAll.setVisibility(View.GONE); diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 206ae404c..862c60f52 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -602,6 +602,11 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta preferLinphoneContacts = false; } + public void displayChatList() { + Bundle extras = new Bundle(); + changeCurrentFragment(FragmentsAvailable.CHATLIST, extras); + } + public void displayContactsForEdition(String sipAddress) { Bundle extras = new Bundle(); extras.putBoolean("EditOnClick", true); @@ -872,6 +877,8 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta } } + + public void displayCustomToast(final String message, final int duration) { LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.toast, (ViewGroup) findViewById(R.id.toastRoot)); @@ -1080,6 +1087,10 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta } else if (resultCode == Activity.RESULT_FIRST_USER && requestCode == CALL_ACTIVITY) { getIntent().putExtra("PreviousActivity", CALL_ACTIVITY); boolean callTransfer = data == null ? false : data.getBooleanExtra("Transfer", false); + boolean chat = data == null ? false : data.getBooleanExtra("chat", false); + if(chat){ + displayChatList(); + } if (LinphoneManager.getLc().getCallsNb() > 0) { initInCallMenuLayout(callTransfer); } else {