Commit a486eef2 by Dell

1、增加请求头

2、调整新闻列表热度
3、更换底图
4、更换推荐文字
parent b30ddf09
...@@ -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()
} }
...@@ -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"
......
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();
......
...@@ -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"
......
...@@ -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.iv_recommend) val tvRecommend = helper.getView<View>(R.id.tv_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) {
ivRecommend.visibility = View.VISIBLE tvRecommend.visibility = View.VISIBLE
} else { } else {
ivRecommend.visibility = View.GONE tvRecommend.visibility = View.GONE
} }
if (item.roomStatus == 1) { if (item.roomStatus == 1) {
ivLive.visibility = View.VISIBLE ivLive.visibility = View.VISIBLE
......
...@@ -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()
......
<?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 @@ ...@@ -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
......
...@@ -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="horizontal"> android:orientation="vertical">
<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" />
......
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