私聊改造:UI完善,私聊页代码精简

This commit is contained in:
huangjian
2023-01-31 15:37:20 +08:00
parent 3379aeed02
commit 0ba0aed40f
17 changed files with 401 additions and 636 deletions

View File

@@ -25,8 +25,8 @@ import com.mango.xchat_android_library.R;
*/
public class IOSSwitchView extends View {
private static final int foregroundColor = 0xFFEFEFEF;
private static final int backgroundColor = 0xFFCCCCCC;
private static final int foregroundColor = Color.parseColor("#C7DAEA");
private static final int backgroundColor = Color.parseColor("#C7DAEA");
private int colorStep = backgroundColor;
private int mTintColor;
@@ -66,6 +66,8 @@ public class IOSSwitchView extends View {
//手势检测器
private GestureDetector mGestureDetector;
private boolean mIsNoStrokeColor = false;
private boolean mIsKeepRate = true;
public IOSSwitchView(Context context) {
this(context, null);
@@ -75,6 +77,7 @@ public class IOSSwitchView extends View {
this(context, attrs, 0);
}
public IOSSwitchView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs);
@@ -257,7 +260,6 @@ public class IOSSwitchView extends View {
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
@@ -469,9 +471,11 @@ public class IOSSwitchView extends View {
public void setOn(boolean on) {
setOn(on, false);
}
public void setOn(boolean on, boolean isNeedListener) {
setOn(on, false, isNeedListener);
}
public void setOn(boolean on, boolean animate, boolean isNeedListener) {
if (isOn == on) return;
@@ -540,20 +544,18 @@ public class IOSSwitchView extends View {
invalidate();
}
private boolean mIsNoStrokeColor = false;
public void setNoStrokeColor(boolean isNoStrokeColor) {
mIsNoStrokeColor = isNoStrokeColor;
invalidate();
}
private boolean mIsKeepRate = true;
public void setmIsKeepRate(boolean isKeepRate) {
mIsKeepRate = isKeepRate;
invalidate();
}
public int getSelectedColor() {
return 0xFFFF894F;
return Color.parseColor("#5FCCE4");
}
/**