Smaller image is displayed as a thumbnail.
The thumbnail is now 200dp by 200dp
This commit is contained in:
@@ -52,7 +52,6 @@ import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.SimpleItemAnimator;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -158,7 +157,13 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
protected EndlessScrollListener mEndlessScrollListener;
|
||||
protected BaseChatAdapter mBaseChatAdapter;
|
||||
private Snackbar mSnackbar;
|
||||
|
||||
MediaRecorder mMediaRecorder;
|
||||
private int xDelta;
|
||||
private String mAudioFilePath;
|
||||
private Rect mDialogContainer;
|
||||
private int mInitialLeft = 0;
|
||||
private int mInitialMarginLeft = 0;
|
||||
|
||||
@Inject
|
||||
@Named(AppPrefsConstants.CHAT_OPENED)
|
||||
@@ -346,14 +351,6 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
mSendMessageImageView.setEnabled(!TextUtils.isEmpty(editable.toString()) && editable.toString().trim().length() > 0);
|
||||
}
|
||||
|
||||
private int xDelta;
|
||||
private String mAudioFilePath;
|
||||
private Rect mDialogContainer;
|
||||
private int mStartMarginLeft = 0;
|
||||
private int mInitialMarginX = 0;
|
||||
private int mInitialLeft = 0;
|
||||
private int mInitialMarginLeft = 0;
|
||||
|
||||
private void selectFile(int requestCode) {
|
||||
final String[] zipFileTypes = {".zip", ".rar", ".7z"};
|
||||
final String[] pdfFileTypes = {".pdf"};
|
||||
@@ -437,19 +434,11 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
GridLayout.LayoutParams layoutParams1 = (GridLayout.LayoutParams) v.getLayoutParams();
|
||||
xDelta = x - layoutParams1.leftMargin;
|
||||
|
||||
Log.d("ON_TOUCH", "starting value of left margin: " + layoutParams1.leftMargin);
|
||||
|
||||
mInitialMarginLeft = ((GridLayout.LayoutParams) attachRecordAudioImageView.getLayoutParams()).leftMargin;
|
||||
|
||||
mDialogContainer = ViewUtils.getRectFromView(dialog.findViewById(R.id.dialogGridLayout));
|
||||
|
||||
|
||||
mInitialLeft = ViewUtils.getRectFromView(attachRecordAudioImageView).left;
|
||||
mInitialMarginX = mInitialLeft - mInitialMarginLeft;
|
||||
Log.d("ON_TOUCH", "initial left x value from audio recording button: " + mInitialMarginX + "; initial left: " + mInitialLeft);
|
||||
|
||||
Log.d("ON_TOUCH", "xDelta: " + xDelta);
|
||||
|
||||
|
||||
attachRecordAudioImageView.setImageResource(R.mipmap.ic_file_dialog_record_audio_pressed);
|
||||
limitTextView.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -332,7 +332,7 @@ abstract class BaseChatAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
viewHolder.fileImageView.setImageDrawable(null);
|
||||
Log.d("FILE_PATH", message.toString());
|
||||
Glide.with(viewHolder.fileImageView.getContext())
|
||||
.load(message.filePath)
|
||||
.load(TextUtils.isEmpty(message.smallerImage) ? message.filePath : message.smallerImage)
|
||||
.placeholder(R.drawable.document)
|
||||
.dontAnimate()
|
||||
.override(500, 500)
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:paddingLeft="40dp"
|
||||
android:paddingEnd="40dp"
|
||||
android:paddingRight="0dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingBottom="0dp">
|
||||
|
||||
@@ -26,17 +24,14 @@
|
||||
android:padding="7dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_toEndOf="@id/chat_item_contact_image"
|
||||
android:layout_toRightOf="@id/chat_item_contact_image"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chat_item_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:textColor="@color/colorManatee"
|
||||
android:textSize="10sp"
|
||||
@@ -48,13 +43,12 @@
|
||||
android:id="@+id/chat_item_file"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@id/chat_item_time"
|
||||
android:layout_marginTop="4dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/document"
|
||||
tools:visibility="visible" />
|
||||
@@ -64,7 +58,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/chat_item_file"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:visibility="gone"
|
||||
@@ -77,7 +70,6 @@
|
||||
android:layout_height="90dp"
|
||||
android:layout_below="@id/chat_item_time"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:visibility="gone"
|
||||
custom:donut_finished_color="@color/colorDefault"
|
||||
@@ -90,7 +82,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/chat_item_file_name"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
emojicon:emojiconSize="20sp"
|
||||
style="@style/BaseChatItemText"
|
||||
|
||||
@@ -8,16 +8,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:paddingLeft="40dp"
|
||||
android:paddingEnd="40dp"
|
||||
android:paddingRight="0dp"
|
||||
android:paddingStart="0dp">
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/chat_item_contact_image"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_margin="0dp"
|
||||
android:contentDescription="@null"
|
||||
@@ -28,17 +25,14 @@
|
||||
android:padding="7dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_toEndOf="@id/chat_item_contact_image"
|
||||
android:layout_toRightOf="@id/chat_item_contact_image">
|
||||
android:layout_toEndOf="@id/chat_item_contact_image">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chat_item_sending_failed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/chat_item_message_status"
|
||||
android:layout_toRightOf="@+id/chat_item_message_status"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
@@ -55,10 +49,8 @@
|
||||
android:layout_height="15dp"
|
||||
android:layout_alignBottom="@+id/chat_item_time"
|
||||
android:layout_alignTop="@+id/chat_item_time"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_toEndOf="@+id/chat_item_time"
|
||||
android:layout_toRightOf="@+id/chat_item_time"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
@@ -68,10 +60,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/chat_item_time"
|
||||
android:layout_alignTop="@+id/chat_item_time"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_toEndOf="@+id/chat_item_time"
|
||||
android:layout_toRightOf="@+id/chat_item_time"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:visibility="gone"
|
||||
@@ -82,7 +72,6 @@
|
||||
android:id="@+id/chat_item_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:textColor="@color/colorTimestamp"
|
||||
android:textSize="10sp"
|
||||
@@ -94,13 +83,12 @@
|
||||
android:id="@+id/chat_item_file"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@id/chat_item_time"
|
||||
android:layout_marginTop="4dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/document"
|
||||
tools:visibility="visible" />
|
||||
@@ -109,7 +97,6 @@
|
||||
android:id="@+id/chat_item_file_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@+id/chat_item_file"
|
||||
android:textColor="@color/colorBlack"
|
||||
@@ -121,7 +108,6 @@
|
||||
android:id="@+id/chat_item_progress"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="90dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@id/chat_item_time"
|
||||
android:layout_marginTop="4dp"
|
||||
@@ -133,7 +119,6 @@
|
||||
android:id="@+id/chat_item_message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@id/chat_item_file_name"
|
||||
android:padding="0dp"
|
||||
|
||||
Reference in New Issue
Block a user