Skip to content

Commit

Permalink
Merge pull request #293 from jpush/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
KenChoi1992 committed Mar 8, 2018
2 parents 738ee39 + d78d3f5 commit 0ea4606
Show file tree
Hide file tree
Showing 51 changed files with 712 additions and 508 deletions.
6 changes: 3 additions & 3 deletions Android/chatinput/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

- Gradle
```groovy
compile 'cn.jiguang.imui:chatinput:0.6.3'
compile 'cn.jiguang.imui:chatinput:0.6.5'
```

- Maven
```
<dependency>
<groupId>cn.jiguang.imui</groupId>
<artifactId>chatinput</artifactId>
<version>0.6.3</version>
<version>0.6.5</version>
<type>pom</type>
</dependency>
```
Expand All @@ -42,7 +42,7 @@ compile 'cn.jiguang.imui:chatinput:0.6.3'
```groovy
dependencies {
compile 'com.github.jpush:imui:0.6.9'
compile 'com.github.jpush:imui:0.7.3'
}
```

Expand Down
6 changes: 3 additions & 3 deletions Android/chatinput/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.3'
compile 'cn.jiguang.imui:chatinput:0.6.5'
```

- Via Maven
Expand All @@ -20,7 +20,7 @@ compile 'cn.jiguang.imui:chatinput:0.6.3'
<dependency>
<groupId>cn.jiguang.imui</groupId>
<artifactId>chatinput</artifactId>
<version>0.6.3</version>
<version>0.6.5</version>
<type>pom</type>
</dependency>
```
Expand All @@ -41,7 +41,7 @@ allprojects {
```groovy
dependencies {
compile 'com.github.jpush:imui:0.6.9'
compile 'com.github.jpush:imui:0.7.3'
}
```

Expand Down
16 changes: 8 additions & 8 deletions Android/chatinput/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'cn.jiguang.imui'
PUBLISH_ARTIFACT_ID = 'chatinput'
PUBLISH_VERSION = '0.6.4'
PUBLISH_VERSION = '0.6.5'
}

android {
compileSdkVersion 25
buildToolsVersion "26.0.2"
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 27
versionCode 2
versionName "0.1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -34,11 +34,11 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
compile 'com.google.android:flexbox:0.2.5'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:25.3.1'
implementation 'com.github.bumptech.glide:glide:4.6.1'
implementation 'com.android.support:support-v4:27.1.0'
testCompile 'junit:junit:4.12'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -77,9 +78,11 @@ public void onBindViewHolder(final PhotoViewHolder holder, int position) {
}

FileItem item = mMedias.get(position);
RequestOptions requestOptions = new RequestOptions();
requestOptions.placeholder(R.drawable.aurora_picture_not_found);
Glide.with(mContext)
.setDefaultRequestOptions(requestOptions)
.load(item.getFilePath())
.placeholder(R.drawable.aurora_picture_not_found)
.into(holder.ivPhoto);

if (mSelectedItems.contains(position)) { // Current photo is selected
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions Android/chatinput/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowActionModeOverlay">true</item>
</style>

<style name="ChatMessageInfo">
<item name="android:textSize">12sp</item>
</style>
Expand Down
14 changes: 7 additions & 7 deletions Android/messagelist/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'cn.jiguang.imui'
PUBLISH_ARTIFACT_ID = 'messagelist'
PUBLISH_VERSION = '0.6.3'
PUBLISH_VERSION = '0.6.4'
}

android {
compileSdkVersion 25
buildToolsVersion "26.0.2"
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 27
versionCode 2
versionName "0.1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -27,9 +27,9 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
testCompile 'junit:junit:4.12'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ private View.OnLongClickListener getMessageLongClickListener(final Wrapper<MESSA
@Override
public boolean onLongClick(View view) {
if (mSelectionListener == null) {
notifyMessageLongClicked(wrapper.item);
notifyMessageLongClicked(view, wrapper.item);
return true;
} else {
mIsSelectedMode = true;
Expand All @@ -583,9 +583,9 @@ public boolean onLongClick(View view) {
};
}

private void notifyMessageLongClicked(MESSAGE message) {
private void notifyMessageLongClicked(View view, MESSAGE message) {
if (mMsgLongClickListener != null) {
mMsgLongClickListener.onMessageLongClick(message);
mMsgLongClickListener.onMessageLongClick(view, message);
}
}

Expand Down Expand Up @@ -645,7 +645,7 @@ public interface OnMsgClickListener<MESSAGE extends IMessage> {
* @param <MESSAGE>
*/
public interface OnMsgLongClickListener<MESSAGE extends IMessage> {
void onMessageLongClick(MESSAGE message);
void onMessageLongClick(View view, MESSAGE message);
}

public interface OnAvatarClickListener<MESSAGE extends IMessage> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.jiguang.imui.messages;


import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
Expand Down Expand Up @@ -45,8 +46,9 @@ public PhotoViewHolder(View itemView, boolean isSender) {

@Override
public void onBind(final MESSAGE message) {
if (message.getTimeString() != null) {
mDateTv.setText(message.getTimeString());
String timeString = message.getTimeString();
if (timeString != null && !TextUtils.isEmpty(timeString)) {
mDateTv.setText(timeString);
} else {
mDateTv.setVisibility(View.GONE);
}
Expand Down Expand Up @@ -85,7 +87,7 @@ public void onClick(View view) {
@Override
public boolean onLongClick(View view) {
if (mMsgLongClickListener != null) {
mMsgLongClickListener.onMessageLongClick(message);
mMsgLongClickListener.onMessageLongClick(view, message);
} else {
if (BuildConfig.DEBUG) {
Log.w("MsgListAdapter", "Didn't set long click listener! Drop event.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cn.jiguang.imui.messages;

import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
Expand Down Expand Up @@ -43,8 +44,9 @@ public TxtViewHolder(View itemView, boolean isSender) {
@Override
public void onBind(final MESSAGE message) {
mMsgTv.setText(message.getText());
if (message.getTimeString() != null) {
mDateTv.setText(message.getTimeString());
String timeString = message.getTimeString();
if (timeString != null && !TextUtils.isEmpty(timeString)) {
mDateTv.setText(timeString);
} else {
mDateTv.setVisibility(View.GONE);
}
Expand Down Expand Up @@ -99,7 +101,7 @@ public void onClick(View view) {
@Override
public boolean onLongClick(View view) {
if (mMsgLongClickListener != null) {
mMsgLongClickListener.onMessageLongClick(message);
mMsgLongClickListener.onMessageLongClick(view, message);
} else {
if (BuildConfig.DEBUG) {
Log.w("MsgListAdapter", "Didn't set long click listener! Drop event.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.graphics.Bitmap;
import android.media.ThumbnailUtils;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
Expand All @@ -22,7 +23,7 @@
public class VideoViewHolder<Message extends IMessage> extends BaseMessageViewHolder<Message>
implements MsgListAdapter.DefaultMessageViewHolder {

private final RoundTextView mTextDate;
private final RoundTextView mDateTv;
private final RoundImageView mImageAvatar;
private TextView mDisplayNameTv;
private final ImageView mImageCover;
Expand All @@ -35,7 +36,7 @@ public class VideoViewHolder<Message extends IMessage> extends BaseMessageViewHo
public VideoViewHolder(View itemView, boolean isSender) {
super(itemView);
this.mIsSender = isSender;
mTextDate = (RoundTextView) itemView.findViewById(R.id.aurora_tv_msgitem_date);
mDateTv = (RoundTextView) itemView.findViewById(R.id.aurora_tv_msgitem_date);
mImageAvatar = (RoundImageView) itemView.findViewById(R.id.aurora_iv_msgitem_avatar);
mImageCover = (ImageView) itemView.findViewById(R.id.aurora_iv_msgitem_cover);
mImagePlay = (ImageView) itemView.findViewById(R.id.aurora_iv_msgitem_play);
Expand All @@ -51,10 +52,11 @@ public VideoViewHolder(View itemView, boolean isSender) {

@Override
public void onBind(final Message message) {
if (message.getTimeString() != null) {
mTextDate.setText(message.getTimeString());
String timeString = message.getTimeString();
if (timeString != null && !TextUtils.isEmpty(timeString)) {
mDateTv.setText(timeString);
} else {
mTextDate.setVisibility(View.GONE);
mDateTv.setVisibility(View.GONE);
}
boolean isAvatarExists = message.getFromUser().getAvatarFilePath() != null
&& !message.getFromUser().getAvatarFilePath().isEmpty();
Expand All @@ -75,7 +77,7 @@ public void onClick(View view) {

@Override
public boolean onLongClick(View view) {
mMsgLongClickListener.onMessageLongClick(message);
mMsgLongClickListener.onMessageLongClick(view, message);
return false;
}
});
Expand Down Expand Up @@ -130,12 +132,12 @@ public void onClick(View view) {

@Override
public void applyStyle(MessageListStyle style) {
mTextDate.setTextSize(style.getDateTextSize());
mTextDate.setTextColor(style.getDateTextColor());
mTextDate.setPadding(style.getDatePaddingLeft(), style.getDatePaddingTop(),
mDateTv.setTextSize(style.getDateTextSize());
mDateTv.setTextColor(style.getDateTextColor());
mDateTv.setPadding(style.getDatePaddingLeft(), style.getDatePaddingTop(),
style.getDatePaddingRight(), style.getDatePaddingBottom());
mTextDate.setBgCornerRadius(style.getDateBgCornerRadius());
mTextDate.setBgColor(style.getDateBgColor());
mDateTv.setBgCornerRadius(style.getDateBgCornerRadius());
mDateTv.setBgColor(style.getDateBgColor());
if (mIsSender) {
if (style.getSendingProgressDrawable() != null) {
mSendingPb.setProgressDrawable(style.getSendingProgressDrawable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.graphics.drawable.AnimationDrawable;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
Expand Down Expand Up @@ -71,8 +72,9 @@ public boolean onError(MediaPlayer mp, int what, int extra) {
return false;
}
});
if (message.getTimeString() != null) {
mDateTv.setText(message.getTimeString());
String timeString = message.getTimeString();
if (timeString != null && !TextUtils.isEmpty(timeString)) {
mDateTv.setText(timeString);
} else {
mDateTv.setVisibility(View.GONE);
}
Expand Down Expand Up @@ -180,7 +182,7 @@ public void onClick(View view) {
@Override
public boolean onLongClick(View view) {
if (mMsgLongClickListener != null) {
mMsgLongClickListener.onMessageLongClick(message);
mMsgLongClickListener.onMessageLongClick(view, message);
} else {
if (BuildConfig.DEBUG) {
Log.w("MsgListAdapter", "Didn't set long click listener! Drop event.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import android.graphics.Bitmap;
import android.util.LruCache;

/**
* Created by caiyaoguan on 2017/7/6.
*/

public class BitmapCache {

Expand All @@ -28,11 +25,6 @@ protected int sizeOf(String key, Bitmap bitmap) {
};
}

/**
* 通过此方法来获取NativeImageLoader的实例
*
* @return NativeImageLoader
*/
public static BitmapCache getInstance() {
return mInstance;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
android:layout_marginTop="10dp">

<cn.jiguang.imui.view.RoundImageView
android:id="@+id/aurora_iv_msgitem_avatar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
android:layout_marginTop="10dp">

<cn.jiguang.imui.view.RoundImageView
android:id="@+id/aurora_iv_msgitem_avatar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="4dp">
android:layout_marginTop="10dp">

<cn.jiguang.imui.view.RoundImageView
android:id="@+id/aurora_iv_msgitem_avatar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
android:layout_marginTop="10dp">

<cn.jiguang.imui.view.RoundImageView
android:id="@+id/aurora_iv_msgitem_avatar"
Expand Down
Loading

0 comments on commit 0ea4606

Please sign in to comment.