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
fdcdb8bf
Commit
fdcdb8bf
authored
Jul 06, 2022
by
fengquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 咨询详情页视频播放
parent
cce84b56
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
180 additions
and
7 deletions
+180
-7
BasePhotoFragment.java
m-consultant/src/main/java/com/yidianling/consultant/preview/BasePhotoFragment.java
+0
-0
GPreviewActivity.java
m-consultant/src/main/java/com/yidianling/consultant/preview/GPreviewActivity.java
+5
-1
GridPreviewActivity.java
m-consultant/src/main/java/com/yidianling/consultant/preview/GridPreviewActivity.java
+1
-1
SmoothImageView.java
m-consultant/src/main/java/com/yidianling/consultant/preview/SmoothImageView.java
+13
-0
TestImageLoader.java
m-consultant/src/main/java/com/yidianling/consultant/preview/TestImageLoader.java
+5
-0
ic_video_play.png
m-consultant/src/main/res/drawable-xxxhdpi/ic_video_play.png
+0
-0
consultant_back.png
m-consultant/src/main/res/drawable/consultant_back.png
+0
-0
consultant_bg_loading.xml
m-consultant/src/main/res/drawable/consultant_bg_loading.xml
+8
-0
consultant_seekbar_style.xml
m-consultant/src/main/res/drawable/consultant_seekbar_style.xml
+56
-0
consultant_seekbar_thumb.xml
m-consultant/src/main/res/drawable/consultant_seekbar_thumb.xml
+19
-0
consultant_image_preview_photo.xml
m-consultant/src/main/res/layout/consultant_image_preview_photo.xml
+1
-0
fragment_image_photo_layout.xml
m-consultant/src/main/res/layout/fragment_image_photo_layout.xml
+72
-5
No files found.
m-consultant/src/main/java/com/yidianling/consultant/preview/BasePhotoFragment.java
View file @
fdcdb8bf
This diff is collapsed.
Click to expand it.
m-consultant/src/main/java/com/yidianling/consultant/preview/GPreviewActivity.java
View file @
fdcdb8bf
...
...
@@ -2,6 +2,7 @@ package com.yidianling.consultant.preview;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.fragment.app.Fragment
;
...
...
@@ -49,7 +50,6 @@ public class GPreviewActivity extends AppCompatActivity {
viewPager
.
setAdapter
(
adapter
);
viewPager
.
setCurrentItem
(
currentIndex
);
// viewPager.setOffscreenPageLimit(3);
viewPager
.
setOffscreenPageLimit
(
0
);
}
private
void
initData
()
{
...
...
@@ -126,6 +126,7 @@ public class GPreviewActivity extends AppCompatActivity {
isTransformOut
=
true
;
int
currentItem
=
viewPager
.
getCurrentItem
();
if
(
currentItem
<
imgUrls
.
size
())
{
if
(
TextUtils
.
isEmpty
(
imgUrls
.
get
(
currentItem
).
getVideoUrl
())){
BasePhotoFragment
fragment
=
fragments
.
get
(
currentItem
);
fragment
.
changeBg
(
Color
.
TRANSPARENT
);
fragment
.
transformOut
(
new
SmoothImageView
.
onTransformListener
()
{
...
...
@@ -135,6 +136,9 @@ public class GPreviewActivity extends AppCompatActivity {
exit
();
}
});
}
else
{
exit
();
}
}
else
{
exit
();
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/preview/GridPreviewActivity.java
View file @
fdcdb8bf
...
...
@@ -70,7 +70,7 @@ public class GridPreviewActivity extends BaseActivity {
mThumbViewInfoList
.
add
(
new
UserViewInfo
(
urls
.
get
(
i
)));
}
mThumbViewInfoList
.
add
(
4
,
new
UserViewInfo
(
"https://pic.ydlcdn.com/
Qkkb6HmQiM.mp
4"
,
null
));
mThumbViewInfoList
.
add
(
4
,
new
UserViewInfo
(
"https://pic.ydlcdn.com/
GGyHyDwKJ8.MP
4"
,
null
));
adapter
=
new
MyListAdapter
();
gridView
.
setAdapter
(
adapter
);
gridView
.
setOnItemClickListener
(
new
AdapterView
.
OnItemClickListener
()
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/preview/SmoothImageView.java
View file @
fdcdb8bf
...
...
@@ -54,6 +54,7 @@ public class SmoothImageView extends PhotoView {
private
float
MAX_TRANS_SCALE
=
0.2f
;
private
boolean
isMaskPoint
=
false
;
private
View
btnLL
;
private
View
backIv
;
@Override
protected
void
onDetachedFromWindow
()
{
...
...
@@ -62,6 +63,7 @@ public class SmoothImageView extends PhotoView {
bitmapHeight
=
0
;
thumbRect
=
null
;
btnLL
=
null
;
backIv
=
null
;
ISFUll
=
false
;
if
(
animator
!=
null
)
{
animator
.
cancel
();
...
...
@@ -190,6 +192,9 @@ public class SmoothImageView extends PhotoView {
if
(
btnLL
!=
null
&&
btnLL
.
getVisibility
()
==
View
.
VISIBLE
)
{
btnLL
.
setVisibility
(
INVISIBLE
);
}
if
(
backIv
!=
null
&&
backIv
.
getVisibility
()
==
View
.
VISIBLE
)
{
backIv
.
setVisibility
(
INVISIBLE
);
}
if
(
alphaChangeListener
!=
null
)
{
alphaChangeListener
.
onAlphaChange
(
alpha
);
}
...
...
@@ -207,6 +212,10 @@ public class SmoothImageView extends PhotoView {
if
(
btnLL
!=
null
&&
btnLL
.
getVisibility
()
!=
View
.
VISIBLE
)
{
btnLL
.
setVisibility
(
VISIBLE
);
}
if
(
backIv
!=
null
&&
backIv
.
getVisibility
()
!=
View
.
VISIBLE
)
{
backIv
.
setVisibility
(
VISIBLE
);
}
}
else
{
changeTransform
();
setTag
(
R
.
id
.
consultant_item_image_key
,
true
);
...
...
@@ -484,6 +493,10 @@ public class SmoothImageView extends PhotoView {
this
.
btnLL
=
view
;
}
public
void
setBackIv
(
View
view
){
this
.
backIv
=
view
;
}
private
void
initTransform
()
{
if
(
getDrawable
()
==
null
)
{
return
;
...
...
m-consultant/src/main/java/com/yidianling/consultant/preview/TestImageLoader.java
View file @
fdcdb8bf
...
...
@@ -31,6 +31,11 @@ public class TestImageLoader implements IZoomMediaLoader {
simpleTarget
.
onResourceReady
();
imageView
.
setImageBitmap
(
resource
);
}
@Override
public
void
onLoadFailed
(
@Nullable
@org
.
jetbrains
.
annotations
.
Nullable
Drawable
errorDrawable
)
{
simpleTarget
.
onLoadFailed
(
errorDrawable
);
}
});
}
...
...
m-consultant/src/main/res/drawable-xxxhdpi/ic_video_play.png
0 → 100644
View file @
fdcdb8bf
3.61 KB
m-consultant/src/main/res/drawable/consultant_back.png
0 → 100644
View file @
fdcdb8bf
2.22 KB
m-consultant/src/main/res/drawable/consultant_bg_loading.xml
0 → 100644
View file @
fdcdb8bf
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"@dimen/platform_dp_8"
/>
<solid
android:color=
"#40000000"
/>
</shape>
\ No newline at end of file
m-consultant/src/main/res/drawable/consultant_seekbar_style.xml
0 → 100644
View file @
fdcdb8bf
<?xml version="1.0" encoding="UTF-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:id=
"@android:id/background"
>
<selector>
<item
android:state_pressed=
"true"
>
<shape>
<corners
android:radius=
"4dp"
/>
<solid
android:color=
"#59FFFFFF"
/>
<stroke
android:width=
"1dp"
android:color=
"@color/transparent"
/>
</shape>
</item>
<item>
<shape>
<corners
android:radius=
"4dp"
/>
<solid
android:color=
"#59FFFFFF"
/>
<stroke
android:width=
"5dp"
android:color=
"@color/transparent"
/>
</shape>
</item>
</selector>
</item>
<item
android:id=
"@android:id/secondaryProgress"
>
<clip>
<shape>
<corners
android:radius=
"4dp"
/>
<solid
android:color=
"@color/white"
/>
</shape>
</clip>
</item>
<item
android:id=
"@android:id/progress"
>
<selector>
<item
android:state_pressed=
"true"
>
<clip>
<shape>
<corners
android:radius=
"4dp"
/>
<solid
android:color=
"@color/white"
/>
<stroke
android:width=
"1dp"
android:color=
"@color/transparent"
/>
</shape>
</clip>
</item>
<item>
<clip>
<shape>
<corners
android:radius=
"4dp"
/>
<solid
android:color=
"@color/white"
/>
<stroke
android:width=
"5dp"
android:color=
"@color/transparent"
/>
</shape>
</clip>
</item>
</selector>
</item>
</layer-list>
\ No newline at end of file
m-consultant/src/main/res/drawable/consultant_seekbar_thumb.xml
0 → 100644
View file @
fdcdb8bf
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:state_pressed=
"true"
>
<shape
android:shape=
"rectangle"
>
<solid
android:color=
"@color/white"
/>
<size
android:width=
"6dp"
android:height=
"8dp"
/>
<corners
android:radius=
"2dp"
/>
</shape>
</item>
<item
android:state_pressed=
"false"
>
<shape
android:shape=
"oval"
>
<solid
android:color=
"@color/white"
/>
<size
android:width=
"8dp"
android:height=
"8dp"
/>
<stroke
android:width=
"2dp"
android:color=
"@color/transparent"
/>
</shape>
</item>
</selector>
\ No newline at end of file
m-consultant/src/main/res/layout/consultant_image_preview_photo.xml
View file @
fdcdb8bf
...
...
@@ -9,4 +9,5 @@
android:id=
"@+id/viewPager"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</FrameLayout>
m-consultant/src/main/res/layout/fragment_image_photo_layout.xml
View file @
fdcdb8bf
...
...
@@ -24,11 +24,44 @@
android:id=
"@+id/videoView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_centerInParent=
"true"
/>
android:focusableInTouchMode=
"true"
android:layout_centerInParent=
"true"
/>
<ImageView
android:id=
"@+id/ivImage"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<ImageView
android:id=
"@+id/ivPlay"
android:layout_width=
"76dp"
android:layout_height=
"76dp"
android:layout_centerInParent=
"true"
android:src=
"@drawable/ic_video_play"
android:visibility=
"gone"
/>
</RelativeLayout>
<SeekBar
android:id=
"@+id/seekbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginBottom=
"120dp"
android:maxHeight=
"10dp"
android:paddingStart=
"0dp"
android:paddingTop=
"8dp"
android:paddingEnd=
"0dp"
android:paddingBottom=
"8dp"
android:visibility=
"gone"
android:progressDrawable=
"@drawable/consultant_seekbar_style"
android:splitTrack=
"false"
android:thumb=
"@drawable/consultant_seekbar_thumb"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
<LinearLayout
android:id=
"@+id/btnLL"
...
...
@@ -55,13 +88,32 @@
</LinearLayout>
<
ProgressBar
<
LinearLayout
android:id=
"@+id/loading"
style=
"@android:style/Widget.DeviceDefault.Light.ProgressBar"
android:layout_width=
"103dp"
android:layout_height=
"103dp"
android:layout_centerInParent=
"true"
android:background=
"@drawable/consultant_bg_loading"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ProgressBar
style=
"?android:attr/progressBarStyleSmall"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_centerInParent=
"true"
android:visibility=
"visible"
/>
android:layout_gravity=
"center"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_10"
android:text=
"正在加载"
android:textColor=
"@color/white"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/btnVideo"
...
...
@@ -70,4 +122,18 @@
android:layout_centerInParent=
"true"
android:alpha=
"0"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/ivBack"
android:layout_width=
"36dp"
android:layout_height=
"36dp"
android:layout_marginLeft=
"12dp"
android:layout_marginTop=
"24dp"
android:padding=
"4dp"
android:scaleType=
"fitXY"
android:src=
"@drawable/consultant_back"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</RelativeLayout>
\ No newline at end of file
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