|
@@ -8,6 +8,7 @@ import android.graphics.drawable.GradientDrawable;
|
|
|
import android.graphics.drawable.LayerDrawable;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.CheckBox;
|
|
|
+import android.widget.EditText;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.TableLayout;
|
|
|
import android.widget.TextView;
|
|
@@ -41,6 +42,7 @@ public class IMThemManager {
|
|
|
private int searchBtBackgroundRes = -1;
|
|
|
private int checkBtDrawableRes = -1;
|
|
|
private int mainButtonBackgroundRes = -1;
|
|
|
+ private int chatTopViewBackgroundRes = -1;
|
|
|
|
|
|
|
|
|
private IMThemManager() {
|
|
@@ -94,6 +96,17 @@ public class IMThemManager {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void setTopBgStyles(ImageView ivTopBg) {
|
|
|
+ if (ivTopBg == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (chatTopViewBackgroundRes != -1) {
|
|
|
+ ivTopBg.setImageResource(chatTopViewBackgroundRes);
|
|
|
+ } else {
|
|
|
+ ivTopBg.setImageDrawable(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void setSearchIconStyles(ImageView imageView) {
|
|
|
if (imageView == null) {
|
|
|
return;
|
|
@@ -124,6 +137,20 @@ public class IMThemManager {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void setEditStyle(EditText editText) {
|
|
|
+ Drawable textCursorDrawable = null;
|
|
|
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) {
|
|
|
+ textCursorDrawable = editText.getTextCursorDrawable();
|
|
|
+ if (textCursorDrawable != null) {
|
|
|
+ if (mainStyleColor != -1) {
|
|
|
+ textCursorDrawable.setTint(mainStyleColor);
|
|
|
+ } else {
|
|
|
+ textCursorDrawable.setTintList(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void setEmptyDrawable(Drawable emptyDrawable) {
|
|
|
MessageProperties instance = MessageProperties.getInstance();
|
|
|
instance.setConversationListEmptyDrawable(emptyDrawable);
|
|
@@ -152,6 +179,10 @@ public class IMThemManager {
|
|
|
this.mainButtonBackgroundRes = mainButtonBackgroundRes;
|
|
|
}
|
|
|
|
|
|
+ public void setChatTopViewBackgroundRes(int chatTopViewBackgroundRes) {
|
|
|
+ this.chatTopViewBackgroundRes = chatTopViewBackgroundRes;
|
|
|
+ }
|
|
|
+
|
|
|
public void resetStyleValue() {
|
|
|
this.tabIndicatorDrawable = null;
|
|
|
setMainStyleColor(-1);
|
|
@@ -159,6 +190,7 @@ public class IMThemManager {
|
|
|
this.searchBtBackgroundRes = -1;
|
|
|
this.checkBtDrawableRes = -1;
|
|
|
this.mainButtonBackgroundRes = -1;
|
|
|
+ this.chatTopViewBackgroundRes = -1;
|
|
|
setEmptyDrawable(null);
|
|
|
}
|
|
|
}
|