Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
a8b2a28e
Commit
a8b2a28e
authored
Nov 22, 2019
by
konghaorui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增电台播放页面 PlayerFloatView 点击监听
parent
4b2e2b1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
FMDetailActivity.java
m-fm/src/main/java/com/yidianling/fm/FMDetailActivity.java
+18
-1
PlayerFloatHelper.kt
ydl-media/src/main/java/com/ydl/media/view/PlayerFloatHelper.kt
+7
-1
No files found.
m-fm/src/main/java/com/yidianling/fm/FMDetailActivity.java
View file @
a8b2a28e
...
@@ -26,6 +26,7 @@ import com.ydl.media.audio.AudioPlayer;
...
@@ -26,6 +26,7 @@ import com.ydl.media.audio.AudioPlayer;
import
com.ydl.media.audio.OnPlayerEventListener
;
import
com.ydl.media.audio.OnPlayerEventListener
;
import
com.ydl.media.audio.model.Music
;
import
com.ydl.media.audio.model.Music
;
import
com.ydl.media.view.PlayerFloatHelper
;
import
com.ydl.media.view.PlayerFloatHelper
;
import
com.ydl.media.view.PlayerFloatView
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.transform.GlideCircleRingTransform
;
import
com.ydl.ydl_image.transform.GlideCircleRingTransform
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.ydl.ydlcommon.base.BaseActivity
;
...
@@ -222,11 +223,27 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
...
@@ -222,11 +223,27 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
iv_next
.
setOnClickListener
(
this
);
iv_next
.
setOnClickListener
(
this
);
iv_last
.
setOnClickListener
(
this
);
iv_last
.
setOnClickListener
(
this
);
iv_share
.
setOnClickListener
(
this
);
iv_share
.
setOnClickListener
(
this
);
initRefreshAnimate
();
initRefreshAnimate
();
init
();
init
();
initSurfaceView
();
initSurfaceView
();
initImg
();
initImg
();
PlayerFloatHelper
.
Companion
.
addClickListener
(
new
PlayerFloatView
.
FloatViewPlayListener
()
{
@Override
public
void
onPauseClick
()
{
iv_play
.
setImageResource
(
R
.
drawable
.
fm_play_2
);
fmSurfaceView
.
stopTimer
();
}
@Override
public
void
onStartClick
()
{
iv_play
.
setImageResource
(
R
.
drawable
.
fm_stop_2
);
fmSurfaceView
.
playTimer
();
}
@Override
public
void
onPlayFinish
()
{
}
});
}
}
@SuppressLint
(
"WrongConstant"
)
@SuppressLint
(
"WrongConstant"
)
...
...
ydl-media/src/main/java/com/ydl/media/view/PlayerFloatHelper.kt
View file @
a8b2a28e
...
@@ -6,6 +6,7 @@ import android.content.Intent
...
@@ -6,6 +6,7 @@ import android.content.Intent
import
android.graphics.PixelFormat
import
android.graphics.PixelFormat
import
android.graphics.Point
import
android.graphics.Point
import
android.os.Bundle
import
android.os.Bundle
import
android.support.v4.view.ViewCompat
import
android.text.TextUtils
import
android.text.TextUtils
import
android.view.Gravity
import
android.view.Gravity
import
android.view.View
import
android.view.View
...
@@ -141,7 +142,12 @@ class PlayerFloatHelper {
...
@@ -141,7 +142,12 @@ class PlayerFloatHelper {
private
fun
addFloatToWm
(
context
:
Context
)
{
private
fun
addFloatToWm
(
context
:
Context
)
{
if
(
wm
!=
null
&&
!
TextUtils
.
isEmpty
(
showingPageName
))
{
if
(
wm
!=
null
&&
!
TextUtils
.
isEmpty
(
showingPageName
))
{
wm
?.
removeViewImmediate
(
mPlayerFloatView
)
if
(
ViewCompat
.
isAttachedToWindow
(
mPlayerFloatView
)){
// if (context is Activity && !(context.isFinishing)){
// wm?.removeViewImmediate(mPlayerFloatView)
// }
wm
?.
removeViewImmediate
(
mPlayerFloatView
)
}
wm
=
null
wm
=
null
}
}
//获取WindowManager
//获取WindowManager
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment