Add chat in call
This commit is contained in:
parent
5f2203fcd4
commit
92c066d239
5 changed files with 51 additions and 13 deletions
|
@ -22,6 +22,16 @@
|
|||
android:layout_alignParentLeft="true"
|
||||
android:padding="15dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_in_call"
|
||||
android:src="@drawable/call_back"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="15dp"
|
||||
android:visibility="gone"
|
||||
android:layout_toRightOf="@+id/new_discussion"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/edit"
|
||||
android:src="@drawable/edit_list_button"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- New settings -->
|
||||
<!-- TODO Migrate it in linphonerc -->
|
||||
<bool name="assistant_use_linphone_login_as_first_fragment">false</bool>
|
||||
<bool name="hide_in_call_stats">false</bool>
|
||||
<string name="default_domain">sip.linphone.org</string>
|
||||
|
|
|
@ -84,7 +84,7 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
private ImageView switchCamera;
|
||||
private RelativeLayout mActiveCallHeader, sideMenuContent, avatar_layout;
|
||||
private ImageView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference, conferenceStatus, contactPicture;
|
||||
private ImageView audioRoute, routeSpeaker, routeEarpiece, routeBluetooth, menu;
|
||||
private ImageView audioRoute, routeSpeaker, routeEarpiece, routeBluetooth, menu, chat;
|
||||
private LinearLayout mNoCurrentCall, callInfo, mCallPaused;
|
||||
private ProgressBar videoProgress;
|
||||
private StatusFragment status;
|
||||
|
@ -327,6 +327,9 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
numpad = (Numpad) findViewById(R.id.numpad);
|
||||
numpad.getBackground().setAlpha(240);
|
||||
|
||||
chat = (ImageView) findViewById(R.id.chat);
|
||||
chat.setOnClickListener(this);
|
||||
|
||||
//Others
|
||||
|
||||
//Active Call
|
||||
|
@ -569,6 +572,9 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
else if (id == R.id.dialer) {
|
||||
hideOrDisplayNumpad();
|
||||
}
|
||||
else if (id == R.id.chat) {
|
||||
goToChatList();
|
||||
}
|
||||
else if (id == R.id.conference) {
|
||||
enterConference();
|
||||
hideOrDisplayCallOptions();
|
||||
|
@ -653,7 +659,7 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
|
||||
private void enabledConferenceButton(boolean enabled){
|
||||
if(enabled) {
|
||||
if (enabled) {
|
||||
conference.setEnabled(true);
|
||||
conference.setImageAlpha(250);
|
||||
} else {
|
||||
|
@ -1236,6 +1242,13 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
finish();
|
||||
}
|
||||
|
||||
private void goToChatList() {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("chat", true);
|
||||
setResult(Activity.RESULT_FIRST_USER, intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
public void acceptCallUpdate(boolean accept) {
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
|
@ -1450,7 +1463,6 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
|
||||
|
||||
//CALL INFORMATION
|
||||
|
||||
private void displayCurrentCall(LinphoneCall call){
|
||||
//if(!isVideoEnabled(call)){
|
||||
// mActiveCallHeader.setVisibility(View.VISIBLE);
|
||||
|
@ -1527,14 +1539,6 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
return isCallPaused || isInConference;
|
||||
}
|
||||
|
||||
private void displayOrHideContactPicture(LinearLayout callView, Uri pictureUri, Uri thumbnailUri, boolean hide) {
|
||||
/*ImageView contactPicture = (ImageView) callView.findViewById(R.id.contactPicture);
|
||||
if (pictureUri != null) {
|
||||
|
||||
}
|
||||
callView.setVisibility(hide ? View.GONE : View.VISIBLE);*/
|
||||
}
|
||||
|
||||
private void registerCallDurationTimer(View v, LinphoneCall call) {
|
||||
int callDuration = call.getDuration();
|
||||
if (callDuration == 0 && call.getState() != State.StreamsRunning) {
|
||||
|
|
|
@ -69,7 +69,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, contactPicture, cancel;
|
||||
private ImageView edit, selectAll, deselectAll, delete, newDiscussion, contactPicture, cancel, backInCall;
|
||||
private RelativeLayout editList, topbar;
|
||||
private boolean isEditMode = false;
|
||||
|
||||
|
@ -103,6 +103,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;
|
||||
|
@ -195,6 +198,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();
|
||||
|
@ -265,6 +274,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);
|
||||
|
|
|
@ -603,6 +603,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);
|
||||
|
@ -881,6 +886,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));
|
||||
|
@ -1087,6 +1094,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 {
|
||||
|
|
Loading…
Reference in a new issue