opt 音乐浮框
This commit is contained in:
@@ -18,6 +18,7 @@ import android.widget.ImageView;
|
||||
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.skin.support.IMogoSkinCompatSupportable;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatHelperDelegate;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatImageHelperDelegate;
|
||||
|
||||
@SuppressLint("AppCompatCustomView")
|
||||
@@ -30,6 +31,8 @@ public class AnimCircleImageView extends ImageView implements IMogoSkinCompatSup
|
||||
int defaultHeight;
|
||||
int diameter;
|
||||
int radius;
|
||||
PaintFlagsDrawFilter drawFilter = new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG);
|
||||
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
|
||||
|
||||
MogoSkinCompatImageHelperDelegate imageHelper;
|
||||
|
||||
@@ -81,6 +84,7 @@ public class AnimCircleImageView extends ImageView implements IMogoSkinCompatSup
|
||||
@Override
|
||||
public void setImageResource(int resId) {
|
||||
super.setImageResource(resId);
|
||||
Log.d("AnimCircle", "setImageResource: " + MogoSkinCompatHelperDelegate.isSupport());
|
||||
imageHelper.setImageResource(resId);
|
||||
mDrawbleSrc = getDrawable();
|
||||
output = null;
|
||||
@@ -112,7 +116,7 @@ public class AnimCircleImageView extends ImageView implements IMogoSkinCompatSup
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
Log.d("AnimCircle", "onDraw====");
|
||||
// Log.d("AnimCircle", "onDraw====");
|
||||
try {
|
||||
if (mDrawbleSrc == null) {
|
||||
return;
|
||||
@@ -131,7 +135,8 @@ public class AnimCircleImageView extends ImageView implements IMogoSkinCompatSup
|
||||
defaultWidth = getWidth();
|
||||
diameter = (defaultHeight > defaultWidth ? defaultWidth : defaultHeight);
|
||||
radius = diameter / 2;
|
||||
mBitmapOut = getCuttedPicture(mDrawbleSrc);
|
||||
// mBitmapOut = getCuttedPicture(mDrawbleSrc);
|
||||
mBitmapOut = ((BitmapDrawable) mDrawbleSrc).getBitmap();
|
||||
|
||||
Paint paint = new Paint();
|
||||
Rect rect = new Rect(0, 0, mBitmapOut.getWidth(),
|
||||
@@ -156,9 +161,9 @@ public class AnimCircleImageView extends ImageView implements IMogoSkinCompatSup
|
||||
if (isRotateEnable) {
|
||||
currentDegree = (currentDegree + mRotateAngleStep) % 360;
|
||||
canvas.save();
|
||||
canvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG));
|
||||
canvas.setDrawFilter(drawFilter);
|
||||
canvas.rotate(currentDegree, defaultWidth / 2, defaultHeight / 2);
|
||||
canvas.drawBitmap(output, defaultWidth / 2 - radius, defaultHeight / 2 - radius, null);
|
||||
canvas.drawBitmap(output, defaultWidth / 2 - radius, defaultHeight / 2 - radius, mPaint);
|
||||
canvas.restore();
|
||||
if (isRotateEnable) {
|
||||
removeCallbacks(loopInvalidate);
|
||||
@@ -167,9 +172,9 @@ public class AnimCircleImageView extends ImageView implements IMogoSkinCompatSup
|
||||
}
|
||||
} else {
|
||||
canvas.save();
|
||||
canvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG));
|
||||
canvas.setDrawFilter(drawFilter);
|
||||
canvas.rotate(currentDegree, defaultWidth / 2, defaultHeight / 2);
|
||||
canvas.drawBitmap(output, defaultWidth / 2 - radius, defaultHeight / 2 - radius, null);
|
||||
canvas.drawBitmap(output, defaultWidth / 2 - radius, defaultHeight / 2 - radius, mPaint);
|
||||
canvas.restore();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.widget.TextView;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
|
||||
import com.mogo.module.media.MediaConstants;
|
||||
import com.mogo.module.media.R;
|
||||
import com.mogo.module.media.ServiceMediaHandler;
|
||||
@@ -92,6 +93,11 @@ public class MediaWindow2 implements IMusicView {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!ServiceMediaHandler.getIMogoStatusManager().isMainPageOnResume()){
|
||||
Log.d(TAG, "not in front");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mHasAddWindow) {
|
||||
mHasAddWindow = true;
|
||||
mWindowView =
|
||||
@@ -199,10 +205,14 @@ public class MediaWindow2 implements IMusicView {
|
||||
|
||||
if (mCircleImg != null) {
|
||||
if(mMediaInfoData!=null&&mMediaInfoData.getMediaImg()!=null&&!mMediaInfoData.getMediaImg().isEmpty()) {
|
||||
int size =
|
||||
mContext.getResources().getDimensionPixelSize(R.dimen.module_media_pop_window_anim_img_size);
|
||||
Logger.d(TAG, "overload: " + size);
|
||||
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);
|
||||
.placeholder(R.drawable.module_media_default_music_img).error(R.drawable.module_media_default_music_img).override(size, size);
|
||||
GlideApp.with(mContext).asBitmap().apply(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options));
|
||||
// GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options));
|
||||
}else{
|
||||
mCircleImg.setImageResource(R.drawable.module_media_default_music_img);
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 588 B After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 588 B After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 3.9 KiB |
@@ -65,7 +65,7 @@
|
||||
<dimen name="module_media_pop_window_height">140px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">112px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">30px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">90px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">80px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">230px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">14px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">35px</dimen>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<dimen name="module_media_pop_window_height">76.7px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">60px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">18px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">48px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">44px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">123px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">10px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">18px</dimen>
|
||||
|
||||
Reference in New Issue
Block a user