Jelajahi Sumber

【Android】Update version to 1.3.4

rulongzhang 2 tahun lalu
induk
melakukan
6fb28d0df2
100 mengubah file dengan 2041 tambahan dan 2202 penghapusan
  1. 1 1
      Android/.gitignore
  2. 5 1
      Android/app/build.gradle
  3. 1 1
      Android/app/src/main/java/com/tencent/liteav/demo/AvatarConstant.java
  4. 2 4
      Android/app/src/main/java/com/tencent/liteav/demo/LoginActivity.java
  5. 5 7
      Android/app/src/main/java/com/tencent/liteav/demo/ProfileActivity.java
  6. 2 2
      Android/app/src/main/java/com/tencent/liteav/demo/SplashActivity.java
  7. 0 39
      Android/basic/build.gradle
  8. 0 21
      Android/basic/proguard-rules.pro
  9. 0 5
      Android/basic/src/main/AndroidManifest.xml
  10. 0 27
      Android/basic/src/main/java/com/tencent/liteav/basic/Constants.java
  11. 0 136
      Android/basic/src/main/java/com/tencent/liteav/basic/MD5Utils.java
  12. 0 23
      Android/basic/src/main/java/com/tencent/liteav/basic/OnSingleClickListener.java
  13. 0 59
      Android/basic/src/main/java/com/tencent/liteav/basic/PictureUtils.java
  14. 0 72
      Android/basic/src/main/java/com/tencent/liteav/basic/ResourceUtils.java
  15. 0 2
      Android/basic/src/main/res/values-en/strings.xml
  16. 0 2
      Android/basic/src/main/res/values/colors.xml
  17. 0 2
      Android/basic/src/main/res/values/strings.xml
  18. 0 2
      Android/basic/src/main/res/values/styles.xml
  19. 0 1
      Android/build.gradle
  20. 0 58
      Android/debug/src/main/java/com/tencent/liteav/debug/GenerateTestUserSig.java
  21. 1 1
      Android/gradle.properties
  22. 2 5
      Android/settings.gradle
  23. 8 3
      Android/timcommon/build.gradle
  24. 8 0
      Android/timcommon/src/main/AndroidManifest.xml
  25. 0 1
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/TIMCommonConfig.java
  26. 3 3
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/MessageReactBean.java
  27. 3 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/MessageRepliesBean.java
  28. 505 509
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/TUIMessageBean.java
  29. 0 1
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/TUIReplyQuoteBean.java
  30. 1 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/UserBean.java
  31. 4 7
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/classicui/component/BeginnerGuidePage.java
  32. 14 19
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/classicui/widget/message/ChatFlowReactView.java
  33. 6 13
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/classicui/widget/message/MessageBaseHolder.java
  34. 203 196
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/classicui/widget/message/MessageContentHolder.java
  35. 48 52
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/classicui/widget/message/SelectTextHelper.java
  36. 0 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/CustomLinearLayoutManager.java
  37. 0 3
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/LineControllerView.java
  38. 1 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/MaxWidthFrameLayout.java
  39. 1 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/MaxWidthLinearLayout.java
  40. 1 4
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/MessageProperties.java
  41. 0 4
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/MinimalistLineControllerView.java
  42. 0 1
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/MinimalistTitleBar.java
  43. 9 16
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/PopupInputCard.java
  44. 2 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/RoundCornerImageView.java
  45. 2 3
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/RoundFrameLayout.java
  46. 1 1
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/SwitchCustomWidth.java
  47. 2 3
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/TitleBarLayout.java
  48. 1 4
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/UnreadCountTextView.java
  49. 0 1
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/action/PopActionClickListener.java
  50. 1 3
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/action/PopDialogAdapter.java
  51. 9 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/action/PopMenuAction.java
  52. 13 19
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/action/PopMenuAdapter.java
  53. 2 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/BaseLightActivity.java
  54. 0 1
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/BaseMinimalistLightActivity.java
  55. 35 42
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/ImageSelectActivity.java
  56. 33 42
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/ImageSelectMinimalistActivity.java
  57. 6 8
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/SelectionActivity.java
  58. 6 8
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/SelectionMinimalistActivity.java
  59. 9 16
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/dialog/TUIKitDialog.java
  60. 1 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/face/CustomFace.java
  61. 1 0
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/face/Emoji.java
  62. 97 62
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/face/FaceManager.java
  63. 1 5
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/face/RecentEmojiManager.java
  64. 2 3
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/fragments/BaseFragment.java
  65. 5 6
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/MultiImageData.java
  66. 0 4
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/ShadeImageView.java
  67. 1 3
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/SynthesizedImageView.java
  68. 0 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/Synthesizer.java
  69. 35 31
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/TeamHeadSynthesizer.java
  70. 0 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/UserIconView.java
  71. 11 11
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/impl/CornerTransform.java
  72. 42 64
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/impl/GlideEngine.java
  73. 0 1
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/interfaces/ILayout.java
  74. 15 17
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/interfaces/ITitleBarLayout.java
  75. 1 3
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/interfaces/IUIKitCallback.java
  76. 1 5
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/Attributes.java
  77. 4 6
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/RecyclerSwipeAdapter.java
  78. 6 13
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/SimpleSwipeListener.java
  79. 0 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/SwipeAdapterInterface.java
  80. 13 13
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/SwipeItemMangerImpl.java
  81. 1 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/SwipeItemMangerInterface.java
  82. 314 214
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/SwipeLayout.java
  83. 10 0
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/ChatInputMoreListener.java
  84. 1 0
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/ICommonMessageAdapter.java
  85. 32 33
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/IMessageProperties.java
  86. 0 9
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/OnChatInputMoreActionClickListener.java
  87. 0 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/OnChatPopActionClickListener.java
  88. 5 6
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/OnItemClickListener.java
  89. 2 5
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/ChatReactView.java
  90. 6 13
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/MessageBaseHolder.java
  91. 7 13
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/MessageContentHolder.java
  92. 0 1
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/MessageStatusTimeView.java
  93. 9 5
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/MinimalistMessageLayout.java
  94. 11 19
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/ReplyPreviewView.java
  95. 2 5
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/TimeInLineTextLayout.java
  96. 283 0
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/util/ActivityResultResolver.java
  97. 17 20
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/util/DateTimeUtil.java
  98. 1 2
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/util/FileProvider.java
  99. 71 59
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/util/FileUtil.java
  100. 77 69
      Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/util/ImageUtil.java

+ 1 - 1
Android/.gitignore

@@ -9,4 +9,4 @@ build/
 .cxx
 *.codecc/
 /build.yml
-tuiofflinepush
+

+ 5 - 1
Android/app/build.gradle

@@ -27,5 +27,9 @@ android {
 }
 
 dependencies {
-    api project(':tuiroomkit')
+    implementation project(':tuiroomkit')
+    implementation project(':debug')
+    implementation project(':tuicore')
+    implementation "androidx.navigation:navigation-fragment:2.1.0"
+    implementation "androidx.navigation:navigation-ui:2.1.0"
 }

+ 1 - 1
Android/basic/src/main/java/com/tencent/liteav/basic/AvatarConstant.java → Android/app/src/main/java/com/tencent/liteav/demo/AvatarConstant.java

@@ -1,4 +1,4 @@
-package com.tencent.liteav.basic;
+package com.tencent.liteav.demo;
 
 public interface AvatarConstant {
     String[] USER_AVATAR_ARRAY = {

+ 2 - 4
Android/app/src/main/java/com/tencent/liteav/demo/LoginActivity.java

@@ -4,7 +4,6 @@ import android.content.Intent;
 import android.graphics.Color;
 import android.os.Build;
 import android.os.Bundle;
-import android.text.TextUtils;
 import android.view.View;
 import android.view.Window;
 import android.view.WindowManager;
@@ -13,9 +12,8 @@ import android.widget.EditText;
 
 import androidx.appcompat.app.AppCompatActivity;
 
-import com.tencent.liteav.basic.AvatarConstant;
-import com.tencent.liteav.basic.UserModel;
-import com.tencent.liteav.basic.UserModelManager;
+import com.tencent.cloud.tuikit.roomkit.utils.UserModel;
+import com.tencent.cloud.tuikit.roomkit.utils.UserModelManager;
 import com.tencent.liteav.debug.GenerateTestUserSig;
 
 import java.util.Random;

+ 5 - 7
Android/app/src/main/java/com/tencent/liteav/demo/ProfileActivity.java

@@ -17,13 +17,11 @@ import android.widget.TextView;
 
 import androidx.appcompat.app.AppCompatActivity;
 
-import com.blankj.utilcode.util.ToastUtils;
 import com.tencent.cloud.tuikit.roomkit.TUIRoomKit;
 import com.tencent.cloud.tuikit.roomkit.TUIRoomKitListener;
-import com.tencent.liteav.basic.AvatarConstant;
-import com.tencent.liteav.basic.ImageLoader;
-import com.tencent.liteav.basic.UserModel;
-import com.tencent.liteav.basic.UserModelManager;
+import com.tencent.cloud.tuikit.roomkit.utils.ImageLoader;
+import com.tencent.cloud.tuikit.roomkit.utils.UserModel;
+import com.tencent.cloud.tuikit.roomkit.utils.UserModelManager;
 import com.tencent.liteav.debug.GenerateTestUserSig;
 import com.tencent.qcloud.tuicore.util.ToastUtil;
 
@@ -111,7 +109,7 @@ public class ProfileActivity extends AppCompatActivity {
     private void setProfile() {
         final String userName = mEditUserName.getText().toString().trim();
         if (TextUtils.isEmpty(userName)) {
-            ToastUtils.showLong(getString(R.string.app_hint_user_name));
+            ToastUtil.toastLongMessage(getString(R.string.app_hint_user_name));
             return;
         }
         String reg = "^[a-z0-9A-Z\\u4e00-\\u9fa5\\_]{2,20}$";
@@ -125,7 +123,7 @@ public class ProfileActivity extends AppCompatActivity {
         model.userAvatar = mAvatarUrl;
         UserModelManager.getInstance().setUserModel(model);
         Log.i(TAG, "set profile success.");
-        ToastUtils.showLong(getString(R.string.app_toast_register_success_and_logging_in));
+        ToastUtil.toastLongMessage(getString(R.string.app_toast_register_success_and_logging_in));
         startPrepareActivity();
     }
 

+ 2 - 2
Android/app/src/main/java/com/tencent/liteav/demo/SplashActivity.java

@@ -10,8 +10,8 @@ import androidx.annotation.Nullable;
 
 import com.tencent.cloud.tuikit.roomkit.TUIRoomKit;
 import com.tencent.cloud.tuikit.roomkit.TUIRoomKitListener;
-import com.tencent.liteav.basic.UserModel;
-import com.tencent.liteav.basic.UserModelManager;
+import com.tencent.cloud.tuikit.roomkit.utils.UserModel;
+import com.tencent.cloud.tuikit.roomkit.utils.UserModelManager;
 import com.tencent.liteav.debug.GenerateTestUserSig;
 import com.tencent.qcloud.tuicore.util.ToastUtil;
 

+ 0 - 39
Android/basic/build.gradle

@@ -1,39 +0,0 @@
-apply plugin: 'com.android.library'
-
-android {
-    compileSdkVersion 28
-
-    defaultConfig {
-        minSdkVersion 19
-        targetSdkVersion 26
-    }
-
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
-        }
-    }
-}
-
-dependencies {
-    api fileTree(include: ['*.jar'], dir: 'libs')
-
-    api "com.blankj:utilcode:1.30.7"
-    api "com.google.code.gson:gson:2.3.1"
-    api "de.hdodenhof:circleimageview:3.1.0"
-    api "com.github.ctiao:DanmakuFlameMaster:0.3.8"
-    api "com.github.bumptech.glide:glide:4.12.0"
-    api "com.squareup.okhttp3:okhttp:3.11.0"
-    api "com.squareup.retrofit2:retrofit:2.2.0"
-    api "com.squareup.retrofit2:converter-gson:2.2.0"
-    api "com.squareup.okhttp3:logging-interceptor:3.8.1"
-    api "androidx.constraintlayout:constraintlayout:1.1.3"
-    api "com.google.android.material:material:1.0.0"
-    api "androidx.appcompat:appcompat:1.0.0"
-    api "androidx.recyclerview:recyclerview:1.2.1"
-    api "androidx.multidex:multidex:2.0.0"
-    api 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
-    api 'me.dm7.barcodescanner:zxing:1.8.4'
-}
-

+ 0 - 21
Android/basic/proguard-rules.pro

@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile

+ 0 - 5
Android/basic/src/main/AndroidManifest.xml

@@ -1,5 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.tencent.liteav.trtc.basic">
-
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-</manifest>

+ 0 - 27
Android/basic/src/main/java/com/tencent/liteav/basic/Constants.java

@@ -1,27 +0,0 @@
-package com.tencent.liteav.basic;
-
-import android.content.Context;
-import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
-
-public class Constants {
-    public static final String URL_PUSH = "url_push";       // RTMP 推流地址
-    public static final String URL_PLAY_FLV = "url_play_flv";   // FLV  播放地址
-    public static final String POPULAR_RECOMMENDATION_BEAN_KEY = "popular_recommendation_bean_key";
-
-    public static final int APP_ID = 1500005830;
-
-    public static final int NOT_SELECTED = -1;
-
-    public static boolean isNetworkConnected(Context context) {
-        if (context != null) {
-            ConnectivityManager mConnectivityManager = (ConnectivityManager) context.getApplicationContext()
-                    .getSystemService(Context.CONNECTIVITY_SERVICE);
-            NetworkInfo mNetworkInfo = mConnectivityManager.getActiveNetworkInfo();
-            if (mNetworkInfo != null) {
-                return mNetworkInfo.isAvailable();
-            }
-        }
-        return false;
-    }
-}

+ 0 - 136
Android/basic/src/main/java/com/tencent/liteav/basic/MD5Utils.java

@@ -1,136 +0,0 @@
-package com.tencent.liteav.basic;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.nio.channels.FileChannel;
-import java.nio.charset.StandardCharsets;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-public class MD5Utils {
-
-    private static final String[] hexDigits = {"0", "1", "2", "3", "4", "5",
-            "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
-
-    private static MessageDigest messageDigest = null;
-
-    static {
-        try {
-            messageDigest = MessageDigest.getInstance("MD5");
-        } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static String getFileMD5String(File file) {
-        String ret = "";
-        FileInputStream in = null;
-        FileChannel ch = null;
-        try {
-            in = new FileInputStream(file);
-            ch = in.getChannel();
-            ByteBuffer byteBuffer = ch.map(FileChannel.MapMode.READ_ONLY, 0,
-                    file.length());
-            messageDigest.update(byteBuffer);
-            ret = bytesToHex(messageDigest.digest());
-        } catch (IOException e) {
-            e.printStackTrace();
-
-        } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-            if (ch != null) {
-                try {
-                    ch.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        return ret;
-    }
-
-    public static String getFileMD5String(String fileName) {
-        return getFileMD5String(new File(fileName));
-    }
-
-    public static String getMD5String(String sourceStr) {
-        return getMD5String(sourceStr.getBytes());
-    }
-
-    public static String getMD5String(byte[] bytes) {
-        messageDigest.update(bytes);
-        return bytesToHex(messageDigest.digest());
-    }
-
-    public static boolean checkPassword(String pwd, String md5) {
-        return getMD5String(pwd).equalsIgnoreCase(md5);
-    }
-
-    public static boolean checkPassword(char[] pwd, String md5) {
-        return checkPassword(new String(pwd), md5);
-
-    }
-
-    public static boolean checkFileMD5(File file, String md5) {
-        return getFileMD5String(file).equalsIgnoreCase(md5);
-
-    }
-
-    public static boolean checkFileMD5(String fileName, String md5) {
-        return checkFileMD5(new File(fileName), md5);
-
-    }
-
-    public static String bytesToHex(byte[] bytes) {
-        return bytesToHex(bytes, 0, bytes.length);
-
-    }
-
-    public static String bytesToHex(byte[] bytes, int start, int end) {
-        StringBuilder sb = new StringBuilder();
-        for (int i = start; i < start + end; i++) {
-            sb.append(byteToHex(bytes[i]));
-        }
-        return sb.toString();
-
-    }
-
-    public static String byteToHex(byte bt) {
-        return hexDigits[(bt & 0xf0) >> 4] + "" + hexDigits[bt & 0xf];
-
-    }
-
-    public static String parseUrlToFileName(String urlStr)
-            throws UnsupportedEncodingException, NoSuchAlgorithmException {
-        MessageDigest md = MessageDigest.getInstance("MD5");
-        byte[] results = md.digest(urlStr.getBytes(StandardCharsets.UTF_8));
-        return byteArrayToHexString(results);
-    }
-
-    private static String byteArrayToHexString(byte[] b) {
-        StringBuffer resultSb = new StringBuffer();
-        for (int i = 0; i < b.length; i++) {
-            resultSb.append(byteToHexString(b[i]));
-        }
-        return resultSb.toString();
-    }
-
-    private static String byteToHexString(byte b) {
-        int n = b;
-        if (n < 0) {
-            n = 256 + n;
-        }
-        int d1 = n / 16;
-        int d2 = n % 16;
-        return hexDigits[d1] + hexDigits[d2];
-    }
-}

+ 0 - 23
Android/basic/src/main/java/com/tencent/liteav/basic/OnSingleClickListener.java

@@ -1,23 +0,0 @@
-package com.tencent.liteav.basic;
-
-import android.view.View;
-
-/**
- * 作用:防止快速点击按钮引起的错误
- * 使用:Button.setOnClickListener 时,使用此类作的实现类作为Listener
- */
-public abstract class OnSingleClickListener implements View.OnClickListener {
-    private static final long MIN_CLICK_DELAY_TIME = 500;
-    private long mLastClickTime = 0;
-
-    @Override
-    public void onClick(View v) {
-        long curClickTime = System.currentTimeMillis();
-        if ((curClickTime - mLastClickTime) >= MIN_CLICK_DELAY_TIME) {
-            mLastClickTime = curClickTime;
-            onSingleClick(v);
-        }
-    }
-
-    public abstract void onSingleClick(View v);
-}

+ 0 - 59
Android/basic/src/main/java/com/tencent/liteav/basic/PictureUtils.java

@@ -1,59 +0,0 @@
-package com.tencent.liteav.basic;
-
-import android.content.ContentValues;
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.net.Uri;
-import android.os.Build;
-import android.provider.MediaStore;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.OutputStream;
-
-public class PictureUtils {
-    private static final String TAG = "PictureUtils";
-
-    /**
-     * 保存 Bitmap 到图库
-     * @param context
-     * @param bitmap
-     * @return
-     */
-    public static boolean saveBitmap2Gallery(Context context, Bitmap bitmap) {
-        if (context == null || bitmap == null) {
-            return false;
-        }
-        if (Build.VERSION.SDK_INT >= 29) {
-            //返回出一个URI
-            Uri insert = context.getContentResolver()
-                    .insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new ContentValues());
-            if (insert == null) {
-                return false;
-            }
-
-            //这个打开了输出流  直接保存图片就好了
-            OutputStream outputStream = null;
-            try {
-                outputStream = context.getContentResolver().openOutputStream(insert);
-                if (outputStream == null) {
-                    return false;
-                } else {
-                    bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
-                }
-            } catch (FileNotFoundException e) {
-                e.printStackTrace();
-            } finally {
-                try {
-                    if (outputStream != null) {
-                        outputStream.close();
-                    }
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        } else {
-            MediaStore.Images.Media.insertImage(context.getContentResolver(), bitmap, "snapshot", "desc");
-        }
-        return true;
-    }
-}

+ 0 - 72
Android/basic/src/main/java/com/tencent/liteav/basic/ResourceUtils.java

@@ -1,72 +0,0 @@
-package com.tencent.liteav.basic;
-
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.Color;
-import android.util.TypedValue;
-
-import androidx.annotation.StringRes;
-
-public class ResourceUtils {
-
-    private static final String TYPE_QUOTE_PREFIX = "@";
-    private static final String TYPE_COLOR_PREFIX = "#";
-
-    private static final String TYPE_STRING   = "string";
-    private static final String TYPE_COLOR    = "color";
-    private static final String TYPE_DRAWABLE = "drawable";
-
-    public static int getDrawableId(String resName) {
-        if (resName.startsWith(TYPE_QUOTE_PREFIX)) {
-            return getResources().getIdentifier(resName, TYPE_DRAWABLE, RTCubeUtils.getPackageName());
-        }
-        throw new IllegalArgumentException("\"" + resName + "\" is illegal, must start with \"@\".");
-    }
-
-    public static int getStringId(String resName) {
-        return getResources().getIdentifier(resName, TYPE_STRING, RTCubeUtils.getPackageName());
-    }
-
-    public static String getString(String resName) {
-        if (resName.startsWith(TYPE_QUOTE_PREFIX)) {
-            return getResources().getString(getStringId(resName.substring(1)));
-        }
-        return resName;
-    }
-
-    public static String getString(@StringRes int resId) {
-        return getResources().getString(resId);
-    }
-
-    public static int getColor(String resName) {
-        if (resName.startsWith(TYPE_COLOR_PREFIX)) {
-            return Color.parseColor(resName);
-        }
-        if (resName.startsWith(TYPE_QUOTE_PREFIX)) {
-            return getResources().getColor(getColorId(resName));
-        }
-        throw new IllegalArgumentException("\"" + resName + "\" is unknown color.");
-    }
-
-    public static int getColorId(String resName) {
-        return getResources().getIdentifier(resName, TYPE_COLOR, RTCubeUtils.getPackageName());
-    }
-
-    public static Resources getResources() {
-        return RTCubeUtils.getApplicationByReflect().getResources();
-    }
-
-    public static int dip2px(float dpValue) {
-        final float scale = getResources().getDisplayMetrics().density;
-        return (int) (dpValue * scale + 0.5f);
-    }
-
-    public static Bitmap decodeResource(int id) {
-        TypedValue value = new TypedValue();
-        getResources().openRawResource(id, value);
-        BitmapFactory.Options opts = new BitmapFactory.Options();
-        opts.inTargetDensity = value.density;
-        return BitmapFactory.decodeResource(getResources(), id, opts);
-    }
-}

+ 0 - 2
Android/basic/src/main/res/values-en/strings.xml

@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources></resources>

+ 0 - 2
Android/basic/src/main/res/values/colors.xml

@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources></resources>

+ 0 - 2
Android/basic/src/main/res/values/strings.xml

@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources></resources>

+ 0 - 2
Android/basic/src/main/res/values/styles.xml

@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources></resources>

+ 0 - 1
Android/build.gradle

@@ -30,7 +30,6 @@ task clean(type: Delete) {
 }
 
 ext {
-    liteavSdk = "com.tencent.liteav:LiteAVSDK_TRTC:11.2.0.13154"
     roomEngineSdk = "com.tencent.liteav.tuikit:tuiroomengine:1.3.4.17"
     imSdk = "com.tencent.imsdk:imsdk-plus:7.2.4146"
 }

+ 0 - 58
Android/debug/src/main/java/com/tencent/liteav/debug/GenerateTestUserSig.java

@@ -56,14 +56,6 @@ public class GenerateTestUserSig {
      */
     private static final int EXPIRETIME = 604800;
 
-    /**
-     * Sends request for the pull/push address from the backend
-     * <p>
-     * key: url_push         Gets the RTMP push address
-     * key: url_play_flv     Gets the FLV playback address
-     */
-    public static final String URL_FETCH_PUSH_URL = "PLACEHOLDER";
-
     /**
      * Follow the steps below to obtain the key required for UserSig calculation.
      * <p>
@@ -79,56 +71,6 @@ public class GenerateTestUserSig {
      */
     private static final String SECRETKEY = "PLACEHOLDER";
 
-
-    /**
-     * Xmagic美颜证书url
-     * <p>
-     * 详细内容见https://cloud.tencent.com/document/product/616/65878
-     * </p>
-     */
-    public static final String XMAGIC_LICENSE_URL = "PLACEHOLDER";
-
-    /**
-     * Xmagic美颜证书url
-     * <p>
-     * 详细内容见https://cloud.tencent.com/document/product/616/65878
-     * </p>
-     */
-    public static final String XMAGIC_LICENSE_KEY = "PLACEHOLDER";
-
-
-    /**
-     * 腾讯云直播license管理页面(https://console.cloud.tencent.com/live/license)
-     * 当前应用的License LicenseUrl
-     * <p>
-     * License Management View (https://console.cloud.tencent.com/live/license)
-     * License URL of your application
-     */
-    public static final String LICENSEURL = "请替换成您的licenseURL";
-
-    /**
-     * 腾讯云直播license管理页面(https://console.cloud.tencent.com/live/license)
-     * 当前应用的License Key
-     * <p>
-     * License Management View (https://console.cloud.tencent.com/live/license)
-     * License key of your application
-     */
-    public static final String LICENSEURLKEY = "请替换成您的licenseKey";
-
-    /**
-     * 配置的后台服务域名,类似:https://service-3vscss6c-xxxxxxxxxxx.gz.apigw.tencentcs.com"
-     * <p>
-     * 小直播后台提供有登录、房间列表等服务,更多细节见文档:https://cloud.tencent.com/document/product/454/38625
-     */
-    public static final String SERVERLESSURL = "PLACEHOLDER";
-
-    /**
-     * 配置的播放域名
-     * <p>
-     * 腾讯云域名管理页面:https://console.cloud.tencent.com/live/domainmanage
-     */
-    public static final String PLAY_DOMAIN = "PLACEHOLDER";
-
     /**
      * Calculating UserSig
      * <p>

+ 1 - 1
Android/gradle.properties

@@ -6,7 +6,7 @@
 # http://www.gradle.org/docs/current/userguide/build_environment.html
 # Specifies the JVM arguments used for the daemon process.
 # The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
+org.gradle.jvmargs=-Xmx4608M
 # When configured, Gradle will run in incubating parallel mode.
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects

+ 2 - 5
Android/settings.gradle

@@ -1,10 +1,7 @@
 include ':app'
-include ':tuiroom'
 include ':debug'
-include ':tuibeauty'
+include ':tuiroomkit'
+include ':tuicore'
 include ':tuivideoseat'
 include ':tuichat'
 include ':timcommon'
-include ':tuiroomkit'
-include ':basic'
-include ':tuicore'

+ 8 - 3
Android/timcommon/build.gradle

@@ -33,12 +33,17 @@ android {
     }
 }
 
-afterEvaluate{
-    generateReleaseBuildConfig.enabled =false
-    generateDebugBuildConfig.enabled =false
+afterEvaluate {
+    generateReleaseBuildConfig.enabled = false
+    generateDebugBuildConfig.enabled = false
 }
 
 dependencies {
+    /*plugin-build-Begin
+
+    compileOnly fileTree(include: ['*.jar','*.aar'], dir: '../../../../tuikit/android/libs')
+
+    plugin-build-End*/
 
     api project(':tuicore')
     implementation 'com.google.code.gson:gson:2.9.1'

+ 8 - 0
Android/timcommon/src/main/AndroidManifest.xml

@@ -18,6 +18,13 @@
             android:name="com.tencent.qcloud.tuikit.timcommon.component.activities.ImageSelectMinimalistActivity"
             android:screenOrientation="portrait" />
 
+        <activity android:name=".util.ActivityResultResolver$ActivityResultProxyActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:multiprocess="true"
+            android:launchMode="singleTask"
+            android:theme="@style/CoreActivityTranslucent"
+            android:windowSoftInputMode="stateHidden|stateAlwaysHidden"/>
+        
         <provider
             android:name=".util.FileProvider"
             android:authorities="${applicationId}.timcommon.fileprovider"
@@ -31,6 +38,7 @@
         <provider
             android:name=".TIMCommonService"
             android:authorities="${applicationId}.TIMCommon.Init"
+            android:initOrder="1"
             android:enabled="true"
             android:exported="false"/>
 

+ 0 - 1
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/TIMCommonConfig.java

@@ -64,5 +64,4 @@ public class TIMCommonConfig {
     public static void setDefaultGroupAvatarImage(int defaultGroupAvatarImage) {
         TIMCommonConfig.defaultGroupAvatarImage = defaultGroupAvatarImage;
     }
-
 }

+ 3 - 3
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/MessageReactBean.java

@@ -12,7 +12,7 @@ public class MessageReactBean implements Serializable {
     private Map<String, Set<String>> reacts;
     private int version = VERSION;
 
-    private transient Map<String, ReactUserBean> reactUserBeanMap;
+    private transient Map<String, UserBean> reactUserBeanMap;
 
     public void operateUser(String emojiId, String userId) {
         if (reacts == null) {
@@ -48,11 +48,11 @@ public class MessageReactBean implements Serializable {
         return 0;
     }
 
-    public void setReactUserBeanMap(Map<String, ReactUserBean> reactUserBeanMap) {
+    public void setReactUserBeanMap(Map<String, UserBean> reactUserBeanMap) {
         this.reactUserBeanMap = reactUserBeanMap;
     }
 
-    public Map<String, ReactUserBean> getReactUserBeanMap() {
+    public Map<String, UserBean> getReactUserBeanMap() {
         return reactUserBeanMap;
     }
 

+ 3 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/MessageRepliesBean.java

@@ -13,8 +13,9 @@ public class MessageRepliesBean implements Serializable {
         private String messageID;
         private String messageAbstract;
         private String messageSender;
-        transient private String senderFaceUrl;
-        transient private String senderShowName;
+        private transient String senderFaceUrl;
+        private transient String senderShowName;
+
         public String getMessageID() {
             return messageID;
         }

+ 505 - 509
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/TUIMessageBean.java

@@ -16,513 +16,509 @@ import org.json.JSONObject;
 import java.io.Serializable;
 
 public abstract class TUIMessageBean implements Serializable {
-     /**
-      * 消息正常状态
-      *
-      * message normal
-      */
-     public static final int MSG_STATUS_NORMAL = 0;
-     /**
-      * 消息发送中状态
-      *
-      * message sending
-      */
-     public static final int MSG_STATUS_SENDING = 1;
-     /**
-      * 消息发送成功状态
-      *
-      * message send success
-      */
-     public static final int MSG_STATUS_SEND_SUCCESS = 2;
-     /**
-      * 消息发送失败状态
-      *
-      * message send failed
-      */
-     public static final int MSG_STATUS_SEND_FAIL = 3;
-
-     /**
-      * 消息未读状态
-      *
-      * message unread
-      */
-     public static final int MSG_STATUS_READ = 0x111;
-     /**
-      * 消息删除状态
-      *
-      * message deleted
-      */
-     public static final int MSG_STATUS_DELETE = 0x112;
-     /**
-      * 消息撤回状态
-      *
-      * messaage revoked
-      */
-     public static final int MSG_STATUS_REVOKE = 0x113;
-
-     /**
-      * 消息内容下载中状态
-      *
-      * message downloading
-      */
-     public static final int MSG_STATUS_DOWNLOADING = 4;
-     /**
-      * 消息内容未下载状态
-      *
-      * message undownloaded
-      */
-     public static final int MSG_STATUS_UN_DOWNLOAD = 5;
-     /**
-      * 消息内容已下载状态
-      *
-      * message downloaded
-      */
-     public static final int MSG_STATUS_DOWNLOADED = 6;
-     /**
-      * 消息翻译初始化状态
-      *
-      * message translation unknown
-      */
-     public static final int MSG_TRANSLATE_STATUS_UNKNOWN = 0;
-     /**
-      * 消息翻译隐藏状态
-      *
-      * message translation hidden
-      */
-     public static final int MSG_TRANSLATE_STATUS_HIDDEN  = 1;
-     /**
-      * 消息翻译进行中状态
-      *
-      * message translation loading
-      */
-     public static final int MSG_TRANSLATE_STATUS_LOADING = 2;
-     /**
-      * 消息翻译展示状态
-      *
-      * message translation shown
-      */
-     public static final int MSG_TRANSLATE_STATUS_SHOWN   = 3;
-
-     public static final String TRANSLATION_KEY = "translation";
-     public static final String TRANSLATION_VIEW_STATUS_KEY = "translation_view_status";
-
-     private V2TIMMessage v2TIMMessage;
-     private long msgTime;
-     private String extra;
-     private String id;
-     private boolean isGroup;
-     private int status;
-     private int downloadStatus;
-     private String selectText;
-     private int translationStatus = MSG_TRANSLATE_STATUS_UNKNOWN;
-     private boolean excludeFromHistory;
-     private boolean isUseMsgReceiverAvatar = false;
-     private boolean isEnableForward = true;
-
-     public void setExcludeFromHistory(boolean excludeFromHistory) {
-          this.excludeFromHistory = excludeFromHistory;
-     }
-
-     public boolean isExcludeFromHistory() {
-          return excludeFromHistory;
-     }
-
-     public void setUseMsgReceiverAvatar(boolean useMsgReceiverAvatar) {
-          isUseMsgReceiverAvatar = useMsgReceiverAvatar;
-     }
-
-     public boolean isUseMsgReceiverAvatar() {
-          return isUseMsgReceiverAvatar;
-     }
-
-     public boolean isEnableForward() {
-          return isEnableForward;
-     }
-
-     public void setEnableForward(boolean enableForward) {
-          isEnableForward = enableForward;
-     }
-
-     private MessageReceiptInfo messageReceiptInfo;
-     private MessageRepliesBean messageRepliesBean;
-     private MessageReactBean messageReactBean;
-
-     public MessageReactBean getMessageReactBean() {
-          return messageReactBean;
-     }
-
-     public MessageRepliesBean getMessageRepliesBean() {
-          return messageRepliesBean;
-     }
-
-     public void setMessageReactBean(MessageReactBean messageReactBean) {
-          this.messageReactBean = messageReactBean;
-          MessageBuilder.mergeCloudCustomData(this, TIMCommonConstants.MESSAGE_REACT_KEY, messageReactBean);
-     }
-
-     public void setMessageRepliesBean(MessageRepliesBean messageRepliesBean) {
-          this.messageRepliesBean = messageRepliesBean;
-          MessageBuilder.mergeCloudCustomData(this, TIMCommonConstants.MESSAGE_REPLIES_KEY, messageRepliesBean);
-     }
-
-     public void setMessageReceiptInfo(MessageReceiptInfo messageReceiptInfo) {
-          this.messageReceiptInfo = messageReceiptInfo;
-     }
-
-     public long getReadCount() {
-          if (messageReceiptInfo != null) {
-               return messageReceiptInfo.getReadCount();
-          }
-          return 0;
-     }
-
-     public long getUnreadCount() {
-          if (messageReceiptInfo != null) {
-               return messageReceiptInfo.getUnreadCount();
-          }
-          return 0;
-     }
-
-     public void setCommonAttribute(V2TIMMessage v2TIMMessage) {
-          msgTime = System.currentTimeMillis() / 1000;
-          this.v2TIMMessage = v2TIMMessage;
-
-          if (v2TIMMessage == null) {
-               return;
-          }
-
-          id = v2TIMMessage.getMsgID();
-          isGroup = !TextUtils.isEmpty(v2TIMMessage.getGroupID());
-
-          if (v2TIMMessage.getStatus() == V2TIMMessage.V2TIM_MSG_STATUS_LOCAL_REVOKED) {
-               status = MSG_STATUS_REVOKE;
-               if (isSelf()) {
-                    extra = TIMCommonService.getAppContext().getString(R.string.revoke_tips_you);
-               } else if (isGroup) {
-                    String message = TIMCommonConstants.covert2HTMLString(getSender());
-                    extra = message + TIMCommonService.getAppContext().getString(R.string.revoke_tips);
-               } else {
-                    extra = TIMCommonService.getAppContext().getString(R.string.revoke_tips_other);
-               }
-          } else {
-               if (isSelf()) {
-                    if (v2TIMMessage.getStatus() == V2TIMMessage.V2TIM_MSG_STATUS_SEND_FAIL) {
-                         status = MSG_STATUS_SEND_FAIL;
-                    } else if (v2TIMMessage.getStatus() == V2TIMMessage.V2TIM_MSG_STATUS_SEND_SUCC) {
-                         status = MSG_STATUS_SEND_SUCCESS;
-                    } else if (v2TIMMessage.getStatus() == V2TIMMessage.V2TIM_MSG_STATUS_SENDING) {
-                         status = MSG_STATUS_SENDING;
-                    }
-               }
-          }
-
-          messageReactBean = MessageParser.parseMessageReact(this);
-          messageRepliesBean = MessageParser.parseMessageReplies(this);
-     }
-
-     public boolean isPeerRead() {
-          if (messageReceiptInfo != null) {
-               return messageReceiptInfo.isPeerRead();
-          }
-          return false;
-     }
-
-     public boolean isAllRead() {
-          return getUnreadCount() == 0 && getReadCount() > 0;
-     }
-
-     public boolean isUnread() {
-          return getReadCount() == 0;
-     }
-
-     /**
-      * 获取要显示在会话列表的消息摘要
-      *
-      * Get a summary of messages to display in the conversation list
-      * @return
-      */
-     public abstract String onGetDisplayString();
-
-     public abstract void onProcessMessage(V2TIMMessage v2TIMMessage);
-
-     public final long getMessageTime() {
-          if (v2TIMMessage != null) {
-               long timestamp = v2TIMMessage.getTimestamp();
-               if (timestamp != 0) {
-                    return timestamp;
-               }
-          }
-          return msgTime;
-     }
-
-     public long getMsgSeq() {
-          if (v2TIMMessage != null) {
-               return v2TIMMessage.getSeq();
-          }
-          return 0;
-     }
-
-     public void setId(String id) {
-          this.id = id;
-     }
-
-     public String getId() {
-          return id;
-     }
-
-
-     public String getUserId() {
-          if (v2TIMMessage != null) {
-               return v2TIMMessage.getUserID();
-          }
-          return "";
-     }
-
-     public boolean isSelf() {
-          if (v2TIMMessage != null) {
-               return v2TIMMessage.isSelf();
-          }
-          return true;
-     }
-
-     public String getSender() {
-          String sender = null;
-          if (v2TIMMessage != null) {
-               sender = v2TIMMessage.getSender();
-          }
-          if (TextUtils.isEmpty(sender)) {
-               sender = V2TIMManager.getInstance().getLoginUser();
-          }
-          return sender;
-     }
-
-     public V2TIMMessage getV2TIMMessage() {
-          return v2TIMMessage;
-     }
-
-     public boolean isGroup() {
-          return isGroup;
-     }
-
-     public void setGroup(boolean group) {
-          isGroup = group;
-     }
-
-     public String getGroupId() {
-          if (v2TIMMessage != null) {
-               return v2TIMMessage.getGroupID();
-          }
-          return "";
-     }
-
-     public String getNameCard() {
-          if (v2TIMMessage != null) {
-               return v2TIMMessage.getNameCard();
-          }
-          return "";
-     }
-
-     public String getNickName() {
-          if (v2TIMMessage != null) {
-               return v2TIMMessage.getNickName();
-          }
-          return "";
-     }
-
-     public String getFriendRemark() {
-          if (v2TIMMessage != null) {
-               return v2TIMMessage.getFriendRemark();
-          }
-          return "";
-     }
-
-     public String getUserDisplayName() {
-          String displayName;
-          if (!TextUtils.isEmpty(getNameCard())) {
-               displayName = getNameCard();
-          } else if (!TextUtils.isEmpty(getFriendRemark())) {
-               displayName = getFriendRemark();
-          } else if (!TextUtils.isEmpty(getNickName())) {
-               displayName = getNickName();
-          } else {
-               displayName = getSender();
-          }
-          return displayName;
-     }
-
-     public String getFaceUrl() {
-          if (v2TIMMessage != null) {
-               return v2TIMMessage.getFaceUrl();
-          }
-          return "";
-     }
-
-     public void setStatus(int status) {
-          this.status = status;
-     }
-
-     public int getStatus() {
-          return status;
-     }
-
-     public void setExtra(String extra) {
-          this.extra = extra;
-     }
-
-     public String getExtra() {
-          return extra;
-     }
-
-     public void setDownloadStatus(int downloadStatus) {
-          this.downloadStatus = downloadStatus;
-     }
-
-     public int getDownloadStatus() {
-          return downloadStatus;
-     }
-
-     public int getMsgType() {
-          if (v2TIMMessage != null) {
-               return v2TIMMessage.getElemType();
-          } else {
-               return V2TIMMessage.V2TIM_ELEM_TYPE_NONE;
-          }
-     }
-
-     public boolean isNeedReadReceipt() {
-          if (v2TIMMessage != null) {
-               return v2TIMMessage.isNeedReadReceipt();
-          }
-          return false;
-     }
-
-     public void setNeedReadReceipt(boolean isNeedReceipt) {
-          if (v2TIMMessage != null) {
-               v2TIMMessage.setNeedReadReceipt(isNeedReceipt);
-          }
-     }
-
-     public void setTranslationStatus(int status) {
-          if (status != MSG_TRANSLATE_STATUS_UNKNOWN &&
-              status != MSG_TRANSLATE_STATUS_HIDDEN &&
-              status != MSG_TRANSLATE_STATUS_SHOWN &&
-              status != MSG_TRANSLATE_STATUS_LOADING) {
-               return;
-          }
-
-          if (status == translationStatus) {
-               return;
-          }
-
-          if (status == MSG_TRANSLATE_STATUS_LOADING) {
-               translationStatus = MSG_TRANSLATE_STATUS_LOADING;
-               return;
-          }
-
-          translationStatus = status;
-
-          if (v2TIMMessage != null) {
-               String localCustomData = v2TIMMessage.getLocalCustomData();
-               JSONObject customJson = new JSONObject();
-               try {
-                    if (!TextUtils.isEmpty(localCustomData)) {
-                         customJson = new JSONObject(localCustomData);
-                    }
-                    customJson.put(TRANSLATION_VIEW_STATUS_KEY, status);
-                    v2TIMMessage.setLocalCustomData(customJson.toString());
-               } catch (JSONException e) {
-                    e.printStackTrace();
-               }
-          }
-     }
-
-     public int getTranslationStatus() {
-          if (translationStatus != MSG_TRANSLATE_STATUS_UNKNOWN) {
-               return translationStatus;
-          }
-
-          if (v2TIMMessage != null) {
-               String localCustomData = v2TIMMessage.getLocalCustomData();
-               if (TextUtils.isEmpty(localCustomData)) {
-                    return translationStatus;
-               }
-               try {
-                    JSONObject customJson = new JSONObject(localCustomData);
-                    if (customJson.has(TRANSLATION_VIEW_STATUS_KEY)) {
-                         translationStatus = customJson.getInt(TRANSLATION_VIEW_STATUS_KEY);
-                    }
-               } catch (JSONException e) {
-                    e.printStackTrace();
-               }
-          }
-          return translationStatus;
-     }
-
-     public void setTranslation(String translation) {
-          if (v2TIMMessage != null) {
-               String localCustomData = v2TIMMessage.getLocalCustomData();
-               JSONObject customJson = new JSONObject();
-               try {
-                    if (!TextUtils.isEmpty(localCustomData)) {
-                         customJson = new JSONObject(localCustomData);
-                    }
-                    customJson.put(TRANSLATION_KEY, translation);
-                    customJson.put(TRANSLATION_VIEW_STATUS_KEY, MSG_TRANSLATE_STATUS_SHOWN);
-                    v2TIMMessage.setLocalCustomData(customJson.toString());
-               } catch (JSONException e) {
-                    e.printStackTrace();
-               }
-               translationStatus = MSG_TRANSLATE_STATUS_SHOWN;
-          }
-     }
-
-     public String getTranslation() {
-          String translation = "";
-          if (v2TIMMessage != null) {
-               String localCustomData = v2TIMMessage.getLocalCustomData();
-               if (TextUtils.isEmpty(localCustomData)) {
-                    return translation;
-               }
-               try {
-                    JSONObject customJson = new JSONObject(localCustomData);
-                    if (customJson.has(TRANSLATION_KEY)) {
-                         translation = customJson.getString(TRANSLATION_KEY);
-                    }
-               } catch (JSONException e) {
-                    e.printStackTrace();
-               }
-          }
-          return translation;
-     }
-
-     public void setV2TIMMessage(V2TIMMessage v2TIMMessage) {
-          this.v2TIMMessage = v2TIMMessage;
-          setCommonAttribute(v2TIMMessage);
-          onProcessMessage(v2TIMMessage);
-     }
-
-     public void update(TUIMessageBean messageBean) {
-          setV2TIMMessage(messageBean.getV2TIMMessage());
-     }
-
-     public String getSelectText() {
-          return selectText;
-     }
-
-     public void setSelectText(String text) {
-          this.selectText = text;
-     }
-
-     public MessageFeature isSupportTyping() {
-          return MessageParser.isSupportTyping(this);
-     }
-
-     public void setMessageTypingFeature(MessageFeature messageFeature) {
-          MessageBuilder.mergeCloudCustomData(this, TIMCommonConstants.MESSAGE_FEATURE_KEY, messageFeature);
-     }
-
-     public Class<? extends TUIReplyQuoteBean> getReplyQuoteBeanClass() {
-          return null;
-     }
-
+    /**
+     * 消息正常状态
+     *
+     * message normal
+     */
+    public static final int MSG_STATUS_NORMAL = 0;
+    /**
+     * 消息发送中状态
+     *
+     * message sending
+     */
+    public static final int MSG_STATUS_SENDING = 1;
+    /**
+     * 消息发送成功状态
+     *
+     * message send success
+     */
+    public static final int MSG_STATUS_SEND_SUCCESS = 2;
+    /**
+     * 消息发送失败状态
+     *
+     * message send failed
+     */
+    public static final int MSG_STATUS_SEND_FAIL = 3;
+
+    /**
+     * 消息未读状态
+     *
+     * message unread
+     */
+    public static final int MSG_STATUS_READ = 0x111;
+    /**
+     * 消息删除状态
+     *
+     * message deleted
+     */
+    public static final int MSG_STATUS_DELETE = 0x112;
+    /**
+     * 消息撤回状态
+     *
+     * messaage revoked
+     */
+    public static final int MSG_STATUS_REVOKE = 0x113;
+
+    /**
+     * 消息内容下载中状态
+     *
+     * message downloading
+     */
+    public static final int MSG_STATUS_DOWNLOADING = 4;
+    /**
+     * 消息内容未下载状态
+     *
+     * message undownloaded
+     */
+    public static final int MSG_STATUS_UN_DOWNLOAD = 5;
+    /**
+     * 消息内容已下载状态
+     *
+     * message downloaded
+     */
+    public static final int MSG_STATUS_DOWNLOADED = 6;
+    /**
+     * 消息翻译初始化状态
+     *
+     * message translation unknown
+     */
+    public static final int MSG_TRANSLATE_STATUS_UNKNOWN = 0;
+    /**
+     * 消息翻译隐藏状态
+     *
+     * message translation hidden
+     */
+    public static final int MSG_TRANSLATE_STATUS_HIDDEN = 1;
+    /**
+     * 消息翻译进行中状态
+     *
+     * message translation loading
+     */
+    public static final int MSG_TRANSLATE_STATUS_LOADING = 2;
+    /**
+     * 消息翻译展示状态
+     *
+     * message translation shown
+     */
+    public static final int MSG_TRANSLATE_STATUS_SHOWN = 3;
+
+    public static final String TRANSLATION_KEY = "translation";
+    public static final String TRANSLATION_VIEW_STATUS_KEY = "translation_view_status";
+
+    private V2TIMMessage v2TIMMessage;
+    private long msgTime;
+    private String extra;
+    private String id;
+    private boolean isGroup;
+    private int status;
+    private int downloadStatus;
+    private String selectText;
+    private int translationStatus = MSG_TRANSLATE_STATUS_UNKNOWN;
+    private boolean excludeFromHistory;
+    private boolean isUseMsgReceiverAvatar = false;
+    private boolean isEnableForward = true;
+
+    public void setExcludeFromHistory(boolean excludeFromHistory) {
+        this.excludeFromHistory = excludeFromHistory;
+    }
+
+    public boolean isExcludeFromHistory() {
+        return excludeFromHistory;
+    }
+
+    public void setUseMsgReceiverAvatar(boolean useMsgReceiverAvatar) {
+        isUseMsgReceiverAvatar = useMsgReceiverAvatar;
+    }
+
+    public boolean isUseMsgReceiverAvatar() {
+        return isUseMsgReceiverAvatar;
+    }
+
+    public boolean isEnableForward() {
+        return isEnableForward;
+    }
+
+    public void setEnableForward(boolean enableForward) {
+        isEnableForward = enableForward;
+    }
+
+    private MessageReceiptInfo messageReceiptInfo;
+    private MessageRepliesBean messageRepliesBean;
+    private MessageReactBean messageReactBean;
+
+    public MessageReactBean getMessageReactBean() {
+        return messageReactBean;
+    }
+
+    public MessageRepliesBean getMessageRepliesBean() {
+        return messageRepliesBean;
+    }
+
+    public void setMessageReactBean(MessageReactBean messageReactBean) {
+        this.messageReactBean = messageReactBean;
+        MessageBuilder.mergeCloudCustomData(this, TIMCommonConstants.MESSAGE_REACT_KEY, messageReactBean);
+    }
+
+    public void setMessageRepliesBean(MessageRepliesBean messageRepliesBean) {
+        this.messageRepliesBean = messageRepliesBean;
+        MessageBuilder.mergeCloudCustomData(this, TIMCommonConstants.MESSAGE_REPLIES_KEY, messageRepliesBean);
+    }
+
+    public void setMessageReceiptInfo(MessageReceiptInfo messageReceiptInfo) {
+        this.messageReceiptInfo = messageReceiptInfo;
+    }
+
+    public long getReadCount() {
+        if (messageReceiptInfo != null) {
+            return messageReceiptInfo.getReadCount();
+        }
+        return 0;
+    }
+
+    public long getUnreadCount() {
+        if (messageReceiptInfo != null) {
+            return messageReceiptInfo.getUnreadCount();
+        }
+        return 0;
+    }
+
+    public void setCommonAttribute(V2TIMMessage v2TIMMessage) {
+        msgTime = System.currentTimeMillis() / 1000;
+        this.v2TIMMessage = v2TIMMessage;
+
+        if (v2TIMMessage == null) {
+            return;
+        }
+
+        id = v2TIMMessage.getMsgID();
+        isGroup = !TextUtils.isEmpty(v2TIMMessage.getGroupID());
+
+        if (v2TIMMessage.getStatus() == V2TIMMessage.V2TIM_MSG_STATUS_LOCAL_REVOKED) {
+            status = MSG_STATUS_REVOKE;
+            if (isSelf()) {
+                extra = TIMCommonService.getAppContext().getString(R.string.revoke_tips_you);
+            } else if (isGroup) {
+                String message = TIMCommonConstants.covert2HTMLString(getSender());
+                extra = message + TIMCommonService.getAppContext().getString(R.string.revoke_tips);
+            } else {
+                extra = TIMCommonService.getAppContext().getString(R.string.revoke_tips_other);
+            }
+        } else {
+            if (isSelf()) {
+                if (v2TIMMessage.getStatus() == V2TIMMessage.V2TIM_MSG_STATUS_SEND_FAIL) {
+                    status = MSG_STATUS_SEND_FAIL;
+                } else if (v2TIMMessage.getStatus() == V2TIMMessage.V2TIM_MSG_STATUS_SEND_SUCC) {
+                    status = MSG_STATUS_SEND_SUCCESS;
+                } else if (v2TIMMessage.getStatus() == V2TIMMessage.V2TIM_MSG_STATUS_SENDING) {
+                    status = MSG_STATUS_SENDING;
+                }
+            }
+        }
+
+        messageReactBean = MessageParser.parseMessageReact(this);
+        messageRepliesBean = MessageParser.parseMessageReplies(this);
+    }
+
+    public boolean isPeerRead() {
+        if (messageReceiptInfo != null) {
+            return messageReceiptInfo.isPeerRead();
+        }
+        return false;
+    }
+
+    public boolean isAllRead() {
+        return getUnreadCount() == 0 && getReadCount() > 0;
+    }
+
+    public boolean isUnread() {
+        return getReadCount() == 0;
+    }
+
+    /**
+     * 获取要显示在会话列表的消息摘要
+     *
+     * Get a summary of messages to display in the conversation list
+     * @return
+     */
+    public abstract String onGetDisplayString();
+
+    public abstract void onProcessMessage(V2TIMMessage v2TIMMessage);
+
+    public final long getMessageTime() {
+        if (v2TIMMessage != null) {
+            long timestamp = v2TIMMessage.getTimestamp();
+            if (timestamp != 0) {
+                return timestamp;
+            }
+        }
+        return msgTime;
+    }
+
+    public long getMsgSeq() {
+        if (v2TIMMessage != null) {
+            return v2TIMMessage.getSeq();
+        }
+        return 0;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public String getUserId() {
+        if (v2TIMMessage != null) {
+            return v2TIMMessage.getUserID();
+        }
+        return "";
+    }
+
+    public boolean isSelf() {
+        if (v2TIMMessage != null) {
+            return v2TIMMessage.isSelf();
+        }
+        return true;
+    }
+
+    public String getSender() {
+        String sender = null;
+        if (v2TIMMessage != null) {
+            sender = v2TIMMessage.getSender();
+        }
+        if (TextUtils.isEmpty(sender)) {
+            sender = V2TIMManager.getInstance().getLoginUser();
+        }
+        return sender;
+    }
+
+    public V2TIMMessage getV2TIMMessage() {
+        return v2TIMMessage;
+    }
+
+    public boolean isGroup() {
+        return isGroup;
+    }
+
+    public void setGroup(boolean group) {
+        isGroup = group;
+    }
+
+    public String getGroupId() {
+        if (v2TIMMessage != null) {
+            return v2TIMMessage.getGroupID();
+        }
+        return "";
+    }
+
+    public String getNameCard() {
+        if (v2TIMMessage != null) {
+            return v2TIMMessage.getNameCard();
+        }
+        return "";
+    }
+
+    public String getNickName() {
+        if (v2TIMMessage != null) {
+            return v2TIMMessage.getNickName();
+        }
+        return "";
+    }
+
+    public String getFriendRemark() {
+        if (v2TIMMessage != null) {
+            return v2TIMMessage.getFriendRemark();
+        }
+        return "";
+    }
+
+    public String getUserDisplayName() {
+        String displayName;
+        if (!TextUtils.isEmpty(getNameCard())) {
+            displayName = getNameCard();
+        } else if (!TextUtils.isEmpty(getFriendRemark())) {
+            displayName = getFriendRemark();
+        } else if (!TextUtils.isEmpty(getNickName())) {
+            displayName = getNickName();
+        } else {
+            displayName = getSender();
+        }
+        return displayName;
+    }
+
+    public String getFaceUrl() {
+        if (v2TIMMessage != null) {
+            return v2TIMMessage.getFaceUrl();
+        }
+        return "";
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setExtra(String extra) {
+        this.extra = extra;
+    }
+
+    public String getExtra() {
+        return extra;
+    }
+
+    public void setDownloadStatus(int downloadStatus) {
+        this.downloadStatus = downloadStatus;
+    }
+
+    public int getDownloadStatus() {
+        return downloadStatus;
+    }
+
+    public int getMsgType() {
+        if (v2TIMMessage != null) {
+            return v2TIMMessage.getElemType();
+        } else {
+            return V2TIMMessage.V2TIM_ELEM_TYPE_NONE;
+        }
+    }
+
+    public boolean isNeedReadReceipt() {
+        if (v2TIMMessage != null) {
+            return v2TIMMessage.isNeedReadReceipt();
+        }
+        return false;
+    }
+
+    public void setNeedReadReceipt(boolean isNeedReceipt) {
+        if (v2TIMMessage != null) {
+            v2TIMMessage.setNeedReadReceipt(isNeedReceipt);
+        }
+    }
+
+    public void setTranslationStatus(int status) {
+        if (status != MSG_TRANSLATE_STATUS_UNKNOWN && status != MSG_TRANSLATE_STATUS_HIDDEN && status != MSG_TRANSLATE_STATUS_SHOWN
+            && status != MSG_TRANSLATE_STATUS_LOADING) {
+            return;
+        }
+
+        if (status == translationStatus) {
+            return;
+        }
+
+        if (status == MSG_TRANSLATE_STATUS_LOADING) {
+            translationStatus = MSG_TRANSLATE_STATUS_LOADING;
+            return;
+        }
+
+        translationStatus = status;
+
+        if (v2TIMMessage != null) {
+            String localCustomData = v2TIMMessage.getLocalCustomData();
+            JSONObject customJson = new JSONObject();
+            try {
+                if (!TextUtils.isEmpty(localCustomData)) {
+                    customJson = new JSONObject(localCustomData);
+                }
+                customJson.put(TRANSLATION_VIEW_STATUS_KEY, status);
+                v2TIMMessage.setLocalCustomData(customJson.toString());
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public int getTranslationStatus() {
+        if (translationStatus != MSG_TRANSLATE_STATUS_UNKNOWN) {
+            return translationStatus;
+        }
+
+        if (v2TIMMessage != null) {
+            String localCustomData = v2TIMMessage.getLocalCustomData();
+            if (TextUtils.isEmpty(localCustomData)) {
+                return translationStatus;
+            }
+            try {
+                JSONObject customJson = new JSONObject(localCustomData);
+                if (customJson.has(TRANSLATION_VIEW_STATUS_KEY)) {
+                    translationStatus = customJson.getInt(TRANSLATION_VIEW_STATUS_KEY);
+                }
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+        }
+        return translationStatus;
+    }
+
+    public void setTranslation(String translation) {
+        if (v2TIMMessage != null) {
+            String localCustomData = v2TIMMessage.getLocalCustomData();
+            JSONObject customJson = new JSONObject();
+            try {
+                if (!TextUtils.isEmpty(localCustomData)) {
+                    customJson = new JSONObject(localCustomData);
+                }
+                customJson.put(TRANSLATION_KEY, translation);
+                customJson.put(TRANSLATION_VIEW_STATUS_KEY, MSG_TRANSLATE_STATUS_SHOWN);
+                v2TIMMessage.setLocalCustomData(customJson.toString());
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+            translationStatus = MSG_TRANSLATE_STATUS_SHOWN;
+        }
+    }
+
+    public String getTranslation() {
+        String translation = "";
+        if (v2TIMMessage != null) {
+            String localCustomData = v2TIMMessage.getLocalCustomData();
+            if (TextUtils.isEmpty(localCustomData)) {
+                return translation;
+            }
+            try {
+                JSONObject customJson = new JSONObject(localCustomData);
+                if (customJson.has(TRANSLATION_KEY)) {
+                    translation = customJson.getString(TRANSLATION_KEY);
+                }
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+        }
+        return translation;
+    }
+
+    public void setV2TIMMessage(V2TIMMessage v2TIMMessage) {
+        this.v2TIMMessage = v2TIMMessage;
+        setCommonAttribute(v2TIMMessage);
+        onProcessMessage(v2TIMMessage);
+    }
+
+    public void update(TUIMessageBean messageBean) {
+        setV2TIMMessage(messageBean.getV2TIMMessage());
+    }
+
+    public String getSelectText() {
+        return selectText;
+    }
+
+    public void setSelectText(String text) {
+        this.selectText = text;
+    }
+
+    public MessageFeature isSupportTyping() {
+        return MessageParser.isSupportTyping(this);
+    }
+
+    public void setMessageTypingFeature(MessageFeature messageFeature) {
+        MessageBuilder.mergeCloudCustomData(this, TIMCommonConstants.MESSAGE_FEATURE_KEY, messageFeature);
+    }
+
+    public Class<? extends TUIReplyQuoteBean> getReplyQuoteBeanClass() {
+        return null;
+    }
 }

+ 0 - 1
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/TUIReplyQuoteBean.java

@@ -32,5 +32,4 @@ public abstract class TUIReplyQuoteBean<T extends TUIMessageBean> implements Ser
     public String getDefaultAbstract() {
         return defaultAbstract;
     }
-
 }

+ 1 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/ReactUserBean.java → Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/bean/UserBean.java

@@ -1,10 +1,9 @@
 package com.tencent.qcloud.tuikit.timcommon.bean;
 
 import android.text.TextUtils;
-
 import java.io.Serializable;
 
-public class ReactUserBean implements Serializable {
+public class UserBean implements Serializable {
     private String userId;
     private String nikeName;
     private String nameCard;

+ 4 - 7
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/classicui/component/BeginnerGuidePage.java

@@ -12,11 +12,9 @@ import android.view.WindowManager;
 import android.view.animation.LinearInterpolator;
 import android.widget.ImageView;
 import android.widget.PopupWindow;
-
 import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.RecyclerView;
 import androidx.viewpager2.widget.ViewPager2;
-
 import com.tencent.qcloud.tuicore.util.SPUtils;
 import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.component.impl.GlideEngine;
@@ -25,11 +23,11 @@ import com.tencent.qcloud.tuikit.timcommon.util.SoftKeyBoardUtil;
 import com.tencent.qcloud.tuikit.timcommon.util.TIMCommonConstants;
 
 public class BeginnerGuidePage {
-
     private PopupWindow popupWindow;
     private ViewPager2 viewPager;
     private OnFinishListener onFinishListener;
     private int[] resIDs;
+
     public BeginnerGuidePage(Activity activity) {
         View popupView = LayoutInflater.from(activity).inflate(R.layout.layout_beginner_guide, null);
         viewPager = popupView.findViewById(R.id.view_pager);
@@ -63,7 +61,6 @@ public class BeginnerGuidePage {
     }
 
     private void startAnimation(Window window, boolean isShow) {
-        LinearInterpolator interpolator = new LinearInterpolator();
         ValueAnimator animator;
         if (isShow) {
             animator = ValueAnimator.ofFloat(1.0f, 0.5f);
@@ -78,7 +75,7 @@ public class BeginnerGuidePage {
                 window.setAttributes(lp);
             }
         });
-
+        LinearInterpolator interpolator = new LinearInterpolator();
         animator.setDuration(200);
         animator.setInterpolator(interpolator);
         animator.start();
@@ -105,7 +102,7 @@ public class BeginnerGuidePage {
         @NonNull
         @Override
         public GuideViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
-            return new GuideViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_beginner_guide_item, parent ,false));
+            return new GuideViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_beginner_guide_item, parent, false));
         }
 
         @Override
@@ -147,6 +144,7 @@ public class BeginnerGuidePage {
 
         class GuideViewHolder extends RecyclerView.ViewHolder {
             private final ImageView image;
+
             public GuideViewHolder(@NonNull View itemView) {
                 super(itemView);
                 image = itemView.findViewById(R.id.center_image);
@@ -154,7 +152,6 @@ public class BeginnerGuidePage {
         }
     }
 
-
     public static void showBeginnerGuideThen(View view, Runnable runnable) {
         boolean isShowGuide = SPUtils.getInstance(TIMCommonConstants.CHAT_SETTINGS_SP_NAME).getBoolean(TIMCommonConstants.CHAT_REPLY_GUIDE_SHOW_SP_KEY, true);
         if (isShowGuide) {

+ 14 - 19
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/classicui/widget/message/ChatFlowReactView.java

@@ -10,17 +10,14 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.TextView;
-
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.recyclerview.widget.RecyclerView;
-
 import com.tencent.qcloud.tuicore.TUIThemeManager;
 import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.bean.MessageReactBean;
-import com.tencent.qcloud.tuikit.timcommon.bean.ReactUserBean;
+import com.tencent.qcloud.tuikit.timcommon.bean.UserBean;
 import com.tencent.qcloud.tuikit.timcommon.component.face.FaceManager;
-
 import java.util.ArrayList;
 import java.util.Map;
 import java.util.Set;
@@ -29,6 +26,7 @@ public class ChatFlowReactView extends RecyclerView {
     private ChatFlowReactLayoutManager layoutManager;
     private ChatFlowReactAdapter adapter;
     private int themeColorId;
+
     public ChatFlowReactView(@NonNull Context context) {
         super(context);
         initView();
@@ -45,7 +43,6 @@ public class ChatFlowReactView extends RecyclerView {
     }
 
     private void initView() {
-
         DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
         float spacingVertical = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 7.68f, displayMetrics);
         float spacingHorizontal = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5.76f, displayMetrics);
@@ -78,6 +75,7 @@ public class ChatFlowReactView extends RecyclerView {
         private MessageReactBean data;
         private ReactOnClickListener reactOnClickListener;
         private int themeColorId;
+
         public void setReactOnClickListener(ReactOnClickListener reactOnClickListener) {
             this.reactOnClickListener = reactOnClickListener;
         }
@@ -101,11 +99,10 @@ public class ChatFlowReactView extends RecyclerView {
         public void onBindViewHolder(@NonNull ChatFlowReactViewHolder holder, int position) {
             Map.Entry<String, Set<String>> entry = new ArrayList<>(data.getReacts().entrySet()).get(position);
             String emojiId = entry.getKey();
-            Set<String> userIds = entry.getValue();
-
             Bitmap bitmap = FaceManager.getEmoji(emojiId);
             holder.faceImageView.setImageBitmap(bitmap);
-
+            Set<String> userIds = entry.getValue();
+            holder.userTextView.setText(formatDisplayUserName(userIds));
             holder.faceImageView.setOnClickListener(new OnClickListener() {
                 @Override
                 public void onClick(View v) {
@@ -118,19 +115,18 @@ public class ChatFlowReactView extends RecyclerView {
                 holder.userTextView.setTextColor(holder.userTextView.getResources().getColor(themeColorId));
                 holder.userTextView.setTextColor(holder.userTextView.getResources().getColor(themeColorId));
             } else {
-                holder.userTextView.setTextColor(holder.userTextView.getResources().getColor(
-                        TUIThemeManager.getAttrResId(holder.userTextView.getContext(), R.attr.chat_react_text_color)));
-                holder.userTextView.setTextColor(holder.userTextView.getResources().getColor(
-                        TUIThemeManager.getAttrResId(holder.userTextView.getContext(), R.attr.chat_react_text_color)));
+                holder.userTextView.setTextColor(
+                    holder.userTextView.getResources().getColor(TUIThemeManager.getAttrResId(holder.userTextView.getContext(), R.attr.chat_react_text_color)));
+                holder.userTextView.setTextColor(
+                    holder.userTextView.getResources().getColor(TUIThemeManager.getAttrResId(holder.userTextView.getContext(), R.attr.chat_react_text_color)));
             }
-            holder.userTextView.setText(formatDisplayUserName(userIds));
         }
 
         private String getUserDisplayName(String id) {
             if (data.getReactUserBeanMap() == null) {
                 return id;
             } else {
-                ReactUserBean reactUserBean = data.getReactUserBeanMap().get(id);
+                UserBean reactUserBean = data.getReactUserBeanMap().get(id);
                 if (reactUserBean == null) {
                     return id;
                 } else {
@@ -146,7 +142,7 @@ public class ChatFlowReactView extends RecyclerView {
             }
             return 0;
         }
-        
+
         private String formatDisplayUserName(Set<String> userIds) {
             StringBuilder stringBuilder = new StringBuilder();
             int index = 0;
@@ -168,6 +164,7 @@ public class ChatFlowReactView extends RecyclerView {
     static class ChatFlowReactViewHolder extends ViewHolder {
         public TextView userTextView;
         public ImageView faceImageView;
+
         public ChatFlowReactViewHolder(@NonNull View itemView) {
             super(itemView);
             userTextView = itemView.findViewById(R.id.users_tv);
@@ -175,7 +172,6 @@ public class ChatFlowReactView extends RecyclerView {
         }
     }
 
-
     // ChatReactView is just a simple flowLayout
     static class ChatFlowReactLayoutManager extends LayoutManager {
         private int verticalSpacing = 0;
@@ -216,10 +212,8 @@ public class ChatFlowReactView extends RecyclerView {
                 addView(childView);
                 measureChildWithMargins(childView, 0, 0);
                 int childMeasuredWidth = getDecoratedMeasuredWidth(childView);
-                int childMeasuredHeight = getDecoratedMeasuredHeight(childView);
 
-                if (i != 0 && offsetRight + horizontalSpacing + childMeasuredWidth >
-                        getWidth() - getPaddingStart() - getPaddingEnd()) {
+                if (i != 0 && offsetRight + horizontalSpacing + childMeasuredWidth > getWidth() - getPaddingStart() - getPaddingEnd()) {
                     // switch a new line
                     isLineFirstItem = true;
                     isFirstLine = false;
@@ -237,6 +231,7 @@ public class ChatFlowReactView extends RecyclerView {
                 } else {
                     offsetTop = currentMaxBottom + verticalSpacing;
                 }
+                int childMeasuredHeight = getDecoratedMeasuredHeight(childView);
 
                 offsetRight = offsetLeft + childMeasuredWidth;
                 offsetBottom = offsetTop + childMeasuredHeight;

+ 6 - 13
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/classicui/widget/message/MessageBaseHolder.java

@@ -11,19 +11,16 @@ import android.widget.FrameLayout;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
-
 import androidx.recyclerview.widget.RecyclerView;
-
 import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
 import com.tencent.qcloud.tuikit.timcommon.component.MessageProperties;
 import com.tencent.qcloud.tuikit.timcommon.interfaces.ICommonMessageAdapter;
 import com.tencent.qcloud.tuikit.timcommon.interfaces.OnItemClickListener;
 import com.tencent.qcloud.tuikit.timcommon.util.DateTimeUtil;
-
 import java.util.Date;
 
-public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
+public abstract class MessageBaseHolder<T extends TUIMessageBean> extends RecyclerView.ViewHolder {
     public static final int MSG_TYPE_HEADER_VIEW = -99;
 
     public ICommonMessageAdapter mAdapter;
@@ -41,6 +38,7 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
     public RelativeLayout mContentLayout;
 
     private ValueAnimator highLightAnimator;
+
     public MessageBaseHolder(View itemView) {
         super(itemView);
         chatTimeText = itemView.findViewById(R.id.message_top_time_tv);
@@ -81,7 +79,7 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
         return this.onItemClickListener;
     }
 
-    public void layoutViews(final TUIMessageBean msg, final int position) {
+    public void layoutViews(final T msg, final int position) {
         if (properties.getChatTimeBubble() != null) {
             chatTimeText.setBackground(properties.getChatTimeBubble());
         }
@@ -120,7 +118,6 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
         int highLightColorLight = itemView.getResources().getColor(com.tencent.qcloud.tuikit.timcommon.R.color.chat_message_bubble_high_light_light_color);
 
         if (highLightAnimator == null) {
-            ArgbEvaluator argbEvaluator = new ArgbEvaluator();
             highLightAnimator = new ValueAnimator();
             highLightAnimator.setIntValues(highLightColorDark, highLightColorLight);
             highLightAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@@ -132,9 +129,7 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
             });
             highLightAnimator.addListener(new Animator.AnimatorListener() {
                 @Override
-                public void onAnimationStart(Animator animation) {
-
-                }
+                public void onAnimationStart(Animator animation) {}
 
                 @Override
                 public void onAnimationEnd(Animator animation) {
@@ -147,10 +142,9 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
                 }
 
                 @Override
-                public void onAnimationRepeat(Animator animation) {
-
-                }
+                public void onAnimationRepeat(Animator animation) {}
             });
+            ArgbEvaluator argbEvaluator = new ArgbEvaluator();
             highLightAnimator.setEvaluator(argbEvaluator);
             highLightAnimator.setRepeatCount(3);
             highLightAnimator.setDuration(250);
@@ -172,5 +166,4 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
             drawable.setColorFilter(null);
         }
     }
-
 }

+ 203 - 196
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/classicui/widget/message/MessageContentHolder.java

@@ -9,9 +9,7 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.ProgressBar;
 import android.widget.TextView;
-
 import androidx.recyclerview.widget.RecyclerView;
-
 import com.tencent.imsdk.v2.V2TIMManager;
 import com.tencent.imsdk.v2.V2TIMMessage;
 import com.tencent.imsdk.v2.V2TIMUserFullInfo;
@@ -29,14 +27,12 @@ import com.tencent.qcloud.tuikit.timcommon.component.gatherimage.UserIconView;
 import com.tencent.qcloud.tuikit.timcommon.util.DateTimeUtil;
 import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
 import com.tencent.qcloud.tuikit.timcommon.util.TIMCommonLog;
-
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 
-public abstract class MessageContentHolder extends MessageBaseHolder {
-
+public abstract class MessageContentHolder<T extends TUIMessageBean> extends MessageBaseHolder<T> {
     public UserIconView leftUserIcon;
     public UserIconView rightUserIcon;
     public TextView usernameText;
@@ -89,7 +85,7 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
         }
 
         List<TUIMessageBean> mediaSource = new ArrayList<>();
-        for(TUIMessageBean messageBean : dataSource) {
+        for (TUIMessageBean messageBean : dataSource) {
             int type = messageBean.getMsgType();
             if (type == V2TIMMessage.V2TIM_ELEM_TYPE_IMAGE || type == V2TIMMessage.V2TIM_ELEM_TYPE_VIDEO) {
                 mediaSource.add(messageBean);
@@ -109,103 +105,13 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
     }
 
     @Override
-    public void layoutViews(final TUIMessageBean msg, final int position) {
+    public void layoutViews(final T msg, final int position) {
         super.layoutViews(msg, position);
 
-        if (isForwardMode || isReplyDetailMode) {
-            leftUserIcon.setVisibility(View.VISIBLE);
-            rightUserIcon.setVisibility(View.GONE);
-        } else {
-            if (msg.isSelf()) {
-                leftUserIcon.setVisibility(View.GONE);
-                rightUserIcon.setVisibility(View.VISIBLE);
-            } else {
-                leftUserIcon.setVisibility(View.VISIBLE);
-                rightUserIcon.setVisibility(View.GONE);
-            }
-        }
-        if (properties.getAvatar() != 0) {
-            leftUserIcon.setDefaultImageResId(properties.getAvatar());
-            rightUserIcon.setDefaultImageResId(properties.getAvatar());
-        } else {
-            leftUserIcon.setDefaultImageResId(TUIThemeManager.getAttrResId(leftUserIcon.getContext(), com.tencent.qcloud.tuikit.timcommon.R.attr.core_default_user_icon));
-            rightUserIcon.setDefaultImageResId(TUIThemeManager.getAttrResId(rightUserIcon.getContext(), com.tencent.qcloud.tuikit.timcommon.R.attr.core_default_user_icon));
-        }
-        if (properties.getAvatarRadius() != 0) {
-            leftUserIcon.setRadius(properties.getAvatarRadius());
-            rightUserIcon.setRadius(properties.getAvatarRadius());
-        } else {
-            int radius = ScreenUtil.dip2px(4);
-            leftUserIcon.setRadius(radius);
-            rightUserIcon.setRadius(radius);
-        }
-        if (properties.getAvatarSize() != null && properties.getAvatarSize().length == 2) {
-            ViewGroup.LayoutParams params = leftUserIcon.getLayoutParams();
-            params.width = properties.getAvatarSize()[0];
-            params.height = properties.getAvatarSize()[1];
-            leftUserIcon.setLayoutParams(params);
-
-            params = rightUserIcon.getLayoutParams();
-            params.width = properties.getAvatarSize()[0];
-            params.height = properties.getAvatarSize()[1];
-            rightUserIcon.setLayoutParams(params);
-        }
-
-        if (isForwardMode || isReplyDetailMode) {
-            usernameText.setVisibility(View.VISIBLE);
-        } else {
-            if (msg.isSelf()) {
-                if (properties.getRightNameVisibility() == 0) {
-                    usernameText.setVisibility(View.GONE);
-                } else {
-                    usernameText.setVisibility(properties.getRightNameVisibility());
-                }
-            } else {
-                if (properties.getLeftNameVisibility() == 0) {
-                    if (msg.isGroup()) {
-                        usernameText.setVisibility(View.VISIBLE);
-                    } else {
-                        usernameText.setVisibility(View.GONE);
-                    }
-                } else {
-                    usernameText.setVisibility(properties.getLeftNameVisibility());
-                }
-            }
-        }
-        if (properties.getNameFontColor() != 0) {
-            usernameText.setTextColor(properties.getNameFontColor());
-        }
-        if (properties.getNameFontSize() != 0) {
-            usernameText.setTextSize(properties.getNameFontSize());
-        }
-
-        if (!TextUtils.isEmpty(msg.getNameCard())) {
-            usernameText.setText(msg.getNameCard());
-        } else if (!TextUtils.isEmpty(msg.getFriendRemark())) {
-            usernameText.setText(msg.getFriendRemark());
-        } else if (!TextUtils.isEmpty(msg.getNickName())) {
-            usernameText.setText(msg.getNickName());
-        } else {
-            usernameText.setText(msg.getSender());
-        }
-
+        setUserIcon(msg);
+        setUserName(msg);
         loadAvatar(msg);
-
-        if (isForwardMode || isReplyDetailMode) {
-            sendingProgress.setVisibility(View.GONE);
-        } else {
-            if (msg.isSelf()) {
-                if (msg.getStatus() == TUIMessageBean.MSG_STATUS_SEND_FAIL
-                        || msg.getStatus() == TUIMessageBean.MSG_STATUS_SEND_SUCCESS
-                        || msg.isPeerRead()) {
-                    sendingProgress.setVisibility(View.GONE);
-                } else {
-                    sendingProgress.setVisibility(View.VISIBLE);
-                }
-            } else {
-                sendingProgress.setVisibility(View.GONE);
-            }
-        }
+        setSendingProgress(msg);
 
         if (isForwardMode || isReplyDetailMode) {
             msgArea.setBackgroundResource(TUIThemeManager.getAttrResId(itemView.getContext(), R.attr.chat_bubble_other_bg));
@@ -224,74 +130,7 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
                     msgArea.setBackgroundResource(TUIThemeManager.getAttrResId(itemView.getContext(), R.attr.chat_bubble_other_bg));
                 }
             }
-
-            if (onItemClickListener != null) {
-                msgContentFrame.setOnLongClickListener(new View.OnLongClickListener() {
-                    @Override
-                    public boolean onLongClick(View v) {
-                        onItemClickListener.onMessageLongClick(v, position, msg);
-                        return true;
-                    }
-                });
-
-                msgArea.setOnLongClickListener(new View.OnLongClickListener() {
-                    @Override
-                    public boolean onLongClick(View v) {
-                        onItemClickListener.onMessageLongClick(msgArea, position, msg);
-                        return true;
-                    }
-                });
-
-                leftUserIcon.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        onItemClickListener.onUserIconClick(view, position, msg);
-                    }
-                });
-                leftUserIcon.setOnLongClickListener(new View.OnLongClickListener() {
-                    @Override
-                    public boolean onLongClick(View view) {
-                        onItemClickListener.onUserIconLongClick(view, position, msg);
-                        return true;
-                    }
-                });
-                rightUserIcon.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        onItemClickListener.onUserIconClick(view, position, msg);
-                    }
-                });
-            }
-
-            if (msg.getStatus() == TUIMessageBean.MSG_STATUS_SEND_FAIL) {
-                statusImage.setVisibility(View.VISIBLE);
-                msgContentFrame.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        if (onItemClickListener != null) {
-                            onItemClickListener.onMessageLongClick(msgContentFrame, position, msg);
-                        }
-                    }
-                });
-                statusImage.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        if (onItemClickListener != null) {
-                            onItemClickListener.onSendFailBtnClick(statusImage, position, msg);
-                        }
-                    }
-                });
-            } else {
-                msgContentFrame.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        if (onItemClickListener != null) {
-                            onItemClickListener.onMessageClick(msgContentFrame, position, msg);
-                        }
-                    }
-                });
-                statusImage.setVisibility(View.GONE);
-            }
+            setOnClickListener(msg, position);
         }
 
         if (isForwardMode || isReplyDetailMode) {
@@ -352,13 +191,185 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
         layoutVariableViews(msg, position);
     }
 
+    private void setOnClickListener(T msg, int position) {
+        if (onItemClickListener != null) {
+            msgContentFrame.setOnLongClickListener(new View.OnLongClickListener() {
+                @Override
+                public boolean onLongClick(View v) {
+                    onItemClickListener.onMessageLongClick(v, position, msg);
+                    return true;
+                }
+            });
+
+            msgArea.setOnLongClickListener(new View.OnLongClickListener() {
+                @Override
+                public boolean onLongClick(View v) {
+                    onItemClickListener.onMessageLongClick(msgArea, position, msg);
+                    return true;
+                }
+            });
+
+            leftUserIcon.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    onItemClickListener.onUserIconClick(view, position, msg);
+                }
+            });
+            leftUserIcon.setOnLongClickListener(new View.OnLongClickListener() {
+                @Override
+                public boolean onLongClick(View view) {
+                    onItemClickListener.onUserIconLongClick(view, position, msg);
+                    return true;
+                }
+            });
+            rightUserIcon.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    onItemClickListener.onUserIconClick(view, position, msg);
+                }
+            });
+        }
+
+        if (msg.getStatus() == TUIMessageBean.MSG_STATUS_SEND_FAIL) {
+            statusImage.setVisibility(View.VISIBLE);
+            msgContentFrame.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    if (onItemClickListener != null) {
+                        onItemClickListener.onMessageLongClick(msgContentFrame, position, msg);
+                    }
+                }
+            });
+            statusImage.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if (onItemClickListener != null) {
+                        onItemClickListener.onSendFailBtnClick(statusImage, position, msg);
+                    }
+                }
+            });
+        } else {
+            msgContentFrame.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if (onItemClickListener != null) {
+                        onItemClickListener.onMessageClick(msgContentFrame, position, msg);
+                    }
+                }
+            });
+            statusImage.setVisibility(View.GONE);
+        }
+    }
+
+    private void setSendingProgress(T msg) {
+
+        if (isForwardMode || isReplyDetailMode) {
+            sendingProgress.setVisibility(View.GONE);
+        } else {
+            if (msg.isSelf()) {
+                if (msg.getStatus() == TUIMessageBean.MSG_STATUS_SEND_FAIL || msg.getStatus() == TUIMessageBean.MSG_STATUS_SEND_SUCCESS || msg.isPeerRead()) {
+                    sendingProgress.setVisibility(View.GONE);
+                } else {
+                    sendingProgress.setVisibility(View.VISIBLE);
+                }
+            } else {
+                sendingProgress.setVisibility(View.GONE);
+            }
+        }
+    }
+
+    private void setUserName(T msg) {
+
+        if (isForwardMode || isReplyDetailMode) {
+            usernameText.setVisibility(View.VISIBLE);
+        } else {
+            if (msg.isSelf()) {
+                if (properties.getRightNameVisibility() == 0) {
+                    usernameText.setVisibility(View.GONE);
+                } else {
+                    usernameText.setVisibility(properties.getRightNameVisibility());
+                }
+            } else {
+                if (properties.getLeftNameVisibility() == 0) {
+                    if (msg.isGroup()) {
+                        usernameText.setVisibility(View.VISIBLE);
+                    } else {
+                        usernameText.setVisibility(View.GONE);
+                    }
+                } else {
+                    usernameText.setVisibility(properties.getLeftNameVisibility());
+                }
+            }
+        }
+        if (properties.getNameFontColor() != 0) {
+            usernameText.setTextColor(properties.getNameFontColor());
+        }
+        if (properties.getNameFontSize() != 0) {
+            usernameText.setTextSize(properties.getNameFontSize());
+        }
+
+        if (!TextUtils.isEmpty(msg.getNameCard())) {
+            usernameText.setText(msg.getNameCard());
+        } else if (!TextUtils.isEmpty(msg.getFriendRemark())) {
+            usernameText.setText(msg.getFriendRemark());
+        } else if (!TextUtils.isEmpty(msg.getNickName())) {
+            usernameText.setText(msg.getNickName());
+        } else {
+            usernameText.setText(msg.getSender());
+        }
+    }
+
+    private void setUserIcon(T msg) {
+
+        if (isForwardMode || isReplyDetailMode) {
+            leftUserIcon.setVisibility(View.VISIBLE);
+            rightUserIcon.setVisibility(View.GONE);
+        } else {
+            if (msg.isSelf()) {
+                leftUserIcon.setVisibility(View.GONE);
+                rightUserIcon.setVisibility(View.VISIBLE);
+            } else {
+                leftUserIcon.setVisibility(View.VISIBLE);
+                rightUserIcon.setVisibility(View.GONE);
+            }
+        }
+        if (properties.getAvatar() != 0) {
+            leftUserIcon.setDefaultImageResId(properties.getAvatar());
+            rightUserIcon.setDefaultImageResId(properties.getAvatar());
+        } else {
+            leftUserIcon.setDefaultImageResId(
+                TUIThemeManager.getAttrResId(leftUserIcon.getContext(), R.attr.core_default_user_icon));
+            rightUserIcon.setDefaultImageResId(
+                TUIThemeManager.getAttrResId(rightUserIcon.getContext(), R.attr.core_default_user_icon));
+        }
+        if (properties.getAvatarRadius() != 0) {
+            leftUserIcon.setRadius(properties.getAvatarRadius());
+            rightUserIcon.setRadius(properties.getAvatarRadius());
+        } else {
+            int radius = ScreenUtil.dip2px(4);
+            leftUserIcon.setRadius(radius);
+            rightUserIcon.setRadius(radius);
+        }
+        if (properties.getAvatarSize() != null && properties.getAvatarSize().length == 2) {
+            ViewGroup.LayoutParams params = leftUserIcon.getLayoutParams();
+            params.width = properties.getAvatarSize()[0];
+            params.height = properties.getAvatarSize()[1];
+            leftUserIcon.setLayoutParams(params);
+
+            params = rightUserIcon.getLayoutParams();
+            params.width = properties.getAvatarSize()[0];
+            params.height = properties.getAvatarSize()[1];
+            rightUserIcon.setLayoutParams(params);
+        }
+    }
+
     private void setTranslationContent(TUIMessageBean msg) {
         HashMap<String, Object> param = new HashMap<>();
         param.put(TUIConstants.TUIChat.MESSAGE_BEAN, msg);
         param.put(TUIConstants.TUIChat.CHAT_RECYCLER_VIEW, recyclerView);
         param.put(TUIConstants.TUIChat.FRAGMENT, fragment);
 
-        TUICore.raiseExtension(TUIConstants.TUITranslation.Extension.TranslationView.CLASSIC_EXTENSION_ID, translationContentFrameLayout, param);
+        TUICore.raiseExtension(TUIConstants.TUITranslationPlugin.Extension.TranslationView.CLASSIC_EXTENSION_ID, translationContentFrameLayout, param);
     }
 
     private void loadAvatar(TUIMessageBean msg) {
@@ -500,7 +511,8 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
             if (msg.isAllRead()) {
                 isReadText.setText(R.string.has_all_read);
             } else if (msg.isUnread()) {
-                isReadText.setTextColor(isReadText.getResources().getColor(TUIThemeManager.getAttrResId(isReadText.getContext(), R.attr.chat_read_receipt_text_color)));
+                isReadText.setTextColor(
+                    isReadText.getResources().getColor(TUIThemeManager.getAttrResId(isReadText.getContext(), R.attr.chat_read_receipt_text_color)));
                 isReadText.setText(R.string.unread);
                 isReadText.setOnClickListener(new View.OnClickListener() {
                     @Override
@@ -512,7 +524,8 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
                 long readCount = msg.getReadCount();
                 if (readCount > 0) {
                     isReadText.setText(isReadText.getResources().getString(R.string.someone_has_read, readCount));
-                    isReadText.setTextColor(isReadText.getResources().getColor(TUIThemeManager.getAttrResId(isReadText.getContext(), R.attr.chat_read_receipt_text_color)));
+                    isReadText.setTextColor(
+                        isReadText.getResources().getColor(TUIThemeManager.getAttrResId(isReadText.getContext(), R.attr.chat_read_receipt_text_color)));
                     isReadText.setOnClickListener(new View.OnClickListener() {
                         @Override
                         public void onClick(View v) {
@@ -527,7 +540,8 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
                 isReadText.setText(R.string.has_read);
             } else {
                 isReadText.setText(R.string.unread);
-                isReadText.setTextColor(isReadText.getResources().getColor(TUIThemeManager.getAttrResId(isReadText.getContext(), R.attr.chat_read_receipt_text_color)));
+                isReadText.setTextColor(
+                    isReadText.getResources().getColor(TUIThemeManager.getAttrResId(isReadText.getContext(), R.attr.chat_read_receipt_text_color)));
                 isReadText.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
@@ -538,7 +552,7 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
         }
     }
 
-    public abstract void layoutVariableViews(final TUIMessageBean msg, final int position);
+    public abstract void layoutVariableViews(final T msg, final int position);
 
     public void onRecycled() {
         if (selectableTextHelper != null) {
@@ -556,26 +570,23 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
         if (selectableTextHelper != null) {
             selectableTextHelper.destroy();
         }
-        selectableTextHelper = new SelectTextHelper
-                .Builder(textView)
-                .setCursorHandleColor(TIMCommonService.getAppContext().getResources().getColor(R.color.font_blue))
-                .setCursorHandleSizeInDp(18)
-                .setSelectedColor(TIMCommonService.getAppContext().getResources().getColor(R.color.test_blue))
-                .setSelectAll(true)
-                .setIsEmoji(isEmoji)
-                .setScrollShow(false)
-                .setSelectedAllNoPop(true)
-                .setMagnifierShow(false)
-                .build();
+        selectableTextHelper = new SelectTextHelper.Builder(textView)
+                                   .setCursorHandleColor(TIMCommonService.getAppContext().getResources().getColor(R.color.font_blue))
+                                   .setCursorHandleSizeInDp(18)
+                                   .setSelectedColor(TIMCommonService.getAppContext().getResources().getColor(R.color.test_blue))
+                                   .setSelectAll(true)
+                                   .setIsEmoji(isEmoji)
+                                   .setScrollShow(false)
+                                   .setSelectedAllNoPop(true)
+                                   .setMagnifierShow(false)
+                                   .build();
 
         selectableTextHelper.setSelectListener(new SelectTextHelper.OnSelectListener() {
             @Override
-            public void onClick(View v) {
-            }
+            public void onClick(View v) {}
 
             @Override
-            public void onLongClick(View v) {
-            }
+            public void onLongClick(View v) {}
 
             @Override
             public void onTextSelected(CharSequence content) {
@@ -593,12 +604,10 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
             }
 
             @Override
-            public void onClickUrl(String url) {
-            }
+            public void onClickUrl(String url) {}
 
             @Override
-            public void onSelectAllShowCustomPop() {
-            }
+            public void onSelectAllShowCustomPop() {}
 
             @Override
             public void onReset() {
@@ -607,12 +616,10 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
             }
 
             @Override
-            public void onDismissCustomPop() {
-            }
+            public void onDismissCustomPop() {}
 
             @Override
-            public void onScrolling() {
-            }
+            public void onScrolling() {}
         });
     }
 

+ 48 - 52
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/classicui/widget/message/SelectTextHelper.java

@@ -30,21 +30,17 @@ import android.view.ViewTreeObserver;
 import android.widget.Magnifier;
 import android.widget.PopupWindow;
 import android.widget.TextView;
-
 import androidx.annotation.ColorInt;
 import androidx.annotation.DrawableRes;
 import androidx.annotation.StringRes;
-
 import com.tencent.qcloud.tuikit.timcommon.classicui.component.BeginnerGuidePage;
 import com.tencent.qcloud.tuikit.timcommon.component.face.FaceManager;
 import com.tencent.qcloud.tuikit.timcommon.util.TIMCommonLog;
-
 import java.util.LinkedList;
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-
 public class SelectTextHelper {
     private static final String TAG = SelectTextHelper.class.getSimpleName();
 
@@ -63,7 +59,7 @@ public class SelectTextHelper {
 
     private int mTouchX;
     private int mTouchY;
-    private int mTextViewMarginStart = 0;// textView的marginStart值
+    private int mTextViewMarginStart = 0; // textView的marginStart值
 
     private int mSelectedColor;
     private int mCursorHandleColor;
@@ -77,7 +73,7 @@ public class SelectTextHelper {
     private int mPopArrowImg;
     private boolean mIsEmoji = false;
     private List<Pair<Integer, String>> itemTextList;
-    private List<Builder.onSeparateItemClickListener> itemListenerList = new LinkedList<>();
+    private List<Builder.OnSeparateItemClickListener> itemListenerList = new LinkedList<>();
 
     private BackgroundColorSpan mSpan;
     private boolean isHideWhenScroll;
@@ -88,25 +84,24 @@ public class SelectTextHelper {
     private ViewTreeObserver.OnScrollChangedListener mOnScrollChangedListener;
     private View.OnTouchListener mRootTouchListener;
 
-
     public interface OnSelectListener {
-        void onClick(View v);// 点击textView
+        void onClick(View v); // 点击textView
 
-        void onLongClick(View v);// 长按textView
+        void onLongClick(View v); // 长按textView
 
-        void onTextSelected(CharSequence content);// 选中文本回调
+        void onTextSelected(CharSequence content); // 选中文本回调
 
-        void onDismiss();// 解除弹窗回调
+        void onDismiss(); // 解除弹窗回调
 
-        void onClickUrl(String url);// 点击文本里的url回调
+        void onClickUrl(String url); // 点击文本里的url回调
 
-        void onSelectAllShowCustomPop();// 全选显示自定义弹窗回调
+        void onSelectAllShowCustomPop(); // 全选显示自定义弹窗回调
 
-        void onReset();// 重置回调
+        void onReset(); // 重置回调
 
-        void onDismissCustomPop();// 解除自定义弹窗回调
+        void onDismissCustomPop(); // 解除自定义弹窗回调
 
-        void onScrolling();// 正在滚动回调
+        void onScrolling(); // 正在滚动回调
     }
 
     public static class Builder {
@@ -123,7 +118,7 @@ public class SelectTextHelper {
         private int mPopArrowImg = 0;
         private boolean mIsEmoji = false;
         private List<Pair<Integer, String>> itemTextList = new LinkedList<>();
-        private List<onSeparateItemClickListener> itemListenerList = new LinkedList<>();
+        private List<OnSeparateItemClickListener> itemListenerList = new LinkedList<>();
 
         public Builder(TextView textView) {
             mTextView = textView;
@@ -207,13 +202,13 @@ public class SelectTextHelper {
             return this;
         }
 
-        public Builder addItem(@DrawableRes int drawableId, @StringRes int textResId, onSeparateItemClickListener listener) {
+        public Builder addItem(@DrawableRes int drawableId, @StringRes int textResId, OnSeparateItemClickListener listener) {
             itemTextList.add(new Pair<>(drawableId, mTextView.getContext().getResources().getString(textResId)));
             itemListenerList.add(listener);
             return this;
         }
 
-        public Builder addItem(@DrawableRes int drawableId, String itemText, onSeparateItemClickListener listener) {
+        public Builder addItem(@DrawableRes int drawableId, String itemText, OnSeparateItemClickListener listener) {
             itemTextList.add(new Pair<>(drawableId, itemText));
             itemListenerList.add(listener);
             return this;
@@ -223,7 +218,7 @@ public class SelectTextHelper {
             return new SelectTextHelper(this);
         }
 
-        public interface onSeparateItemClickListener {
+        public interface OnSeparateItemClickListener {
             void onClick();
         }
     }
@@ -260,7 +255,6 @@ public class SelectTextHelper {
         }
     }
 
-
     /**
      * 选择文本监听
      */
@@ -329,8 +323,7 @@ public class SelectTextHelper {
             private void onLongTextViewClick() {
                 mTextView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
                     @Override
-                    public void onViewAttachedToWindow(View v) {
-                    }
+                    public void onViewAttachedToWindow(View v) {}
 
                     @Override
                     public void onViewDetachedFromWindow(View v) {
@@ -416,7 +409,9 @@ public class SelectTextHelper {
     private final Runnable mShowSelectViewRunnable = new Runnable() {
         @Override
         public void run() {
-            if (isHide) return;
+            if (isHide) {
+                return;
+            }
             if (mStartHandle != null) {
                 showCursorHandle(mStartHandle);
             }
@@ -451,8 +446,12 @@ public class SelectTextHelper {
     private void showSelectView(int x, int y) {
         reset();
         isHide = false;
-        if (mStartHandle == null) mStartHandle = new CursorHandle(true);
-        if (mEndHandle == null) mEndHandle = new CursorHandle(false);
+        if (mStartHandle == null) {
+            mStartHandle = new CursorHandle(true);
+        }
+        if (mEndHandle == null) {
+            mEndHandle = new CursorHandle(false);
+        }
 
         int startOffset = getPreciseOffset(mTextView, x, y);
         int endOffset = startOffset + DEFAULT_SELECTION_LENGTH;
@@ -474,8 +473,12 @@ public class SelectTextHelper {
     private void showAllView() {
         reset();
         isHide = false;
-        if (mStartHandle == null) mStartHandle = new CursorHandle(true);
-        if (mEndHandle == null) mEndHandle = new CursorHandle(false);
+        if (mStartHandle == null) {
+            mStartHandle = new CursorHandle(true);
+        }
+        if (mEndHandle == null) {
+            mEndHandle = new CursorHandle(false);
+        }
 
         if (mTextView.getText() instanceof Spannable) {
             mSpannable = (Spannable) mTextView.getText();
@@ -521,7 +524,7 @@ public class SelectTextHelper {
             }
 
             if (mIsEmoji) {
-                //handlerEmojiSelectText();
+                // handlerEmojiSelectText();
             }
         }
     }
@@ -535,11 +538,10 @@ public class SelectTextHelper {
             String emojiName = m.group();
             Bitmap bitmap = FaceManager.getEmoji(emojiName);
             if (bitmap != null) {
-
                 Drawable drawable = new BitmapDrawable(bitmap);
                 ShapeDrawable background = new ShapeDrawable();
                 background.getPaint().setColor(mTextView.getContext().getResources().getColor(com.tencent.qcloud.tuikit.timcommon.R.color.text_select_color));
-                LayerDrawable layerDrawable = new LayerDrawable(new Drawable[]{background, drawable});
+                LayerDrawable layerDrawable = new LayerDrawable(new Drawable[] {background, drawable});
                 layerDrawable.setBounds(0, 0, 64, 64);
                 ImageSpan image = new ImageSpan(layerDrawable, ImageSpan.ALIGN_BASELINE);
                 mSpannable.setSpan(image, mSelectionInfo.mStart, mSelectionInfo.mEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
@@ -551,14 +553,13 @@ public class SelectTextHelper {
      * 游标
      */
     private class CursorHandle extends View {
-
         private PopupWindow mPopupWindow;
         private Paint mPaint;
 
         private int mCircleRadius = mCursorHandleSize / 2;
         private int mWidth = mCursorHandleSize;
         private int mHeight = mCursorHandleSize;
-        private int mPadding = 32;// 游标padding
+        private int mPadding = 32; // 游标padding
         private boolean isLeft;
 
         public CursorHandle(boolean isLeft) {
@@ -603,8 +604,7 @@ public class SelectTextHelper {
                 case MotionEvent.ACTION_CANCEL:
                     if (mMagnifierShow) {
                         // android 9 放大镜
-                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P
-                                && null != mMagnifier) {
+                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && null != mMagnifier) {
                             mMagnifier.dismiss();
                         }
                     }
@@ -616,8 +616,7 @@ public class SelectTextHelper {
                     int rawX = (int) event.getRawX();
                     int rawY = (int) event.getRawY();
                     // x y不准 x 减去textView距离x轴距离值  y减去字体大小的像素值
-                    update(rawX + mAdjustX - mWidth - mTextViewMarginStart,
-                            rawY + mAdjustY - mHeight - (int) mTextView.getTextSize());
+                    update(rawX + mAdjustX - mWidth - mTextViewMarginStart, rawY + mAdjustY - mHeight - (int) mTextView.getTextSize());
                     if (mMagnifierShow) {
                         // android 9 放大镜功能
                         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
@@ -633,6 +632,8 @@ public class SelectTextHelper {
                         }
                     }
                     break;
+                default:
+                    break;
             }
             return true;
         }
@@ -696,10 +697,10 @@ public class SelectTextHelper {
             Layout layout = mTextView.getLayout();
             if (isLeft) {
                 mPopupWindow.update((int) layout.getPrimaryHorizontal(mSelectionInfo.mStart) - mWidth + getExtraX(),
-                        layout.getLineBottom(layout.getLineForOffset(mSelectionInfo.mStart)) + getExtraY(), -1, -1);
+                    layout.getLineBottom(layout.getLineForOffset(mSelectionInfo.mStart)) + getExtraY(), -1, -1);
             } else {
                 mPopupWindow.update((int) layout.getPrimaryHorizontal(mSelectionInfo.mEnd) + getExtraX(),
-                        layout.getLineBottom(layout.getLineForOffset(mSelectionInfo.mEnd)) + getExtraY(), -1, -1);
+                    layout.getLineBottom(layout.getLineForOffset(mSelectionInfo.mEnd)) + getExtraY(), -1, -1);
             }
         }
 
@@ -736,15 +737,13 @@ public class SelectTextHelper {
      * 处理内容链接跳转
      */
     private class LinkMovementMethodInterceptor extends LinkMovementMethod {
-
         private long downLinkTime;
 
         @Override
         public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {
             int action = event.getAction();
 
-            if (action == MotionEvent.ACTION_UP ||
-                    action == MotionEvent.ACTION_DOWN) {
+            if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_DOWN) {
                 int x = (int) event.getX();
                 int y = (int) event.getY();
 
@@ -758,8 +757,7 @@ public class SelectTextHelper {
                 int line = layout.getLineForVertical(y);
                 int off = layout.getOffsetForHorizontal(line, x);
 
-                ClickableSpan[] links =
-                        buffer.getSpans(off, off, ClickableSpan.class);
+                ClickableSpan[] links = buffer.getSpans(off, off, ClickableSpan.class);
 
                 if (links.length != 0) {
                     if (action == MotionEvent.ACTION_UP) {
@@ -782,9 +780,7 @@ public class SelectTextHelper {
                         }
                     } else if (action == MotionEvent.ACTION_DOWN) {
                         downLinkTime = System.currentTimeMillis();
-                        Selection.setSelection(buffer,
-                                buffer.getSpanStart(links[0]),
-                                buffer.getSpanEnd(links[0]));
+                        Selection.setSelection(buffer, buffer.getSpanStart(links[0]), buffer.getSpanEnd(links[0]));
                     }
                     return true;
                 } else {
@@ -794,7 +790,6 @@ public class SelectTextHelper {
 
             return super.onTouchEvent(widget, buffer, event);
         }
-
     }
 
     // util
@@ -819,7 +814,9 @@ public class SelectTextHelper {
 
     public static int getHysteresisOffset(TextView textView, int x, int y, int previousOffset) {
         final Layout layout = textView.getLayout();
-        if (layout == null) return -1;
+        if (layout == null) {
+            return -1;
+        }
 
         int line = layout.getLineForVertical(y);
 
@@ -855,9 +852,8 @@ public class SelectTextHelper {
 
         // If new line is just before or after previous line and y position is less than
         // hysteresisThreshold away from previous line, keep cursor on previous line.
-        if (((line == previousLine + 1) && ((y - previousLineBottom) < hysteresisThreshold)) || ((line == previousLine - 1) && ((
-                previousLineTop
-                        - y) < hysteresisThreshold))) {
+        if (((line == previousLine + 1) && ((y - previousLineBottom) < hysteresisThreshold))
+            || ((line == previousLine - 1) && ((previousLineTop - y) < hysteresisThreshold))) {
             line = previousLine;
         }
 

+ 0 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/CustomLinearLayoutManager.java

@@ -11,7 +11,6 @@ import androidx.recyclerview.widget.RecyclerView;
  * https://stackoverflow.com/questions/30458640/recyclerview-java-lang-indexoutofboundsexception-inconsistency-detected-inval
  */
 public class CustomLinearLayoutManager extends LinearLayoutManager {
-
     public CustomLinearLayoutManager(Context context) {
         super(context);
     }
@@ -31,6 +30,5 @@ public class CustomLinearLayoutManager extends LinearLayoutManager {
         } catch (IndexOutOfBoundsException e) {
             Log.w("CustomLinearLayoutManager", e.getLocalizedMessage());
         }
-
     }
 }

+ 0 - 3
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/LineControllerView.java

@@ -12,7 +12,6 @@ import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.Switch;
 import android.widget.TextView;
-
 import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
 
@@ -20,7 +19,6 @@ import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
  * Custom LineControllerView
  */
 public class LineControllerView extends RelativeLayout {
-
     private String mName;
     private boolean mIsBottom;
     private boolean mIsTop;
@@ -134,5 +132,4 @@ public class LineControllerView extends RelativeLayout {
             mSwitchView.setEnabled(true);
         }
     }
-
 }

+ 1 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/MaxWidthFrameLayout.java

@@ -11,7 +11,6 @@ import androidx.annotation.Nullable;
 import com.tencent.qcloud.tuikit.timcommon.R;
 
 public class MaxWidthFrameLayout extends FrameLayout {
-
     int maxWidthPx;
 
     public MaxWidthFrameLayout(@NonNull Context context) {
@@ -37,7 +36,7 @@ public class MaxWidthFrameLayout extends FrameLayout {
     @Override
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         int measuredWidth = MeasureSpec.getSize(widthMeasureSpec);
-        if(maxWidthPx > 0 && maxWidthPx < measuredWidth) {
+        if (maxWidthPx > 0 && maxWidthPx < measuredWidth) {
             widthMeasureSpec = MeasureSpec.makeMeasureSpec(maxWidthPx, MeasureSpec.AT_MOST);
         }
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);

+ 1 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/MaxWidthLinearLayout.java

@@ -11,7 +11,6 @@ import androidx.annotation.Nullable;
 import com.tencent.qcloud.tuikit.timcommon.R;
 
 public class MaxWidthLinearLayout extends LinearLayout {
-
     int maxWidthPx;
 
     public MaxWidthLinearLayout(@NonNull Context context) {
@@ -37,7 +36,7 @@ public class MaxWidthLinearLayout extends LinearLayout {
     @Override
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         int measuredWidth = MeasureSpec.getSize(widthMeasureSpec);
-        if(maxWidthPx > 0 && maxWidthPx < measuredWidth) {
+        if (maxWidthPx > 0 && maxWidthPx < measuredWidth) {
             widthMeasureSpec = MeasureSpec.makeMeasureSpec(maxWidthPx, MeasureSpec.AT_MOST);
         }
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);

+ 1 - 4
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/MessageProperties.java

@@ -26,9 +26,7 @@ public class MessageProperties implements IMessageProperties {
     private int mChatTimeFontColor;
     private Drawable mChatTimeBubble;
 
-    private MessageProperties() {
-
-    }
+    private MessageProperties() {}
 
     public static MessageProperties getInstance() {
         if (sP == null) {
@@ -220,5 +218,4 @@ public class MessageProperties implements IMessageProperties {
     public void setChatTimeFontColor(int color) {
         this.mChatTimeFontColor = color;
     }
-
 }

+ 0 - 4
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/MinimalistLineControllerView.java

@@ -11,9 +11,7 @@ import android.widget.CompoundButton;
 import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
-
 import androidx.appcompat.widget.SwitchCompat;
-
 import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
 
@@ -21,7 +19,6 @@ import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
  * Custom LineControllerView
  */
 public class MinimalistLineControllerView extends RelativeLayout {
-
     private String mName;
     private boolean mIsBottom;
     private boolean mIsTop;
@@ -157,5 +154,4 @@ public class MinimalistLineControllerView extends RelativeLayout {
         this.mName = name;
         mNameText.setText(name);
     }
-
 }

+ 0 - 1
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/MinimalistTitleBar.java

@@ -9,7 +9,6 @@ import androidx.annotation.Nullable;
 import com.tencent.qcloud.tuikit.timcommon.R;
 
 public class MinimalistTitleBar extends TitleBarLayout {
-
     public MinimalistTitleBar(Context context) {
         super(context);
         initView(context);

+ 9 - 16
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/PopupInputCard.java

@@ -17,11 +17,9 @@ import android.widget.Button;
 import android.widget.EditText;
 import android.widget.PopupWindow;
 import android.widget.TextView;
-
-import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuicore.util.ToastUtil;
+import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.util.SoftKeyBoardUtil;
-
 import java.util.regex.Pattern;
 
 public class PopupInputCard {
@@ -40,6 +38,7 @@ public class PopupInputCard {
     private String rule;
     private String notMachRuleTip;
     private ByteLengthFilter lengthFilter = new ByteLengthFilter();
+
     public PopupInputCard(Activity activity) {
         View popupView = LayoutInflater.from(activity).inflate(R.layout.layout_popup_card, null);
         titleTv = popupView.findViewById(R.id.popup_card_title);
@@ -118,14 +117,10 @@ public class PopupInputCard {
         editText.setFilters(new InputFilter[] {lengthFilter});
         editText.addTextChangedListener(new TextWatcher() {
             @Override
-            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-
-            }
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
 
             @Override
-            public void onTextChanged(CharSequence s, int start, int before, int count) {
-
-            }
+            public void onTextChanged(CharSequence s, int start, int before, int count) {}
 
             @Override
             public void afterTextChanged(Editable s) {
@@ -138,10 +133,9 @@ public class PopupInputCard {
                 }
             }
         });
-
     }
+
     private void startAnimation(Window window, boolean isShow) {
-        LinearInterpolator interpolator = new LinearInterpolator();
         ValueAnimator animator;
         if (isShow) {
             animator = ValueAnimator.ofFloat(1.0f, 0.5f);
@@ -156,7 +150,7 @@ public class PopupInputCard {
                 window.setAttributes(lp);
             }
         });
-
+        LinearInterpolator interpolator = new LinearInterpolator();
         animator.setDuration(200);
         animator.setInterpolator(interpolator);
         animator.start();
@@ -218,8 +212,8 @@ public class PopupInputCard {
 
     class ByteLengthFilter implements InputFilter {
         private int length = Integer.MAX_VALUE;
-        public ByteLengthFilter() {
-        }
+
+        public ByteLengthFilter() {}
 
         public void setLength(int length) {
             this.length = length;
@@ -232,7 +226,7 @@ public class PopupInputCard {
             int sourceLength = 0;
             if (!TextUtils.isEmpty(dest)) {
                 destLength = dest.toString().getBytes().length;
-                destReplaceLength= dest.subSequence(dstart, dend).toString().getBytes().length;
+                destReplaceLength = dest.subSequence(dstart, dend).toString().getBytes().length;
             }
             if (!TextUtils.isEmpty(source)) {
                 sourceLength = source.subSequence(start, end).toString().getBytes().length;
@@ -271,7 +265,6 @@ public class PopupInputCard {
             }
             return sequence.subSequence(start, end);
         }
-
     }
 
     @FunctionalInterface

+ 2 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/RoundCornerImageView.java

@@ -117,8 +117,8 @@ public class RoundCornerImageView extends AppCompatImageView {
         canvas.setDrawFilter(aliasFilter);
         rectF.set(0, 0, getMeasuredWidth(), getMeasuredHeight());
         // left-top -> right-top -> right-bottom -> left-bottom
-        float[] radius = {leftTopRadius, leftTopRadius, rightTopRadius, rightTopRadius,
-                rightBottomRadius, rightBottomRadius, leftBottomRadius, leftBottomRadius};
+        float[] radius = {
+            leftTopRadius, leftTopRadius, rightTopRadius, rightTopRadius, rightBottomRadius, rightBottomRadius, leftBottomRadius, leftBottomRadius};
         path.addRoundRect(rectF, radius, Path.Direction.CW);
         canvas.clipPath(path);
         super.onDraw(canvas);

+ 2 - 3
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/RoundFrameLayout.java

@@ -17,7 +17,6 @@ import androidx.annotation.Nullable;
 import com.tencent.qcloud.tuikit.timcommon.R;
 
 public class RoundFrameLayout extends FrameLayout {
-
     private final Path path = new Path();
     private final RectF rectF = new RectF();
     private final PaintFlagsDrawFilter aliasFilter = new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);
@@ -74,8 +73,8 @@ public class RoundFrameLayout extends FrameLayout {
         canvas.setDrawFilter(aliasFilter);
         rectF.set(0, 0, getMeasuredWidth(), getMeasuredHeight());
         // left-top -> right-top -> right-bottom -> left-bottom
-        float[] radius = {leftTopRadius, leftTopRadius, rightTopRadius, rightTopRadius,
-                rightBottomRadius, rightBottomRadius, leftBottomRadius, leftBottomRadius};
+        float[] radius = {
+            leftTopRadius, leftTopRadius, rightTopRadius, rightTopRadius, rightBottomRadius, rightBottomRadius, leftBottomRadius, leftBottomRadius};
         path.addRoundRect(rectF, radius, Path.Direction.CW);
         canvas.clipPath(path);
         super.dispatchDraw(canvas);

+ 1 - 1
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/SwitchCustomWidth.java

@@ -45,7 +45,7 @@ public class SwitchCustomWidth extends SwitchCompat {
     public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
         try {
-            if(customSwitchWidth == 0){
+            if (customSwitchWidth == 0) {
                 return;
             }
             Class<SwitchCompat> clazz = SwitchCompat.class;

+ 2 - 3
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/TitleBarLayout.java

@@ -12,16 +12,13 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
-
 import androidx.annotation.Nullable;
-
 import com.tencent.qcloud.tuicore.TUIThemeManager;
 import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.component.interfaces.ITitleBarLayout;
 import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
 
 public class TitleBarLayout extends LinearLayout implements ITitleBarLayout {
-
     private LinearLayout mLeftGroup;
     private LinearLayout mRightGroup;
     private TextView mLeftTitle;
@@ -126,6 +123,8 @@ public class TitleBarLayout extends LinearLayout implements ITitleBarLayout {
             case MIDDLE:
                 mCenterTitle.setText(title);
                 break;
+            default:
+                break;
         }
     }
 

+ 1 - 4
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/UnreadCountTextView.java

@@ -13,9 +13,7 @@ import androidx.appcompat.widget.AppCompatTextView;
 
 import com.tencent.qcloud.tuikit.timcommon.R;
 
-
 public class UnreadCountTextView extends AppCompatTextView {
-
     private int mNormalSize;
     private Paint mPaint;
 
@@ -65,7 +63,6 @@ public class UnreadCountTextView extends AppCompatTextView {
             canvas.drawRoundRect(new RectF(0, 0, getMeasuredWidth(), getMeasuredHeight()), getMeasuredHeight() / 2, getMeasuredHeight() / 2, mPaint);
         }
         super.onDraw(canvas);
-
     }
 
     @Override
@@ -80,6 +77,6 @@ public class UnreadCountTextView extends AppCompatTextView {
 
     private int dp2px(float dp) {
         DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
-        return  (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, displayMetrics);
+        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, displayMetrics);
     }
 }

+ 0 - 1
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/action/PopActionClickListener.java

@@ -1,6 +1,5 @@
 package com.tencent.qcloud.tuikit.timcommon.component.action;
 
-
 public interface PopActionClickListener {
     void onActionClick(int index, Object data);
 }

+ 1 - 3
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/action/PopDialogAdapter.java

@@ -6,15 +6,14 @@ import android.view.ViewGroup;
 import android.widget.BaseAdapter;
 import android.widget.TextView;
 
-import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuicore.TUIConfig;
+import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.util.ThreadUtils;
 
 import java.util.ArrayList;
 import java.util.List;
 
 public class PopDialogAdapter extends BaseAdapter {
-
     private List<PopMenuAction> dataSource = new ArrayList<>();
 
     public void setDataSource(final List datas) {
@@ -44,7 +43,6 @@ public class PopDialogAdapter extends BaseAdapter {
 
     @Override
     public View getView(final int position, View convertView, ViewGroup parent) {
-
         ViewHolder holder;
         if (convertView == null) {
             convertView = LayoutInflater.from(TUIConfig.getAppContext()).inflate(R.layout.pop_dialog_adapter, parent, false);

+ 9 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/action/PopMenuAction.java

@@ -3,11 +3,11 @@ package com.tencent.qcloud.tuikit.timcommon.component.action;
 import android.graphics.Bitmap;
 
 public class PopMenuAction {
-
     private String actionName;
     private Bitmap icon;
     private int iconResId;
     private PopActionClickListener actionClickListener;
+    private int weight;
 
     public String getActionName() {
         return actionName;
@@ -25,7 +25,6 @@ public class PopMenuAction {
         this.icon = mIcon;
     }
 
-
     public int getIconResId() {
         return iconResId;
     }
@@ -41,4 +40,12 @@ public class PopMenuAction {
     public void setActionClickListener(PopActionClickListener actionClickListener) {
         this.actionClickListener = actionClickListener;
     }
+
+    public int getWeight() {
+        return weight;
+    }
+
+    public void setWeight(int weight) {
+        this.weight = weight;
+    }
 }

+ 13 - 19
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/action/PopMenuAdapter.java

@@ -6,21 +6,16 @@ import android.view.ViewGroup;
 import android.widget.BaseAdapter;
 import android.widget.ImageView;
 import android.widget.TextView;
-
-import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuicore.TUIConfig;
+import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.util.ThreadUtils;
-
 import java.util.ArrayList;
 import java.util.List;
 
 public class PopMenuAdapter extends BaseAdapter {
-
     private List<PopMenuAction> dataSource = new ArrayList<>();
 
-    public PopMenuAdapter() {
-
-    }
+    public PopMenuAdapter() {}
 
     public void setDataSource(final List datas) {
         dataSource = datas;
@@ -49,39 +44,38 @@ public class PopMenuAdapter extends BaseAdapter {
 
     @Override
     public View getView(final int position, View convertView, ViewGroup parent) {
-
         ViewHolder holder;
         if (convertView == null) {
             convertView = LayoutInflater.from(TUIConfig.getAppContext()).inflate(R.layout.pop_menu_adapter, parent, false);
             holder = new ViewHolder();
-            holder.menu_icon = convertView.findViewById(R.id.pop_menu_icon);
+            holder.menuIcon = convertView.findViewById(R.id.pop_menu_icon);
 
             int iconSize = convertView.getResources().getDimensionPixelSize(R.dimen.core_pop_menu_icon_size);
-            ViewGroup.LayoutParams params = holder.menu_icon.getLayoutParams();
+            ViewGroup.LayoutParams params = holder.menuIcon.getLayoutParams();
             params.width = iconSize;
             params.height = iconSize;
-            holder.menu_icon.setLayoutParams(params);
+            holder.menuIcon.setLayoutParams(params);
 
-            holder.menu_lable = convertView.findViewById(R.id.pop_menu_label);
+            holder.menuLable = convertView.findViewById(R.id.pop_menu_label);
             convertView.setTag(holder);
         } else {
             holder = (ViewHolder) convertView.getTag();
         }
         PopMenuAction action = (PopMenuAction) getItem(position);
-        holder.menu_icon.setVisibility(View.VISIBLE);
+        holder.menuIcon.setVisibility(View.VISIBLE);
         if (action.getIcon() != null) {
-            holder.menu_icon.setImageBitmap(action.getIcon());
+            holder.menuIcon.setImageBitmap(action.getIcon());
         } else if (action.getIconResId() > 0) {
-            holder.menu_icon.setImageResource(action.getIconResId());
+            holder.menuIcon.setImageResource(action.getIconResId());
         } else {
-            holder.menu_icon.setVisibility(View.GONE);
+            holder.menuIcon.setVisibility(View.GONE);
         }
-        holder.menu_lable.setText(action.getActionName());
+        holder.menuLable.setText(action.getActionName());
         return convertView;
     }
 
     static class ViewHolder {
-        TextView menu_lable;
-        ImageView menu_icon;
+        TextView menuLable;
+        ImageView menuIcon;
     }
 }

+ 2 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/BaseLightActivity.java

@@ -14,7 +14,6 @@ import androidx.appcompat.app.AppCompatActivity;
 import com.tencent.qcloud.tuicore.TUIThemeManager;
 import com.tencent.qcloud.tuikit.timcommon.R;
 
-
 public class BaseLightActivity extends AppCompatActivity {
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -23,7 +22,8 @@ public class BaseLightActivity extends AppCompatActivity {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
             getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
             getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
-            getWindow().setStatusBarColor(getResources().getColor(TUIThemeManager.getAttrResId(this, com.tencent.qcloud.tuicore.R.attr.core_header_start_color)));
+            getWindow().setStatusBarColor(
+                getResources().getColor(TUIThemeManager.getAttrResId(this, com.tencent.qcloud.tuicore.R.attr.core_header_start_color)));
             getWindow().setNavigationBarColor(getResources().getColor(R.color.navigation_bar_color));
             int vis = getWindow().getDecorView().getSystemUiVisibility();
             vis |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;

+ 0 - 1
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/BaseMinimalistLightActivity.java

@@ -11,7 +11,6 @@ import android.view.inputmethod.InputMethodManager;
 import androidx.annotation.Nullable;
 import androidx.appcompat.app.AppCompatActivity;
 
-
 public class BaseMinimalistLightActivity extends AppCompatActivity {
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {

+ 35 - 42
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/ImageSelectActivity.java

@@ -1,6 +1,5 @@
 package com.tencent.qcloud.tuikit.timcommon.component.activities;
 
-
 import android.app.ProgressDialog;
 import android.content.DialogInterface;
 import android.content.Intent;
@@ -14,12 +13,10 @@ import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.RelativeLayout;
-
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.recyclerview.widget.GridLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
-
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.DataSource;
 import com.bumptech.glide.load.engine.GlideException;
@@ -34,12 +31,10 @@ import com.tencent.qcloud.tuikit.timcommon.component.TitleBarLayout;
 import com.tencent.qcloud.tuikit.timcommon.component.gatherimage.SynthesizedImageView;
 import com.tencent.qcloud.tuikit.timcommon.component.interfaces.ITitleBarLayout;
 import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
-
 import java.io.File;
 import java.io.Serializable;
 import java.util.List;
 
-
 public class ImageSelectActivity extends BaseLightActivity {
     private static final String TAG = ImageSelectActivity.class.getSimpleName();
 
@@ -74,7 +69,6 @@ public class ImageSelectActivity extends BaseLightActivity {
         setContentView(R.layout.core_activity_image_select_layout);
         Intent intent = getIntent();
         String title = intent.getStringExtra(TITLE);
-        boolean needDownload = intent.getBooleanExtra(NEED_DOWLOAD_LOCAL, false);
         titleBarLayout = findViewById(R.id.image_select_title);
         titleBarLayout.setTitle(title, ITitleBarLayout.Position.MIDDLE);
         titleBarLayout.setTitle(getString(com.tencent.qcloud.tuicore.R.string.sure), ITitleBarLayout.Position.RIGHT);
@@ -87,6 +81,7 @@ public class ImageSelectActivity extends BaseLightActivity {
                 finish();
             }
         });
+        boolean needDownload = intent.getBooleanExtra(NEED_DOWLOAD_LOCAL, false);
         titleBarLayout.setOnRightClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -94,7 +89,7 @@ public class ImageSelectActivity extends BaseLightActivity {
                     return;
                 }
                 if (needDownload) {
-                    DownloadUrl();
+                    downloadUrl();
                 } else {
                     Intent resultIntent = new Intent();
                     resultIntent.putExtra(DATA, (Serializable) selected);
@@ -133,7 +128,7 @@ public class ImageSelectActivity extends BaseLightActivity {
         gridAdapter.notifyDataSetChanged();
     }
 
-    private void DownloadUrl() {
+    private void downloadUrl() {
         if (selected == null) {
             return;
         }
@@ -157,7 +152,6 @@ public class ImageSelectActivity extends BaseLightActivity {
         dialog.setCancelable(false);
         dialog.setCanceledOnTouchOutside(false);
         dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
-
             @Override
             public void onDismiss(DialogInterface dialog) {
                 // TODO Auto-generated method stub
@@ -169,29 +163,29 @@ public class ImageSelectActivity extends BaseLightActivity {
 
         ImageBean finalBean = selected;
         Glide.with(this)
-                .downloadOnly()
-                .load(url)
-                .listener(new RequestListener<File>() {
-                    @Override
-                    public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<File> target, boolean isFirstResource) {
-                        dialog.cancel();
-                        Log.e(TAG, "DownloadUrl onLoadFailed e = " + e);
-                        ToastUtil.toastShortMessage(getResources().getString(R.string.setting_fail));
-                        return false;
-                    }
+            .downloadOnly()
+            .load(url)
+            .listener(new RequestListener<File>() {
+                @Override
+                public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<File> target, boolean isFirstResource) {
+                    dialog.cancel();
+                    Log.e(TAG, "DownloadUrl onLoadFailed e = " + e);
+                    ToastUtil.toastShortMessage(getResources().getString(R.string.setting_fail));
+                    return false;
+                }
 
-                    @Override
-                    public boolean onResourceReady(File resource, Object model, Target<File> target, DataSource dataSource, boolean isFirstResource) {
-                        dialog.cancel();
-                        String path = resource.getAbsolutePath();
-                        Log.e(TAG, "DownloadUrl resource path = " + path);
-                        finalBean.setLocalPath(path);
-                        setResult(finalBean);
-                        ToastUtil.toastShortMessage(getResources().getString(R.string.setting_success));
-                        return false;
-                    }
-                })
-                .preload();
+                @Override
+                public boolean onResourceReady(File resource, Object model, Target<File> target, DataSource dataSource, boolean isFirstResource) {
+                    dialog.cancel();
+                    String path = resource.getAbsolutePath();
+                    Log.e(TAG, "DownloadUrl resource path = " + path);
+                    finalBean.setLocalPath(path);
+                    setResult(finalBean);
+                    ToastUtil.toastShortMessage(getResources().getString(R.string.setting_success));
+                    return false;
+                }
+            })
+            .preload();
     }
 
     private void setResult(ImageBean bean) {
@@ -204,7 +198,8 @@ public class ImageSelectActivity extends BaseLightActivity {
     private void setSelectedStatus() {
         if (selected != null && data != null && data.contains(selected)) {
             titleBarLayout.getRightTitle().setEnabled(true);
-            titleBarLayout.getRightTitle().setTextColor(getResources().getColor(TUIThemeManager.getAttrResId(this, com.tencent.qcloud.tuicore.R.attr.core_primary_color)));
+            titleBarLayout.getRightTitle().setTextColor(
+                getResources().getColor(TUIThemeManager.getAttrResId(this, com.tencent.qcloud.tuicore.R.attr.core_primary_color)));
         } else {
             titleBarLayout.getRightTitle().setEnabled(false);
             titleBarLayout.getRightTitle().setTextColor(0xFF666666);
@@ -281,11 +276,12 @@ public class ImageSelectActivity extends BaseLightActivity {
                 imageView.setImageResource(android.R.color.transparent);
             } else {
                 holder.defaultLayout.setVisibility(View.GONE);
-                Glide.with(holder.itemView.getContext()).asBitmap()
-                        .load(imageBean.getThumbnailUri())
-                        .placeholder(placeHolder)
-                        .apply(new RequestOptions().error(placeHolder))
-                        .into(imageView);
+                Glide.with(holder.itemView.getContext())
+                    .asBitmap()
+                    .load(imageBean.getThumbnailUri())
+                    .placeholder(placeHolder)
+                    .apply(new RequestOptions().error(placeHolder))
+                    .into(imageView);
             }
 
             holder.itemView.setOnClickListener(new View.OnClickListener() {
@@ -345,7 +341,6 @@ public class ImageSelectActivity extends BaseLightActivity {
      * add spacing
      */
     public static class GridDecoration extends RecyclerView.ItemDecoration {
-
         private final int columnNum; // span count
         private final int leftRightSpace; // vertical spacing
         private final int topBottomSpace; // horizontal spacing
@@ -375,7 +370,7 @@ public class ImageSelectActivity extends BaseLightActivity {
         void onClick(ImageBean obj);
     }
 
-    public static class ImageBean implements Serializable{
+    public static class ImageBean implements Serializable {
         String thumbnailUri; // for display
         String imageUri; // for download
         String localPath; // for local path
@@ -383,9 +378,7 @@ public class ImageSelectActivity extends BaseLightActivity {
         List<Object> groupGridAvatar = null; // for group grid avatar
         String imageId;
 
-        public ImageBean() {
-
-        }
+        public ImageBean() {}
 
         public ImageBean(String thumbnailUri, String imageUri, boolean isDefault) {
             this.thumbnailUri = thumbnailUri;

+ 33 - 42
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/ImageSelectMinimalistActivity.java

@@ -1,6 +1,5 @@
 package com.tencent.qcloud.tuikit.timcommon.component.activities;
 
-
 import android.app.ProgressDialog;
 import android.content.DialogInterface;
 import android.content.Intent;
@@ -14,12 +13,10 @@ import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.RelativeLayout;
-
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.recyclerview.widget.GridLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
-
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.DataSource;
 import com.bumptech.glide.load.engine.GlideException;
@@ -34,12 +31,10 @@ import com.tencent.qcloud.tuikit.timcommon.component.TitleBarLayout;
 import com.tencent.qcloud.tuikit.timcommon.component.gatherimage.SynthesizedImageView;
 import com.tencent.qcloud.tuikit.timcommon.component.interfaces.ITitleBarLayout;
 import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
-
 import java.io.File;
 import java.io.Serializable;
 import java.util.List;
 
-
 public class ImageSelectMinimalistActivity extends BaseMinimalistLightActivity {
     private static final String TAG = ImageSelectMinimalistActivity.class.getSimpleName();
 
@@ -74,7 +69,6 @@ public class ImageSelectMinimalistActivity extends BaseMinimalistLightActivity {
         setContentView(R.layout.core_minimalist_activity_image_select_layout);
         Intent intent = getIntent();
         String title = intent.getStringExtra(TITLE);
-        boolean needDownload = intent.getBooleanExtra(NEED_DOWLOAD_LOCAL, false);
         titleBarLayout = findViewById(R.id.image_select_title);
         titleBarLayout.setTitle(title, ITitleBarLayout.Position.MIDDLE);
         titleBarLayout.setTitle(getString(com.tencent.qcloud.tuicore.R.string.sure), ITitleBarLayout.Position.RIGHT);
@@ -87,6 +81,7 @@ public class ImageSelectMinimalistActivity extends BaseMinimalistLightActivity {
                 finish();
             }
         });
+        boolean needDownload = intent.getBooleanExtra(NEED_DOWLOAD_LOCAL, false);
         titleBarLayout.setOnRightClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -156,7 +151,6 @@ public class ImageSelectMinimalistActivity extends BaseMinimalistLightActivity {
         dialog.setCancelable(false);
         dialog.setCanceledOnTouchOutside(false);
         dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
-
             @Override
             public void onDismiss(DialogInterface dialog) {
                 // TODO Auto-generated method stub
@@ -168,29 +162,29 @@ public class ImageSelectMinimalistActivity extends BaseMinimalistLightActivity {
 
         ImageBean finalBean = selected;
         Glide.with(this)
-                .downloadOnly()
-                .load(url)
-                .listener(new RequestListener<File>() {
-                    @Override
-                    public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<File> target, boolean isFirstResource) {
-                        dialog.cancel();
-                        Log.e(TAG, "DownloadUrl onLoadFailed e = " + e);
-                        ToastUtil.toastShortMessage(getResources().getString(R.string.setting_fail));
-                        return false;
-                    }
+            .downloadOnly()
+            .load(url)
+            .listener(new RequestListener<File>() {
+                @Override
+                public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<File> target, boolean isFirstResource) {
+                    dialog.cancel();
+                    Log.e(TAG, "DownloadUrl onLoadFailed e = " + e);
+                    ToastUtil.toastShortMessage(getResources().getString(R.string.setting_fail));
+                    return false;
+                }
 
-                    @Override
-                    public boolean onResourceReady(File resource, Object model, Target<File> target, DataSource dataSource, boolean isFirstResource) {
-                        dialog.cancel();
-                        String path = resource.getAbsolutePath();
-                        Log.e(TAG, "DownloadUrl resource path = " + path);
-                        finalBean.setLocalPath(path);
-                        setResult(finalBean);
-                        ToastUtil.toastShortMessage(getResources().getString(R.string.setting_success));
-                        return false;
-                    }
-                })
-                .preload();
+                @Override
+                public boolean onResourceReady(File resource, Object model, Target<File> target, DataSource dataSource, boolean isFirstResource) {
+                    dialog.cancel();
+                    String path = resource.getAbsolutePath();
+                    Log.e(TAG, "DownloadUrl resource path = " + path);
+                    finalBean.setLocalPath(path);
+                    setResult(finalBean);
+                    ToastUtil.toastShortMessage(getResources().getString(R.string.setting_success));
+                    return false;
+                }
+            })
+            .preload();
     }
 
     private void setResult(ImageBean bean) {
@@ -203,7 +197,8 @@ public class ImageSelectMinimalistActivity extends BaseMinimalistLightActivity {
     private void setSelectedStatus() {
         if (selected != null && data != null && data.contains(selected)) {
             titleBarLayout.getRightTitle().setEnabled(true);
-            titleBarLayout.getRightTitle().setTextColor(getResources().getColor(TUIThemeManager.getAttrResId(this, com.tencent.qcloud.tuicore.R.attr.core_primary_color)));
+            titleBarLayout.getRightTitle().setTextColor(
+                getResources().getColor(TUIThemeManager.getAttrResId(this, com.tencent.qcloud.tuicore.R.attr.core_primary_color)));
         } else {
             titleBarLayout.getRightTitle().setEnabled(false);
             titleBarLayout.getRightTitle().setTextColor(0xFF666666);
@@ -284,9 +279,7 @@ public class ImageSelectMinimalistActivity extends BaseMinimalistLightActivity {
         }
 
         @Override
-        public void onBindViewHolder(@NonNull ImageViewHolder holder, int position) {
-
-        }
+        public void onBindViewHolder(@NonNull ImageViewHolder holder, int position) {}
 
         @Override
         public void onBindViewHolder(@NonNull ImageViewHolder holder, int position, @NonNull List<Object> payload) {
@@ -315,11 +308,12 @@ public class ImageSelectMinimalistActivity extends BaseMinimalistLightActivity {
                 imageView.setImageResource(android.R.color.transparent);
             } else {
                 holder.defaultLayout.setVisibility(View.GONE);
-                Glide.with(holder.itemView.getContext()).asBitmap()
-                        .load(imageBean.getThumbnailUri())
-                        .placeholder(placeHolder)
-                        .apply(new RequestOptions().error(placeHolder))
-                        .into(imageView);
+                Glide.with(holder.itemView.getContext())
+                    .asBitmap()
+                    .load(imageBean.getThumbnailUri())
+                    .placeholder(placeHolder)
+                    .apply(new RequestOptions().error(placeHolder))
+                    .into(imageView);
             }
 
             holder.itemView.setOnClickListener(new View.OnClickListener() {
@@ -379,7 +373,6 @@ public class ImageSelectMinimalistActivity extends BaseMinimalistLightActivity {
      * add spacing
      */
     public static class GridDecoration extends RecyclerView.ItemDecoration {
-
         private final int columnNum; // span count
         private final int leftRightSpace; // vertical spacing
         private final int topBottomSpace; // horizontal spacing
@@ -417,9 +410,7 @@ public class ImageSelectMinimalistActivity extends BaseMinimalistLightActivity {
         List<Object> groupGridAvatar = null; // for group grid avatar
         String imageId;
 
-        public ImageBean() {
-
-        }
+        public ImageBean() {}
 
         public ImageBean(String thumbnailUri, String imageUri, boolean isDefault) {
             this.thumbnailUri = thumbnailUri;

+ 6 - 8
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/SelectionActivity.java

@@ -11,20 +11,16 @@ import android.view.ViewGroup;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.TextView;
-
 import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.DividerItemDecoration;
 import androidx.recyclerview.widget.RecyclerView;
-
 import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.component.CustomLinearLayoutManager;
 import com.tencent.qcloud.tuikit.timcommon.component.TitleBarLayout;
 import com.tencent.qcloud.tuikit.timcommon.component.interfaces.ITitleBarLayout;
-
 import java.util.ArrayList;
 
 public class SelectionActivity extends BaseLightActivity {
-
     private static OnResultReturnListener sOnResultReturnListener;
 
     private RecyclerView selectListView;
@@ -91,7 +87,7 @@ public class SelectionActivity extends BaseLightActivity {
                     input.setSelection(defaultString.length());
                 }
                 if (limit > 0) {
-                    input.setFilters(new InputFilter[]{new InputFilter.LengthFilter(limit)});
+                    input.setFilters(new InputFilter[] {new InputFilter.LengthFilter(limit)});
                 }
                 break;
             case Selection.TYPE_LIST:
@@ -152,6 +148,8 @@ public class SelectionActivity extends BaseLightActivity {
                     sOnResultReturnListener.onReturn(selectedItem);
                 }
                 break;
+            default:
+                break;
         }
         if (returnNow) {
             finish();
@@ -180,7 +178,7 @@ public class SelectionActivity extends BaseLightActivity {
         @NonNull
         @Override
         public SelectViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
-            View view = LayoutInflater.from(SelectionActivity.this).inflate(R.layout.core_select_item_layout,parent, false);
+            View view = LayoutInflater.from(SelectionActivity.this).inflate(R.layout.core_select_item_layout, parent, false);
             return new SelectViewHolder(view);
         }
 
@@ -206,9 +204,10 @@ public class SelectionActivity extends BaseLightActivity {
             return data.size();
         }
 
-        class SelectViewHolder extends RecyclerView.ViewHolder{
+        class SelectViewHolder extends RecyclerView.ViewHolder {
             TextView name;
             ImageView selectedIcon;
+
             public SelectViewHolder(@NonNull View itemView) {
                 super(itemView);
                 name = itemView.findViewById(R.id.name);
@@ -238,6 +237,5 @@ public class SelectionActivity extends BaseLightActivity {
         public static final String RETURN_NOW = "returnNow";
         public static final int TYPE_TEXT = 1;
         public static final int TYPE_LIST = 2;
-
     }
 }

+ 6 - 8
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/activities/SelectionMinimalistActivity.java

@@ -11,20 +11,16 @@ import android.view.ViewGroup;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.TextView;
-
 import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.DividerItemDecoration;
 import androidx.recyclerview.widget.RecyclerView;
-
 import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.component.CustomLinearLayoutManager;
 import com.tencent.qcloud.tuikit.timcommon.component.TitleBarLayout;
 import com.tencent.qcloud.tuikit.timcommon.component.interfaces.ITitleBarLayout;
-
 import java.util.ArrayList;
 
 public class SelectionMinimalistActivity extends BaseMinimalistLightActivity {
-
     private static OnResultReturnListener sOnResultReturnListener;
 
     private RecyclerView selectListView;
@@ -91,7 +87,7 @@ public class SelectionMinimalistActivity extends BaseMinimalistLightActivity {
                     input.setSelection(defaultString.length());
                 }
                 if (limit > 0) {
-                    input.setFilters(new InputFilter[]{new InputFilter.LengthFilter(limit)});
+                    input.setFilters(new InputFilter[] {new InputFilter.LengthFilter(limit)});
                 }
                 break;
             case Selection.TYPE_LIST:
@@ -152,6 +148,8 @@ public class SelectionMinimalistActivity extends BaseMinimalistLightActivity {
                     sOnResultReturnListener.onReturn(selectedItem);
                 }
                 break;
+            default:
+                break;
         }
         if (returnNow) {
             finish();
@@ -180,7 +178,7 @@ public class SelectionMinimalistActivity extends BaseMinimalistLightActivity {
         @NonNull
         @Override
         public SelectViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
-            View view = LayoutInflater.from(SelectionMinimalistActivity.this).inflate(R.layout.core_select_item_layout,parent, false);
+            View view = LayoutInflater.from(SelectionMinimalistActivity.this).inflate(R.layout.core_select_item_layout, parent, false);
             return new SelectViewHolder(view);
         }
 
@@ -206,9 +204,10 @@ public class SelectionMinimalistActivity extends BaseMinimalistLightActivity {
             return data.size();
         }
 
-        class SelectViewHolder extends RecyclerView.ViewHolder{
+        class SelectViewHolder extends RecyclerView.ViewHolder {
             TextView name;
             ImageView selectedIcon;
+
             public SelectViewHolder(@NonNull View itemView) {
                 super(itemView);
                 name = itemView.findViewById(R.id.name);
@@ -238,6 +237,5 @@ public class SelectionMinimalistActivity extends BaseMinimalistLightActivity {
         public static final String RETURN_NOW = "returnNow";
         public static final int TYPE_TEXT = 1;
         public static final int TYPE_LIST = 2;
-
     }
 }

+ 9 - 16
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/dialog/TUIKitDialog.java

@@ -27,7 +27,6 @@ import com.tencent.qcloud.tuikit.timcommon.R;
 import java.lang.ref.WeakReference;
 
 public class TUIKitDialog {
-
     private Context mContext;
     protected Dialog dialog;
     private LinearLayout mBackgroundLayout;
@@ -41,9 +40,8 @@ public class TUIKitDialog {
     private boolean showTitle = false;
     private boolean showPosBtn = false;
     private boolean showNegBtn = false;
-    
-    private float dialogWidth = 0.7f;
 
+    private float dialogWidth = 0.7f;
 
     public TUIKitDialog(Context context) {
         this.mContext = context;
@@ -72,7 +70,6 @@ public class TUIKitDialog {
         return this;
     }
 
-
     public TUIKitDialog setTitle(@NonNull CharSequence title) {
         showTitle = true;
         mTitleTv.setText(title);
@@ -100,8 +97,12 @@ public class TUIKitDialog {
         return this;
     }
 
-    public TUIKitDialog setPositiveButton(CharSequence text,
-                                          final OnClickListener listener) {
+    public TUIKitDialog setPositiveButton(final OnClickListener listener) {
+        setPositiveButton(TUIConfig.getAppContext().getString(com.tencent.qcloud.tuicore.R.string.sure), listener);
+        return this;
+    }
+
+    public TUIKitDialog setPositiveButton(CharSequence text, final OnClickListener listener) {
         showPosBtn = true;
         mSureButton.setText(text);
         mSureButton.setOnClickListener(new OnClickListener() {
@@ -118,13 +119,7 @@ public class TUIKitDialog {
         mTitleTv.setGravity(gravity);
     }
 
-    public TUIKitDialog setPositiveButton(final OnClickListener listener) {
-        setPositiveButton(TUIConfig.getAppContext().getString(com.tencent.qcloud.tuicore.R.string.sure), listener);
-        return this;
-    }
-
-    public TUIKitDialog setNegativeButton(CharSequence text,
-                                          final OnClickListener listener) {
+    public TUIKitDialog setNegativeButton(CharSequence text, final OnClickListener listener) {
         showNegBtn = true;
         mCancelButton.setText(text);
         mCancelButton.setOnClickListener(new OnClickListener() {
@@ -142,7 +137,6 @@ public class TUIKitDialog {
         return this;
     }
 
-
     private void setLayout() {
         if (!showTitle) {
             mTitleTv.setVisibility(View.GONE);
@@ -207,7 +201,6 @@ public class TUIKitDialog {
     }
 
     public static class TUIIMUpdateDialog {
-
         private static final class TUIIMUpdateDialogHolder {
             private static final TUIIMUpdateDialog instance = new TUIIMUpdateDialog();
         }
@@ -221,7 +214,7 @@ public class TUIKitDialog {
         private WeakReference<TUIKitDialog> tuiKitDialog;
 
         public static TUIIMUpdateDialog getInstance() {
-           return TUIIMUpdateDialogHolder.instance;
+            return TUIIMUpdateDialogHolder.instance;
         }
 
         private TUIIMUpdateDialog() {

+ 1 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/face/CustomFace.java

@@ -2,11 +2,10 @@ package com.tencent.qcloud.tuikit.timcommon.component.face;
 
 /**
  * 自定义表情属性类
- * 
+ *
  * Custom expression attribute class
  */
 public class CustomFace extends ChatFace {
-
     /**
      * 设置表情在asset中的路径
      *

+ 1 - 0
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/face/Emoji.java

@@ -4,6 +4,7 @@ import android.graphics.Bitmap;
 
 public class Emoji extends ChatFace {
     private Bitmap icon;
+
     public Bitmap getIcon() {
         return icon;
     }

File diff ditekan karena terlalu besar
+ 97 - 62
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/face/FaceManager.java


+ 1 - 5
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/face/RecentEmojiManager.java

@@ -2,9 +2,7 @@ package com.tencent.qcloud.tuikit.timcommon.component.face;
 
 import android.text.TextUtils;
 import android.util.Base64;
-
 import com.tencent.qcloud.tuicore.util.SPUtils;
-
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -12,9 +10,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Collection;
 
-
 public class RecentEmojiManager {
-    public static final String PREFERENCE_NAME = "recentFace";//"preference";
+    public static final String PREFERENCE_NAME = "recentFace"; //"preference";
 
     private static final RecentEmojiManager instance = new RecentEmojiManager();
 
@@ -33,7 +30,6 @@ public class RecentEmojiManager {
         return this;
     }
 
-
     public RecentEmojiManager putCollection(String key, Collection collection) throws IOException {
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
         ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);

+ 2 - 3
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/fragments/BaseFragment.java

@@ -4,13 +4,12 @@ import androidx.fragment.app.Fragment;
 import androidx.fragment.app.FragmentTransaction;
 
 public class BaseFragment extends Fragment {
-
     public void forward(Fragment fragment, boolean hide) {
         forward(getId(), fragment, null, hide);
     }
 
     public void forward(int viewId, Fragment fragment, String name, boolean hide) {
-        if (getFragmentManager() == null){
+        if (getFragmentManager() == null) {
             return;
         }
         FragmentTransaction trans = getFragmentManager().beginTransaction();
@@ -26,7 +25,7 @@ public class BaseFragment extends Fragment {
     }
 
     public void backward() {
-        if (getFragmentManager() == null){
+        if (getFragmentManager() == null) {
             return;
         }
         getFragmentManager().popBackStack();

+ 5 - 6
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/MultiImageData.java

@@ -12,22 +12,21 @@ import java.util.Map;
  * Multiple image data
  */
 
-public class MultiImageData implements Cloneable{
-    final static int maxSize = 9;
+public class MultiImageData implements Cloneable {
+    static final int maxSize = 9;
     List<Object> imageUrls;
     int defaultImageResId;
     Map<Integer, Bitmap> bitmapMap;
     int bgColor = Color.parseColor("#cfd3d8");
 
-
     int targetImageSize;
-    int maxWidth, maxHeight;
+    int maxWidth;
+    int maxHeight;
     int rowCount;
     int columnCount;
     int gap = 6;
 
-    public MultiImageData() {
-    }
+    public MultiImageData() {}
 
     public MultiImageData(int defaultImageResId) {
         this.defaultImageResId = defaultImageResId;

+ 0 - 4
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/ShadeImageView.java

@@ -22,7 +22,6 @@ import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
 
 @SuppressLint("AppCompatCustomView")
 public class ShadeImageView extends ImageView {
-
     private static SparseArray<Bitmap> sRoundBitmapArray = new SparseArray();
     private Paint mShadePaint = new Paint();
     private Bitmap mRoundBitmap;
@@ -82,7 +81,6 @@ public class ShadeImageView extends ImageView {
         return output;
     }
 
-
     public int getRadius() {
         return radius;
     }
@@ -90,6 +88,4 @@ public class ShadeImageView extends ImageView {
     public void setRadius(int radius) {
         this.radius = radius;
     }
-
-
 }

+ 1 - 3
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/SynthesizedImageView.java

@@ -11,11 +11,10 @@ import com.tencent.qcloud.tuikit.timcommon.R;
 
 import java.util.List;
 
-
 public class SynthesizedImageView extends ShadeImageView {
     /**
      * 群聊头像合成器
-     * 
+     *
      * Group Chat Avatar Synthesizer
      */
     TeamHeadSynthesizer teamHeadSynthesizer;
@@ -86,5 +85,4 @@ public class SynthesizedImageView extends ShadeImageView {
     public void clear() {
         teamHeadSynthesizer.clearImage();
     }
-
 }

+ 0 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/Synthesizer.java

@@ -3,9 +3,7 @@ package com.tencent.qcloud.tuikit.timcommon.component.gatherimage;
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
 
-
 public interface Synthesizer {
-
     Bitmap synthesizeImageList(MultiImageData imageData);
 
     boolean asyncLoadImageList(MultiImageData imageData);

+ 35 - 31
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/TeamHeadSynthesizer.java

@@ -7,21 +7,17 @@ import android.graphics.Canvas;
 import android.graphics.Rect;
 import android.text.TextUtils;
 import android.widget.ImageView;
-
 import com.tencent.qcloud.tuicore.TUIConfig;
 import com.tencent.qcloud.tuikit.timcommon.TIMCommonConfig;
 import com.tencent.qcloud.tuikit.timcommon.component.impl.GlideEngine;
 import com.tencent.qcloud.tuikit.timcommon.util.ImageUtil;
 import com.tencent.qcloud.tuikit.timcommon.util.ThreadUtils;
-
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 
-
 public class TeamHeadSynthesizer implements Synthesizer {
-
     MultiImageData multiImageData;
     Context mContext;
 
@@ -39,7 +35,6 @@ public class TeamHeadSynthesizer implements Synthesizer {
         }
     };
 
-
     public TeamHeadSynthesizer(Context mContext, ImageView imageView) {
         this.mContext = mContext;
         this.imageView = imageView;
@@ -130,10 +125,10 @@ public class TeamHeadSynthesizer implements Synthesizer {
     public void drawDrawable(Canvas canvas, MultiImageData imageData) {
         canvas.drawColor(imageData.bgColor);
         int size = imageData.size();
-        int t_center = (imageData.maxHeight + imageData.gap) / 2;
-        int b_center = (imageData.maxHeight - imageData.gap) / 2;
-        int l_center = (imageData.maxWidth + imageData.gap) / 2;
-        int r_center = (imageData.maxWidth - imageData.gap) / 2;
+        int tCenter = (imageData.maxHeight + imageData.gap) / 2;
+        int bCenter = (imageData.maxHeight - imageData.gap) / 2;
+        int lCenter = (imageData.maxWidth + imageData.gap) / 2;
+        int rCenter = (imageData.maxWidth - imageData.gap) / 2;
         int center = (imageData.maxHeight - imageData.targetImageSize) / 2;
         for (int i = 0; i < size; i++) {
             int rowNum = i / imageData.columnCount;
@@ -153,43 +148,53 @@ public class TeamHeadSynthesizer implements Synthesizer {
                 if (i == 0) {
                     drawBitmapAtPosition(canvas, center, top, center + imageData.targetImageSize, bottom, bitmap);
                 } else {
-                    drawBitmapAtPosition(canvas, imageData.gap * i + imageData.targetImageSize * (i - 1), t_center, imageData.gap * i + imageData.targetImageSize * i, t_center + imageData.targetImageSize, bitmap);
+                    drawBitmapAtPosition(canvas, imageData.gap * i + imageData.targetImageSize * (i - 1), tCenter,
+                        imageData.gap * i + imageData.targetImageSize * i, tCenter + imageData.targetImageSize, bitmap);
                 }
             } else if (size == 4) {
                 drawBitmapAtPosition(canvas, left, top, right, bottom, bitmap);
             } else if (size == 5) {
                 if (i == 0) {
-                    drawBitmapAtPosition(canvas, r_center - imageData.targetImageSize, r_center - imageData.targetImageSize, r_center, r_center, bitmap);
+                    drawBitmapAtPosition(canvas, rCenter - imageData.targetImageSize, rCenter - imageData.targetImageSize, rCenter, rCenter, bitmap);
                 } else if (i == 1) {
-                    drawBitmapAtPosition(canvas, l_center, r_center - imageData.targetImageSize, l_center + imageData.targetImageSize, r_center, bitmap);
+                    drawBitmapAtPosition(canvas, lCenter, rCenter - imageData.targetImageSize, lCenter + imageData.targetImageSize, rCenter, bitmap);
                 } else {
-                    drawBitmapAtPosition(canvas, imageData.gap * (i - 1) + imageData.targetImageSize * (i - 2), t_center, imageData.gap * (i - 1) + imageData.targetImageSize * (i - 1), t_center +
-                            imageData.targetImageSize, bitmap);
+                    drawBitmapAtPosition(canvas, imageData.gap * (i - 1) + imageData.targetImageSize * (i - 2), tCenter,
+                        imageData.gap * (i - 1) + imageData.targetImageSize * (i - 1), tCenter + imageData.targetImageSize, bitmap);
                 }
             } else if (size == 6) {
                 if (i < 3) {
-                    drawBitmapAtPosition(canvas, imageData.gap * (i + 1) + imageData.targetImageSize * i, b_center - imageData.targetImageSize, imageData.gap * (i + 1) + imageData.targetImageSize * (i + 1), b_center, bitmap);
+                    drawBitmapAtPosition(canvas, imageData.gap * (i + 1) + imageData.targetImageSize * i, bCenter - imageData.targetImageSize,
+                        imageData.gap * (i + 1) + imageData.targetImageSize * (i + 1), bCenter, bitmap);
                 } else {
-                    drawBitmapAtPosition(canvas, imageData.gap * (i - 2) + imageData.targetImageSize * (i - 3), t_center, imageData.gap * (i - 2) + imageData.targetImageSize * (i - 2), t_center +
-                            imageData.targetImageSize, bitmap);
+                    drawBitmapAtPosition(canvas, imageData.gap * (i - 2) + imageData.targetImageSize * (i - 3), tCenter,
+                        imageData.gap * (i - 2) + imageData.targetImageSize * (i - 2), tCenter + imageData.targetImageSize, bitmap);
                 }
             } else if (size == 7) {
                 if (i == 0) {
                     drawBitmapAtPosition(canvas, center, imageData.gap, center + imageData.targetImageSize, imageData.gap + imageData.targetImageSize, bitmap);
                 } else if (i > 0 && i < 4) {
-                    drawBitmapAtPosition(canvas, imageData.gap * i + imageData.targetImageSize * (i - 1), center, imageData.gap * i + imageData.targetImageSize * i, center + imageData.targetImageSize, bitmap);
+                    drawBitmapAtPosition(canvas, imageData.gap * i + imageData.targetImageSize * (i - 1), center,
+                        imageData.gap * i + imageData.targetImageSize * i, center + imageData.targetImageSize, bitmap);
                 } else {
-                    drawBitmapAtPosition(canvas, imageData.gap * (i - 3) + imageData.targetImageSize * (i - 4), t_center + imageData.targetImageSize / 2, imageData.gap * (i - 3) + imageData.targetImageSize * (i - 3), t_center + imageData.targetImageSize / 2 + imageData.targetImageSize, bitmap);
+                    drawBitmapAtPosition(canvas, imageData.gap * (i - 3) + imageData.targetImageSize * (i - 4), tCenter + imageData.targetImageSize / 2,
+                        imageData.gap * (i - 3) + imageData.targetImageSize * (i - 3), tCenter + imageData.targetImageSize / 2 + imageData.targetImageSize,
+                        bitmap);
                 }
             } else if (size == 8) {
                 if (i == 0) {
-                    drawBitmapAtPosition(canvas, r_center - imageData.targetImageSize, imageData.gap, r_center, imageData.gap + imageData.targetImageSize, bitmap);
+                    drawBitmapAtPosition(
+                        canvas, rCenter - imageData.targetImageSize, imageData.gap, rCenter, imageData.gap + imageData.targetImageSize, bitmap);
                 } else if (i == 1) {
-                    drawBitmapAtPosition(canvas, l_center, imageData.gap, l_center + imageData.targetImageSize, imageData.gap + imageData.targetImageSize, bitmap);
+                    drawBitmapAtPosition(
+                        canvas, lCenter, imageData.gap, lCenter + imageData.targetImageSize, imageData.gap + imageData.targetImageSize, bitmap);
                 } else if (i > 1 && i < 5) {
-                    drawBitmapAtPosition(canvas, imageData.gap * (i - 1) + imageData.targetImageSize * (i - 2), center, imageData.gap * (i - 1) + imageData.targetImageSize * (i - 1), center + imageData.targetImageSize, bitmap);
+                    drawBitmapAtPosition(canvas, imageData.gap * (i - 1) + imageData.targetImageSize * (i - 2), center,
+                        imageData.gap * (i - 1) + imageData.targetImageSize * (i - 1), center + imageData.targetImageSize, bitmap);
                 } else {
-                    drawBitmapAtPosition(canvas, imageData.gap * (i - 4) + imageData.targetImageSize * (i - 5), t_center + imageData.targetImageSize / 2, imageData.gap * (i - 4) + imageData.targetImageSize * (i - 4), t_center + imageData.targetImageSize / 2 + imageData.targetImageSize, bitmap);
+                    drawBitmapAtPosition(canvas, imageData.gap * (i - 4) + imageData.targetImageSize * (i - 5), tCenter + imageData.targetImageSize / 2,
+                        imageData.gap * (i - 4) + imageData.targetImageSize * (i - 4), tCenter + imageData.targetImageSize / 2 + imageData.targetImageSize,
+                        bitmap);
                 }
             } else if (size == 9) {
                 drawBitmapAtPosition(canvas, left, top, right, bottom, bitmap);
@@ -234,7 +239,7 @@ public class TeamHeadSynthesizer implements Synthesizer {
     public void load(String imageId) {
         if (multiImageData.size() == 0) {
             // 发起请求时的图片 id 和当前图片 id 不一致,说明发生了复用,此时不应该再设置图像
-            // The image id when the request is initiated is inconsistent with the current image id, 
+            // The image id when the request is initiated is inconsistent with the current image id,
             // indicating that multiplexing has occurred, and the image should not be set at this time.
             if (imageId != null && !TextUtils.equals(imageId, currentImageId)) {
                 return;
@@ -245,7 +250,7 @@ public class TeamHeadSynthesizer implements Synthesizer {
 
         if (multiImageData.size() == 1) {
             // 发起请求时的图片 id 和当前图片 id 不一致,说明发生了复用,此时不应该再设置图像
-            // The image id when the request is initiated is inconsistent with the current image id, 
+            // The image id when the request is initiated is inconsistent with the current image id,
             // indicating that multiplexing has occurred, and the image should not be set at this time.
             if (imageId != null && !TextUtils.equals(imageId, currentImageId)) {
                 return;
@@ -260,9 +265,9 @@ public class TeamHeadSynthesizer implements Synthesizer {
 
         // 初始化图片信息,由于是异步加载和合成头像,这里需要传给合成线程一个局部对象,只在异步加载线程中使用
         // 这样在图片被复用时外部线程再次设置 url 就不会覆盖此局部对象
-        // Initialize the image information. Since it is asynchronous loading and synthesizing the avatar, 
-        // a local object needs to be passed to the synthesis thread, which is only used in the asynchronous 
-        // loading thread, so that when the image is reused, the external thread will not overwrite the local 
+        // Initialize the image information. Since it is asynchronous loading and synthesizing the avatar,
+        // a local object needs to be passed to the synthesis thread, which is only used in the asynchronous
+        // loading thread, so that when the image is reused, the external thread will not overwrite the local
         // object by setting the url again.
         MultiImageData copyMultiImageData;
         try {
@@ -278,8 +283,8 @@ public class TeamHeadSynthesizer implements Synthesizer {
         int[] gridParam = calculateGridParam(multiImageData.size());
         copyMultiImageData.rowCount = gridParam[0];
         copyMultiImageData.columnCount = gridParam[1];
-        copyMultiImageData.targetImageSize = (copyMultiImageData.maxWidth - (copyMultiImageData.columnCount + 1)
-                * copyMultiImageData.gap) / (copyMultiImageData.columnCount == 1 ? 2 : copyMultiImageData.columnCount);
+        copyMultiImageData.targetImageSize = (copyMultiImageData.maxWidth - (copyMultiImageData.columnCount + 1) * copyMultiImageData.gap)
+            / (copyMultiImageData.columnCount == 1 ? 2 : copyMultiImageData.columnCount);
         final String finalImageId = imageId;
         final MultiImageData finalCopyMultiImageData = copyMultiImageData;
         ThreadUtils.execute(new Runnable() {
@@ -326,5 +331,4 @@ public class TeamHeadSynthesizer implements Synthesizer {
     interface Callback {
         void onCall(Bitmap bitmap, String targetID);
     }
-
 }

+ 0 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/gatherimage/UserIconView.java

@@ -10,7 +10,6 @@ import com.tencent.qcloud.tuikit.timcommon.R;
 import java.util.List;
 
 public class UserIconView extends RelativeLayout {
-
     private SynthesizedImageView mIconView;
     private int mDefaultImageResId;
     private int mIconRadius;
@@ -63,5 +62,4 @@ public class UserIconView extends RelativeLayout {
     public void setIconUrls(List<Object> iconUrls) {
         mIconView.displayImage(iconUrls).load(null);
     }
-
 }

+ 11 - 11
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/impl/CornerTransform.java

@@ -8,22 +8,21 @@ import android.graphics.Matrix;
 import android.graphics.Paint;
 import android.graphics.RectF;
 import android.graphics.Shader;
-
 import androidx.annotation.NonNull;
-
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.Transformation;
 import com.bumptech.glide.load.engine.Resource;
 import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
 import com.bumptech.glide.load.resource.bitmap.BitmapResource;
-
 import java.security.MessageDigest;
 
 public class CornerTransform implements Transformation<Bitmap> {
-
     private BitmapPool mBitmapPool;
     private float radius;
-    private boolean exceptLeftTop, exceptRightTop, exceptLeftBottom, exceptRightBottom;
+    private boolean exceptLeftTop;
+    private boolean exceptRightTop;
+    private boolean exceptLeftBottom;
+    private boolean exceptRightBottom;
 
     public CornerTransform(Context context, float radius) {
         this.mBitmapPool = Glide.get(context).getBitmapPool();
@@ -41,7 +40,8 @@ public class CornerTransform implements Transformation<Bitmap> {
     @Override
     public Resource<Bitmap> transform(@NonNull Context context, @NonNull Resource<Bitmap> resource, int outWidth, int outHeight) {
         Bitmap source = resource.get();
-        int finalWidth, finalHeight;
+        int finalWidth;
+        int finalHeight;
         // 输出目标的宽高或高宽比例
         // The width-height or height-width ratio of the output target
         float ratio;
@@ -52,7 +52,7 @@ public class CornerTransform implements Transformation<Bitmap> {
             finalWidth = source.getWidth();
             // 固定原图宽度,求最终高度
             // Fix the width of the original image and find the final height
-            finalHeight = (int) ((float) source.getWidth() * ratio); 
+            finalHeight = (int) ((float) source.getWidth() * ratio);
             if (finalHeight > source.getHeight()) {
                 // 求出的最终高度>原图高度,求宽高比
                 // Find the final height > the original image height, find the aspect ratio
@@ -62,7 +62,7 @@ public class CornerTransform implements Transformation<Bitmap> {
                 // Fix the width of the original image and find the final width
                 finalWidth = (int) ((float) source.getHeight() * ratio);
             }
-        } else if (outWidth < outHeight) { 
+        } else if (outWidth < outHeight) {
             // 输出宽度 < 输出高度,求宽高比
             // output width < output height, find the aspect ratio
             ratio = (float) outWidth / (float) outHeight;
@@ -70,14 +70,14 @@ public class CornerTransform implements Transformation<Bitmap> {
             // 固定原图高度,求最终宽度
             // Fix the width of the original image and find the final width
             finalWidth = (int) ((float) source.getHeight() * ratio);
-            if (finalWidth > source.getWidth()) { 
+            if (finalWidth > source.getWidth()) {
                 // 求出的最终宽度 > 原图宽度,求高宽比
                 // Find the final width > the original image width, find the aspect ratio
                 ratio = (float) outHeight / (float) outWidth;
                 finalWidth = source.getWidth();
                 finalHeight = (int) ((float) source.getWidth() * ratio);
             }
-        } else { 
+        } else {
             // 输出宽度=输出高度
             // output width = output height
             finalHeight = source.getHeight();
@@ -92,7 +92,6 @@ public class CornerTransform implements Transformation<Bitmap> {
             outBitmap = Bitmap.createBitmap(finalWidth, finalHeight, Bitmap.Config.ARGB_8888);
         }
 
-        Canvas canvas = new Canvas(outBitmap);
         Paint paint = new Paint();
         BitmapShader shader = new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
         // 计算中心位置,进行偏移
@@ -107,6 +106,7 @@ public class CornerTransform implements Transformation<Bitmap> {
 
         paint.setShader(shader);
         paint.setAntiAlias(true);
+        Canvas canvas = new Canvas(outBitmap);
         RectF rectF = new RectF(0.0F, 0.0F, (float) canvas.getWidth(), (float) canvas.getHeight());
         canvas.drawRoundRect(rectF, this.radius, this.radius, paint);
 

+ 42 - 64
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/impl/GlideEngine.java

@@ -4,56 +4,48 @@ import android.content.Context;
 import android.graphics.Bitmap;
 import android.net.Uri;
 import android.widget.ImageView;
-
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.Priority;
 import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
 import com.bumptech.glide.request.RequestListener;
 import com.bumptech.glide.request.RequestOptions;
-import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuicore.TUILogin;
 import com.tencent.qcloud.tuicore.TUIThemeManager;
-
+import com.tencent.qcloud.tuikit.timcommon.R;
 import java.io.File;
 import java.util.concurrent.ExecutionException;
 
 public class GlideEngine {
-
     public static void loadCornerImageWithoutPlaceHolder(ImageView imageView, String filePath, RequestListener listener, float radius) {
         RoundedCorners transform = null;
         if ((int) radius > 0) {
             transform = new RoundedCorners((int) radius);
         }
 
-        RequestOptions options = new RequestOptions()
-                .centerCrop();
+        RequestOptions options = new RequestOptions().centerCrop();
         if (transform != null) {
             options = options.transform(transform);
         }
-        Glide.with(TUILogin.getAppContext())
-                .load(filePath)
-                .apply(options)
-                .listener(listener)
-                .into(imageView);
+        Glide.with(TUILogin.getAppContext()).load(filePath).apply(options).listener(listener).into(imageView);
+    }
+
+    public static void clear(ImageView imageView) {
+        Glide.with(TUILogin.getAppContext()).clear(imageView);
     }
 
     public static void loadImage(ImageView imageView, String filePath, RequestListener listener) {
         Glide.with(TUILogin.getAppContext())
-                .load(filePath)
-                .listener(listener)
-                .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
-                .into(imageView);
+            .load(filePath)
+            .listener(listener)
+            .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
+            .into(imageView);
     }
 
     public static void loadImage(ImageView imageView, String filePath) {
         Glide.with(TUILogin.getAppContext())
-                .load(filePath)
-                .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
-                .into(imageView);
-    }
-
-    public static void clear(ImageView imageView) {
-        Glide.with(TUILogin.getAppContext()).clear(imageView);
+            .load(filePath)
+            .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
+            .into(imageView);
     }
 
     public static void loadImage(ImageView imageView, Uri uri) {
@@ -61,9 +53,9 @@ public class GlideEngine {
             return;
         }
         Glide.with(TUILogin.getAppContext())
-                .load(uri)
-                .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
-                .into(imageView);
+            .load(uri)
+            .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
+            .into(imageView);
     }
 
     public static void loadImage(String filePath, String url) {
@@ -78,14 +70,18 @@ public class GlideEngine {
         }
     }
 
+    public void loadImage(Context context, int resizeX, int resizeY, ImageView imageView, Uri uri) {
+        Glide.with(context).load(uri).apply(new RequestOptions().override(resizeX, resizeY).priority(Priority.HIGH).fitCenter()).into(imageView);
+    }
+
     public static void loadImage(ImageView imageView, Object uri) {
         if (uri == null) {
             return;
         }
         Glide.with(TUILogin.getAppContext())
-                .load(uri)
-                .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
-                .into(imageView);
+            .load(uri)
+            .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
+            .into(imageView);
     }
 
     public static void loadUserIcon(ImageView imageView, Object uri) {
@@ -94,59 +90,41 @@ public class GlideEngine {
 
     public static void loadUserIcon(ImageView imageView, Object uri, int radius) {
         Glide.with(TUILogin.getAppContext())
-                .load(uri)
-                .placeholder(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon))
-                .apply(new RequestOptions().centerCrop().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
-                .into(imageView);
+            .load(uri)
+            .placeholder(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon))
+            .apply(new RequestOptions().centerCrop().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
+            .into(imageView);
     }
 
     public static void loadUserIcon(ImageView imageView, Object uri, int defaultResId, int radius) {
-        Glide.with(TUILogin.getAppContext())
-                .load(uri)
-                .placeholder(defaultResId)
-                .apply(new RequestOptions().centerCrop().error(defaultResId))
-                .into(imageView);
+        Glide.with(TUILogin.getAppContext()).load(uri).placeholder(defaultResId).apply(new RequestOptions().centerCrop().error(defaultResId)).into(imageView);
     }
 
     public static Bitmap loadBitmap(Object imageUrl, int targetImageSize) throws InterruptedException, ExecutionException {
         if (imageUrl == null) {
             return null;
         }
-        return Glide.with(TUILogin.getAppContext()).asBitmap()
-                .load(imageUrl)
-                .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
-                .into(targetImageSize, targetImageSize)
-                .get();
+        return Glide.with(TUILogin.getAppContext())
+            .asBitmap()
+            .load(imageUrl)
+            .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
+            .into(targetImageSize, targetImageSize)
+            .get();
     }
 
     public static Bitmap loadBitmap(Object imageUrl, int width, int height) throws InterruptedException, ExecutionException {
         if (imageUrl == null) {
             return null;
         }
-        return Glide.with(TUILogin.getAppContext()).asBitmap()
-                .load(imageUrl)
-                .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
-                .into(width, height)
-                .get();
-    }
-
-
-    public void loadImage(Context context, int resizeX, int resizeY, ImageView imageView, Uri uri) {
-        Glide.with(context)
-                .load(uri)
-                .apply(new RequestOptions()
-                        .override(resizeX, resizeY)
-                        .priority(Priority.HIGH)
-                        .fitCenter())
-                .into(imageView);
+        return Glide.with(TUILogin.getAppContext())
+            .asBitmap()
+            .load(imageUrl)
+            .apply(new RequestOptions().error(TUIThemeManager.getAttrResId(TUILogin.getAppContext(), R.attr.core_default_user_icon)))
+            .into(width, height)
+            .get();
     }
 
     public static void loadImageSetDefault(ImageView imageView, Object uri, int defaultResId) {
-        Glide.with(TUILogin.getAppContext())
-                .load(uri)
-                .placeholder(defaultResId)
-                .apply(new RequestOptions().centerCrop().error(defaultResId))
-                .into(imageView);
+        Glide.with(TUILogin.getAppContext()).load(uri).placeholder(defaultResId).apply(new RequestOptions().centerCrop().error(defaultResId)).into(imageView);
     }
-
 }

+ 0 - 1
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/interfaces/ILayout.java

@@ -3,7 +3,6 @@ package com.tencent.qcloud.tuikit.timcommon.component.interfaces;
 import com.tencent.qcloud.tuikit.timcommon.component.TitleBarLayout;
 
 public interface ILayout {
-
     /**
      * get title bar
      *

+ 15 - 17
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/interfaces/ITitleBarLayout.java

@@ -9,17 +9,16 @@ import android.widget.TextView;
  * 会话列表窗口 {@link ConversationLayout}、聊天窗口 {@link ChatLayout} 等都自带标题栏,<br>
  * 标题栏设计为左中右三部分标题,左边可为图片+文字,中间为文字,右边也可为图片+文字,这些区域返回的都是标准的<br>
  * Android View,可以根据业务需要对这些 View 进行交互响应处理。
- * 
+ *
  * Conversation list window {@link ConversationLayout}、chat window {@link ChatLayout} have title bar,
- * The title bar is designed as a three-part title on the left, middle and right. The left can be 
- * picture + text, the middle is text, and the right can also be picture + text. These areas return the 
+ * The title bar is designed as a three-part title on the left, middle and right. The left can be
+ * picture + text, the middle is text, and the right can also be picture + text. These areas return the
  * standard Android View,These Views can be interactively processed according to business needs。
  */
 public interface ITitleBarLayout {
-
     /**
      * 设置左边标题的点击事件
-     * 
+     *
      * Set the click event of the left header
      *
      * @param listener
@@ -28,7 +27,7 @@ public interface ITitleBarLayout {
 
     /**
      * 设置右边标题的点击事件
-     * 
+     *
      * Set the click event of the right title
      *
      * @param listener
@@ -37,7 +36,7 @@ public interface ITitleBarLayout {
 
     /**
      * 设置标题
-     * 
+     *
      * set Title
      *
      */
@@ -45,7 +44,7 @@ public interface ITitleBarLayout {
 
     /**
      * 返回左边标题区域
-     * 
+     *
      * Return to the left header area
      *
      * @return
@@ -54,7 +53,7 @@ public interface ITitleBarLayout {
 
     /**
      * 返回右边标题区域
-     * 
+     *
      * Return to the right header area
      *
      * @return
@@ -63,7 +62,7 @@ public interface ITitleBarLayout {
 
     /**
      * 返回左边标题的图片
-     * 
+     *
      * Returns the image for the left header
      *
      * @return
@@ -72,7 +71,7 @@ public interface ITitleBarLayout {
 
     /**
      * 设置左边标题的图片
-     * 
+     *
      * Set the image for the left header
      *
      * @param resId
@@ -81,7 +80,7 @@ public interface ITitleBarLayout {
 
     /**
      * 返回右边标题的图片
-     * 
+     *
      * Returns the image with the right header
      *
      * @return
@@ -90,7 +89,7 @@ public interface ITitleBarLayout {
 
     /**
      * 设置右边标题的图片
-     * 
+     *
      * Set the image for the title on the right
      *
      * @param resId
@@ -99,7 +98,7 @@ public interface ITitleBarLayout {
 
     /**
      * 返回左边标题的文字
-     * 
+     *
      * Returns the text of the left header
      *
      * @return
@@ -108,7 +107,7 @@ public interface ITitleBarLayout {
 
     /**
      * 返回中间标题的文字
-     * 
+     *
      * Returns the text of the middle title
      *
      * @return
@@ -117,7 +116,7 @@ public interface ITitleBarLayout {
 
     /**
      * 返回右边标题的文字
-     * 
+     *
      * Returns the text of the title on the right
      *
      * @return
@@ -149,5 +148,4 @@ public interface ITitleBarLayout {
          */
         RIGHT
     }
-
 }

+ 1 - 3
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/interfaces/IUIKitCallback.java

@@ -1,8 +1,7 @@
 package com.tencent.qcloud.tuikit.timcommon.component.interfaces;
 
 public abstract class IUIKitCallback<T> {
-
-    public void onSuccess(T data) {};
+    public void onSuccess(T data){}
 
     public void onError(String module, int errCode, String errMsg) {}
 
@@ -21,5 +20,4 @@ public abstract class IUIKitCallback<T> {
             callback.onError(errCode, errMsg, data);
         }
     }
-
 }

+ 1 - 5
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/Attributes.java

@@ -1,9 +1,5 @@
 package com.tencent.qcloud.tuikit.timcommon.component.swipe;
 
-
 public class Attributes {
-
-    public enum Mode {
-        Single, Multiple
-    }
+    public enum Mode { Single, Multiple }
 }

+ 4 - 6
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/RecyclerSwipeAdapter.java

@@ -6,15 +6,13 @@ import androidx.recyclerview.widget.RecyclerView;
 
 import java.util.List;
 
-public abstract class RecyclerSwipeAdapter<VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> implements SwipeItemMangerInterface, SwipeAdapterInterface {
-
+public abstract class RecyclerSwipeAdapter<VH extends RecyclerView.ViewHolder>
+    extends RecyclerView.Adapter<VH> implements SwipeItemMangerInterface, SwipeAdapterInterface {
     public SwipeItemMangerImpl mItemManger = new SwipeItemMangerImpl(this);
 
-    @Override
-    public abstract VH onCreateViewHolder(ViewGroup parent, int viewType);
+    @Override public abstract VH onCreateViewHolder(ViewGroup parent, int viewType);
 
-    @Override
-    public abstract void onBindViewHolder(VH viewHolder, final int position);
+    @Override public abstract void onBindViewHolder(VH viewHolder, final int position);
 
     @Override
     public void notifyDatasetChanged() {

+ 6 - 13
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/SimpleSwipeListener.java

@@ -1,28 +1,21 @@
 package com.tencent.qcloud.tuikit.timcommon.component.swipe;
 
 public class SimpleSwipeListener implements SwipeLayout.SwipeListener {
-
     @Override
-    public void onStartOpen(SwipeLayout layout) {
-    }
+    public void onStartOpen(SwipeLayout layout) {}
 
     @Override
-    public void onOpen(SwipeLayout layout) {
-    }
+    public void onOpen(SwipeLayout layout) {}
 
     @Override
-    public void onStartClose(SwipeLayout layout) {
-    }
+    public void onStartClose(SwipeLayout layout) {}
 
     @Override
-    public void onClose(SwipeLayout layout) {
-    }
+    public void onClose(SwipeLayout layout) {}
 
     @Override
-    public void onUpdate(SwipeLayout layout, int leftOffset, int topOffset) {
-    }
+    public void onUpdate(SwipeLayout layout, int leftOffset, int topOffset) {}
 
     @Override
-    public void onHandRelease(SwipeLayout layout, float xvel, float yvel) {
-    }
+    public void onHandRelease(SwipeLayout layout, float xvel, float yvel) {}
 }

+ 0 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/SwipeAdapterInterface.java

@@ -1,11 +1,9 @@
 package com.tencent.qcloud.tuikit.timcommon.component.swipe;
 
 public interface SwipeAdapterInterface {
-
     int getSwipeLayoutResourceId(int position);
 
     void notifyDatasetChanged();
 
     void notifySwipeItemChanged(int position);
-
 }

+ 13 - 13
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/SwipeItemMangerImpl.java

@@ -9,9 +9,8 @@ import java.util.List;
 import java.util.Set;
 
 public class SwipeItemMangerImpl implements SwipeItemMangerInterface {
-
     private Attributes.Mode mode = Attributes.Mode.Single;
-    public final int INVALID_POSITION = -1;
+    public static final int INVALID_POSITION = -1;
 
     protected int mOpenPosition = INVALID_POSITION;
 
@@ -22,8 +21,9 @@ public class SwipeItemMangerImpl implements SwipeItemMangerInterface {
     protected SwipeAdapterInterface swipeAdapterInterface;
 
     public SwipeItemMangerImpl(SwipeAdapterInterface swipeAdapterInterface) {
-        if (swipeAdapterInterface == null)
+        if (swipeAdapterInterface == null) {
             throw new IllegalArgumentException("SwipeAdapterInterface can not be null");
+        }
 
         this.swipeAdapterInterface = swipeAdapterInterface;
     }
@@ -42,8 +42,9 @@ public class SwipeItemMangerImpl implements SwipeItemMangerInterface {
     public void bind(View view, int position) {
         int resId = swipeAdapterInterface.getSwipeLayoutResourceId(position);
         SwipeLayout swipeLayout = (SwipeLayout) view.findViewById(resId);
-        if (swipeLayout == null)
+        if (swipeLayout == null) {
             throw new IllegalStateException("can not find SwipeLayout in target view");
+        }
 
         swipeLayout.setSwipeEnabled(isSwipeEnabled);
         if (swipeLayout.getTag(resId) == null) {
@@ -64,8 +65,9 @@ public class SwipeItemMangerImpl implements SwipeItemMangerInterface {
     @Override
     public void openItem(int position) {
         if (mode == Attributes.Mode.Multiple) {
-            if (!mOpenPositions.contains(position))
+            if (!mOpenPositions.contains(position)) {
                 mOpenPositions.add(position);
+            }
         } else {
             mOpenPosition = position;
         }
@@ -77,8 +79,9 @@ public class SwipeItemMangerImpl implements SwipeItemMangerInterface {
         if (mode == Attributes.Mode.Multiple) {
             mOpenPositions.remove(position);
         } else {
-            if (mOpenPosition == position)
+            if (mOpenPosition == position) {
                 mOpenPosition = INVALID_POSITION;
+            }
         }
         swipeAdapterInterface.notifySwipeItemChanged(position);
     }
@@ -86,8 +89,9 @@ public class SwipeItemMangerImpl implements SwipeItemMangerInterface {
     @Override
     public void closeAllExcept(SwipeLayout layout) {
         for (SwipeLayout s : mShownLayouts) {
-            if (s != layout)
+            if (s != layout) {
                 s.close();
+            }
         }
     }
 
@@ -155,7 +159,6 @@ public class SwipeItemMangerImpl implements SwipeItemMangerInterface {
     }
 
     class OnLayoutListener implements SwipeLayout.OnLayout {
-
         private int position;
 
         OnLayoutListener(int position) {
@@ -174,11 +177,9 @@ public class SwipeItemMangerImpl implements SwipeItemMangerInterface {
                 v.close(false, false);
             }
         }
-
     }
 
     class SwipeMemory extends SimpleSwipeListener {
-
         private int position;
 
         SwipeMemory(int position) {
@@ -203,9 +204,9 @@ public class SwipeItemMangerImpl implements SwipeItemMangerInterface {
 
         @Override
         public void onOpen(SwipeLayout layout) {
-            if (mode == Attributes.Mode.Multiple)
+            if (mode == Attributes.Mode.Multiple) {
                 mOpenPositions.add(position);
-            else {
+            } else {
                 closeAllExcept(layout);
                 mOpenPosition = position;
             }
@@ -215,5 +216,4 @@ public class SwipeItemMangerImpl implements SwipeItemMangerInterface {
             this.position = position;
         }
     }
-
 }

+ 1 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/SwipeItemMangerInterface.java

@@ -3,13 +3,12 @@ package com.tencent.qcloud.tuikit.timcommon.component.swipe;
 import java.util.List;
 
 public interface SwipeItemMangerInterface {
-
     void openItem(int position);
 
     void closeItem(int position);
 
     void closeAllExcept(SwipeLayout layout);
-    
+
     void closeAllSwipeItems();
 
     List<Integer> getOpenItems();

File diff ditekan karena terlalu besar
+ 314 - 214
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/component/swipe/SwipeLayout.java


+ 10 - 0
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/ChatInputMoreListener.java

@@ -0,0 +1,10 @@
+package com.tencent.qcloud.tuikit.timcommon.interfaces;
+
+import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
+import com.tencent.qcloud.tuikit.timcommon.component.interfaces.IUIKitCallback;
+
+public abstract class ChatInputMoreListener {
+    public String sendMessage(TUIMessageBean msg, IUIKitCallback<TUIMessageBean> callback) {
+        return null;
+    }
+}

+ 1 - 0
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/ICommonMessageAdapter.java

@@ -4,5 +4,6 @@ import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
 
 public interface ICommonMessageAdapter {
     TUIMessageBean getItem(int position);
+
     void notifyItemChanged(int position);
 }

+ 32 - 33
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/IMessageProperties.java

@@ -3,13 +3,12 @@ package com.tencent.qcloud.tuikit.timcommon.interfaces;
 import android.graphics.drawable.Drawable;
 
 public interface IMessageProperties {
-
     /// @name 设置头像 Set Avatar
     /// @{
 
     /**
      * 获取默认头像
-     * 
+     *
      * Get default avatar
      *
      * @return
@@ -18,7 +17,7 @@ public interface IMessageProperties {
 
     /**
      * 设置默认头像,默认与左边与右边的头像相同
-     * 
+     *
      * Set the default avatar, the default is the same as the avatar on the left and right
      *
      * @param resId
@@ -27,7 +26,7 @@ public interface IMessageProperties {
 
     /**
      * 获取头像圆角
-     * 
+     *
      * Get avatar rounded corners
      *
      * @return
@@ -36,7 +35,7 @@ public interface IMessageProperties {
 
     /**
      * 设置头像圆角
-     * 
+     *
      * Set avatar rounded corners
      *
      * @param radius
@@ -45,7 +44,7 @@ public interface IMessageProperties {
 
     /**
      * 获得头像大小
-     * 
+     *
      * Get avatar size
      *
      * @return
@@ -56,7 +55,7 @@ public interface IMessageProperties {
      * 设置头像大小
      *
      * Set avatar size
-     * 
+     *
      * @param size
      */
     void setAvatarSize(int[] size);
@@ -67,7 +66,7 @@ public interface IMessageProperties {
 
     /**
      * 获得昵称文字大小
-     * 
+     *
      * Get nickname text size
      *
      * @return
@@ -76,7 +75,7 @@ public interface IMessageProperties {
 
     /**
      * 设置昵称文字大小
-     * 
+     *
      * Set nickname text size
      *
      * @param size
@@ -85,7 +84,7 @@ public interface IMessageProperties {
 
     /**
      * 获取昵称文字颜色
-     * 
+     *
      * Get nickname text color
      *
      * @return
@@ -94,7 +93,7 @@ public interface IMessageProperties {
 
     /**
      * 设置昵称文字颜色
-     * 
+     *
      * Set nickname text color
      *
      * @param color
@@ -103,7 +102,7 @@ public interface IMessageProperties {
 
     /**
      * 获取左边昵称显示状态
-     * 
+     *
      * Get the display status of the nickname on the left
      *
      * @return
@@ -112,7 +111,7 @@ public interface IMessageProperties {
 
     /**
      * 设置左边昵称是否显示
-     * 
+     *
      * Set the display status of the nickname on the left
      *
      * @param visibility
@@ -121,7 +120,7 @@ public interface IMessageProperties {
 
     /**
      * 获取右边昵称显示状态
-     * 
+     *
      * Get the display status of the nickname on the right
      *
      * @return
@@ -130,7 +129,7 @@ public interface IMessageProperties {
 
     /**
      * 设置右边昵称是否显示
-     * 
+     *
      * Set the display status of the nickname on the right
      *
      * @param visibility
@@ -143,7 +142,7 @@ public interface IMessageProperties {
 
     /**
      * 获取右边聊天气泡的背景
-     * 
+     *
      * Get the background of the chat bubble on the right
      *
      * @return
@@ -152,7 +151,7 @@ public interface IMessageProperties {
 
     /**
      * 设置右边聊天气泡的背景
-     * 
+     *
      * Set the background of the chat bubble on the right
      *
      * @param drawable
@@ -161,7 +160,7 @@ public interface IMessageProperties {
 
     /**
      * 获取左边聊天气泡的背景
-     * 
+     *
      * Get the background of the left chat bubble
      *
      * @return
@@ -170,7 +169,7 @@ public interface IMessageProperties {
 
     /**
      * 设置左边聊天气泡的背景
-     * 
+     *
      * Set the background of the left chat bubble
      *
      * @param drawable
@@ -183,7 +182,7 @@ public interface IMessageProperties {
 
     /**
      * 获取聊天内容字体大小
-     * 
+     *
      * Get chat content font size
      *
      * @return
@@ -192,7 +191,7 @@ public interface IMessageProperties {
 
     /**
      * 设置聊天内容字体大小
-     * 
+     *
      * Set chat content font size
      *
      * @param size
@@ -201,7 +200,7 @@ public interface IMessageProperties {
 
     /**
      * 获取右边聊天内容字体颜色
-     * 
+     *
      * Get the font color of the chat content on the right
      *
      * @return
@@ -210,7 +209,7 @@ public interface IMessageProperties {
 
     /**
      * 设置右边聊天内容字体颜色
-     * 
+     *
      * Set the font color of the chat content on the right
      *
      * @param color
@@ -219,7 +218,7 @@ public interface IMessageProperties {
 
     /**
      * 获取左边聊天内容字体颜色
-     * 
+     *
      * Get the font color of the chat content on the left
      *
      * @return
@@ -228,7 +227,7 @@ public interface IMessageProperties {
 
     /**
      * 设置左边聊天内容字体颜色
-     * 
+     *
      * Set the font color of the chat content on the left
      *
      * @param color
@@ -241,7 +240,7 @@ public interface IMessageProperties {
 
     /**
      * 获取聊天时间的背景
-     * 
+     *
      * Get the context of the chat time
      *
      * @return
@@ -250,7 +249,7 @@ public interface IMessageProperties {
 
     /**
      * 设置聊天时间的背景
-     * 
+     *
      * Set the context of the chat time
      *
      * @param drawable
@@ -259,7 +258,7 @@ public interface IMessageProperties {
 
     /**
      * 获取聊天时间的文字大小
-     * 
+     *
      * Get the text size of the chat time
      *
      * @return
@@ -268,7 +267,7 @@ public interface IMessageProperties {
 
     /**
      * 设置聊天时间的字体大小
-     * 
+     *
      * Set the text size of the chat time
      *
      * @param size
@@ -277,7 +276,7 @@ public interface IMessageProperties {
 
     /**
      * 获取聊天时间的字体颜色
-     * 
+     *
      * Get the font color of chat time
      *
      * @return
@@ -286,7 +285,7 @@ public interface IMessageProperties {
 
     /**
      * 设置聊天时间的字体颜色
-     * 
+     *
      * Set the font color of chat time
      *
      * @param color
@@ -299,7 +298,7 @@ public interface IMessageProperties {
 
     /**
      * 获取聊天提示信息的背景
-     * 
+     *
      * Get context for chat alerts
      *
      * @return
@@ -308,7 +307,7 @@ public interface IMessageProperties {
 
     /**
      * 设置聊天提示信息的背景
-     * 
+     *
      * Set context for chat alerts
      *
      * @param drawable

+ 0 - 9
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/OnChatInputMoreActionClickListener.java

@@ -1,9 +0,0 @@
-package com.tencent.qcloud.tuikit.timcommon.interfaces;
-
-import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
-
-public abstract class OnChatInputMoreActionClickListener {
-
-    public void onSendMessageClick(TUIMessageBean msg) {}
-
-}

+ 0 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/OnChatPopActionClickListener.java

@@ -3,7 +3,6 @@ package com.tencent.qcloud.tuikit.timcommon.interfaces;
 import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
 
 public abstract class OnChatPopActionClickListener {
-
     public void onCopyClick(TUIMessageBean msg) {}
 
     public void onSendMessageClick(TUIMessageBean msg, boolean retry) {}
@@ -21,5 +20,4 @@ public abstract class OnChatPopActionClickListener {
     public void onQuoteMessageClick(TUIMessageBean msg) {}
 
     public void onInfoMessageClick(TUIMessageBean msg) {}
-
 }

+ 5 - 6
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/interfaces/OnItemClickListener.java

@@ -17,16 +17,15 @@ public abstract class OnItemClickListener {
 
     public void onRecallClick(View view, int position, TUIMessageBean messageBean) {}
 
-    public  void onReplyMessageClick(View view, int position, TUIMessageBean messageBean) {}
+    public void onReplyMessageClick(View view, int position, TUIMessageBean messageBean) {}
 
-    public  void onReplyDetailClick(TUIMessageBean messageBean) {}
+    public void onReplyDetailClick(TUIMessageBean messageBean) {}
 
-    public  void onReactOnClick(String emojiId, TUIMessageBean messageBean) {}
+    public void onReactOnClick(String emojiId, TUIMessageBean messageBean) {}
 
-    public  void onSendFailBtnClick(View view, int position, TUIMessageBean messageBean) {}
+    public void onSendFailBtnClick(View view, int position, TUIMessageBean messageBean) {}
 
-    public  void onTextSelected(View view, int position, TUIMessageBean messageBean) {}
+    public void onTextSelected(View view, int position, TUIMessageBean messageBean) {}
 
     public void onMessageReadStatusClick(View view, TUIMessageBean messageBean) {}
-
 }

+ 2 - 5
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/ChatReactView.java

@@ -9,28 +9,25 @@ import android.view.ViewGroup;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.TextView;
-
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
-
 import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.bean.MessageReactBean;
 import com.tencent.qcloud.tuikit.timcommon.component.face.FaceManager;
-
 import java.util.ArrayList;
 import java.util.Map;
 import java.util.Set;
 
 public class ChatReactView extends FrameLayout {
-
     private static final int EMOJI_LIMIT = 5;
     private LinearLayoutManager layoutManager;
     private TextView reactNumText;
     private View moreIcon;
     private RecyclerView reactRecyclerView;
     private ChatReactAdapter adapter;
+
     public ChatReactView(@NonNull Context context) {
         super(context);
         initView();
@@ -109,10 +106,10 @@ public class ChatReactView extends FrameLayout {
 
     static class ChatReactViewHolder extends RecyclerView.ViewHolder {
         public ImageView faceImageView;
+
         public ChatReactViewHolder(@NonNull View itemView) {
             super(itemView);
             faceImageView = itemView.findViewById(R.id.face_iv);
         }
     }
-
 }

+ 6 - 13
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/MessageBaseHolder.java

@@ -11,9 +11,7 @@ import android.widget.CheckBox;
 import android.widget.FrameLayout;
 import android.widget.LinearLayout;
 import android.widget.TextView;
-
 import androidx.recyclerview.widget.RecyclerView;
-
 import com.tencent.qcloud.tuicore.TUIConfig;
 import com.tencent.qcloud.tuicore.TUIThemeManager;
 import com.tencent.qcloud.tuikit.timcommon.R;
@@ -21,7 +19,6 @@ import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
 import com.tencent.qcloud.tuikit.timcommon.component.MessageProperties;
 import com.tencent.qcloud.tuikit.timcommon.interfaces.ICommonMessageAdapter;
 import com.tencent.qcloud.tuikit.timcommon.interfaces.OnItemClickListener;
-
 import java.util.Calendar;
 import java.util.Date;
 import java.util.Locale;
@@ -129,21 +126,21 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
         calendar.set(Calendar.MINUTE, 0);
         calendar.set(Calendar.SECOND, 0);
         calendar.set(Calendar.MILLISECOND, 0);
-        long dayStartTimeInMillis = calendar.getTimeInMillis();
         calendar = Calendar.getInstance();
         calendar.set(Calendar.DAY_OF_WEEK, 1);
         calendar.set(Calendar.HOUR_OF_DAY, 0);
         calendar.set(Calendar.MINUTE, 0);
         calendar.set(Calendar.SECOND, 0);
         calendar.set(Calendar.MILLISECOND, 0);
-        long weekStartTimeInMillis = calendar.getTimeInMillis();
         calendar = Calendar.getInstance();
         calendar.set(Calendar.DAY_OF_YEAR, 1);
         calendar.set(Calendar.HOUR_OF_DAY, 0);
         calendar.set(Calendar.MINUTE, 0);
         calendar.set(Calendar.SECOND, 0);
         calendar.set(Calendar.MILLISECOND, 0);
+        long dayStartTimeInMillis = calendar.getTimeInMillis();
         long yearStartTimeInMillis = calendar.getTimeInMillis();
+        long weekStartTimeInMillis = calendar.getTimeInMillis();
         long outTimeMillis = date.getTime();
         if (outTimeMillis < yearStartTimeInMillis) {
             timeText = String.format(locale, "%1$tY/%1$tm/%1$td", date);
@@ -171,12 +168,12 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
     protected boolean isShowAvatar(TUIMessageBean messageBean) {
         return false;
     }
+    
     public void startHighLight() {
         int highLightColorDark = itemView.getResources().getColor(R.color.chat_message_bubble_high_light_dark_color);
         int highLightColorLight = itemView.getResources().getColor(R.color.chat_message_bubble_high_light_light_color);
 
         if (highLightAnimator == null) {
-            ArgbEvaluator argbEvaluator = new ArgbEvaluator();
             highLightAnimator = new ValueAnimator();
             highLightAnimator.setIntValues(highLightColorDark, highLightColorLight);
             highLightAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@@ -188,9 +185,7 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
             });
             highLightAnimator.addListener(new Animator.AnimatorListener() {
                 @Override
-                public void onAnimationStart(Animator animation) {
-
-                }
+                public void onAnimationStart(Animator animation) {}
 
                 @Override
                 public void onAnimationEnd(Animator animation) {
@@ -203,10 +198,9 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
                 }
 
                 @Override
-                public void onAnimationRepeat(Animator animation) {
-
-                }
+                public void onAnimationRepeat(Animator animation) {}
             });
+            ArgbEvaluator argbEvaluator = new ArgbEvaluator();
             highLightAnimator.setEvaluator(argbEvaluator);
             highLightAnimator.setRepeatCount(3);
             highLightAnimator.setDuration(250);
@@ -228,5 +222,4 @@ public abstract class MessageBaseHolder extends RecyclerView.ViewHolder {
             drawable.setColorFilter(null);
         }
     }
-
 }

+ 7 - 13
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/MessageContentHolder.java

@@ -9,9 +9,7 @@ import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
-
 import androidx.recyclerview.widget.RecyclerView;
-
 import com.tencent.imsdk.v2.V2TIMManager;
 import com.tencent.imsdk.v2.V2TIMMessage;
 import com.tencent.imsdk.v2.V2TIMUserFullInfo;
@@ -28,14 +26,12 @@ import com.tencent.qcloud.tuikit.timcommon.component.fragments.BaseFragment;
 import com.tencent.qcloud.tuikit.timcommon.component.gatherimage.UserIconView;
 import com.tencent.qcloud.tuikit.timcommon.util.DateTimeUtil;
 import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
-
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 
 public abstract class MessageContentHolder extends MessageBaseHolder {
-
     protected static final int READ_STATUS_UNREAD = 1;
     protected static final int READ_STATUS_PART_READ = 2;
     protected static final int READ_STATUS_ALL_READ = 3;
@@ -102,7 +98,7 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
         }
 
         List<TUIMessageBean> mediaSource = new ArrayList<>();
-        for(TUIMessageBean messageBean : dataSource) {
+        for (TUIMessageBean messageBean : dataSource) {
             int type = messageBean.getMsgType();
             if (type == V2TIMMessage.V2TIM_ELEM_TYPE_IMAGE || type == V2TIMMessage.V2TIM_ELEM_TYPE_VIDEO) {
                 mediaSource.add(messageBean);
@@ -312,7 +308,7 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
         param.put(TUIConstants.TUIChat.CHAT_RECYCLER_VIEW, recyclerView);
         param.put(TUIConstants.TUIChat.FRAGMENT, fragment);
 
-        TUICore.raiseExtension(TUIConstants.TUITranslation.Extension.TranslationView.MINIMALIST_EXTENSION_ID, translationContentFrameLayout, param);
+        TUICore.raiseExtension(TUIConstants.TUITranslationPlugin.Extension.TranslationView.MINIMALIST_EXTENSION_ID, translationContentFrameLayout, param);
     }
 
     private void loadAvatar(TUIMessageBean msg) {
@@ -371,8 +367,6 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
         }
     }
 
-
-
     protected boolean isNeedChangedBackground() {
         return true;
     }
@@ -390,9 +384,7 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
         if (nextMessage != null) {
             if (TextUtils.equals(messageBean.getSender(), nextMessage.getSender())) {
                 boolean longPeriod = nextMessage.getMessageTime() - messageBean.getMessageTime() >= 5 * 60;
-                if (!isShowAvatar(nextMessage)
-                        && nextMessage.getStatus() != TUIMessageBean.MSG_STATUS_REVOKE
-                        && !longPeriod) {
+                if (!isShowAvatar(nextMessage) && nextMessage.getStatus() != TUIMessageBean.MSG_STATUS_REVOKE && !longPeriod) {
                     isShowAvatar = false;
                 }
             }
@@ -454,8 +446,10 @@ public abstract class MessageContentHolder extends MessageBaseHolder {
             leftUserIcon.setDefaultImageResId(properties.getAvatar());
             rightUserIcon.setDefaultImageResId(properties.getAvatar());
         } else {
-            leftUserIcon.setDefaultImageResId(TUIThemeManager.getAttrResId(leftUserIcon.getContext(), com.tencent.qcloud.tuikit.timcommon.R.attr.core_default_user_icon));
-            rightUserIcon.setDefaultImageResId(TUIThemeManager.getAttrResId(rightUserIcon.getContext(), com.tencent.qcloud.tuikit.timcommon.R.attr.core_default_user_icon));
+            leftUserIcon.setDefaultImageResId(
+                TUIThemeManager.getAttrResId(leftUserIcon.getContext(), com.tencent.qcloud.tuikit.timcommon.R.attr.core_default_user_icon));
+            rightUserIcon.setDefaultImageResId(
+                TUIThemeManager.getAttrResId(rightUserIcon.getContext(), com.tencent.qcloud.tuikit.timcommon.R.attr.core_default_user_icon));
         }
         if (properties.getAvatarRadius() != 0) {
             leftUserIcon.setRadius(properties.getAvatarRadius());

+ 0 - 1
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/MessageStatusTimeView.java

@@ -59,5 +59,4 @@ public class MessageStatusTimeView extends FrameLayout {
     public void setTimeColor(int color) {
         timeView.setTextColor(color);
     }
-
 }

+ 9 - 5
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/MinimalistMessageLayout.java

@@ -15,7 +15,7 @@ import androidx.annotation.RequiresApi;
 
 import com.tencent.qcloud.tuikit.timcommon.R;
 
-public class MinimalistMessageLayout extends RelativeLayout  {
+public class MinimalistMessageLayout extends RelativeLayout {
     private View msgArea;
     private View quoteArea;
     private View translationArea;
@@ -102,8 +102,8 @@ public class MinimalistMessageLayout extends RelativeLayout  {
     private void drawLine(Canvas canvas) {
         canvas.drawColor(0x00FFFFFF);
         if (msgArea.getVisibility() == VISIBLE) {
-            float msgX, msgCenterY;
             msgAreaRect = getChildRectInParent(msgArea);
+            float msgX;
             if (isStart) {
                 paint.setColor(getResources().getColor(R.color.chat_minimalist_left_message_bubble_color));
                 msgX = msgAreaRect.left + strokeWidth / 2;
@@ -111,9 +111,11 @@ public class MinimalistMessageLayout extends RelativeLayout  {
                 paint.setColor(getResources().getColor(R.color.chat_minimalist_right_message_bubble_color));
                 msgX = msgAreaRect.right - strokeWidth / 2;
             }
+            float msgCenterY;
             msgCenterY = msgAreaRect.top + msgAreaRect.height() * 1.0f / 2;
             if (translationArea.getVisibility() == VISIBLE) {
-                float translationX, translationCenterY;
+                float translationX;
+                float translationCenterY;
                 translationRect = getChildRectInParent(translationArea);
                 if (isStart) {
                     translationX = translationRect.left;
@@ -129,7 +131,8 @@ public class MinimalistMessageLayout extends RelativeLayout  {
                 canvas.drawPath(translationPath, paint);
             }
             if (quoteArea.getVisibility() == VISIBLE) {
-                float quoteX, quoteCenterY;
+                float quoteX;
+                float quoteCenterY;
                 quoteRect = getChildRectInParent(quoteArea);
                 if (isStart) {
                     quoteX = quoteRect.left;
@@ -145,7 +148,8 @@ public class MinimalistMessageLayout extends RelativeLayout  {
                 canvas.drawPath(quotePath, paint);
             }
             if (replyArea.getVisibility() == VISIBLE) {
-                float replyX, replyCenterY;
+                float replyX;
+                float replyCenterY;
                 replyRect = getChildRectInParent(replyArea);
                 if (isStart) {
                     replyX = replyRect.left;

+ 11 - 19
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/ReplyPreviewView.java

@@ -14,11 +14,9 @@ import android.view.LayoutInflater;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.TextView;
-
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.annotation.RequiresApi;
-
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
 import com.bumptech.glide.load.resource.bitmap.CircleCrop;
@@ -26,14 +24,12 @@ import com.bumptech.glide.request.RequestOptions;
 import com.tencent.qcloud.tuikit.timcommon.R;
 import com.tencent.qcloud.tuikit.timcommon.bean.MessageRepliesBean;
 import com.tencent.qcloud.tuikit.timcommon.util.ScreenUtil;
-
 import java.util.ArrayList;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 
 public class ReplyPreviewView extends FrameLayout {
-
     private ImageView firstImg;
     private ImageView secondImg;
     private ImageView thirdImg;
@@ -87,7 +83,6 @@ public class ReplyPreviewView extends FrameLayout {
             if (iconList == null || iconList.isEmpty()) {
                 return;
             }
-            String firstIconUrl = iconList.get(0);
             String secondIconUrl = null;
             String thirdIconUrl = null;
 
@@ -97,7 +92,7 @@ public class ReplyPreviewView extends FrameLayout {
             if (iconList.size() > 2) {
                 thirdIconUrl = iconList.get(2);
             }
-
+            String firstIconUrl = iconList.get(0);
             firstImg.setVisibility(VISIBLE);
             loadAvatar(firstImg, firstIconUrl);
             if (secondIconUrl != null) {
@@ -108,7 +103,7 @@ public class ReplyPreviewView extends FrameLayout {
             if (iconList.size() == 3 && thirdIconUrl != null) {
                 thirdImg.setVisibility(VISIBLE);
                 loadAvatar(thirdImg, thirdIconUrl);
-            } else if (iconList.size() > 3){
+            } else if (iconList.size() > 3) {
                 thirdImg.setVisibility(VISIBLE);
                 loadAvatar(thirdImg, R.drawable.chat_reply_more_icon);
             }
@@ -130,33 +125,30 @@ public class ReplyPreviewView extends FrameLayout {
 
     private void loadAvatar(ImageView imageView, Object url) {
         Glide.with(getContext())
-                .load(url)
-                .centerCrop()
-                .apply(new RequestOptions()
-                        .transform(new ReplyRingCircleCrop())
-                        .error(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light))
-                .into(imageView);
+            .load(url)
+            .centerCrop()
+            .apply(new RequestOptions().transform(new ReplyRingCircleCrop()).error(com.tencent.qcloud.tuikit.timcommon.R.drawable.core_default_user_icon_light))
+            .into(imageView);
     }
 
     static class ReplyRingCircleCrop extends CircleCrop {
         @Override
         protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
             Bitmap outBitmap = pool.get(outWidth, outHeight, Bitmap.Config.ARGB_8888);
-            int borderWidth = ScreenUtil.dip2px(1);
-            int innerWidth = outWidth - 2 * borderWidth;
-            int innerHeight = outHeight - 2 * borderWidth;
-            Bitmap bitmap = super.transform(pool, toTransform, innerWidth, innerHeight);
-            Canvas canvas = new Canvas(outBitmap);
             Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);
             paint.setColor(Color.WHITE);
+            Canvas canvas = new Canvas(outBitmap);
+            int borderWidth = ScreenUtil.dip2px(1);
+            int innerWidth = outWidth - 2 * borderWidth;
             canvas.drawCircle(outWidth / 2, outHeight / 2, innerWidth / 2, paint);
             paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
             Rect rect = new Rect(borderWidth, borderWidth, outWidth - borderWidth, outHeight - borderWidth);
+            int innerHeight = outHeight - 2 * borderWidth;
+            Bitmap bitmap = super.transform(pool, toTransform, innerWidth, innerHeight);
             canvas.drawBitmap(bitmap, null, rect, paint);
             paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OVER));
             canvas.drawCircle(outWidth / 2, outHeight / 2, outWidth / 2, paint);
             return outBitmap;
         }
     }
-
 }

+ 2 - 5
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/minimalistui/widget/message/TimeInLineTextLayout.java

@@ -7,15 +7,11 @@ import android.util.AttributeSet;
 import android.util.TypedValue;
 import android.widget.FrameLayout;
 import android.widget.TextView;
-
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
-
 import com.tencent.qcloud.tuikit.timcommon.R;
 
-
 public class TimeInLineTextLayout extends FrameLayout {
-
     private TextView textView;
     private MessageStatusTimeView statusArea;
 
@@ -97,7 +93,8 @@ public class TimeInLineTextLayout extends FrameLayout {
 
     @Override
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        int maxWidth, maxHeight;
+        int maxWidth;
+        int maxHeight;
         // measure text view
         measureChildren(widthMeasureSpec, heightMeasureSpec);
 

+ 283 - 0
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/util/ActivityResultResolver.java

@@ -0,0 +1,283 @@
+package com.tencent.qcloud.tuikit.timcommon.util;
+
+import android.app.Activity;
+import android.content.ClipData;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.provider.MediaStore;
+import android.text.TextUtils;
+import android.util.Pair;
+import androidx.activity.result.ActivityResult;
+import androidx.activity.result.ActivityResultCallback;
+import androidx.activity.result.ActivityResultCaller;
+import androidx.activity.result.ActivityResultLauncher;
+import androidx.activity.result.contract.ActivityResultContract;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.FragmentActivity;
+import com.tencent.qcloud.tuicore.TUICore;
+import com.tencent.qcloud.tuicore.interfaces.TUIValueCallback;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.List;
+
+public class ActivityResultResolver {
+    public static final String CONTENT_TYPE_ALL = "*/*";
+    public static final String CONTENT_TYPE_IMAGE = "image/*";
+    public static final String CONTENT_TYPE_VIDEO = "video/*";
+
+    private static final String CONTENT_KEY_TYPE = "ContentType";
+    private static final String URI = "Uri";
+    private static final String METHOD = "Method";
+    private static final String KEY_DATA = "Data";
+
+    private static final String METHOD_GET_SINGLE_CONTENT = "MethodGetSingleContent";
+    private static final String METHOD_GET_MULTIPLE_CONTENT = "MethodGetMultipleContent";
+    private static final String METHOD_TAKE_PICTURE = "MethodTakePicture";
+    private static final String METHOD_TAKE_VIDEO = "MethodTakeVideo";
+
+    private ActivityResultResolver() {}
+
+    public static void getSingleContent(ActivityResultCaller activityResultCaller, @NonNull String type, TUIValueCallback<Uri> callback) {
+        getContent(activityResultCaller, new String[] {type}, false, new TUIValueCallback<List<Uri>>() {
+            @Override
+            public void onSuccess(List<Uri> list) {
+                if (list != null && !list.isEmpty()) {
+                    TUIValueCallback.onSuccess(callback, list.get(0));
+                } else {
+                    TUIValueCallback.onError(callback, -1, "getSingleContent result list is empty");
+                }
+            }
+
+            @Override
+            public void onError(int errorCode, String errorMessage) {
+                TUIValueCallback.onError(callback, errorCode, errorMessage);
+            }
+        });
+    }
+
+    public static void getSingleContent(ActivityResultCaller activityResultCaller, @NonNull String[] type, TUIValueCallback<Uri> callback) {
+        getContent(activityResultCaller, type, false, new TUIValueCallback<List<Uri>>() {
+            @Override
+            public void onSuccess(List<Uri> list) {
+                if (list != null && !list.isEmpty()) {
+                    TUIValueCallback.onSuccess(callback, list.get(0));
+                } else {
+                    TUIValueCallback.onError(callback, -1, "getSingleContent result list is empty");
+                }
+            }
+
+            @Override
+            public void onError(int errorCode, String errorMessage) {
+                TUIValueCallback.onError(callback, errorCode, errorMessage);
+            }
+        });
+    }
+
+    public static void getMultipleContent(ActivityResultCaller activityResultCaller, @NonNull String type, TUIValueCallback<List<Uri>> callback) {
+        getContent(activityResultCaller, new String[] {type}, true, callback);
+    }
+
+    public static void getMultipleContent(ActivityResultCaller activityResultCaller, @NonNull String[] type, TUIValueCallback<List<Uri>> callback) {
+        getContent(activityResultCaller, type, true, callback);
+    }
+
+    private static void getContent(
+        ActivityResultCaller activityResultCaller, @NonNull String[] types, boolean isMultiContent, TUIValueCallback<List<Uri>> callback) {
+        Bundle bundle = new Bundle();
+        bundle.putStringArray(CONTENT_KEY_TYPE, types);
+        bundle.putString(METHOD, isMultiContent ? METHOD_GET_MULTIPLE_CONTENT : METHOD_GET_SINGLE_CONTENT);
+        TUICore.startActivityForResult(activityResultCaller, ActivityResultProxyActivity.class, bundle, new ActivityResultCallback<ActivityResult>() {
+            @Override
+            public void onActivityResult(ActivityResult result) {
+                if (result.getData() != null) {
+                    TUIValueCallback.onSuccess(callback, (List<Uri>) result.getData().getSerializableExtra(KEY_DATA));
+                }
+            }
+        });
+    }
+
+    public static void takePicture(ActivityResultCaller activityResultCaller, @NonNull Uri uri, TUIValueCallback<Boolean> callback) {
+        takePictureVideo(activityResultCaller, uri, true, callback);
+    }
+
+    public static void takeVideo(ActivityResultCaller activityResultCaller, @NonNull Uri uri, TUIValueCallback<Boolean> callback) {
+        takePictureVideo(activityResultCaller, uri, false, callback);
+    }
+
+    private static void takePictureVideo(ActivityResultCaller activityResultCaller, @NonNull Uri uri, boolean isPicture, TUIValueCallback<Boolean> callback) {
+        Bundle bundle = new Bundle();
+        if (isPicture) {
+            bundle.putString(METHOD, METHOD_TAKE_PICTURE);
+        } else {
+            bundle.putString(METHOD, METHOD_TAKE_VIDEO);
+        }
+        bundle.putParcelable(URI, uri);
+        TUICore.startActivityForResult(activityResultCaller, ActivityResultProxyActivity.class, bundle, new ActivityResultCallback<ActivityResult>() {
+            @Override
+            public void onActivityResult(ActivityResult result) {
+                if (result.getData() != null) {
+                    TUIValueCallback.onSuccess(callback, result.getData().getBooleanExtra(KEY_DATA, false));
+                }
+            }
+        });
+    }
+
+    private static class GetContentsContract extends ActivityResultContract<Pair<String[], Boolean>, List<Uri>> {
+        @NonNull
+        @Override
+        public Intent createIntent(@NonNull Context context, @NonNull Pair<String[], Boolean> input) {
+            Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+            intent.addCategory(Intent.CATEGORY_OPENABLE);
+            String[] type = input.first;
+            boolean allowMultiple = input.second;
+            if (type.length == 1) {
+                intent.setType(type[0]);
+            } else if (type.length > 1) {
+                intent.setType(type[0]);
+                intent.putExtra(Intent.EXTRA_MIME_TYPES, type);
+            }
+            intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, allowMultiple);
+            return intent;
+        }
+
+        @NonNull
+        @Override
+        public final List<Uri> parseResult(int resultCode, @Nullable Intent intent) {
+            if (intent == null || resultCode != Activity.RESULT_OK) {
+                return Collections.emptyList();
+            } else {
+                return getClipDataUris(intent);
+            }
+        }
+
+        @NonNull
+        static List<Uri> getClipDataUris(@NonNull Intent intent) {
+            // Use a LinkedHashSet to maintain any ordering that may be
+            // present in the ClipData
+            LinkedHashSet<Uri> resultSet = new LinkedHashSet<>();
+            if (intent.getData() != null) {
+                resultSet.add(intent.getData());
+            }
+            ClipData clipData = intent.getClipData();
+            if (clipData == null && resultSet.isEmpty()) {
+                return Collections.emptyList();
+            } else if (clipData != null) {
+                for (int i = 0; i < clipData.getItemCount(); i++) {
+                    Uri uri = clipData.getItemAt(i).getUri();
+                    if (uri != null) {
+                        resultSet.add(uri);
+                    }
+                }
+            }
+            return new ArrayList<>(resultSet);
+        }
+    }
+
+    private static class TakePictureVideoContract extends ActivityResultContract<Pair<Uri, Boolean>, Boolean> {
+        private boolean isTakePicture;
+
+        @NonNull
+        @Override
+        public Intent createIntent(@NonNull Context context, @NonNull Pair<Uri, Boolean> input) {
+            isTakePicture = input.second;
+            if (isTakePicture) {
+                return new Intent(MediaStore.ACTION_IMAGE_CAPTURE)
+                    .putExtra(MediaStore.EXTRA_OUTPUT, input.first)
+                    .addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
+                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            } else {
+                return new Intent(MediaStore.ACTION_VIDEO_CAPTURE)
+                    .putExtra(MediaStore.EXTRA_OUTPUT, input.first)
+                    .addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
+                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            }
+        }
+
+        @NonNull
+        @Override
+        public final Boolean parseResult(int resultCode, @Nullable Intent intent) {
+            if (isTakePicture) {
+                return resultCode == Activity.RESULT_OK;
+            } else {
+                return intent != null && resultCode == Activity.RESULT_OK;
+            }
+        }
+    }
+
+    public static class ActivityResultProxyActivity extends FragmentActivity {
+        @Override
+        protected void onCreate(@Nullable Bundle savedInstanceState) {
+            super.onCreate(savedInstanceState);
+            Intent intent = getIntent();
+            String method = intent.getStringExtra(METHOD);
+            if (TextUtils.equals(method, METHOD_GET_SINGLE_CONTENT)) {
+                getSingleContent(intent);
+            } else if (TextUtils.equals(method, METHOD_GET_MULTIPLE_CONTENT)) {
+                getMultipleContent(intent);
+            } else if (TextUtils.equals(method, METHOD_TAKE_PICTURE)) {
+                takePicture(intent);
+            } else if (TextUtils.equals(method, METHOD_TAKE_VIDEO)) {
+                takeVideo(intent);
+            }
+        }
+
+        private void getSingleContent(Intent intent) {
+            String[] types = intent.getStringArrayExtra(CONTENT_KEY_TYPE);
+            getContent(types, false);
+        }
+
+        private void getMultipleContent(Intent intent) {
+            String[] types = intent.getStringArrayExtra(CONTENT_KEY_TYPE);
+            getContent(types, true);
+        }
+
+        private void getContent(String[] types, boolean isMultiple) {
+            ActivityResultLauncher<Pair<String[], Boolean>> launcher =
+                this.registerForActivityResult(new GetContentsContract(), new ActivityResultCallback<List<Uri>>() {
+                    @Override
+                    public void onActivityResult(List<Uri> result) {
+                        Intent dataIntent = new Intent();
+                        dataIntent.putExtra(KEY_DATA, new ArrayList<>(result));
+                        setResult(Activity.RESULT_OK, dataIntent);
+                        finish();
+                    }
+                });
+            try {
+                launcher.launch(Pair.create(types, isMultiple));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        private void takePicture(Intent intent) {
+            takePictureVideo(intent, true);
+        }
+
+        private void takeVideo(Intent intent) {
+            takePictureVideo(intent, false);
+        }
+
+        private void takePictureVideo(Intent intent, boolean isPicture) {
+            Uri uri = intent.getParcelableExtra(URI);
+            ActivityResultLauncher<Pair<Uri, Boolean>> launcher =
+                this.registerForActivityResult(new TakePictureVideoContract(), new ActivityResultCallback<Boolean>() {
+                    @Override
+                    public void onActivityResult(Boolean result) {
+                        Intent dataIntent = new Intent();
+                        dataIntent.putExtra(KEY_DATA, result);
+                        setResult(Activity.RESULT_OK, dataIntent);
+                        finish();
+                    }
+                });
+            try {
+                launcher.launch(Pair.create(uri, isPicture));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}

+ 17 - 20
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/util/DateTimeUtil.java

@@ -1,26 +1,22 @@
 package com.tencent.qcloud.tuikit.timcommon.util;
 
 import android.content.Context;
-
 import com.tencent.qcloud.tuicore.TUIConfig;
 import com.tencent.qcloud.tuicore.TUIThemeManager;
 import com.tencent.qcloud.tuikit.timcommon.R;
-
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.Locale;
 
-
 public class DateTimeUtil {
-
-    private final static long minute = 60 * 1000;
-    private final static long hour = 60 * minute;
-    private final static long day = 24 * hour;
-    private final static long week = 7 * day;
-    private final static long month = 31 * day;
-    private final static long year = 12 * month;
+    private static final long minute = 60 * 1000;
+    private static final long hour = 60 * minute;
+    private static final long day = 24 * hour;
+    private static final long week = 7 * day;
+    private static final long month = 31 * day;
+    private static final long year = 12 * month;
 
     /**
      * return format text for time
@@ -49,14 +45,12 @@ public class DateTimeUtil {
         calendar.set(Calendar.MINUTE, 0);
         calendar.set(Calendar.SECOND, 0);
         calendar.set(Calendar.MILLISECOND, 0);
-        long dayStartTimeInMillis = calendar.getTimeInMillis();
         calendar = Calendar.getInstance();
         calendar.set(Calendar.DAY_OF_WEEK, 1);
         calendar.set(Calendar.HOUR_OF_DAY, 0);
         calendar.set(Calendar.MINUTE, 0);
         calendar.set(Calendar.SECOND, 0);
         calendar.set(Calendar.MILLISECOND, 0);
-        long weekStartTimeInMillis = calendar.getTimeInMillis();
         calendar = Calendar.getInstance();
         calendar.set(Calendar.DAY_OF_YEAR, 1);
         calendar.set(Calendar.HOUR_OF_DAY, 0);
@@ -64,6 +58,8 @@ public class DateTimeUtil {
         calendar.set(Calendar.SECOND, 0);
         calendar.set(Calendar.MILLISECOND, 0);
         long yearStartTimeInMillis = calendar.getTimeInMillis();
+        long dayStartTimeInMillis = calendar.getTimeInMillis();
+        long weekStartTimeInMillis = calendar.getTimeInMillis();
         long outTimeMillis = date.getTime();
         if (outTimeMillis < yearStartTimeInMillis) {
             timeText = String.format(locale, "%tD", date);
@@ -106,14 +102,16 @@ public class DateTimeUtil {
             if (min > 60) {
                 min = (seconds / 60) % 60;
                 long hour = (seconds / 60) / 60;
-                timeStr = hour + context.getString(R.string.date_hour_short) + min + context.getString(R.string.date_minute_short) + second + context.getString(R.string.date_second_short);
+                timeStr = hour + context.getString(R.string.date_hour_short) + min + context.getString(R.string.date_minute_short) + second
+                    + context.getString(R.string.date_second_short);
                 if (hour % 24 == 0) {
                     long day = (((seconds / 60) / 60) / 24);
                     timeStr = day + context.getString(R.string.date_day_short);
                 } else if (hour > 24) {
                     hour = ((seconds / 60) / 60) % 24;
                     long day = (((seconds / 60) / 60) / 24);
-                    timeStr = day + context.getString(R.string.date_day_short) + hour + context.getString(R.string.date_hour_short) + min + context.getString(R.string.date_minute_short) + second + context.getString(R.string.date_second_short);
+                    timeStr = day + context.getString(R.string.date_day_short) + hour + context.getString(R.string.date_hour_short) + min
+                        + context.getString(R.string.date_minute_short) + second + context.getString(R.string.date_second_short);
                 }
             }
         }
@@ -127,11 +125,10 @@ public class DateTimeUtil {
             int minute = minuteTemp % 60;
             int hour = minuteTemp / 60;
             if (hour > 0) {
-                return (hour >= 10 ? (hour + "") : ("0" + hour)) + ":" + (minute >= 10 ? (minute + "") : ("0" + minute))
-                        + ":" + (second >= 10 ? (second + "") : ("0" + second));
+                return (hour >= 10 ? (hour + "") : ("0" + hour)) + ":" + (minute >= 10 ? (minute + "") : ("0" + minute)) + ":"
+                    + (second >= 10 ? (second + "") : ("0" + second));
             } else {
-                return (minute >= 10 ? (minute + "") : ("0" + minute)) + ":"
-                        + (second >= 10 ? (second + "") : ("0" + second));
+                return (minute >= 10 ? (minute + "") : ("0" + minute)) + ":" + (second >= 10 ? (second + "") : ("0" + second));
             }
         } else {
             return "00:" + (second >= 10 ? (second + "") : ("0" + second));
@@ -141,9 +138,9 @@ public class DateTimeUtil {
     public static long getStringToDate(String dateString, String pattern) {
         SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
         Date date = new Date();
-        try{
+        try {
             date = dateFormat.parse(dateString);
-        } catch(ParseException e) {
+        } catch (ParseException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         }

+ 1 - 2
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/util/FileProvider.java

@@ -1,4 +1,3 @@
 package com.tencent.qcloud.tuikit.timcommon.util;
 
-public class FileProvider extends androidx.core.content.FileProvider {
-}
+public class FileProvider extends androidx.core.content.FileProvider {}

+ 71 - 59
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/util/FileUtil.java

@@ -15,27 +15,20 @@ import android.provider.OpenableColumns;
 import android.text.TextUtils;
 import android.util.Log;
 import android.webkit.MimeTypeMap;
-
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
-
 import com.tencent.qcloud.tuicore.TUIConfig;
 import com.tencent.qcloud.tuicore.TUILogin;
 import com.tencent.qcloud.tuikit.timcommon.R;
-
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.text.DecimalFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
+import java.util.Random;
 
 public class FileUtil {
-
-
     public static final String DOCUMENTS_DIR = "documents";
 
     public static final String FILE_PROVIDER_AUTH = ".timcommon.fileprovider";
@@ -45,22 +38,10 @@ public class FileUtil {
     public static final int SIZETYPE_MB = 3;
     public static final int SIZETYPE_GB = 4;
 
-    public static String saveBitmap(String dir, Bitmap b) {
-        String jpegName = TUIConfig.getMediaDir() + "picture_" + new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date()) + ".jpg";
-        try {
-            FileOutputStream fout = new FileOutputStream(jpegName);
-            BufferedOutputStream bos = new BufferedOutputStream(fout);
-            b.compress(Bitmap.CompressFormat.JPEG, 100, bos);
-            bos.flush();
-            bos.close();
-            return jpegName;
-        } catch (IOException e) {
-            e.printStackTrace();
-            return "";
-        }
-    }
-
     public static boolean deleteFile(String url) {
+        if (TextUtils.isEmpty(url)) {
+            return false;
+        }
         boolean result = false;
         File file = new File(url);
         if (file.exists()) {
@@ -98,7 +79,7 @@ public class FileUtil {
         } else if (ContentResolver.SCHEME_FILE.equals(scheme)) {
             data = uri.getPath();
         } else if (ContentResolver.SCHEME_CONTENT.equals(scheme)) {
-            Cursor cursor = TUILogin.getAppContext().getContentResolver().query(uri, new String[]{MediaStore.Images.ImageColumns.DATA}, null, null, null);
+            Cursor cursor = TUILogin.getAppContext().getContentResolver().query(uri, new String[] {MediaStore.Images.ImageColumns.DATA}, null, null, null);
             if (null != cursor) {
                 if (cursor.moveToFirst()) {
                     int index = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
@@ -115,7 +96,8 @@ public class FileUtil {
     public static Uri getUriFromPath(String path) {
         try {
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
-                return FileProvider.getUriForFile(TUIConfig.getAppContext(), TUIConfig.getAppContext().getApplicationInfo().packageName + FILE_PROVIDER_AUTH, new File(path));
+                return FileProvider.getUriForFile(
+                    TUIConfig.getAppContext(), TUIConfig.getAppContext().getApplicationInfo().packageName + FILE_PROVIDER_AUTH, new File(path));
             } else {
                 return Uri.fromFile(new File(path));
             }
@@ -128,18 +110,16 @@ public class FileUtil {
 
     /**
      * 专为Android4.4以上设计的从Uri获取文件路径
-     * 
+     *
      * Get file path from Uri specially designed for Android4.4 and above
      */
     public static String getPath(final Context context, final Uri uri) {
-
         final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
 
         // DocumentProvider
         if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
             // ExternalStorageProvider
             if (isExternalStorageDocument(uri)) {
-
                 final String docId = DocumentsContract.getDocumentId(uri);
                 final String[] split = docId.split(":");
                 final String type = split[0];
@@ -152,17 +132,13 @@ public class FileUtil {
             }
             // DownloadsProvider
             else if (isDownloadsDocument(uri)) {
-
                 final String id = DocumentsContract.getDocumentId(uri);
                 if (id.startsWith("raw:")) {
                     final String path = id.replaceFirst("raw:", "");
                     return path;
                 }
-                String[] contentUriPrefixesToTry = new String[]{
-                        "content://downloads/public_downloads",
-                        "content://downloads/my_downloads",
-                        "content://downloads/all_downloads"
-                };
+                String[] contentUriPrefixesToTry =
+                    new String[] {"content://downloads/public_downloads", "content://downloads/my_downloads", "content://downloads/all_downloads"};
 
                 for (String contentUriPrefix : contentUriPrefixesToTry) {
                     Uri contentUri = ContentUris.withAppendedId(Uri.parse(contentUriPrefix), Long.parseLong(id));
@@ -182,7 +158,6 @@ public class FileUtil {
             }
             // MediaProvider
             else if (isMediaDocument(uri)) {
-
                 final String docId = DocumentsContract.getDocumentId(uri);
                 final String[] split = docId.split(":");
                 final String type = split[0];
@@ -197,7 +172,7 @@ public class FileUtil {
                 }
 
                 final String selection = "_id=?";
-                final String[] selectionArgs = new String[]{split[1]};
+                final String[] selectionArgs = new String[] {split[1]};
 
                 String path = getDataColumn(context, contentUri, selection, selectionArgs);
                 if (TextUtils.isEmpty(path) || Build.VERSION.SDK_INT >= 29) {
@@ -275,7 +250,6 @@ public class FileUtil {
             return null;
         }
 
-
         return file;
     }
 
@@ -286,8 +260,7 @@ public class FileUtil {
         if (mimeType == null && context != null) {
             filename = getName(uri.toString());
         } else {
-            Cursor returnCursor = context.getContentResolver().query(uri, null,
-                    null, null, null);
+            Cursor returnCursor = context.getContentResolver().query(uri, null, null, null, null);
             if (returnCursor != null) {
                 int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
                 returnCursor.moveToFirst();
@@ -299,12 +272,12 @@ public class FileUtil {
         return filename;
     }
 
-    private static String getName(String filename) {
-        if (filename == null) {
+    public static String getName(String filePath) {
+        if (filePath == null) {
             return null;
         }
-        int index = filename.lastIndexOf('/');
-        return filename.substring(index + 1);
+        int index = filePath.lastIndexOf('/');
+        return filePath.substring(index + 1);
     }
 
     public static File getDocumentCacheDir(@NonNull Context context) {
@@ -333,8 +306,12 @@ public class FileUtil {
             return false;
         } finally {
             try {
-                if (is != null) is.close();
-                if (bos != null) bos.close();
+                if (is != null) {
+                    is.close();
+                }
+                if (bos != null) {
+                    bos.close();
+                }
             } catch (IOException e) {
                 e.printStackTrace();
             }
@@ -352,16 +329,13 @@ public class FileUtil {
      * @param selectionArgs (Optional) Selection arguments used in the query.
      * @return The value of the _data column, which is typically a file path.
      */
-    public static String getDataColumn(Context context, Uri uri, String selection,
-                                       String[] selectionArgs) {
-
+    public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {
         Cursor cursor = null;
         final String column = "_data";
         final String[] projection = {column};
 
         try {
-            cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
-                    null);
+            cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);
             if (cursor != null && cursor.moveToFirst()) {
                 final int column_index = cursor.getColumnIndexOrThrow(column);
                 return cursor.getString(column_index);
@@ -400,10 +374,9 @@ public class FileUtil {
         return "com.android.providers.media.documents".equals(uri.getAuthority());
     }
 
-
     /**
      * 转换文件大小
-     * 
+     *
      * Convert file size to string
      *
      * @param fileS
@@ -428,7 +401,6 @@ public class FileUtil {
         return fileSizeString;
     }
 
-
     // 修复 android.webkit.MimeTypeMap 的 getFileExtensionFromUrl 方法不支持中文的问题
     // fix the problem that getFileExtensionFromUrl does not support Chinese
     public static String getFileExtensionFromUrl(String url) {
@@ -444,13 +416,12 @@ public class FileUtil {
             }
 
             int filenamePos = url.lastIndexOf('/');
-            String filename =
-                    0 <= filenamePos ? url.substring(filenamePos + 1) : url;
+            String filename = 0 <= filenamePos ? url.substring(filenamePos + 1) : url;
 
             // if the filename contains special characters, we don't
             // consider it valid for our matching purposes:
             // 去掉正则表达式判断以添加中文支持
-//          if (!filename.isEmpty() && Pattern.matches("[a-zA-Z_0-9\\.\\-\\(\\)\\%]+", filename))
+            //          if (!filename.isEmpty() && Pattern.matches("[a-zA-Z_0-9\\.\\-\\(\\)\\%]+", filename))
             if (!filename.isEmpty()) {
                 int dotPos = filename.lastIndexOf('.');
                 if (0 <= dotPos) {
@@ -463,9 +434,8 @@ public class FileUtil {
     }
 
     public static void openFile(String path, String fileName) {
-        Uri uri = FileProvider.getUriForFile(TUIConfig.getAppContext(),
-                TUIConfig.getAppContext().getApplicationInfo().packageName + FILE_PROVIDER_AUTH,
-                new File(path));
+        Uri uri = FileProvider.getUriForFile(
+            TUIConfig.getAppContext(), TUIConfig.getAppContext().getApplicationInfo().packageName + FILE_PROVIDER_AUTH, new File(path));
         if (uri == null) {
             Log.e("FileUtil", "openFile failed , uri is null");
             return;
@@ -496,4 +466,46 @@ public class FileUtil {
         }
         return 0;
     }
+
+    public static String generateImageFilePath() {
+        String name = System.nanoTime() + "_" + Math.abs(new Random().nextInt());
+        return TUIConfig.getImageBaseDir() + name + ".jpg";
+    }
+
+    public static String generateExternalStorageImageFilePath() {
+        File dir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separatorChar + TUIConfig.getAppContext().getPackageName()
+            + TUIConfig.IMAGE_BASE_DIR_SUFFIX);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+        return dir.getAbsolutePath() + File.separatorChar + System.nanoTime() + "_" + Math.abs(new Random().nextInt()) + ".jpg";
+    }
+
+    public static String generateVideoFilePath() {
+        String name = System.nanoTime() + "_" + Math.abs(new Random().nextInt());
+        return TUIConfig.getVideoBaseDir() + name + ".mp4";
+    }
+
+    public static String generateExternalStorageVideoFilePath() {
+        File dir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separatorChar + TUIConfig.getAppContext().getPackageName()
+            + TUIConfig.VIDEO_BASE_DIR_SUFFIX);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+        return dir.getAbsolutePath() + File.separatorChar + System.nanoTime() + "_" + Math.abs(new Random().nextInt()) + ".mp4";
+    }
+
+    public static boolean saveBitmap(String path, Bitmap b) {
+        try {
+            FileOutputStream fout = new FileOutputStream(path);
+            BufferedOutputStream bos = new BufferedOutputStream(fout);
+            b.compress(Bitmap.CompressFormat.JPEG, 100, bos);
+            bos.flush();
+            bos.close();
+            return true;
+        } catch (IOException e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
 }

+ 77 - 69
Android/timcommon/src/main/java/com/tencent/qcloud/tuikit/timcommon/util/ImageUtil.java

@@ -13,6 +13,7 @@ import android.media.ExifInterface;
 import android.net.Uri;
 import android.text.TextUtils;
 
+import com.tencent.imsdk.v2.V2TIMImageElem;
 import com.tencent.qcloud.tuicore.TUIConfig;
 import com.tencent.qcloud.tuicore.TUILogin;
 import com.tencent.qcloud.tuicore.util.SPUtils;
@@ -20,14 +21,12 @@ import com.tencent.qcloud.tuicore.util.SPUtils;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
-
 public class ImageUtil {
-    public final static String SP_IMAGE = "_conversation_group_face";
+    public static final String SP_IMAGE = "_conversation_group_face";
 
     /**
      * @param outFile
@@ -63,17 +62,18 @@ public class ImageUtil {
     public static Bitmap getBitmapFormPath(Uri uri) {
         Bitmap bitmap = null;
         try {
-            InputStream input = TUIConfig.getAppContext().getContentResolver().openInputStream(uri);
             BitmapFactory.Options onlyBoundsOptions = new BitmapFactory.Options();
             onlyBoundsOptions.inJustDecodeBounds = true;
-            onlyBoundsOptions.inDither = true;//optional
-            onlyBoundsOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;//optional
+            onlyBoundsOptions.inDither = true; // optional
+            onlyBoundsOptions.inPreferredConfig = Bitmap.Config.ARGB_8888; // optional
+            InputStream input = TUIConfig.getAppContext().getContentResolver().openInputStream(uri);
             BitmapFactory.decodeStream(input, null, onlyBoundsOptions);
             input.close();
             int originalWidth = onlyBoundsOptions.outWidth;
             int originalHeight = onlyBoundsOptions.outHeight;
-            if ((originalWidth == -1) || (originalHeight == -1))
+            if ((originalWidth == -1) || (originalHeight == -1)) {
                 return null;
+            }
             float hh = 800f;
             float ww = 480f;
             int degree = getBitmapDegree(uri);
@@ -89,8 +89,9 @@ public class ImageUtil {
             } else if (originalWidth < originalHeight && originalHeight > hh) {
                 be = (int) (originalHeight / hh);
             }
-            if (be <= 0)
+            if (be <= 0) {
                 be = 1;
+            }
             BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();
             bitmapOptions.inSampleSize = be;
             bitmapOptions.inDither = true;
@@ -116,7 +117,6 @@ public class ImageUtil {
     }
 
     public static Bitmap compressImage(Bitmap image) {
-
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         image.compress(Bitmap.CompressFormat.JPEG, 100, baos);
         int options = 100;
@@ -132,15 +132,14 @@ public class ImageUtil {
 
     /**
      * 读取图片的旋转的角度
-     * 
+     *
      * Read the rotation angle of the image
      */
     public static int getBitmapDegree(Uri uri) {
         int degree = 0;
         try {
             ExifInterface exifInterface = new ExifInterface(FileUtil.getPathFromUri(uri));
-            int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION,
-                    ExifInterface.ORIENTATION_NORMAL);
+            int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
             switch (orientation) {
                 case ExifInterface.ORIENTATION_ROTATE_90:
                     degree = 90;
@@ -151,6 +150,8 @@ public class ImageUtil {
                 case ExifInterface.ORIENTATION_ROTATE_270:
                     degree = 270;
                     break;
+                default:
+                    break;
             }
         } catch (IOException e) {
             e.printStackTrace();
@@ -160,15 +161,14 @@ public class ImageUtil {
 
     /**
      * 读取图片的旋转的角度
-     * 
+     *
      * Read the rotation angle of the image
      */
     public static int getBitmapDegree(String fileName) {
         int degree = 0;
         try {
             ExifInterface exifInterface = new ExifInterface(fileName);
-            int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION,
-                    ExifInterface.ORIENTATION_NORMAL);
+            int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
             switch (orientation) {
                 case ExifInterface.ORIENTATION_ROTATE_90:
                     degree = 90;
@@ -179,6 +179,8 @@ public class ImageUtil {
                 case ExifInterface.ORIENTATION_ROTATE_270:
                     degree = 270;
                     break;
+                default:
+                    break;
             }
         } catch (IOException e) {
             e.printStackTrace();
@@ -192,10 +194,10 @@ public class ImageUtil {
      * @param bm     需要旋转的图片
      * @param degree 旋转角度
      * @return 旋转后的图片
-     * 
-     * 
+     *
+     *
      * Rotate the image by an angle
-     * 
+     *
      * @param bm     image to be rotated
      * @param degree Rotation angle
      * @return rotated image
@@ -208,6 +210,7 @@ public class ImageUtil {
         try {
             returnBm = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), matrix, true);
         } catch (OutOfMemoryError e) {
+            e.printStackTrace();
         }
         if (returnBm == null) {
             returnBm = bm;
@@ -219,15 +222,15 @@ public class ImageUtil {
     }
 
     public static int[] getImageSize(String path) {
-        int size[] = new int[2];
+        int[] size = new int[2];
         try {
             BitmapFactory.Options onlyBoundsOptions = new BitmapFactory.Options();
             onlyBoundsOptions.inJustDecodeBounds = true;
             BitmapFactory.decodeFile(path, onlyBoundsOptions);
             int originalWidth = onlyBoundsOptions.outWidth;
             int originalHeight = onlyBoundsOptions.outHeight;
-            //size[0] = originalWidth;
-            //size[1] = originalHeight;
+            // size[0] = originalWidth;
+            // size[1] = originalHeight;
 
             int degree = getBitmapDegree(path);
             if (degree == 0) {
@@ -246,8 +249,9 @@ public class ImageUtil {
                 } else if (originalWidth < originalHeight && originalHeight > hh) {
                     be = (int) (originalHeight / hh);
                 }
-                if (be <= 0)
+                if (be <= 0) {
                     be = 1;
+                }
                 BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();
                 bitmapOptions.inSampleSize = be;
                 bitmapOptions.inDither = true;
@@ -261,33 +265,29 @@ public class ImageUtil {
             e.printStackTrace();
         }
         return size;
-
     }
 
-
     // 图片文件先在本地做旋转,返回旋转之后的图片文件路径
     // The image file is rotated locally, and the path of the image file after rotation is returned.
-    public static String getImagePathAfterRotate(final Uri uri) {
+    public static String getImagePathAfterRotate(final String imagePath) {
         try {
-            InputStream is = TUIConfig.getAppContext().getContentResolver()
-                    .openInputStream(uri);
-            Bitmap originBitmap = BitmapFactory.decodeStream(is, null, null);
-            int degree = ImageUtil.getBitmapDegree(uri);
+            Bitmap originBitmap = BitmapFactory.decodeFile(imagePath, null);
+            int degree = ImageUtil.getBitmapDegree(imagePath);
             if (degree == 0) {
-                return FileUtil.getPathFromUri(uri);
+                return imagePath;
             } else {
                 Bitmap newBitmap = ImageUtil.rotateBitmapByDegree(originBitmap, degree);
-                String oldName = FileUtil.getFileName(TUIConfig.getAppContext(), uri);
+                String oldName = FileUtil.getName(imagePath);
                 File newImageFile = FileUtil.generateFileName(oldName, FileUtil.getDocumentCacheDir(TUIConfig.getAppContext()));
                 if (newImageFile == null) {
-                    return FileUtil.getPathFromUri(uri);
+                    return imagePath;
                 }
                 ImageUtil.storeBitmap(newImageFile, newBitmap);
                 newBitmap.recycle();
                 return newImageFile.getAbsolutePath();
             }
-        }catch (FileNotFoundException e) {
-            return FileUtil.getPathFromUri(uri);
+        } catch (Exception e) {
+            return imagePath;
         }
     }
 
@@ -296,8 +296,8 @@ public class ImageUtil {
      *
      * @param bitmap 传入Bitmap对象
      * @return
-     * 
-     * 
+     *
+     *
      * Convert image to circle
      *
      * @param bitmap   Pass in a Bitmap object
@@ -307,7 +307,14 @@ public class ImageUtil {
         int width = bitmap.getWidth();
         int height = bitmap.getHeight();
         float roundPx;
-        float left, top, right, bottom, dst_left, dst_top, dst_right, dst_bottom;
+        float left;
+        float top;
+        float right;
+        float bottom;
+        float dstLeft;
+        float dstTop;
+        float dstRight;
+        float dstBottom;
         if (width <= height) {
             roundPx = width / 2;
             left = 0;
@@ -315,10 +322,10 @@ public class ImageUtil {
             right = width;
             bottom = width;
             height = width;
-            dst_left = 0;
-            dst_top = 0;
-            dst_right = width;
-            dst_bottom = width;
+            dstLeft = 0;
+            dstTop = 0;
+            dstRight = width;
+            dstBottom = width;
         } else {
             roundPx = height / 2;
             float clip = (width - height) / 2;
@@ -327,10 +334,10 @@ public class ImageUtil {
             top = 0;
             bottom = height;
             width = height;
-            dst_left = 0;
-            dst_top = 0;
-            dst_right = height;
-            dst_bottom = height;
+            dstLeft = 0;
+            dstTop = 0;
+            dstRight = height;
+            dstBottom = height;
         }
 
         Bitmap output = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
@@ -339,7 +346,7 @@ public class ImageUtil {
         final int color = 0xff424242;
         final Paint paint = new Paint();
         final Rect src = new Rect((int) left, (int) top, (int) right, (int) bottom);
-        final Rect dst = new Rect((int) dst_left, (int) dst_top, (int) dst_right, (int) dst_bottom);
+        final Rect dst = new Rect((int) dstLeft, (int) dstTop, (int) dstRight, (int) dstBottom);
         final RectF rectF = new RectF(dst);
 
         paint.setAntiAlias(true);
@@ -361,11 +368,11 @@ public class ImageUtil {
             BitmapFactory.Options options = new BitmapFactory.Options();
             options.inJustDecodeBounds = true;
             BitmapFactory.decodeFile(imagePath, options);
-//            ImageDecoder.Source src = ImageDecoder.createSource(mContext.getContentResolver(),
-//                    uri, res);
-//            return ImageDecoder.decodeDrawable(src, (decoder, info, s) -> {
-//                decoder.setAllocator(ImageDecoder.ALLOCATOR_SOFTWARE);
-//            });
+            //            ImageDecoder.Source src = ImageDecoder.createSource(mContext.getContentResolver(),
+            //                    uri, res);
+            //            return ImageDecoder.decodeDrawable(src, (decoder, info, s) -> {
+            //                decoder.setAllocator(ImageDecoder.ALLOCATOR_SOFTWARE);
+            //            });
 
             return true;
         } catch (Exception e) {
@@ -379,14 +386,14 @@ public class ImageUtil {
      *
      * @param imagePath 图片路径
      * @return Bitmap 调整后的位图
-     * 
-     * 
+     *
+     *
      * Loading high-resolution images requires adaptation
-     * 
+     *
      * @param imagePath
      * @return Bitmap
      */
-    public static Bitmap adaptBitmapFormPath(String imagePath, int reqWidth, int reqHeight){
+    public static Bitmap adaptBitmapFormPath(String imagePath, int reqWidth, int reqHeight) {
         try {
             BitmapFactory.Options options = new BitmapFactory.Options();
             options.inJustDecodeBounds = true;
@@ -403,22 +410,19 @@ public class ImageUtil {
         return null;
     }
 
-    private static int calculateInSampleSize(
-            BitmapFactory.Options options, int reqWidth, int reqHeight) {
+    private static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) {
         // Raw height and width of image
         final int height = options.outHeight;
         final int width = options.outWidth;
         int inSampleSize = 1;
 
         if (height > reqHeight || width > reqWidth) {
-
             final int halfHeight = height / 2;
             final int halfWidth = width / 2;
 
             // Calculate the largest inSampleSize value that is a power of 2 and keeps both
             // height and width larger than the requested height and width.
-            while ((halfHeight / inSampleSize) >= reqHeight
-                    && (halfWidth / inSampleSize) >= reqWidth) {
+            while ((halfHeight / inSampleSize) >= reqHeight && (halfWidth / inSampleSize) >= reqWidth) {
                 inSampleSize *= 2;
             }
         }
@@ -426,28 +430,33 @@ public class ImageUtil {
         return inSampleSize;
     }
 
-
     /**
      * 根据图片 UUID 和 类型得到图片文件路径
      * @param uuid 图片 UUID
      * @param imageType 图片类型 V2TIMImageElem.V2TIM_IMAGE_TYPE_THUMB , V2TIMImageElem.V2TIM_IMAGE_TYPE_ORIGIN ,
      *                  V2TIMImageElem.V2TIM_IMAGE_TYPE_LARGE
      * @return 图片文件路径
-     * 
-     * 
-     * 
-     * 
+     *
      * Get the image file path based on the image UUID and type
-     * @param uuid 
+     * @param uuid
      * @param imageType V2TIMImageElem.V2TIM_IMAGE_TYPE_THUMB , V2TIMImageElem.V2TIM_IMAGE_TYPE_ORIGIN ,
      *                  V2TIMImageElem.V2TIM_IMAGE_TYPE_LARGE
      * @return path
      */
     public static String generateImagePath(String uuid, int imageType) {
-        return TUIConfig.getImageDownloadDir() + uuid + "_" + imageType;
+        String imageTypePreStr;
+        if (imageType == V2TIMImageElem.V2TIM_IMAGE_TYPE_THUMB) {
+            imageTypePreStr = "thumb_";
+        } else if (imageType == V2TIMImageElem.V2TIM_IMAGE_TYPE_ORIGIN) {
+            imageTypePreStr = "origin_";
+        } else if (imageType == V2TIMImageElem.V2TIM_IMAGE_TYPE_LARGE) {
+            imageTypePreStr = "large_";
+        } else {
+            imageTypePreStr = "other_";
+        }
+        return TUIConfig.getImageDownloadDir() + imageTypePreStr + uuid;
     }
 
-
     public static String getGroupConversationAvatar(String conversationID) {
         SPUtils spUtils = SPUtils.getInstance(TUILogin.getSdkAppId() + SP_IMAGE);
         final String savedIcon = spUtils.getString(conversationID, "");
@@ -461,5 +470,4 @@ public class ImageUtil {
         SPUtils spUtils = SPUtils.getInstance(TUILogin.getSdkAppId() + SP_IMAGE);
         spUtils.put(conversationId, url);
     }
-
 }

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini