Fix squared images in chat

This commit is contained in:
Sylvain Berfini 2016-09-09 12:03:05 +02:00
parent 5378f46b56
commit 0d62aef3c6
3 changed files with 32 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View file

@ -27,14 +27,33 @@
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/delete_message"
android:orientation="horizontal">
<ImageView
android:id="@+id/contact_picture"
android:src="@drawable/avatar"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:layout_width="40dp"
android:layout_height="40dp"/>
<RelativeLayout
android:id="@+id/avatar_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true">
<ImageView
android:id="@+id/contact_picture"
android:src="@drawable/avatar"
android:contentDescription="@string/content_description_contact_picture"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:layout_width="45dp"
android:layout_height="45dp"
android:adjustViewBounds="true"/>
<ImageView
android:id="@+id/mask"
android:src="@drawable/avatar_chat_mask"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:layout_width="45dp"
android:layout_height="45dp"
android:adjustViewBounds="true"/>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
@ -111,4 +130,4 @@
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>

View file

@ -950,6 +950,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
public Button fileTransferAction;
public ImageView messageStatus;
public ProgressBar messageSendingInProgress;
public ImageView contactPictureMask;
public ViewHolder(View view) {
id = view.getId();
@ -965,6 +966,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
fileTransferAction = (Button) view.findViewById(R.id.file_transfer_action);
messageStatus = (ImageView) view.findViewById(R.id.status);
messageSendingInProgress = (ProgressBar) view.findViewById(R.id.inprogress);
contactPictureMask = (ImageView) view.findViewById(R.id.mask);
}
@Override
@ -1191,6 +1193,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
Compatibility.setTextAppearance(holder.contactName, getActivity(), R.style.font3);
Compatibility.setTextAppearance(holder.fileTransferAction, getActivity(), R.style.font15);
holder.fileTransferAction.setBackgroundResource(R.drawable.resizable_confirm_delete_button);
holder.contactPictureMask.setImageResource(R.drawable.avatar_chat_mask_outgoing);
} else {
if (isEditMode) {
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
@ -1203,6 +1206,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
Compatibility.setTextAppearance(holder.contactName, getActivity(), R.style.font9);
Compatibility.setTextAppearance(holder.fileTransferAction, getActivity(), R.style.font8);
holder.fileTransferAction.setBackgroundResource(R.drawable.resizable_assistant_button);
holder.contactPictureMask.setImageResource(R.drawable.avatar_chat_mask);
}
holder.bubbleLayout.setLayoutParams(layoutParams);