Commit 61841ef1 authored by jyx's avatar jyx

代码优化

parent 2e7a1f24
...@@ -48,10 +48,11 @@ class JzvdStdTikTok : JzvdStd { ...@@ -48,10 +48,11 @@ class JzvdStdTikTok : JzvdStd {
progressBar.layoutParams = layoutParams2 progressBar.layoutParams = layoutParams2
progressBar.setPadding(0, 0, 0, 0) progressBar.setPadding(0, 0, 0, 0)
val layoutParams3 = startButton.layoutParams as LinearLayout.LayoutParams // val startLayout = findViewById<LinearLayout>(cn.jzvd.R.id.start_layout)
layoutParams3.width = UIUtils.dip2px(context, 100f) // startButton.scaleX = 1.5f
layoutParams3.height = UIUtils.dip2px(context, 100f) // startButton.scaleY = 1.5f
startButton.layoutParams = layoutParams3 // startLayout.scaleX = 1.5f
// startLayout.scaleY = 1.5f
} }
override fun setUp( override fun setUp(
......
package com.mints.wisdomclean.video
import android.content.Context
import android.util.AttributeSet
import cn.jzvd.JzvdStd
import com.mints.wisdomclean.R
class MyJzvdStd : JzvdStd {
constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(
context,
attrs
)
override fun getLayoutId() = R.layout.layout_my_video
}
\ No newline at end of file
...@@ -370,15 +370,15 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView, ...@@ -370,15 +370,15 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private fun showVipCountDialog(position: Int) { private fun showVipCountDialog(position: Int) {
if (isFinishing) return if (isFinishing) return
if (position == 0 || mVedioBean!!.tipMaxIndex == 0 || mVedioBean!!.tipMaxIndex - 1 < position) {
autoPlayVideo() autoPlayVideo()
if (position == 0 || mVedioBean!!.tipMaxIndex == 0 || mVedioBean!!.tipMaxIndex - 1 < position) {
return return
} }
VipCountDialog(this, mVedioBean!!) VipCountDialog(this, mVedioBean!!)
.setOnDialogDismiss(object : VipCountDialog.OnDialogDismiss { .setOnDialogDismiss(object : VipCountDialog.OnDialogDismiss {
override fun onDialogDismiss() { override fun onDialogDismiss() {
autoPlayVideo()
} }
}) })
.show() .show()
...@@ -386,7 +386,6 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView, ...@@ -386,7 +386,6 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
} }
override fun finish() { override fun finish() {
Jzvd.releaseAllVideos() Jzvd.releaseAllVideos()
super.finish() super.finish()
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<FrameLayout
android:id="@+id/surface_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
<ProgressBar
android:id="@+id/bottom_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="1.5dp"
android:layout_alignParentBottom="true"
android:max="100"
android:progressDrawable="@drawable/player_ag_bottom_progress" />
<ProgressBar
android:id="@+id/loading"
android:layout_width="@dimen/jz_start_button_w_h_normal"
android:layout_height="@dimen/jz_start_button_w_h_normal"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateDrawable="@drawable/jz_loading"
android:visibility="invisible" />
<LinearLayout
android:id="@+id/start_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical">
<ImageView
android:id="@+id/start"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/jz_click_play_selector" />
</LinearLayout>
<LinearLayout
android:id="@+id/retry_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:gravity="center_horizontal"
android:orientation="vertical"
android:visibility="invisible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/video_loading_failed"
android:textColor="@android:color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/retry_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@drawable/jz_retry"
android:paddingLeft="9dp"
android:paddingTop="4dp"
android:paddingRight="9dp"
android:paddingBottom="4dp"
android:text="@string/click_to_restart"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment