完成了小地图

This commit is contained in:
董宏宇
2020-12-16 19:25:17 +08:00
parent aed0063417
commit 1c4c7faa81
13 changed files with 72 additions and 150 deletions

View File

@@ -3,6 +3,8 @@ package com.mogo.module.common.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PaintFlagsDrawFilter;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
@@ -19,11 +21,10 @@ import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
* desc :
* version: 1.0
*/
public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSupportable {
public class RoundLayout extends RelativeLayout {
private float roundLayoutRadius = 14f;
private Path roundPath;
private RectF rectF;
private MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
public RoundLayout(Context context) {
this(context, null);
@@ -41,9 +42,6 @@ public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSuppor
typedArray.recycle();
init();
mBackgroundTintHelper = new MogoSkinCompatBackgroundHelperDelegate(this);
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
}
@@ -75,16 +73,10 @@ public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSuppor
@Override
public void draw(Canvas canvas) {
if (roundLayoutRadius > 0f) {
canvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG));
canvas.clipPath(roundPath);
}
super.draw(canvas);
}
@Override
public void applySkin() {
if (mBackgroundTintHelper != null) {
mBackgroundTintHelper.applySkin();
}
}
}