A click on a history entry calls the address, a click on the right button displays the details
This commit is contained in:
parent
1358258d72
commit
c26ad9c0b1
2 changed files with 29 additions and 14 deletions
|
@ -245,7 +245,7 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnChil
|
||||||
} else {
|
} else {
|
||||||
address = log.getTo();
|
address = log.getTo();
|
||||||
}
|
}
|
||||||
LinphoneActivity.instance().displayHistoryDetail(address.asStringUriOnly(), log);
|
LinphoneActivity.instance().setAddresGoToDialerAndCall(address.asStringUriOnly(), address.getDisplayName(), null);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -342,8 +342,8 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnChil
|
||||||
view = mInflater.inflate(R.layout.history_cell, parent,false);
|
view = mInflater.inflate(R.layout.history_cell, parent,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
LinphoneCallLog log = (LinphoneCallLog) getChild(groupPosition, childPosition);
|
final LinphoneCallLog log = (LinphoneCallLog) getChild(groupPosition, childPosition);
|
||||||
LinphoneAddress address;
|
final LinphoneAddress address;
|
||||||
|
|
||||||
TextView dateAndTime = (TextView) view.findViewById(R.id.dateAndTime);
|
TextView dateAndTime = (TextView) view.findViewById(R.id.dateAndTime);
|
||||||
ImageView detail = (ImageView) view.findViewById(R.id.detail);
|
ImageView detail = (ImageView) view.findViewById(R.id.detail);
|
||||||
|
@ -374,6 +374,14 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnChil
|
||||||
} else {
|
} else {
|
||||||
delete.setVisibility(View.GONE);
|
delete.setVisibility(View.GONE);
|
||||||
detail.setVisibility(View.VISIBLE);
|
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;
|
return view;
|
||||||
|
|
|
@ -161,16 +161,15 @@ public class HistorySimpleFragment extends Fragment implements OnClickListener,
|
||||||
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
||||||
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
|
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
|
||||||
} else {
|
} else {
|
||||||
LinphoneCallLog log = mLogs.get(position);
|
|
||||||
LinphoneAddress address;
|
|
||||||
if (log.getDirection() == CallDirection.Incoming) {
|
|
||||||
address = log.getFrom();
|
|
||||||
} else {
|
|
||||||
address = log.getTo();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LinphoneActivity.isInstanciated()) {
|
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);
|
view = mInflater.inflate(R.layout.history_cell_simple, parent,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
LinphoneCallLog log = mLogs.get(position);
|
final LinphoneCallLog log = mLogs.get(position);
|
||||||
LinphoneAddress address;
|
final LinphoneAddress address;
|
||||||
|
|
||||||
TextView contact = (TextView) view.findViewById(R.id.sipUri);
|
TextView contact = (TextView) view.findViewById(R.id.sipUri);
|
||||||
ImageView detail = (ImageView) view.findViewById(R.id.detail);
|
ImageView detail = (ImageView) view.findViewById(R.id.detail);
|
||||||
|
@ -320,6 +319,14 @@ public class HistorySimpleFragment extends Fragment implements OnClickListener,
|
||||||
} else {
|
} else {
|
||||||
delete.setVisibility(View.GONE);
|
delete.setVisibility(View.GONE);
|
||||||
detail.setVisibility(View.VISIBLE);
|
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;
|
return view;
|
||||||
|
|
Loading…
Reference in a new issue