Skip to content

Commit

Permalink
jchat2.1.0版本增加:群组@、保存图片、呼吸灯、消息撤回、文本消息url识别、呼吸灯;修复进入会话时跳闪问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyanan committed Aug 4, 2017
1 parent 3e6e77d commit 7522af7
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1137,22 +1137,28 @@ private ImageView setPictureScale(String extra, Message message, String path, fi
}

private ImageView setDensity(String extra, Message message, double imageWidth, double imageHeight, ImageView imageView) {

if (extra != null) {
imageWidth = 200;
imageHeight = 200;
} else {
if (imageWidth > 300) {
imageWidth = 450;
imageHeight = 300;
imageWidth = 550;
imageHeight = 250;
} else if (imageHeight > 450) {
imageWidth = 300;
imageHeight = 450;
} else if ((imageWidth < 50 && imageWidth > 20) || (imageHeight < 50 && imageHeight > 20)) {
imageWidth = 200;
imageHeight = 300;
} else if (imageWidth < 20 || imageHeight < 20) {
imageWidth = 100;
imageHeight = 150;
} else {
imageWidth = 300;
imageHeight = 450;
}
}

ViewGroup.LayoutParams params = imageView.getLayoutParams();
params.width = (int) imageWidth;
params.height = (int) imageHeight;
Expand Down
6 changes: 2 additions & 4 deletions chatapp/src/main/java/jiguang/chat/view/ChatView.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

Expand Down Expand Up @@ -75,13 +74,12 @@ public DropDownListView getListView() {
}
public void setToBottom() {
mChatListView.clearFocus();
mChatListView.setSelection(ListView.FOCUS_DOWN);
mChatListView.postDelayed(new Runnable() {
mChatListView.post(new Runnable() {
@Override
public void run() {
mChatListView.setSelection(mChatListView.getAdapter().getCount() - 1);
}
}, 500);
});
}
public void setConversation(Conversation conv) {
this.mConv = conv;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<ImageView
android:id="@+id/jmui_picture_iv"
android:layout_width="163dp"
android:layout_height="wrap_content"
android:layout_height="90dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:scaleType="fitXY"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<TextView
android:id="@+id/jmui_msg_content"
android:autoLink="email|phone|web"
android:autoLink="web"
android:textColorLink="#157BFB"
style="@style/jmui_msg_text_style"
android:layout_width="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ImageView
android:id="@+id/jmui_picture_iv"
android:layout_width="163dp"
android:layout_height="wrap_content"
android:layout_height="90dp"
android:gravity="center|bottom"
android:scaleType="fitXY"
android:src="@drawable/jmui_location_default"/>
Expand Down
2 changes: 1 addition & 1 deletion chatapp/src/main/res/layout/jmui_chat_item_send_text.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<TextView
android:id="@+id/jmui_msg_content"
android:autoLink="email|phone|web"
android:autoLink="web"
android:textColorLink="#157BFB"
style="@style/jmui_msg_text_style"
android:layout_width="wrap_content"
Expand Down

0 comments on commit 7522af7

Please sign in to comment.