From 9638dcea140808691ac7783c9680ea581aca9505 Mon Sep 17 00:00:00 2001 From: KenChoi Date: Thu, 6 Jul 2017 14:37:32 +0800 Subject: [PATCH 1/3] optimize VideoViewHolder --- .../imui/messages/BaseMessageViewHolder.java | 1 + .../cn/jiguang/imui/messages/MessageList.java | 46 ++++++++++++-- .../jiguang/imui/messages/MsgListAdapter.java | 10 +++ .../imui/messages/PhotoViewHolder.java | 7 ++- .../imui/messages/ScrollMoreListener.java | 38 ++++++++++-- .../imui/messages/VideoViewHolder.java | 10 ++- .../cn/jiguang/imui/utils/BitmapCache.java | 61 +++++++++++++++++++ Android/sample/build.gradle | 2 +- .../messages/MessageListActivity.java | 2 + 9 files changed, 163 insertions(+), 14 deletions(-) create mode 100644 Android/messagelist/src/main/java/cn/jiguang/imui/utils/BitmapCache.java diff --git a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/BaseMessageViewHolder.java b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/BaseMessageViewHolder.java index 0493b987..c8bffc55 100644 --- a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/BaseMessageViewHolder.java +++ b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/BaseMessageViewHolder.java @@ -23,6 +23,7 @@ public abstract class BaseMessageViewHolder protected MsgListAdapter.OnAvatarClickListener mAvatarClickListener; protected MsgListAdapter.OnMsgResendListener mMsgResendListener; protected MediaPlayer mMediaPlayer; + protected boolean mScroll; public BaseMessageViewHolder(View itemView) { super(itemView); diff --git a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/MessageList.java b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/MessageList.java index 0e77d116..142f4f65 100644 --- a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/MessageList.java +++ b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/MessageList.java @@ -7,28 +7,32 @@ import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SimpleItemAnimator; import android.util.AttributeSet; +import android.view.GestureDetector; +import android.view.MotionEvent; import cn.jiguang.imui.commons.models.IMessage; -public class MessageList extends RecyclerView { +public class MessageList extends RecyclerView implements GestureDetector.OnGestureListener { private Context mContext; private MessageListStyle mMsgListStyle; + private final GestureDetector mGestureDetector; + private MsgListAdapter mAdapter; public MessageList(Context context) { - super(context); + this(context, null); } public MessageList(Context context, @Nullable AttributeSet attrs) { - super(context, attrs); - parseStyle(context, attrs); + this(context, attrs, 0); } public MessageList(Context context, @Nullable AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); parseStyle(context, attrs); + mGestureDetector = new GestureDetector(context, this); } @SuppressWarnings("ResourceType") @@ -44,6 +48,7 @@ private void parseStyle(Context context, AttributeSet attrs) { * @param Message model extends IMessage. */ public void setAdapter(MsgListAdapter adapter) { + mAdapter = adapter; SimpleItemAnimator itemAnimator = new DefaultItemAnimator(); itemAnimator.setSupportsChangeAnimations(false); setItemAnimator(itemAnimator); @@ -196,4 +201,37 @@ public void setSendingIndeterminateDrawable(String drawableName, String packageN int resId = getResources().getIdentifier(drawableName, "drawable", packageName); mMsgListStyle.setSendingIndeterminateDrawable(getResources().getDrawable(resId)); } + + @Override + public boolean onDown(MotionEvent e) { + return false; + } + + @Override + public void onShowPress(MotionEvent e) { + + } + + @Override + public boolean onSingleTapUp(MotionEvent e) { + return false; + } + + @Override + public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { + return false; + } + + @Override + public void onLongPress(MotionEvent e) { + + } + + @Override + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { + if (Math.abs(velocityY) > 4000) { + mAdapter.setScrolling(true); + } + return false; + } } diff --git a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/MsgListAdapter.java b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/MsgListAdapter.java index 51ecbcae..3949183c 100644 --- a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/MsgListAdapter.java +++ b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/MsgListAdapter.java @@ -67,6 +67,7 @@ public class MsgListAdapter extends RecyclerView.Adapt private MediaPlayer mMediaPlayer = new MediaPlayer(); private List mItems; + private boolean mScroll; public MsgListAdapter(String senderId, ImageLoader imageLoader) { this(senderId, new HoldersConfig(), imageLoader); @@ -79,6 +80,14 @@ public MsgListAdapter(String senderId, HoldersConfig holders, ImageLoader imageL mItems = new ArrayList<>(); } + public void setScrolling(boolean scroll) { + this.mScroll = scroll; + } + + public boolean getScrolling() { + return this.mScroll; + } + @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { switch (viewType) { @@ -173,6 +182,7 @@ public void onBindViewHolder(ViewHolder holder, int position) { ((BaseMessageViewHolder) holder).mAvatarClickListener = this.mAvatarClickListener; ((BaseMessageViewHolder) holder).mMsgResendListener = this.mMsgResendListener; ((BaseMessageViewHolder) holder).mMediaPlayer = this.mMediaPlayer; + ((BaseMessageViewHolder) holder).mScroll = this.mScroll; } holder.onBind(wrapper.item); } diff --git a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/PhotoViewHolder.java b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/PhotoViewHolder.java index 510c6ebe..243ffe89 100644 --- a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/PhotoViewHolder.java +++ b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/PhotoViewHolder.java @@ -47,7 +47,12 @@ public void onBind(final MESSAGE message) { mImageLoader.loadAvatarImage(mAvatarIv, message.getFromUser().getAvatarFilePath()); } - mImageLoader.loadImage(mPhotoIv, message.getMediaFilePath()); + if (mScroll) { + mPhotoIv.setImageResource(R.drawable.aurora_picture_not_found); + } else { + mImageLoader.loadImage(mPhotoIv, message.getMediaFilePath()); + } + mAvatarIv.setOnClickListener(new View.OnClickListener() { @Override diff --git a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/ScrollMoreListener.java b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/ScrollMoreListener.java index 64640020..86d5a0ae 100644 --- a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/ScrollMoreListener.java +++ b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/ScrollMoreListener.java @@ -6,17 +6,22 @@ import android.support.v7.widget.RecyclerView; import android.support.v7.widget.StaggeredGridLayoutManager; +import static android.support.v7.widget.RecyclerView.SCROLL_STATE_DRAGGING; +import static android.support.v7.widget.RecyclerView.SCROLL_STATE_IDLE; +import static android.support.v7.widget.RecyclerView.SCROLL_STATE_SETTLING; + public class ScrollMoreListener extends RecyclerView.OnScrollListener { private RecyclerView.LayoutManager mLayoutManager; - private OnLoadMoreListener mListener; + private MsgListAdapter mAdapter; private int mCurrentPage = 0; private int mPreviousTotalItemCount = 0; private boolean mLoading = false; + private boolean mScrolled = false; - public ScrollMoreListener(LinearLayoutManager layoutManager, OnLoadMoreListener listener) { + public ScrollMoreListener(LinearLayoutManager layoutManager, MsgListAdapter adapter) { this.mLayoutManager = layoutManager; - this.mListener = listener; + mAdapter = adapter; } private int getLastVisibleItem(int[] lastVisibleItemPositions) { @@ -33,7 +38,10 @@ private int getLastVisibleItem(int[] lastVisibleItemPositions) { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { - if (mListener != null) { + if (dy != 0) { + mScrolled = true; + } + if (mAdapter != null) { int lastVisibleItemPosition = 0; int totalItemCount = mLayoutManager.getItemCount(); if (mLayoutManager instanceof StaggeredGridLayoutManager) { @@ -62,12 +70,32 @@ public void onScrolled(RecyclerView recyclerView, int dx, int dy) { int visibleThreshold = 5; if (!mLoading && lastVisibleItemPosition + visibleThreshold > totalItemCount) { mCurrentPage++; - mListener.onLoadMore(mCurrentPage, totalItemCount); + mAdapter.onLoadMore(mCurrentPage, totalItemCount); mLoading = true; } } } + @Override + public void onScrollStateChanged(RecyclerView recyclerView, int newState) { + switch (newState) { + case SCROLL_STATE_IDLE: + if (mAdapter.getScrolling() && mScrolled) { + mAdapter.setScrolling(false); + mAdapter.notifyDataSetChanged(); + } + mScrolled = false; + break; + case SCROLL_STATE_DRAGGING: +// mAdapter.setScrolling(false); + break; + case SCROLL_STATE_SETTLING: +// mAdapter.setScrolling(true); + break; + } + super.onScrollStateChanged(recyclerView, newState); + } + interface OnLoadMoreListener { void onLoadMore(int page, int total); } diff --git a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/VideoViewHolder.java b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/VideoViewHolder.java index f3d3724a..2db8b0db 100644 --- a/Android/messagelist/src/main/java/cn/jiguang/imui/messages/VideoViewHolder.java +++ b/Android/messagelist/src/main/java/cn/jiguang/imui/messages/VideoViewHolder.java @@ -14,6 +14,7 @@ import cn.jiguang.imui.R; import cn.jiguang.imui.commons.models.IMessage; +import cn.jiguang.imui.utils.BitmapCache; import cn.jiguang.imui.view.CircleImageView; @@ -51,9 +52,12 @@ public void onBind(final Message message) { boolean isAvatarExists = message.getFromUser().getAvatarFilePath() != null && !message.getFromUser().getAvatarFilePath().isEmpty(); - Bitmap thumb = ThumbnailUtils.createVideoThumbnail(message.getMediaFilePath(), - MediaStore.Images.Thumbnails.MINI_KIND); - mImageCover.setImageBitmap(thumb); + if (BitmapCache.getInstance().getBitmapFromMemCache(message.getMediaFilePath()) == null) { + Bitmap thumb = ThumbnailUtils.createVideoThumbnail(message.getMediaFilePath(), + MediaStore.Images.Thumbnails.MINI_KIND); + BitmapCache.getInstance().setBitmapCache(message.getMediaFilePath(), thumb); + } + mImageCover.setImageBitmap(BitmapCache.getInstance().getBitmapFromMemCache(message.getMediaFilePath())); mImageCover.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { diff --git a/Android/messagelist/src/main/java/cn/jiguang/imui/utils/BitmapCache.java b/Android/messagelist/src/main/java/cn/jiguang/imui/utils/BitmapCache.java new file mode 100644 index 00000000..116169bd --- /dev/null +++ b/Android/messagelist/src/main/java/cn/jiguang/imui/utils/BitmapCache.java @@ -0,0 +1,61 @@ +package cn.jiguang.imui.utils; + +import android.graphics.Bitmap; +import android.util.LruCache; + +/** + * Created by caiyaoguan on 2017/7/6. + */ + +public class BitmapCache { + + private LruCache mMemoryCache; + private static BitmapCache mInstance = new BitmapCache(); + + private BitmapCache() { + //获取应用程序的最大内存 + final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024); + + //用最大内存的1/4来存储图片 + final int cacheSize = maxMemory / 4; + mMemoryCache = new LruCache(cacheSize) { + + //获取每张图片的大小 + @Override + protected int sizeOf(String key, Bitmap bitmap) { + return bitmap.getRowBytes() * bitmap.getHeight() / 1024; + } + }; + } + + /** + * 通过此方法来获取NativeImageLoader的实例 + * + * @return NativeImageLoader + */ + public static BitmapCache getInstance() { + return mInstance; + } + + public void setBitmapCache(String path, Bitmap bitmap) { + if (getBitmapFromMemCache(path) == null && bitmap != null) { + mMemoryCache.put(path, bitmap); + } + } + + /** + * 根据key来获取内存中的图片 + * + * @param key path + * @return bitmap + */ + public Bitmap getBitmapFromMemCache(String key) { + if (key == null) { + return null; + } else { + return mMemoryCache.get(key); + } + } + + +} diff --git a/Android/sample/build.gradle b/Android/sample/build.gradle index aabd09c5..84aab455 100644 --- a/Android/sample/build.gradle +++ b/Android/sample/build.gradle @@ -14,7 +14,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:3.0.0-alpha2' + classpath 'com.android.tools.build:gradle:3.0.0-alpha4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/Android/sample/exampleui/src/main/java/imui/jiguang/cn/imuisample/messages/MessageListActivity.java b/Android/sample/exampleui/src/main/java/imui/jiguang/cn/imuisample/messages/MessageListActivity.java index 6651e8c8..2e23b93d 100644 --- a/Android/sample/exampleui/src/main/java/imui/jiguang/cn/imuisample/messages/MessageListActivity.java +++ b/Android/sample/exampleui/src/main/java/imui/jiguang/cn/imuisample/messages/MessageListActivity.java @@ -13,6 +13,7 @@ import android.support.v4.app.ActivityCompat; import android.text.TextUtils; import android.text.format.DateFormat; +import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.Window; @@ -372,6 +373,7 @@ public void onMessageResend(MyMessage message) { @Override public void onLoadMore(int page, int totalCount) { if (totalCount < mData.size()) { + Log.i("MessageListActivity", "Loading next page"); loadNextPage(); } } From 7b2106a0ca937190f3336da1aa362fb436006ae4 Mon Sep 17 00:00:00 2001 From: KenChoi Date: Mon, 10 Jul 2017 13:50:03 +0800 Subject: [PATCH 2/3] modify RN android sample --- .../cn/imuisample/messages/MessageListActivity.java | 2 +- .../jiguang/imui/messagelist/ReactMsgListManager.java | 1 + ReactNative/sample/android/build.gradle | 11 ++++++++++- .../android/gradle/wrapper/gradle-wrapper.properties | 4 ++-- .../react-native-android/pages/chat_activity.js | 8 +++++++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Android/sample/exampleui/src/main/java/imui/jiguang/cn/imuisample/messages/MessageListActivity.java b/Android/sample/exampleui/src/main/java/imui/jiguang/cn/imuisample/messages/MessageListActivity.java index 2e23b93d..57d2a7b0 100644 --- a/Android/sample/exampleui/src/main/java/imui/jiguang/cn/imuisample/messages/MessageListActivity.java +++ b/Android/sample/exampleui/src/main/java/imui/jiguang/cn/imuisample/messages/MessageListActivity.java @@ -372,7 +372,7 @@ public void onMessageResend(MyMessage message) { mAdapter.setOnLoadMoreListener(new MsgListAdapter.OnLoadMoreListener() { @Override public void onLoadMore(int page, int totalCount) { - if (totalCount < mData.size()) { + if (totalCount <= mData.size()) { Log.i("MessageListActivity", "Loading next page"); loadNextPage(); } diff --git a/ReactNative/android/src/main/java/cn/jiguang/imui/messagelist/ReactMsgListManager.java b/ReactNative/android/src/main/java/cn/jiguang/imui/messagelist/ReactMsgListManager.java index 587824bb..1b76f85f 100644 --- a/ReactNative/android/src/main/java/cn/jiguang/imui/messagelist/ReactMsgListManager.java +++ b/ReactNative/android/src/main/java/cn/jiguang/imui/messagelist/ReactMsgListManager.java @@ -365,3 +365,4 @@ public void onCatalystInstanceDestroy() { mContext.unregisterReceiver(RCTMsgListReceiver); } } +ra \ No newline at end of file diff --git a/ReactNative/sample/android/build.gradle b/ReactNative/sample/android/build.gradle index 36d36629..009d88ca 100644 --- a/ReactNative/sample/android/build.gradle +++ b/ReactNative/sample/android/build.gradle @@ -3,9 +3,18 @@ buildscript { repositories { jcenter() + maven { + url 'https://oss.sonatype.org/content/repositories/snapshots/' + } + maven { + url 'https://maven.google.com' + } + maven { + url 'https://dl.google.com/dl/android/maven2/' + } } dependencies { - classpath 'com.android.tools.build:gradle:3.0.0-alpha2' + classpath 'com.android.tools.build:gradle:3.0.0-alpha4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/ReactNative/sample/android/gradle/wrapper/gradle-wrapper.properties b/ReactNative/sample/android/gradle/wrapper/gradle-wrapper.properties index 4b33a93d..6c4f61ce 100644 --- a/ReactNative/sample/android/gradle/wrapper/gradle-wrapper.properties +++ b/ReactNative/sample/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue May 23 16:42:31 CST 2017 +#Fri Jul 07 11:14:30 CST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-rc-1-all.zip diff --git a/ReactNative/sample/react-native-android/pages/chat_activity.js b/ReactNative/sample/react-native-android/pages/chat_activity.js index 1fa0c754..8c80717e 100644 --- a/ReactNative/sample/react-native-android/pages/chat_activity.js +++ b/ReactNative/sample/react-native-android/pages/chat_activity.js @@ -35,6 +35,7 @@ export default class ChatActivity extends React.Component { height: 100 }, isDismissMenuContainer: false, + updateUI: false, }; @@ -146,7 +147,9 @@ export default class ChatActivity extends React.Component { timeString: "10:00", }]; AuroraIMUIModule.appendMessages(messages); - this.forceUpdate(); + this.setState({ + updateUI: true + }); } onSendGalleryFiles(mediaFiles) { @@ -381,6 +384,9 @@ export default class ChatActivity extends React.Component { this.view = com} + updateUI = {this.state.updateUI} onMsgClick = {this.onMsgClick} onMsgLongClick = {this.onMsgLongClick} onAvatarClick = {this.onAvatarClick} From 698c1a7761415838119c33ade8cbb273fdebc061 Mon Sep 17 00:00:00 2001 From: KenChoi Date: Mon, 10 Jul 2017 13:57:07 +0800 Subject: [PATCH 3/3] prepare release v0.4.3 --- Android/chatinput/README.md | 6 +++--- Android/chatinput/README_EN.md | 6 +++--- Android/chatinput/build.gradle | 2 +- Android/messagelist/build.gradle | 2 +- docs/Android/message_list_usage.md | 8 ++++---- docs/Android/message_list_usage_zh.md | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Android/chatinput/README.md b/Android/chatinput/README.md index d0735b76..f33ed240 100644 --- a/Android/chatinput/README.md +++ b/Android/chatinput/README.md @@ -12,7 +12,7 @@ - Gradle ```groovy -compile 'cn.jiguang.imui:chatinput:0.2.0' +compile 'cn.jiguang.imui:chatinput:0.4.3' ``` - Maven @@ -20,7 +20,7 @@ compile 'cn.jiguang.imui:chatinput:0.2.0' cn.jiguang.imui chatinput - 0.2.0 + 0.4.3 pom ``` @@ -42,7 +42,7 @@ compile 'cn.jiguang.imui:chatinput:0.2.0' ```groovy dependencies { - compile 'com.github.jpush:imui:0.2.0' + compile 'com.github.jpush:imui:0.4.3' } ``` diff --git a/Android/chatinput/README_EN.md b/Android/chatinput/README_EN.md index b1780195..497be434 100644 --- a/Android/chatinput/README_EN.md +++ b/Android/chatinput/README_EN.md @@ -11,7 +11,7 @@ Provides several ways to add dependency, you can choose one of them: - Via Gradle ```groovy -compile 'cn.jiguang.imui:chatinput:0.2.0' +compile 'cn.jiguang.imui:chatinput:0.4.3' ``` - Via Maven @@ -20,7 +20,7 @@ compile 'cn.jiguang.imui:chatinput:0.2.0' cn.jiguang.imui chatinput - 0.2.0 + 0.4.3 pom ``` @@ -41,7 +41,7 @@ allprojects { ```groovy dependencies { - compile 'com.github.jpush:imui:0.2.0' + compile 'com.github.jpush:imui:0.4.3' } ``` diff --git a/Android/chatinput/build.gradle b/Android/chatinput/build.gradle index 37bab29e..7df6a828 100644 --- a/Android/chatinput/build.gradle +++ b/Android/chatinput/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.android.library' ext { PUBLISH_GROUP_ID = 'cn.jiguang.imui' PUBLISH_ARTIFACT_ID = 'chatinput' - PUBLISH_VERSION = '0.3.4-beta' + PUBLISH_VERSION = '0.4.3' } android { diff --git a/Android/messagelist/build.gradle b/Android/messagelist/build.gradle index 223426fa..86c0e7d0 100644 --- a/Android/messagelist/build.gradle +++ b/Android/messagelist/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.android.library' ext { PUBLISH_GROUP_ID = 'cn.jiguang.imui' PUBLISH_ARTIFACT_ID = 'messagelist' - PUBLISH_VERSION = '0.4.2' + PUBLISH_VERSION = '0.4.3' } android { diff --git a/docs/Android/message_list_usage.md b/docs/Android/message_list_usage.md index e2f6248d..7e083001 100644 --- a/docs/Android/message_list_usage.md +++ b/docs/Android/message_list_usage.md @@ -10,7 +10,7 @@ We have support several ways to add dependency. You can choose one of them. - Gradle: ```groovy -compile 'cn.jiguang.imui:messagelist:0.4.0' +compile 'cn.jiguang.imui:messagelist:0.4.3' ``` - Maven: @@ -18,7 +18,7 @@ compile 'cn.jiguang.imui:messagelist:0.4.0' cn.jiguang.imui messagelist - 0.4.0 + 0.4.3 pom ``` @@ -35,7 +35,7 @@ allprojects { // Add in module's build.gradle dependencies { - compile 'com.github.jpush:imui:0.4.0' + compile 'com.github.jpush:imui:0.4.3' } ``` @@ -203,7 +203,7 @@ adapter.addToEnd(messages); ``` - Scroll to load history messages -After adding this listener: `OnLoadMoreListener`,when scroll to top will fire `onLoadMore` event,for example: + After adding this listener: `OnLoadMoreListener`,when scroll to top will fire `onLoadMore` event,for example: ```java mAdapter.setOnLoadMoreListener(new MsgListAdapter.OnLoadMoreListener() { @Override diff --git a/docs/Android/message_list_usage_zh.md b/docs/Android/message_list_usage_zh.md index 07ff8518..9f30d326 100644 --- a/docs/Android/message_list_usage_zh.md +++ b/docs/Android/message_list_usage_zh.md @@ -9,7 +9,7 @@ - Gradle ```groovy -compile 'cn.jiguang.imui:messagelist:0.4.0' +compile 'cn.jiguang.imui:messagelist:0.4.3' ``` - Maven @@ -17,7 +17,7 @@ compile 'cn.jiguang.imui:messagelist:0.4.0' cn.jiguang.imui messagelist - 0.4.0 + 0.4.3 pom ``` @@ -34,7 +34,7 @@ allprojects { // module/build.gradle dependencies { - compile 'com.github.jpush:imui:0.4.0' + compile 'com.github.jpush:imui:0.4.3' } ``` @@ -197,7 +197,7 @@ adapter.addToEnd(messages); ``` - 滚动列表加载历史消息 -设置监听 `OnLoadMoreListener`,当滚动列表时就会触发 `onLoadMore` 事件,例如: + 设置监听 `OnLoadMoreListener`,当滚动列表时就会触发 `onLoadMore` 事件,例如: ```java mAdapter.setOnLoadMoreListener(new MsgListAdapter.OnLoadMoreListener() { @Override