opt 音乐浮框

This commit is contained in:
tongchenfei
2020-09-17 14:56:32 +08:00
parent a0cb16d579
commit a344cd18c3
6 changed files with 26 additions and 10 deletions

2
.idea/misc.xml generated
View File

@@ -4,7 +4,7 @@
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

View File

@@ -17,9 +17,11 @@ import android.util.Log;
import android.widget.ImageView;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.skin.support.IMogoSkinCompatSupportable;
import com.mogo.skin.support.helper.MogoSkinCompatImageHelperDelegate;
@SuppressLint("AppCompatCustomView")
public class AnimCircleImageView extends ImageView {
public class AnimCircleImageView extends ImageView implements IMogoSkinCompatSupportable {
Drawable mDrawbleSrc;
Context context;
Bitmap mBitmapOut;
@@ -29,6 +31,8 @@ public class AnimCircleImageView extends ImageView {
int diameter;
int radius;
MogoSkinCompatImageHelperDelegate imageHelper;
int currentDegree;
int savedDegree;
boolean isRotateEnable;
@@ -47,6 +51,7 @@ public class AnimCircleImageView extends ImageView {
public AnimCircleImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
imageHelper = new MogoSkinCompatImageHelperDelegate(this);
this.context = context;
init();
}
@@ -76,6 +81,7 @@ public class AnimCircleImageView extends ImageView {
@Override
public void setImageResource(int resId) {
super.setImageResource(resId);
imageHelper.setImageResource(resId);
mDrawbleSrc = getDrawable();
output = null;
}
@@ -108,14 +114,17 @@ public class AnimCircleImageView extends ImageView {
protected void onDraw(Canvas canvas) {
Log.d("AnimCircle", "onDraw====");
try {
if (mDrawbleSrc == null)
if (mDrawbleSrc == null) {
return;
}
if (getWidth() == 0 || getHeight() == 0)
if (getWidth() == 0 || getHeight() == 0) {
return;
}
if (mDrawbleSrc.getClass() == NinePatchDrawable.class)
if (mDrawbleSrc.getClass() == NinePatchDrawable.class) {
return;
}
if (output == null) {
defaultHeight = getHeight();
@@ -185,10 +194,12 @@ public class AnimCircleImageView extends ImageView {
x = mBitmapScaled.getWidth() / 2 - radius;
y = mBitmapScaled.getHeight() / 2 - radius;
if (x < 0)
if (x < 0) {
x = 0;
if (y < 0)
}
if (y < 0) {
y = 0;
}
Bitmap mBitmapCropped = Bitmap.createBitmap(mBitmapScaled, x, y, diameter, diameter);
return mBitmapCropped;
}
@@ -200,5 +211,10 @@ public class AnimCircleImageView extends ImageView {
public void setDelayMilliseconds(int delayMilliseconds) {
this.delayMilliseconds = delayMilliseconds;
}
@Override
public void applySkin() {
imageHelper.applySkin();
}
}

View File

@@ -202,7 +202,7 @@ public class MediaWindow2 implements IMusicView {
com.bumptech.glide.request.RequestOptions options =
new com.bumptech.glide.request.RequestOptions()
.placeholder(R.drawable.module_media_default_music_img);
GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(mCircleImg);
// GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(mCircleImg);
}else{
mCircleImg.setImageResource(R.drawable.module_media_default_music_img);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_media_music_state_location">881px</dimen>
<dimen name="module_media_music_state_location">872px</dimen>
<dimen name="module_media_music_state_location_x">1067px</dimen>
<!-- lcc start-->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_media_music_state_location">470px</dimen>
<dimen name="module_media_music_state_location">462px</dimen>
<dimen name="module_media_music_state_location_x">573px</dimen>
<!-- lcc start-->