Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
Project
Project
Details
Activity
Releases
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
android
android_vedio
Commits
8af9b83b
Commit
8af9b83b
authored
May 16, 2024
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化切换bug
parent
2d41b642
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
27 deletions
+23
-27
build.gradle
video/app/build.gradle
+1
-3
MovieFragment.kt
...ain/java/com/duben/shortplay/ui/fragment/MovieFragment.kt
+17
-14
UIUtils.java
.../app/src/main/java/com/duben/shortplay/utils/UIUtils.java
+5
-10
No files found.
video/app/build.gradle
View file @
8af9b83b
...
@@ -115,9 +115,7 @@ android {
...
@@ -115,9 +115,7 @@ android {
vivo
{}
vivo
{}
baidu
{}
baidu
{}
oppo
{}
oppo
{}
huawei
{}
yingyongbao
{}
xiaomi
{}
store360
{}
}
}
productFlavors
.
all
{
productFlavors
.
all
{
...
...
video/app/src/main/java/com/duben/shortplay/ui/fragment/MovieFragment.kt
View file @
8af9b83b
...
@@ -121,14 +121,14 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
...
@@ -121,14 +121,14 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
hotStyleAdapter
.
animationEnable
=
false
hotStyleAdapter
.
animationEnable
=
false
rv_pic_list
.
adapter
=
hotStyleAdapter
rv_pic_list
.
adapter
=
hotStyleAdapter
val
emptyView
=
val
emptyView
=
LayoutInflater
.
from
(
requireContext
()).
inflate
(
R
.
layout
.
item_empty_data
,
null
)
LayoutInflater
.
from
(
requireContext
()).
inflate
(
R
.
layout
.
item_empty_data
,
null
)
hotStyleAdapter
.
setEmptyView
(
emptyView
)
hotStyleAdapter
.
setEmptyView
(
emptyView
)
hotStyleAdapter
.
setOnCustomChildClickListener
(
object
:
hotStyleAdapter
.
setOnCustomChildClickListener
(
object
:
NewHotStyleAdapter
.
OnCustomChildClickListener
{
NewHotStyleAdapter
.
OnCustomChildClickListener
{
override
fun
onCustomChildClick
(
view
:
View
,
vedioBean
:
VedioBean
)
{
override
fun
onCustomChildClick
(
view
:
View
,
vedioBean
:
VedioBean
)
{
LocalVedioManager
.
startVedioDetailActivityForType
(
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
requireActivity
(),
vedioBean
vedioBean
)
)
}
}
})
})
...
@@ -169,19 +169,22 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
...
@@ -169,19 +169,22 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
var
insertIndex
=
3
var
insertIndex
=
3
val
allData
=
hotStyleAdapter
.
data
val
allData
=
hotStyleAdapter
.
data
for
(
i
in
allData
.
size
-
1
downTo
0
)
{
if
(
allData
!=
null
&&
allData
.
size
>
0
)
{
if
(
allData
[
i
].
itemType
==
MULTI_ITEM_3
)
{
for
(
i
in
allData
.
size
-
1
downTo
0
)
{
insertIndex
+=
4
if
(
allData
[
i
].
itemType
==
MULTI_ITEM_3
)
{
insertIndex
+=
4
}
}
}
}
if
(
insertIndex
>=
allData
.
size
)
{
if
(
insertIndex
>=
allData
.
size
)
{
insertIndex
=
allData
.
size
insertIndex
=
allData
.
size
}
}
if
(
allData
[
allData
.
lastIndex
].
itemType
==
MULTI_ITEM_3
)
return
if
(
allData
[
allData
.
lastIndex
].
itemType
==
MULTI_ITEM_3
)
return
val
data
=
VideoMultiItemEntity3
(
MULTI_ITEM_3
,
null
,
adView
)
hotStyleAdapter
.
addData
(
insertIndex
,
data
)
}
val
data
=
VideoMultiItemEntity3
(
MULTI_ITEM_3
,
null
,
adView
)
hotStyleAdapter
.
addData
(
insertIndex
,
data
)
}
}
override
fun
onDestroyView
()
{
override
fun
onDestroyView
()
{
...
...
video/app/src/main/java/com/duben/shortplay/utils/UIUtils.java
View file @
8af9b83b
...
@@ -28,8 +28,7 @@ public class UIUtils {
...
@@ -28,8 +28,7 @@ public class UIUtils {
DisplayMetrics
dm
=
context
.
getResources
().
getDisplayMetrics
();
DisplayMetrics
dm
=
context
.
getResources
().
getDisplayMetrics
();
return
dm
.
widthPixels
;
return
dm
.
widthPixels
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
DisplayMetrics
dm
=
ForegroundOrBackground
.
getTopActivity
().
getResources
().
getDisplayMetrics
();
return
0
;
return
dm
.
widthPixels
;
}
}
}
}
...
@@ -39,8 +38,7 @@ public class UIUtils {
...
@@ -39,8 +38,7 @@ public class UIUtils {
DisplayMetrics
dm
=
context
.
getResources
().
getDisplayMetrics
();
DisplayMetrics
dm
=
context
.
getResources
().
getDisplayMetrics
();
return
dm
.
heightPixels
;
return
dm
.
heightPixels
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
DisplayMetrics
dm
=
ForegroundOrBackground
.
getTopActivity
().
getResources
().
getDisplayMetrics
();
return
0
;
return
dm
.
heightPixels
;
}
}
}
}
...
@@ -60,8 +58,7 @@ public class UIUtils {
...
@@ -60,8 +58,7 @@ public class UIUtils {
final
float
scale
=
context
.
getResources
().
getDisplayMetrics
().
density
;
final
float
scale
=
context
.
getResources
().
getDisplayMetrics
().
density
;
return
(
int
)
(
dpValue
*
scale
+
0.5f
);
return
(
int
)
(
dpValue
*
scale
+
0.5f
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
final
float
scale
=
ForegroundOrBackground
.
getTopActivity
().
getResources
().
getDisplayMetrics
().
density
;
return
0
;
return
(
int
)
(
dpValue
*
scale
+
0.5f
);
}
}
}
}
...
@@ -293,8 +290,7 @@ public class UIUtils {
...
@@ -293,8 +290,7 @@ public class UIUtils {
final
float
scale
=
context
.
getResources
().
getDisplayMetrics
().
density
;
final
float
scale
=
context
.
getResources
().
getDisplayMetrics
().
density
;
return
(
int
)
(
pxValue
/
(
scale
<=
0
?
1
:
scale
)
+
0.5f
);
return
(
int
)
(
pxValue
/
(
scale
<=
0
?
1
:
scale
)
+
0.5f
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
final
float
scale
=
ForegroundOrBackground
.
getTopActivity
().
getResources
().
getDisplayMetrics
().
density
;
return
0
;
return
(
int
)
(
pxValue
/
(
scale
<=
0
?
1
:
scale
)
+
0.5f
);
}
}
}
}
...
@@ -304,8 +300,7 @@ public class UIUtils {
...
@@ -304,8 +300,7 @@ public class UIUtils {
final
float
scale
=
context
.
getResources
().
getDisplayMetrics
().
density
;
final
float
scale
=
context
.
getResources
().
getDisplayMetrics
().
density
;
return
(
int
)
(
dp
*
scale
+
0.5f
);
return
(
int
)
(
dp
*
scale
+
0.5f
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
final
float
scale
=
ForegroundOrBackground
.
getTopActivity
().
getResources
().
getDisplayMetrics
().
density
;
return
0
;
return
(
int
)
(
dp
*
scale
+
0.5f
);
}
}
}
}
...
...
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