Skip to content
Snippets Groups Projects
Commit 6da3bb9a authored by Alexandre Lision's avatar Alexandre Lision
Browse files

* #36758: add call hourm and ;issed calls highlighting

parent 423aa13d
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@
<corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" />
</shape></item>
<item><shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/light" />
<solid android:color="@color/transparent_light" />
<padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
......
......@@ -10,8 +10,7 @@
<RelativeLayout
android:id="@+id/iv"
android:layout_width="match_parent"
android:layout_height="@dimen/header_history_detail"
android:background="@color/sfl_light_blue" >
android:layout_height="@dimen/header_history_detail" >
<ImageView
android:id="@+id/contact_photo"
......@@ -20,9 +19,10 @@
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp" />
<RelativeLayout
<LinearLayout
android:id="@+id/call_main_action"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
......@@ -32,30 +32,15 @@
<TextView
android:id="@+id/history_call_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:singleLine="true"
android:textStyle="bold" />
<Button
android:id="@+id/history_call_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/item_generic_selector"
android:paddingLeft="@dimen/padding_small"
android:text="+Contacts"
android:visibility="gone" />
</RelativeLayout>
android:textSize="18sp" />
</LinearLayout>
</RelativeLayout>
<!-- Foreground -->
<!-- You can place any of the items below as the foreground, but for most controll, add the scroll view yourself. -->
<!-- <couk.jenxsol.parallaxscrollview.views.ObservableScrollView -->
<org.sflphone.views.parallaxscrollview.AnotherView
android:id="@+id/anotherView"
......
......@@ -72,7 +72,7 @@ as that of the covered work.
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/photo"
android:paddingLeft="@dimen/padding_small"
android:weightSum="3" >
android:weightSum="2" >
<TextView
android:id="@+id/incomings"
......@@ -90,13 +90,6 @@ as that of the covered work.
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/missed"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<Button
......
......@@ -60,6 +60,15 @@ as that of the covered work.
android:paddingLeft="@dimen/padding_small"
android:singleLine="true" />
<TextView
android:id="@+id/history_call_hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/history_call_date_formatted"
android:paddingLeft="@dimen/padding_small"
android:singleLine="true" />
<TextView
android:id="@+id/history_call_duration"
android:layout_width="wrap_content"
......
......@@ -118,4 +118,10 @@ public class DetailHistoryActivity extends Activity implements DetailsHistoryEnt
}
};
@Override
public void onCallDialed(String to) {
// TODO Stub de la méthode généré automatiquement
}
}
\ No newline at end of file
......@@ -46,6 +46,7 @@ import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.os.RemoteException;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.MeasureSpec;
......@@ -83,10 +84,16 @@ public class DetailsHistoryEntryFragment extends Fragment {
return null;
}
@Override
public void onCallDialed(String to) {
}
};
public interface Callbacks {
public void onCallDialed(String to);
public ISipService getService();
}
......@@ -129,6 +136,15 @@ public class DetailsHistoryEntryFragment extends Fragment {
iv = (RelativeLayout) inflatedView.findViewById(R.id.iv);
((TextView) iv.findViewById(R.id.history_call_name)).setText(toDisplay.getContact().getmDisplayName());
((LinearLayout) iv.findViewById(R.id.call_main_action)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Log.i(TAG, "Clicking");
mCallbacks.onCallDialed(toDisplay.getNumber());
}
});
tasker = new ContactPictureTask(getActivity(), (ImageView) iv.findViewById(R.id.contact_photo), toDisplay.getContact());
tasker.run();
anotherView = (AnotherView) inflatedView.findViewById(R.id.anotherView);
......@@ -227,6 +243,7 @@ public class DetailsHistoryEntryFragment extends Fragment {
entryView = new HistoryCallView();
entryView.historyCallState = (TextView) convertView.findViewById(R.id.history_call_state);
entryView.formatted_date = (TextView) convertView.findViewById(R.id.history_call_date_formatted);
entryView.formatted_hour = (TextView) convertView.findViewById(R.id.history_call_hour);
entryView.record = (Button) convertView.findViewById(R.id.history_call_record);
entryView.duration = (TextView) convertView.findViewById(R.id.history_call_duration);
......@@ -240,6 +257,7 @@ public class DetailsHistoryEntryFragment extends Fragment {
entryView.historyCallState.setText(item.getDirection());
entryView.formatted_date.setText(item.getDate());
entryView.duration.setText(item.getDurationString());
entryView.formatted_hour.setText(item.getStartString("h:mm a"));
if (item.isIncoming() && item.isMissed())
convertView.setBackgroundColor(getResources().getColor(R.color.holo_red_light));
......@@ -277,6 +295,7 @@ public class DetailsHistoryEntryFragment extends Fragment {
public class HistoryCallView {
protected TextView historyCallState;
protected TextView formatted_date;
protected TextView formatted_hour;
protected Button record;
protected TextView duration;
}
......
......@@ -207,7 +207,6 @@ public class HistoryFragment extends ListFragment implements LoaderCallbacks<Arr
entryView.photo = (ImageButton) convertView.findViewById(R.id.photo);
entryView.displayName = (TextView) convertView.findViewById(R.id.display_name);
entryView.date = (TextView) convertView.findViewById(R.id.date_start);
entryView.missed = (TextView) convertView.findViewById(R.id.missed);
entryView.incoming = (TextView) convertView.findViewById(R.id.incomings);
entryView.outgoing = (TextView) convertView.findViewById(R.id.outgoings);
entryView.replay = (Button) convertView.findViewById(R.id.replay);
......@@ -224,7 +223,6 @@ public class HistoryFragment extends ListFragment implements LoaderCallbacks<Arr
infos_fetcher.execute(new ContactPictureTask(mContext, entryView.photo, dataset.get(pos).getContact()));
entryView.missed.setText(getString(R.string.hist_missed_calls, dataset.get(pos).getMissed_sum()));
entryView.incoming.setText(getString(R.string.hist_in_calls, dataset.get(pos).getIncoming_sum()));
entryView.outgoing.setText(getString(R.string.hist_out_calls, dataset.get(pos).getOutgoing_sum()));
......@@ -275,7 +273,6 @@ public class HistoryFragment extends ListFragment implements LoaderCallbacks<Arr
protected TextView displayName;
protected TextView date;
private Button replay;
private TextView missed;
private TextView outgoing;
private TextView incoming;
}
......
......@@ -31,10 +31,14 @@
package org.sflphone.model;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.NavigableMap;
import java.util.TimeZone;
import java.util.TreeMap;
import org.sflphone.service.ServiceConstants;
......@@ -201,6 +205,16 @@ public class HistoryEntry implements Parcelable {
return timeFormatted;
}
public String getStartString(String format) {
Timestamp stamp = new Timestamp(call_start * 1000); // in milliseconds
Date date = new Date(stamp.getTime());
SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());
sdf.setTimeZone(TimeZone.getDefault());
String formattedDate = sdf.format(date);
return formattedDate;
}
public String getDurationString() {
long duration = call_end - call_start;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment