Skip to content
Snippets Groups Projects
Commit 08d9af0e authored by Adrien Béraud's avatar Adrien Béraud
Browse files

add information about missed calls

Tuleap: #424
Change-Id: I953444c614eaefe072c5f818ca3b0464f80ddd0f
parent 1e532c76
No related branches found
No related tags found
No related merge requests found
Showing
with 29 additions and 14 deletions
......@@ -392,6 +392,7 @@ public class ConversationActivity extends AppCompatActivity {
callEntry = (ViewGroup) v.findViewById(R.id.call_entry);
histTxt = (TextView) v.findViewById(R.id.call_hist_txt);
histDetailTxt = (TextView) v.findViewById(R.id.call_details_txt);
photo = (ImageView) v.findViewById(R.id.call_icon);
} else {
txtEntry = (ViewGroup) v.findViewById(R.id.txt_entry);
msgTxt = (TextView) v.findViewById(R.id.msg_txt);
......@@ -540,8 +541,16 @@ public class ConversationActivity extends AppCompatActivity {
h.msgDetailTxt.setVisibility(View.GONE);
}
} else {
h.histTxt.setText(txt.call.isIncoming() ? getString(R.string.notif_incoming_call_title, txt.call.getNumber())
: getString(R.string.notif_outgoing_call_title, txt.call.getNumber()));
h.cid = txt.call.getContactID();
if (txt.call.isMissed()) {
h.photo.setImageResource(txt.call.isIncoming() ? R.drawable.ic_call_missed_black_24dp : R.drawable.ic_call_missed_outgoing_black_24dp);
h.histTxt.setText(txt.call.isIncoming() ? getString(R.string.notif_missed_incoming_call, txt.call.getNumber())
: getString(R.string.notif_missed_outgoing_call, txt.call.getNumber()));
} else {
h.photo.setImageResource(txt.call.isIncoming() ? R.drawable.ic_call_received_black_24dp : R.drawable.ic_call_made_black_24dp);
h.histTxt.setText(txt.call.isIncoming() ? getString(R.string.notif_incoming_call_title, txt.call.getNumber())
: getString(R.string.notif_outgoing_call_title, txt.call.getNumber()));
}
h.histDetailTxt.setText(DateFormat.getDateTimeInstance().format(txt.call.getStartDate()));
}
}
......
......@@ -75,7 +75,7 @@ public class HistoryCall implements Parcelable {
call_end = call.getTimestampEnd();
accountID = call.getAccount();
number = call.getNumber();
missed = call.isRinging() && call.isIncoming();
missed = call.isMissed();
direction = call.getCallType();
recordPath = call.getRecordPath();
contactID = call.getContact().getId();
......
......@@ -15,9 +15,8 @@
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cx.ring.model;
......@@ -41,8 +40,9 @@ public class SipCall
private boolean isPeerHolding = false;
private boolean isAudioMuted = false;
private boolean isRecording = false;
private long timestampStart_ = 0;
private long timestampEnd_ = 0;
private long timestampStart = 0;
private long timestampEnd = 0;
private boolean missed = true;
private int mCallType;
private int mCallState = State.NONE;
......@@ -65,8 +65,8 @@ public class SipCall
isPeerHolding = call.isPeerHolding;
isAudioMuted = call.isAudioMuted;
isRecording = call.isRecording;
timestampStart_ = call.timestampStart_;
timestampEnd_ = call.timestampEnd_;
timestampStart = call.timestampStart;
timestampEnd = call.timestampEnd;
mCallType = call.mCallType;
mCallState = call.mCallState;
}
......@@ -134,19 +134,19 @@ public class SipCall
}
public long getTimestampStart() {
return timestampStart_;
return timestampStart;
}
public void setTimestampStart(long timestampStart) {
this.timestampStart_ = timestampStart;
this.timestampStart = timestampStart;
}
public long getTimestampEnd() {
return timestampEnd_;
return timestampEnd;
}
public void setTimestampEnd(long timestampEnd) {
this.timestampEnd_ = timestampEnd;
this.timestampEnd = timestampEnd;
}
public void setAccount(String account) {
......@@ -159,6 +159,12 @@ public class SipCall
public void setCallState(int callState) {
mCallState = callState;
if (mCallState == State.CURRENT)
missed = false;
}
public boolean isMissed() {
return missed;
}
public void setContact(CallContact c) {
......
ring-android/app/src/main/res/drawable-hdpi/ic_call_made_black_24dp.png

174 B

ring-android/app/src/main/res/drawable-hdpi/ic_call_missed_black_24dp.png

201 B

ring-android/app/src/main/res/drawable-hdpi/ic_call_missed_outgoing_black_24dp.png

188 B

ring-android/app/src/main/res/drawable-hdpi/ic_call_received_black_24dp.png

175 B

ring-android/app/src/main/res/drawable-mdpi/ic_call_made_black_24dp.png

132 B

ring-android/app/src/main/res/drawable-mdpi/ic_call_missed_black_24dp.png

149 B

ring-android/app/src/main/res/drawable-mdpi/ic_call_missed_outgoing_black_24dp.png

141 B

ring-android/app/src/main/res/drawable-mdpi/ic_call_received_black_24dp.png

131 B

ring-android/app/src/main/res/drawable-xhdpi/ic_call_made_black_24dp.png

166 B

ring-android/app/src/main/res/drawable-xhdpi/ic_call_missed_black_24dp.png

195 B

ring-android/app/src/main/res/drawable-xhdpi/ic_call_missed_outgoing_black_24dp.png

189 B

ring-android/app/src/main/res/drawable-xhdpi/ic_call_received_black_24dp.png

167 B

ring-android/app/src/main/res/drawable-xxhdpi/ic_call_made_black_24dp.png

212 B

ring-android/app/src/main/res/drawable-xxhdpi/ic_call_missed_black_24dp.png

267 B

ring-android/app/src/main/res/drawable-xxhdpi/ic_call_missed_outgoing_black_24dp.png

257 B

ring-android/app/src/main/res/drawable-xxhdpi/ic_call_received_black_24dp.png

214 B

ring-android/app/src/main/res/drawable-xxxhdpi/ic_call_made_black_24dp.png

261 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment