A click on a history entry calls the address, a click on the right button displays the details

This commit is contained in:
Sylvain Berfini 2012-09-21 09:47:23 +02:00
parent 1358258d72
commit c26ad9c0b1
2 changed files with 29 additions and 14 deletions

View file

@ -245,7 +245,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnChil
} else {
address = log.getTo();
}
LinphoneActivity.instance().displayHistoryDetail(address.asStringUriOnly(), log);
LinphoneActivity.instance().setAddresGoToDialerAndCall(address.asStringUriOnly(), address.getDisplayName(), null);
}
return false;
}
@ -342,8 +342,8 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnChil
view = mInflater.inflate(R.layout.history_cell, parent,false);
}
LinphoneCallLog log = (LinphoneCallLog) getChild(groupPosition, childPosition);
LinphoneAddress address;
final LinphoneCallLog log = (LinphoneCallLog) getChild(groupPosition, childPosition);
final LinphoneAddress address;
TextView dateAndTime = (TextView) view.findViewById(R.id.dateAndTime);
ImageView detail = (ImageView) view.findViewById(R.id.detail);
@ -374,6 +374,14 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnChil
} 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(address.asStringUriOnly(), log);
}
}
});
}
return view;

View file

@ -161,16 +161,15 @@ public class HistorySimpleFragment extends Fragment implements OnClickListener,
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
} else {
LinphoneCallLog log = mLogs.get(position);
LinphoneAddress address;
if (log.getDirection() == CallDirection.Incoming) {
address = log.getFrom();
} else {
address = log.getTo();
}
if (LinphoneActivity.isInstanciated()) {
LinphoneActivity.instance().displayHistoryDetail(address.asStringUriOnly(), log);
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);
}
}
}
@ -274,8 +273,8 @@ public class HistorySimpleFragment extends Fragment implements OnClickListener,
view = mInflater.inflate(R.layout.history_cell_simple, parent,false);
}
LinphoneCallLog log = mLogs.get(position);
LinphoneAddress address;
final LinphoneCallLog log = mLogs.get(position);
final LinphoneAddress address;
TextView contact = (TextView) view.findViewById(R.id.sipUri);
ImageView detail = (ImageView) view.findViewById(R.id.detail);
@ -320,6 +319,14 @@ public class HistorySimpleFragment extends Fragment implements OnClickListener,
} 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(address.asStringUriOnly(), log);
}
}
});
}
return view;