Skip to content
Snippets Groups Projects
Commit b989e9a0 authored by Romain Bertozzi's avatar Romain Bertozzi Committed by Alexandre Lision
Browse files

conversations: improve layout

- change bubble size
- change call info display
- change arrow orientation (outgoing missed)

Change-Id: I1ca95ac0cf49a25b009e1a0606dcef904c8272d2
Tuleap: #661
parent 5eeb80d7
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,7 @@ public class ConversationAdapter extends RecyclerView.Adapter<ConversationViewHo
* Refreshes the data and notifies the changes
*
* @param list an arraylist of ConversationElement
* @param id the message id initiating the update, 0 if full refresh
* @param id the message id initiating the update, 0 if full refresh
*/
public void updateDataset(final ArrayList<Conversation.ConversationElement> list, long id) {
Log.d(TAG, "updateDataset, list size: " + list.size() + " - mId: " + id);
......@@ -208,11 +208,16 @@ public class ConversationAdapter extends RecyclerView.Adapter<ConversationViewHo
int pictureResID;
String histTxt;
String callNumber = convElement.call.getNumber();
String callNumber = convElement.call.getShortenedNumber();
convViewHolder.mPhoto.setScaleY(1);
if (convElement.call.isMissed()) {
pictureResID = (convElement.call.isIncoming()) ?
R.drawable.ic_call_missed_black_24dp :
R.drawable.ic_call_missed_outgoing_black_24dp;
if (convElement.call.isIncoming()) {
pictureResID = R.drawable.ic_call_missed_black_24dp;
} else {
pictureResID = R.drawable.ic_call_missed_outgoing_black_24dp;
// Flip the photo upside down to show a "missed outgoing call"
convViewHolder.mPhoto.setScaleY(-1);
}
histTxt = convElement.call.isIncoming() ?
mContext.getString(R.string.notif_missed_incoming_call, callNumber) :
mContext.getString(R.string.notif_missed_outgoing_call, callNumber);
......
......@@ -25,6 +25,7 @@ package cx.ring.history;
import android.content.res.Resources;
import android.os.Parcel;
import android.os.Parcelable;
import com.j256.ormlite.field.DatabaseField;
import cx.ring.R;
......@@ -38,7 +39,7 @@ import java.util.TimeZone;
public class HistoryCall implements Parcelable {
@DatabaseField(index = true, columnName="TIMESTAMP_START")
@DatabaseField(index = true, columnName = "TIMESTAMP_START")
public long call_start;
@DatabaseField
public long call_end;
......@@ -66,6 +67,7 @@ public class HistoryCall implements Parcelable {
public long getContactID() {
return contactID;
}
public String getContactKey() {
return contactKey;
}
......@@ -101,9 +103,11 @@ public class HistoryCall implements Parcelable {
public String getDate() {
return HistoryTimeModel.timeToHistoryConst(call_start);
}
public Date getStartDate() {
return new Date(call_start);
}
public Date getEndDate() {
return new Date(call_end);
}
......@@ -119,7 +123,7 @@ public class HistoryCall implements Parcelable {
public String getDurationString() {
long duration = (call_end - call_start)/1000;
long duration = (call_end - call_start) / 1000;
if (duration < 60)
return String.format(Locale.getDefault(), "%02d secs", duration);
......@@ -145,6 +149,13 @@ public class HistoryCall implements Parcelable {
return number;
}
public String getShortenedNumber() {
if (number.length() > 18) {
return number.substring(0, 18).concat("…");
}
return number;
}
@Override
public int describeContents() {
return 0;
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="0dp"
android:color="@android:color/transparent" />
<solid android:color="#dee4e7" />
<padding
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<corners android:radius="5dp" />
</shape>
\ No newline at end of file
......@@ -20,46 +20,65 @@ along with this program; if not, write to the Free Software
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:layout_gravity="end|bottom"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="#ced8da"
android:clickable="true"
android:descendantFocusability="blocksDescendants"
android:focusable="false"
android:padding="12dp">
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/call_icon"
android:layout_alignParentEnd="false"
android:layout_alignParentStart="true"
android:src="@drawable/ic_call_missed_black_24dp"
android:layout_centerVertical="true"
android:layout_marginRight="12dp" />
android:background="@drawable/textmsg_call_background"
android:orientation="horizontal"
android:paddingBottom="4dp"
android:paddingTop="4dp">
<TextView
android:id="@+id/call_hist_txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="false"
android:text="Appel manqué"
android:textColor="@color/text_color_primary"
android:textSize="14sp"
android:layout_toEndOf="@id/call_icon"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:orientation="horizontal">
<TextView
android:id="@+id/call_details_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="false"
android:layout_below="@+id/call_hist_txt"
android:text="Adrien - 12 mars"
android:textColor="@color/text_color_secondary"
android:textSize="12sp"
android:layout_toEndOf="@id/call_icon" />
<ImageView
android:id="@+id/call_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.75"
android:src="@drawable/ic_call_missed_black_24dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:orientation="vertical">
<TextView
android:id="@+id/call_hist_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="false"
android:text="Appel manqué"
android:textColor="@color/text_color_primary"
android:textSize="14sp" />
<TextView
android:id="@+id/call_details_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Adrien - 12 mars"
android:textColor="@color/text_color_secondary"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
......@@ -52,7 +52,10 @@ along with this program; if not, write to the Free Software
android:ellipsize="marquee"
android:focusable="true"
android:marqueeRepeatLimit="marquee_forever"
android:padding="12dp"
android:paddingBottom="8dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="8dp"
android:scrollHorizontally="true"
android:singleLine="false"
android:textColor="@color/text_color_primary"
......
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