UI 视频播放器圆角
This commit is contained in:
@@ -26,6 +26,8 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.BitmapHelper;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.glide.GlideRoundedCornersTransform;
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager;
|
||||
import com.mogo.utils.DateTimeUtils;
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
||||
@@ -136,7 +138,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
try {
|
||||
mRecyclerView = findViewById(R.id.traffic_info_recyclerView);
|
||||
//网格布局
|
||||
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2,StaggeredGridLayoutManager.VERTICAL);
|
||||
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
|
||||
mRecyclerView.setLayoutManager(staggeredGridLayoutManager);
|
||||
NoticeTrafficInfoGridItemDivider gridLayoutDivider = new NoticeTrafficInfoGridItemDivider(1,
|
||||
(mContext.getResources().getColor(R.color.notice_check_dialog_bg_color)));
|
||||
@@ -211,7 +213,9 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
*/
|
||||
private void complete(Bitmap firstbitmap) {
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
thumbnailImage.setImageBitmap(firstbitmap);
|
||||
// thumbnailImage.setImageBitmap(firstbitmap);
|
||||
GlideApp.with(mContext).load(firstbitmap).optionalTransform(new GlideRoundedCornersTransform
|
||||
(20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImage);
|
||||
playImageView.setImageResource(R.drawable.notice_video_play);
|
||||
playImageView.setVisibility(View.VISIBLE);
|
||||
playImageView.setOnClickListener(v -> {
|
||||
@@ -400,9 +404,9 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
|
||||
NoticeValue status = new NoticeValue();
|
||||
status.setKey("处理状态:");
|
||||
if (info.getOperaStatus() == "0"){
|
||||
if (info.getOperaStatus().equals("1")) {
|
||||
status.setValue("待处理");
|
||||
}else {
|
||||
} else {
|
||||
status.setValue("已处理");
|
||||
}
|
||||
dataArrayList.add(status);
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/notice_traffic_placeholder"
|
||||
app:layout_constraintBottom_toBottomOf="@id/video_player"
|
||||
app:layout_constraintEnd_toEndOf="@id/video_player"
|
||||
@@ -85,7 +84,7 @@
|
||||
android:id="@+id/traffic_info_recyclerView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="@dimen/dp_80"
|
||||
android:layout_marginLeft="@dimen/dp_100"
|
||||
android:layout_marginTop="@dimen/dp_38"
|
||||
android:layout_marginRight="@dimen/dp_70"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
@@ -94,13 +93,14 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/video_player" />
|
||||
<!--分割线-->
|
||||
<ImageView
|
||||
<com.mogo.eagle.core.function.hmi.ui.notice.roundimage.RoundedImageView
|
||||
android:id="@+id/traffic_top_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2px"
|
||||
android:layout_marginBottom="@dimen/dp_150"
|
||||
android:background="@color/notice_traffic_line"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:riv_corner_radius="@dimen/dp_20" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/traffic_middle_line"
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
<color name="notice_text_blue">#1F9BFE</color>
|
||||
<color name="notice_banner_blue">#5A8EFD</color>
|
||||
<color name="notice_check_dialog_bg_color">#E63B4577</color>
|
||||
<color name="notice_traffic_line">#CCD5D5D4</color>
|
||||
<color name="notice_traffic_line">#33D5D5D4</color>
|
||||
<color name="notice_dialog_back">#3B4577</color>
|
||||
</resources>
|
||||
@@ -27,6 +27,7 @@
|
||||
<dimen name="dp_70">70px</dimen>
|
||||
<dimen name="dp_75">80px</dimen>
|
||||
<dimen name="dp_80">80px</dimen>
|
||||
<dimen name="dp_100">100px</dimen>
|
||||
<dimen name="dp_140">140px</dimen>
|
||||
<dimen name="dp_150">150px</dimen>
|
||||
<dimen name="dp_180">180px</dimen>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<dimen name="dp_56">56px</dimen>
|
||||
<dimen name="dp_62">62px</dimen>
|
||||
<dimen name="dp_75">80px</dimen>
|
||||
<dimen name="dp_100">100px</dimen>
|
||||
<dimen name="dp_140">140px</dimen>
|
||||
<dimen name="dp_150">150px</dimen>
|
||||
<dimen name="dp_180">180px</dimen>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.eagle.core.widget">
|
||||
package="com.mogo.eagle.core.widget"
|
||||
android:launchMode="singleTask">
|
||||
|
||||
</manifest>
|
||||
@@ -58,6 +58,7 @@ public class AnimationView extends View implements Handler.Callback {
|
||||
mHandler = new Handler(this);
|
||||
mProcessThread = new ProcessAnimThread(getContext(), mHandler);
|
||||
mAnimTime = DEFAULT_ANIM_TIME;
|
||||
|
||||
}
|
||||
|
||||
public void setIsRepeat(boolean repeat) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.widget.media.video
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.Surface
|
||||
@@ -11,6 +12,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.TimeTransformUtils
|
||||
import com.mogo.eagle.core.widget.R
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.render.GSYRenderView
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||
@@ -71,7 +73,7 @@ class NoticeSimpleSmallVideoPlayer : StandardGSYVideoPlayer {
|
||||
}
|
||||
|
||||
override fun updateStartImage() {
|
||||
Log.d(TAG,"updateStartImage");
|
||||
Log.d(TAG, "updateStartImage");
|
||||
when (mCurrentState) {
|
||||
GSYVideoView.CURRENT_STATE_PLAYING ->
|
||||
start.setImageResource(R.drawable.notice_video_pause)
|
||||
@@ -89,7 +91,7 @@ class NoticeSimpleSmallVideoPlayer : StandardGSYVideoPlayer {
|
||||
forceChange: Boolean
|
||||
) {
|
||||
super.setProgressAndTime(progress, secProgress, currentTime, totalTime, forceChange)
|
||||
Log.d(TAG,"setProgressAndTime");
|
||||
Log.d(TAG, "setProgressAndTime");
|
||||
mBottomContainer?.visibility = View.VISIBLE
|
||||
mProgressBar?.visibility = View.VISIBLE
|
||||
start?.visibility = View.VISIBLE
|
||||
@@ -113,7 +115,7 @@ class NoticeSimpleSmallVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
override fun hideAllWidget() {
|
||||
super.hideAllWidget()
|
||||
Log.d(TAG,"hideAllWidget");
|
||||
Log.d(TAG, "hideAllWidget");
|
||||
mBottomContainer?.visibility = View.VISIBLE
|
||||
mProgressBar?.visibility = View.VISIBLE
|
||||
start?.visibility = View.VISIBLE
|
||||
@@ -122,14 +124,14 @@ class NoticeSimpleSmallVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
override fun changeUiToPrepareingClear() {
|
||||
super.changeUiToPrepareingClear()
|
||||
Log.d(TAG,"changeUiToPrepareingClear");
|
||||
Log.d(TAG, "changeUiToPrepareingClear");
|
||||
mBottomContainer?.visibility = View.INVISIBLE
|
||||
mProgressBar?.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun changeUiToPlayingBufferingClear() {
|
||||
super.changeUiToPlayingBufferingClear()
|
||||
Log.d(TAG,"changeUiToPlayingBufferingClear");
|
||||
Log.d(TAG, "changeUiToPlayingBufferingClear");
|
||||
mBottomContainer?.visibility = View.INVISIBLE
|
||||
mProgressBar?.visibility = View.GONE
|
||||
|
||||
@@ -141,7 +143,7 @@ class NoticeSimpleSmallVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
override fun changeUiToCompleteClear() {
|
||||
super.changeUiToCompleteClear()
|
||||
Log.d(TAG,"changeUiToCompleteClear");
|
||||
Log.d(TAG, "changeUiToCompleteClear");
|
||||
|
||||
mBottomContainer?.visibility = View.INVISIBLE
|
||||
mProgressBar?.visibility = View.GONE
|
||||
@@ -158,7 +160,7 @@ class NoticeSimpleSmallVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
Log.d(TAG,"onDetachedFromWindow");
|
||||
Log.d(TAG, "onDetachedFromWindow");
|
||||
|
||||
mProgressBar?.progress = 0
|
||||
mFullPauseBitmap = null
|
||||
@@ -226,5 +228,16 @@ class NoticeSimpleSmallVideoPlayer : StandardGSYVideoPlayer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||
super.onSizeChanged(w, h, oldw, oldh)
|
||||
if (!mIfCurrentIsFullscreen) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
this.outlineProvider = TextureVideoViewOutlineProvider(40F)
|
||||
this.clipToOutline = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import androidx.annotation.RequiresApi;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 描述
|
||||
* @description
|
||||
* @since: 11/16/21
|
||||
*/
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@@ -23,12 +23,8 @@ public class TextureVideoViewOutlineProvider extends ViewOutlineProvider {
|
||||
|
||||
@Override
|
||||
public void getOutline(View view, Outline outline) {
|
||||
Rect rect = new Rect();
|
||||
view.getGlobalVisibleRect(rect);
|
||||
int leftMargin = 0;
|
||||
int topMargin = 0;
|
||||
Rect selfRect = new Rect(leftMargin, topMargin,
|
||||
rect.right - rect.left - leftMargin, rect.bottom - rect.top - topMargin);
|
||||
Rect selfRect = new Rect(0, 0,
|
||||
view.getMeasuredWidth(), view.getMeasuredHeight());
|
||||
outline.setRoundRect(selfRect, mRadius);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="@dimen/notice_play_marginleft_small"
|
||||
android:layout_marginRight="@dimen/notice_play_marginright_small"
|
||||
|
||||
android:layout_marginBottom="@dimen/notice_play_bottom"
|
||||
android:src="@drawable/notice_video_pause" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user