Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hadalive
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
yichen
hadalive
Commits
a486eef2
Commit
a486eef2
authored
May 16, 2022
by
Dell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、增加请求头
2、调整新闻列表热度 3、更换底图 4、更换推荐文字
parent
b30ddf09
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
91 additions
and
28 deletions
+91
-28
build.gradle
app/build.gradle
+45
-14
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+4
-0
LoggingInterceptor.java
...n/java/com/hupu/tv/player/app/api/LoggingInterceptor.java
+2
-0
Constants.kt
app/src/main/java/com/hupu/tv/player/app/app/Constants.kt
+3
-0
LiveItemAdapter.kt
...java/com/hupu/tv/player/app/ui/adapter/LiveItemAdapter.kt
+3
-4
ProductFlavors.kt
.../main/java/com/hupu/tv/player/app/utils/ProductFlavors.kt
+4
-0
shape_live_recommend.xml
app/src/main/res/drawable/shape_live_recommend.xml
+8
-0
item_match_normal_live.xml
app/src/main/res/layout/item_match_normal_live.xml
+10
-5
item_news.xml
app/src/main/res/layout/item_news.xml
+12
-5
bg_live_anchor.png
app/src/main/res/mipmap-xxhdpi/bg_live_anchor.png
+0
-0
No files found.
app/build.gradle
View file @
a486eef2
...
@@ -42,23 +42,56 @@ android {
...
@@ -42,23 +42,56 @@ android {
}
}
flavorDimensions
"version"
flavorDimensions
"version"
productFlavors
{
productFlavors
{
productFlavors
{
qj_01
{
qj_01
{
manifestPlaceholders
=
[
UMENG_CHANNEL_VALUE:
"qj_01"
]
manifestPlaceholders
=
[
API_CHANNEL_ID
:
"0"
,
UMENG_CHANNEL_VALUE:
"qj_01"
]
}
}
qj_02
{
qj_02
{
manifestPlaceholders
=
[
UMENG_CHANNEL_VALUE:
"qj_02"
]
manifestPlaceholders
=
[
UMENG_CHANNEL_VALUE:
"qj_02"
]
}
}
qj_baidu
{
qj_baidu
{
manifestPlaceholders
=
[
UMENG_CHANNEL_VALUE:
"qj_baidu"
]
manifestPlaceholders
=
[
API_CHANNEL_ID
:
"3"
,
UMENG_CHANNEL_VALUE:
"qj_baidu"
]
}
qj_huawei_01
{
manifestPlaceholders
=
[
API_CHANNEL_ID
:
"4"
,
UMENG_CHANNEL_VALUE:
"qj_huawei_01"
]
}
qj_xiaomi_01
{
manifestPlaceholders
=
[
API_CHANNEL_ID
:
"6"
,
UMENG_CHANNEL_VALUE:
"qj_xiaomi_01"
]
}
}
qj_vivo_01
{
qj_vivo_01
{
manifestPlaceholders
=
[
UMENG_CHANNEL_VALUE:
"qj_vivo_01"
]
manifestPlaceholders
=
[
API_CHANNEL_ID
:
"7"
,
UMENG_CHANNEL_VALUE:
"qj_vivo_01"
]
}
}
qj_oppo_01
{
qj_oppo_01
{
manifestPlaceholders
=
[
UMENG_CHANNEL_VALUE:
"qj_oppo_01"
]
manifestPlaceholders
=
[
API_CHANNEL_ID
:
"8"
,
UMENG_CHANNEL_VALUE:
"qj_oppo_01"
]
}
qj_sanxing_01
{
manifestPlaceholders
=
[
API_CHANNEL_ID
:
"9"
,
UMENG_CHANNEL_VALUE:
"qj_sanxing_01"
]
}
}
qj_huawei_01
{
manifestPlaceholders
=
[
UMENG_CHANNEL_VALUE:
"qj_huawei_01"
]
}
}
}
}
...
@@ -107,7 +140,6 @@ android {
...
@@ -107,7 +140,6 @@ android {
}
}
lintOptions
{
lintOptions
{
checkReleaseBuilds
false
checkReleaseBuilds
false
abortOnError
false
abortOnError
false
...
@@ -124,9 +156,9 @@ android {
...
@@ -124,9 +156,9 @@ android {
// exclude 'support/monitor/mysql/webapp.sql'
// exclude 'support/monitor/mysql/webapp.sql'
// }
// }
}
}
dependencies
{
dependencies
{
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
//support
//support
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
'androidx.appcompat:appcompat:1.2.0'
...
@@ -175,7 +207,7 @@ dependencies {
...
@@ -175,7 +207,7 @@ dependencies {
annotationProcessor
'com.github.bumptech.glide:compiler:4.9.0'
annotationProcessor
'com.github.bumptech.glide:compiler:4.9.0'
implementation
'com.google.android:flexbox:1.0.0'
implementation
'com.google.android:flexbox:1.0.0'
implementation
(
"com.github.bumptech.glide:recyclerview-integration:4.8.0"
)
{
implementation
(
"com.github.bumptech.glide:recyclerview-integration:4.8.0"
)
{
// Excludes the support library because it's already included by Glide.
// Excludes the support library because it's already included by Glide.
transitive
=
false
transitive
=
false
}
}
...
@@ -212,8 +244,7 @@ dependencies {
...
@@ -212,8 +244,7 @@ dependencies {
implementation
'com.github.lihangleo2:ShadowLayout:3.2.4'
implementation
'com.github.lihangleo2:ShadowLayout:3.2.4'
}
}
repositories
{
repositories
{
mavenCentral
()
mavenCentral
()
}
}
app/src/main/AndroidManifest.xml
View file @
a486eef2
...
@@ -80,6 +80,10 @@
...
@@ -80,6 +80,10 @@
<meta-data
<meta-data
android:name=
"UMENG_CHANNEL"
android:name=
"UMENG_CHANNEL"
android:value=
"${UMENG_CHANNEL_VALUE}"
/>
android:value=
"${UMENG_CHANNEL_VALUE}"
/>
<meta-data
android:name=
"API_CHANNEL"
android:value=
"${API_CHANNEL_ID}"
/>
<!-- 声明SDK所需的service SDK核心功能-->
<!-- 声明SDK所需的service SDK核心功能-->
<service
<service
android:name=
"com.hyphenate.chat.EMChatService"
android:name=
"com.hyphenate.chat.EMChatService"
...
...
app/src/main/java/com/hupu/tv/player/app/api/LoggingInterceptor.java
View file @
a486eef2
package
com
.
hupu
.
tv
.
player
.
app
.
api
;
package
com
.
hupu
.
tv
.
player
.
app
.
api
;
import
com.hupu.tv.player.app.BuildConfig
;
import
com.hupu.tv.player.app.BuildConfig
;
import
com.hupu.tv.player.app.utils.ProductFlavors
;
import
com.softgarden.baselibrary.utils.SPUtil
;
import
com.softgarden.baselibrary.utils.SPUtil
;
import
com.hupu.tv.player.app.app.Constants
;
import
com.hupu.tv.player.app.app.Constants
;
...
@@ -148,6 +149,7 @@ public class LoggingInterceptor implements Interceptor {
...
@@ -148,6 +149,7 @@ public class LoggingInterceptor implements Interceptor {
Request
.
Builder
builder
=
request
.
newBuilder
();
Request
.
Builder
builder
=
request
.
newBuilder
();
builder
.
addHeader
(
Constants
.
DEVICE_ID
,
(
String
)
SPUtil
.
Companion
.
get
(
Constants
.
DEVICE_ID
,
""
));
builder
.
addHeader
(
Constants
.
DEVICE_ID
,
(
String
)
SPUtil
.
Companion
.
get
(
Constants
.
DEVICE_ID
,
""
));
builder
.
addHeader
(
Constants
.
TOKEN
,
(
String
)
SPUtil
.
Companion
.
get
(
Constants
.
TOKEN
,
""
));
builder
.
addHeader
(
Constants
.
TOKEN
,
(
String
)
SPUtil
.
Companion
.
get
(
Constants
.
TOKEN
,
""
));
builder
.
addHeader
(
Constants
.
API_CHANNEL
,
String
.
valueOf
(
ProductFlavors
.
INSTANCE
.
getAPIChannel
(
ProductFlavors
.
API_CHANNEL
)));
builder
.
header
(
"Connection"
,
"close"
).
header
(
"Accept-Encoding"
,
"identity"
);
builder
.
header
(
"Connection"
,
"close"
).
header
(
"Accept-Encoding"
,
"identity"
);
request
=
builder
.
build
();
request
=
builder
.
build
();
...
...
app/src/main/java/com/hupu/tv/player/app/app/Constants.kt
View file @
a486eef2
...
@@ -49,6 +49,9 @@ object Constants {
...
@@ -49,6 +49,9 @@ object Constants {
//token
//token
const
val
TOKEN
=
"token"
const
val
TOKEN
=
"token"
//API_CHANNEL
const
val
API_CHANNEL
=
"api-channel"
//分享码
//分享码
const
val
SHARE_CODE
=
"share_code"
const
val
SHARE_CODE
=
"share_code"
...
...
app/src/main/java/com/hupu/tv/player/app/ui/adapter/LiveItemAdapter.kt
View file @
a486eef2
...
@@ -7,7 +7,6 @@ import com.chad.library.adapter.base.BaseViewHolder
...
@@ -7,7 +7,6 @@ import com.chad.library.adapter.base.BaseViewHolder
import
com.hupu.tv.player.app.R
import
com.hupu.tv.player.app.R
import
com.hupu.tv.player.app.bean.LiveBean
import
com.hupu.tv.player.app.bean.LiveBean
import
com.hupu.tv.player.app.utils.GlideUtils
import
com.hupu.tv.player.app.utils.GlideUtils
import
com.softgarden.baselibrary.base.BaseFragment
/**
/**
* @author by Dell
* @author by Dell
...
@@ -18,12 +17,12 @@ class LiveItemAdapter :
...
@@ -18,12 +17,12 @@ class LiveItemAdapter :
BaseQuickAdapter
<
LiveBean
.
DataListBean
,
BaseViewHolder
>(
R
.
layout
.
item_match_normal_live
)
{
BaseQuickAdapter
<
LiveBean
.
DataListBean
,
BaseViewHolder
>(
R
.
layout
.
item_match_normal_live
)
{
override
fun
convert
(
helper
:
BaseViewHolder
,
item
:
LiveBean
.
DataListBean
)
{
override
fun
convert
(
helper
:
BaseViewHolder
,
item
:
LiveBean
.
DataListBean
)
{
val
ivLive
=
helper
.
getView
<
ImageView
>(
R
.
id
.
iv_live
)
val
ivLive
=
helper
.
getView
<
ImageView
>(
R
.
id
.
iv_live
)
val
ivRecommend
=
helper
.
getView
<
View
>(
R
.
id
.
i
v_recommend
)
val
tvRecommend
=
helper
.
getView
<
View
>(
R
.
id
.
t
v_recommend
)
GlideUtils
.
loadImageGif
(
helper
.
itemView
,
R
.
mipmap
.
icon_live_living_gif
,
ivLive
)
GlideUtils
.
loadImageGif
(
helper
.
itemView
,
R
.
mipmap
.
icon_live_living_gif
,
ivLive
)
if
(
item
.
recommend
==
1
)
{
if
(
item
.
recommend
==
1
)
{
i
vRecommend
.
visibility
=
View
.
VISIBLE
t
vRecommend
.
visibility
=
View
.
VISIBLE
}
else
{
}
else
{
i
vRecommend
.
visibility
=
View
.
GONE
t
vRecommend
.
visibility
=
View
.
GONE
}
}
if
(
item
.
roomStatus
==
1
)
{
if
(
item
.
roomStatus
==
1
)
{
ivLive
.
visibility
=
View
.
VISIBLE
ivLive
.
visibility
=
View
.
VISIBLE
...
...
app/src/main/java/com/hupu/tv/player/app/utils/ProductFlavors.kt
View file @
a486eef2
...
@@ -15,10 +15,14 @@ import com.hupu.tv.player.app.app.App
...
@@ -15,10 +15,14 @@ import com.hupu.tv.player.app.app.App
object
ProductFlavors
{
object
ProductFlavors
{
//这个常量值必须在 androidManifest配置后引用 productFlavors的才能用
//这个常量值必须在 androidManifest配置后引用 productFlavors的才能用
const
val
UM_CHANNEL_ID
=
"UMENG_CHANNEL"
const
val
UM_CHANNEL_ID
=
"UMENG_CHANNEL"
const
val
API_CHANNEL
=
"API_CHANNEL"
fun
getChannelId
(
data
:
String
):
String
{
fun
getChannelId
(
data
:
String
):
String
{
return
getMetaDataStr
(
data
)
return
getMetaDataStr
(
data
)
}
}
fun
getAPIChannel
(
data
:
String
):
Int
{
return
getMetaDataInt
(
data
)
}
private
fun
getMetaDataStr
(
key
:
String
?):
String
{
private
fun
getMetaDataStr
(
key
:
String
?):
String
{
return
getAppInfoBundle
()
?.
getString
(
key
).
orEmpty
()
return
getAppInfoBundle
()
?.
getString
(
key
).
orEmpty
()
...
...
app/src/main/res/drawable/shape_live_recommend.xml
0 → 100644
View file @
a486eef2
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"#2CA7F4"
/>
<corners
android:radius=
"@dimen/dp_2"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/item_match_normal_live.xml
View file @
a486eef2
...
@@ -39,14 +39,19 @@
...
@@ -39,14 +39,19 @@
android:layout_marginTop=
"@dimen/dp_5"
android:layout_marginTop=
"@dimen/dp_5"
android:src=
"@mipmap/icon_live_living_gif"
/>
android:src=
"@mipmap/icon_live_living_gif"
/>
<ImageView
<TextView
android:id=
"@+id/iv_recommend"
android:layout_alignParentEnd=
"true"
android:layout_width=
"38dp"
android:gravity=
"center"
android:textColor=
"@color/white"
android:text=
"荐"
android:textSize=
"10dp"
android:layout_marginEnd=
"@dimen/sp_10"
android:id=
"@+id/tv_recommend"
android:layout_width=
"18dp"
android:layout_height=
"@dimen/dp_15"
android:layout_height=
"@dimen/dp_15"
android:layout_marginStart=
"@dimen/dp_3"
android:layout_marginStart=
"@dimen/dp_3"
android:layout_marginTop=
"@dimen/dp_5"
android:layout_marginTop=
"@dimen/dp_5"
android:layout_toEndOf=
"@id/iv_live"
android:background=
"@drawable/shape_live_recommend"
/>
android:src=
"@mipmap/icon_live_recommend"
/>
</RelativeLayout>
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
...
...
app/src/main/res/layout/item_news.xml
View file @
a486eef2
...
@@ -34,10 +34,10 @@
...
@@ -34,10 +34,10 @@
tools:text=
"国足战马代取胜无忧,用轮换 阵容刷净胜球"
/>
tools:text=
"国足战马代取胜无忧,用轮换 阵容刷净胜球"
/>
<LinearLayout
<LinearLayout
android:layout_marginTop=
"@dimen/dp_12"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"
horizont
al"
>
android:orientation=
"
vertic
al"
>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recycler_label"
android:id=
"@+id/recycler_label"
...
@@ -47,12 +47,16 @@
...
@@ -47,12 +47,16 @@
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount=
"3"
tools:itemCount=
"3"
tools:listitem=
"@layout/item_news_label"
/>
tools:listitem=
"@layout/item_news_label"
/>
<LinearLayout
android:layout_marginTop=
"8dp"
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
<ImageView
android:id=
"@+id/iv_hot"
android:id=
"@+id/iv_hot"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginStart=
"@dimen/dp_8"
android:layout_marginStart=
"@dimen/dp_8"
android:src=
"@mipmap/icon_list_like"
/>
android:src=
"@mipmap/icon_list_like"
/>
...
@@ -67,12 +71,15 @@
...
@@ -67,12 +71,15 @@
tools:text=
"1"
/>
tools:text=
"1"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ImageView
<ImageView
android:id=
"@+id/iv_cover"
android:id=
"@+id/iv_cover"
android:layout_width=
"@dimen/dp_125"
android:layout_width=
"@dimen/dp_125"
android:layout_height=
"@dimen/dp_
75
"
android:layout_height=
"@dimen/dp_
90
"
android:layout_marginStart=
"@dimen/dp_17"
android:layout_marginStart=
"@dimen/dp_17"
android:scaleType=
"centerCrop"
/>
android:scaleType=
"centerCrop"
/>
...
...
app/src/main/res/mipmap-xxhdpi/bg_live_anchor.png
View replaced file @
b30ddf09
View file @
a486eef2
84.4 KB
|
W:
|
H:
16.2 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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