|
@@ -1,7 +1,14 @@
|
|
|
package com.cooleshow.chatmodule.utils.helper;
|
|
|
|
|
|
import android.content.Context;
|
|
|
+import android.graphics.Color;
|
|
|
+import android.graphics.PorterDuff;
|
|
|
import android.graphics.drawable.Drawable;
|
|
|
+import android.graphics.drawable.GradientDrawable;
|
|
|
+import android.graphics.drawable.LayerDrawable;
|
|
|
+import android.widget.ImageView;
|
|
|
+import android.widget.TableLayout;
|
|
|
+import android.widget.TextView;
|
|
|
|
|
|
import com.cooleshow.base.common.BaseApplication;
|
|
|
import com.cooleshow.base.utils.SizeUtils;
|
|
@@ -12,6 +19,7 @@ import com.cooleshow.chatmodule.message.bean.TUIChatShareMusicMessageBean;
|
|
|
import com.cooleshow.chatmodule.message.holder.TUIChatShareLiveMessageHolder;
|
|
|
import com.cooleshow.chatmodule.message.holder.TUIChatShareMusicMessageHolder;
|
|
|
import com.cooleshow.chatmodule.widget.CustomChatInputMusicExtension;
|
|
|
+import com.google.android.material.tabs.TabLayout;
|
|
|
import com.tencent.qcloud.tuicore.TUIConfig;
|
|
|
import com.tencent.qcloud.tuicore.TUIConstants;
|
|
|
import com.tencent.qcloud.tuicore.TUICore;
|
|
@@ -25,6 +33,12 @@ import com.tencent.qcloud.tuikit.tuichat.config.TUIChatConfigs;
|
|
|
* Author by pq, Date on 2023/7/3.
|
|
|
*/
|
|
|
public class IMThemManager {
|
|
|
+ private Drawable tabIndicatorDrawable = null;
|
|
|
+ private int tabIndicatorColor = -1;
|
|
|
+ private int searchIconRes = -1;
|
|
|
+ private int searchBtBackgroundRes = -1;
|
|
|
+
|
|
|
+
|
|
|
private IMThemManager() {
|
|
|
}
|
|
|
|
|
@@ -63,8 +77,58 @@ public class IMThemManager {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void setTabViewStyles(TabLayout tableLayout) {
|
|
|
+ if (tableLayout == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Drawable tabSelectedIndicator = tableLayout.getTabSelectedIndicator();
|
|
|
+ if (tabIndicatorDrawable != null && tabIndicatorColor != -1) {
|
|
|
+ tabSelectedIndicator.setTint(tabIndicatorColor);
|
|
|
+ } else {
|
|
|
+ tabSelectedIndicator.setTintList(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setSearchIconStyles(ImageView imageView) {
|
|
|
+ if (imageView == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (searchIconRes != -1) {
|
|
|
+ imageView.setImageResource(searchIconRes);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setSearchButtonStyles(TextView textView) {
|
|
|
+ if (textView == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (searchBtBackgroundRes != -1) {
|
|
|
+ textView.setBackgroundResource(searchBtBackgroundRes);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void setEmptyDrawable(Drawable emptyDrawable) {
|
|
|
MessageProperties instance = MessageProperties.getInstance();
|
|
|
instance.setConversationListEmptyDrawable(emptyDrawable);
|
|
|
}
|
|
|
+
|
|
|
+ public void setTabIndicatorDrawable(Drawable tabIndicatorDrawable, int tabIndicatorColor) {
|
|
|
+ this.tabIndicatorDrawable = tabIndicatorDrawable;
|
|
|
+ this.tabIndicatorColor = tabIndicatorColor;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setSearchIconRes(int searchIconRes) {
|
|
|
+ this.searchIconRes = searchIconRes;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setSearchBtBackgroundRes(int searchBtBackgroundRes) {
|
|
|
+ this.searchBtBackgroundRes = searchBtBackgroundRes;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void resetStyleValue() {
|
|
|
+ this.tabIndicatorDrawable = null;
|
|
|
+ this.tabIndicatorColor = -1;
|
|
|
+ this.searchIconRes = -1;
|
|
|
+ this.searchBtBackgroundRes = -1;
|
|
|
+ }
|
|
|
}
|