Commit a486eef2 by Dell

1、增加请求头

2、调整新闻列表热度
3、更换底图
4、更换推荐文字
parent b30ddf09
......@@ -42,80 +42,112 @@ android {
}
flavorDimensions "version"
productFlavors {
qj_01 {
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qj_01"]
}
qj_02 {
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qj_02"]
}
qj_baidu {
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qj_baidu"]
}
qj_vivo_01 {
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qj_vivo_01"]
}
qj_oppo_01 {
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qj_oppo_01"]
}
qj_huawei_01 {
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qj_huawei_01"]
productFlavors {
qj_01 {
manifestPlaceholders = [
API_CHANNEL_ID : "0",
UMENG_CHANNEL_VALUE: "qj_01"
]
}
qj_02 {
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qj_02"]
}
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 {
manifestPlaceholders = [
API_CHANNEL_ID : "7",
UMENG_CHANNEL_VALUE: "qj_vivo_01"
]
}
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"
]
}
}
}
// AS3.0 自定义APK安装包名
applicationVariants.all { variant ->
variant.outputs.all {
// AS3.0 自定义APK安装包名
applicationVariants.all { variant ->
variant.outputs.all {
// outputFileName = "A_v${variant.versionName}_${variant.buildType.name}_id_0_250.apk"
outputFileName = "qjLive_v${variant.versionName}_${variant.buildType.name}_${variant.productFlavors[0].name}_${releaseTime()}.apk"
outputFileName = "qjLive_v${variant.versionName}_${variant.buildType.name}_${variant.productFlavors[0].name}_${releaseTime()}.apk"
}
}
}
signingConfigs {
release {
storeFile file(rootProject.ext.keystorePath)
storePassword rootProject.ext.keystorePassword
keyAlias rootProject.ext.alias
keyPassword rootProject.ext.aliasPassword
signingConfigs {
release {
storeFile file(rootProject.ext.keystorePath)
storePassword rootProject.ext.keystorePassword
keyAlias rootProject.ext.alias
keyPassword rootProject.ext.aliasPassword
}
}
}
buildTypes {
debug {
buildConfigField 'int', 'CHANNEL_ID', '0'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
release {
//Zipalign开关
zipAlignEnabled true
//清理开关
shrinkResources true
//CHANNEL_ID
buildConfigField 'int', 'CHANNEL_ID', '0'
//混淆
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
buildTypes {
debug {
buildConfigField 'int', 'CHANNEL_ID', '0'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
release {
//Zipalign开关
zipAlignEnabled true
//清理开关
shrinkResources true
//CHANNEL_ID
buildConfigField 'int', 'CHANNEL_ID', '0'
//混淆
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
dataBinding {
enabled = true
}
dataBinding {
enabled = true
}
// packagingOptions{
// exclude 'META-INF/shark-log.kotlin_module'
// exclude 'support/http/resources/js/lang.js'
......@@ -124,41 +156,41 @@ android {
// exclude 'support/monitor/mysql/webapp.sql'
// }
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//support
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
api project(':FlycoTabLayout_Lib')
api project(':baselibrary')
api project(':indexlib')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'jp.wasabeef:glide-transformations:4.0.1'
implementation 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
implementation 'com.android.support:multidex:1.0.3'
//七牛
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//support
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
api project(':FlycoTabLayout_Lib')
api project(':baselibrary')
api project(':indexlib')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'jp.wasabeef:glide-transformations:4.0.1'
implementation 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
implementation 'com.android.support:multidex:1.0.3'
//七牛
// implementation files('src\\lib\\pldroid-player-2.1.9.jar')
implementation files('src\\lib\\core-3.3.0.jar')
implementation files('src\\lib\\core-3.3.0.jar')
implementation library.flexbox
implementation 'com.github.yhaolpz:FloatWindow:1.0.9'
implementation library.flexbox
implementation 'com.github.yhaolpz:FloatWindow:1.0.9'
//XUpdate
implementation 'com.github.xuexiangjys:XUpdate:1.1.6'
implementation 'com.zhy:okhttputils:2.6.2'
//gsy
implementation 'com.shuyu:gsyVideoPlayer-java:8.1.2'
//exo2
implementation 'com.shuyu:GSYVideoPlayer-exo2:8.1.2'
implementation 'com.shuyu:gsyVideoPlayer-armv7a:8.1.2'
implementation 'com.shuyu:gsyVideoPlayer-arm64:8.1.2'
//XUpdate
implementation 'com.github.xuexiangjys:XUpdate:1.1.6'
implementation 'com.zhy:okhttputils:2.6.2'
//gsy
implementation 'com.shuyu:gsyVideoPlayer-java:8.1.2'
//exo2
implementation 'com.shuyu:GSYVideoPlayer-exo2:8.1.2'
implementation 'com.shuyu:gsyVideoPlayer-armv7a:8.1.2'
implementation 'com.shuyu:gsyVideoPlayer-arm64:8.1.2'
// implementation 'com.github.ctiao:DanmakuFlameMaster:0.9.25'
// implementation 'com.github.ctiao:ndkbitmap-armv7a:0.9.21'
......@@ -166,54 +198,53 @@ dependencies {
// implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer:v8.1.3-jitpack'
//m3u8download
implementation 'com.arialyy.aria:core:3.8.10'
kapt 'com.arialyy.aria:compiler:3.8.10'
implementation 'com.arialyy.aria:m3u8Component:3.8.10'
//glide
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.google.android:flexbox:1.0.0'
implementation ("com.github.bumptech.glide:recyclerview-integration:4.8.0") {
// Excludes the support library because it's already included by Glide.
transitive = false
}
//im
api 'com.hyphenate:hyphenate-chat:3.8.0'
api 'com.hyphenate:ease-im-kit:3.8.0'
//m3u8download
implementation 'com.arialyy.aria:core:3.8.10'
kapt 'com.arialyy.aria:compiler:3.8.10'
implementation 'com.arialyy.aria:m3u8Component:3.8.10'
//glide
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.google.android:flexbox:1.0.0'
implementation("com.github.bumptech.glide:recyclerview-integration:4.8.0") {
// Excludes the support library because it's already included by Glide.
transitive = false
}
//im
api 'com.hyphenate:hyphenate-chat:3.8.0'
api 'com.hyphenate:ease-im-kit:3.8.0'
implementation 'com.blankj:utilcode:1.30.6'
implementation 'com.blankj:utilcode:1.30.6'
//SwitchButton
implementation 'com.kyleduo.switchbutton:library:2.0.3'
implementation 'com.github.pinguo-zhouwei:CustomPopwindow:2.1.1'
//SwitchButton
implementation 'com.kyleduo.switchbutton:library:2.0.3'
implementation 'com.github.pinguo-zhouwei:CustomPopwindow:2.1.1'
//友盟
// 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
implementation "com.umeng.umsdk:common:9.4.4" //必选
implementation "com.umeng.umsdk:asms:1.4.1" // asms包依赖(必选)
//友盟
// 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
implementation "com.umeng.umsdk:common:9.4.4" //必选
implementation "com.umeng.umsdk:asms:1.4.1" // asms包依赖(必选)
// 下面各SDK根据宿主App是否使用相关业务按需引入。
implementation "com.umeng.umsdk:abtest:1.0.0" // ABTest功能依赖(可选) 友盟统计
implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3' //核心必须依赖
implementation 'com.scwang.smart:refresh-header-classics:2.0.3' //经典刷新头
//图片选择器
implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
//防连点
implementation 'cc.taylorzhang:single-click:1.1.0'
//Banner
implementation 'com.github.zhpanvip:bannerviewpager:3.5.4'
implementation "com.umeng.umsdk:abtest:1.0.0" // ABTest功能依赖(可选) 友盟统计
implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3' //核心必须依赖
implementation 'com.scwang.smart:refresh-header-classics:2.0.3' //经典刷新头
//图片选择器
implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
//防连点
implementation 'cc.taylorzhang:single-click:1.1.0'
//Banner
implementation 'com.github.zhpanvip:bannerviewpager:3.5.4'
// implementation 'com.jaeger.statusbarutil:library:1.5.1'
implementation 'com.kuaishou:akdanmaku:1.0.3'
implementation 'com.kuaishou:akdanmaku:1.0.3'
implementation 'com.github.lihangleo2:ShadowLayout:3.2.4'
implementation 'com.github.lihangleo2:ShadowLayout:3.2.4'
}
repositories {
mavenCentral()
}
}
repositories {
mavenCentral()
}
......@@ -80,6 +80,10 @@
<meta-data
android:name="UMENG_CHANNEL"
android:value="${UMENG_CHANNEL_VALUE}" />
<meta-data
android:name="API_CHANNEL"
android:value="${API_CHANNEL_ID}" />
<!-- 声明SDK所需的service SDK核心功能-->
<service
android:name="com.hyphenate.chat.EMChatService"
......
package com.hupu.tv.player.app.api;
import com.hupu.tv.player.app.BuildConfig;
import com.hupu.tv.player.app.utils.ProductFlavors;
import com.softgarden.baselibrary.utils.SPUtil;
import com.hupu.tv.player.app.app.Constants;
......@@ -148,6 +149,7 @@ public class LoggingInterceptor implements Interceptor {
Request.Builder builder = request.newBuilder();
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.API_CHANNEL, String.valueOf( ProductFlavors.INSTANCE.getAPIChannel(ProductFlavors.API_CHANNEL)));
builder.header("Connection","close").header("Accept-Encoding", "identity");
request = builder.build();
......
......@@ -49,6 +49,9 @@ object Constants {
//token
const val TOKEN = "token"
//API_CHANNEL
const val API_CHANNEL = "api-channel"
//分享码
const val SHARE_CODE = "share_code"
......
......@@ -7,7 +7,6 @@ import com.chad.library.adapter.base.BaseViewHolder
import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.bean.LiveBean
import com.hupu.tv.player.app.utils.GlideUtils
import com.softgarden.baselibrary.base.BaseFragment
/**
* @author by Dell
......@@ -18,12 +17,12 @@ class LiveItemAdapter :
BaseQuickAdapter<LiveBean.DataListBean, BaseViewHolder>(R.layout.item_match_normal_live) {
override fun convert(helper: BaseViewHolder, item: LiveBean.DataListBean) {
val ivLive = helper.getView<ImageView>(R.id.iv_live)
val ivRecommend = helper.getView<View>(R.id.iv_recommend)
val tvRecommend = helper.getView<View>(R.id.tv_recommend)
GlideUtils.loadImageGif(helper.itemView, R.mipmap.icon_live_living_gif, ivLive)
if (item.recommend == 1) {
ivRecommend.visibility = View.VISIBLE
tvRecommend.visibility = View.VISIBLE
} else {
ivRecommend.visibility = View.GONE
tvRecommend.visibility = View.GONE
}
if (item.roomStatus == 1) {
ivLive.visibility = View.VISIBLE
......
......@@ -15,10 +15,14 @@ import com.hupu.tv.player.app.app.App
object ProductFlavors {
//这个常量值必须在 androidManifest配置后引用 productFlavors的才能用
const val UM_CHANNEL_ID = "UMENG_CHANNEL"
const val API_CHANNEL = "API_CHANNEL"
fun getChannelId(data: String): String {
return getMetaDataStr(data)
}
fun getAPIChannel(data: String): Int {
return getMetaDataInt(data)
}
private fun getMetaDataStr(key: String?): String {
return getAppInfoBundle()?.getString(key).orEmpty()
......
<?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
......@@ -39,14 +39,19 @@
android:layout_marginTop="@dimen/dp_5"
android:src="@mipmap/icon_live_living_gif" />
<ImageView
android:id="@+id/iv_recommend"
android:layout_width="38dp"
<TextView
android:layout_alignParentEnd="true"
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_marginStart="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_5"
android:layout_toEndOf="@id/iv_live"
android:src="@mipmap/icon_live_recommend" />
android:background="@drawable/shape_live_recommend" />
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
......
......@@ -8,7 +8,7 @@
android:orientation="vertical"
android:paddingHorizontal="@dimen/dp_11"
android:paddingVertical="@dimen/dp_24"
>
>
<LinearLayout
android:layout_width="match_parent"
......@@ -34,10 +34,10 @@
tools:text="国足战马代取胜无忧,用轮换 阵容刷净胜球" />
<LinearLayout
android:layout_marginTop="@dimen/dp_12"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_label"
......@@ -47,24 +47,31 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="3"
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
android:id="@+id/iv_hot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8"
android:src="@mipmap/icon_list_like" />
<TextView
android:id="@+id/tv_like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="@dimen/dp_7"
android:textColor="@color/color_666666"
android:textSize="@dimen/dp_12"
tools:text="1" />
</LinearLayout>
<ImageView
android:id="@+id/iv_hot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="@dimen/dp_8"
android:src="@mipmap/icon_list_like" />
<TextView
android:id="@+id/tv_like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="@dimen/dp_7"
android:textColor="@color/color_666666"
android:textSize="@dimen/dp_12"
tools:text="1" />
</LinearLayout>
</LinearLayout>
......@@ -72,7 +79,7 @@
<ImageView
android:id="@+id/iv_cover"
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:scaleType="centerCrop" />
......
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