Commit 3530b849 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent ace01246
...@@ -3,15 +3,13 @@ package com.xinfu.helivideo.ui.fragment ...@@ -3,15 +3,13 @@ package com.xinfu.helivideo.ui.fragment
import android.text.TextUtils import android.text.TextUtils
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.bumptech.glide.Glide
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator import com.google.android.material.tabs.TabLayoutMediator
import com.xinfu.library.utils.GlideUtils import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.xinfu.library.utils.nodoubleclick.AntiShake import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import com.xinfu.helivideo.R import com.xinfu.helivideo.R
import com.xinfu.helivideo.common.AppConfig import com.xinfu.helivideo.common.AppConfig
import com.xinfu.helivideo.common.Constant import com.xinfu.helivideo.common.Constant
...@@ -24,15 +22,9 @@ import com.xinfu.helivideo.mvp.views.HomeView ...@@ -24,15 +22,9 @@ import com.xinfu.helivideo.mvp.views.HomeView
import com.xinfu.helivideo.ui.adapter.HomeVideoPageAdapter import com.xinfu.helivideo.ui.adapter.HomeVideoPageAdapter
import com.xinfu.helivideo.ui.adapter.ImageTitleAdapter import com.xinfu.helivideo.ui.adapter.ImageTitleAdapter
import com.xinfu.helivideo.ui.adapter.TopAdapter import com.xinfu.helivideo.ui.adapter.TopAdapter
import com.xinfu.helivideo.ui.fragment.base.BaseFragment
import com.xinfu.helivideo.ui.fragment.base.LazyLoadBaseFragment import com.xinfu.helivideo.ui.fragment.base.LazyLoadBaseFragment
import com.xinfu.helivideo.video.VideoActivity import com.xinfu.library.utils.GlideUtils
import com.scwang.smartrefresh.layout.api.RefreshLayout import com.xinfu.library.utils.nodoubleclick.AntiShake
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import com.youth.banner.Banner
import com.youth.banner.adapter.BannerImageAdapter
import com.youth.banner.holder.BannerImageHolder
import com.youth.banner.indicator.CircleIndicator
import kotlinx.android.synthetic.main.fragment_main.* import kotlinx.android.synthetic.main.fragment_main.*
import java.util.* import java.util.*
import kotlin.concurrent.schedule import kotlin.concurrent.schedule
......
...@@ -92,6 +92,7 @@ class RecommendFragment : BaseFragment(), View.OnClickListener { ...@@ -92,6 +92,7 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
vp2_recommend.setCurrentItem(1, false) vp2_recommend.setCurrentItem(1, false)
vp2_recommend.offscreenPageLimit = 1 vp2_recommend.offscreenPageLimit = 1
vp2_recommend.isUserInputEnabled = false vp2_recommend.isUserInputEnabled = false
} }
private fun getTabView(position: Int): View { private fun getTabView(position: Int): View {
...@@ -167,15 +168,12 @@ class RecommendFragment : BaseFragment(), View.OnClickListener { ...@@ -167,15 +168,12 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
fun handleEditStyle(isEdit: Boolean) { fun handleEditStyle(isEdit: Boolean) {
if (isEdit) { if (isEdit) {
// 禁止滑动
// vp2_recommend.isUserInputEnabled = false
iv_edit.visibility = View.GONE iv_edit.visibility = View.GONE
iv_edit_close.visibility = View.VISIBLE iv_edit_close.visibility = View.VISIBLE
tab_recommend.visibility = View.GONE tab_recommend.visibility = View.GONE
tv_edit_text.visibility = View.VISIBLE tv_edit_text.visibility = View.VISIBLE
} else { } else {
// 允许滑动 // 允许滑动
// vp2_recommend.isUserInputEnabled = true
iv_edit.visibility = View.VISIBLE iv_edit.visibility = View.VISIBLE
iv_edit_close.visibility = View.GONE iv_edit_close.visibility = View.GONE
tab_recommend.visibility = View.VISIBLE tab_recommend.visibility = View.VISIBLE
...@@ -228,4 +226,7 @@ class RecommendFragment : BaseFragment(), View.OnClickListener { ...@@ -228,4 +226,7 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
} }
} }
} }
\ No newline at end of file
...@@ -38,7 +38,7 @@ class JzvdStdTikTok : JzvdStd { ...@@ -38,7 +38,7 @@ class JzvdStdTikTok : JzvdStd {
topContainer.visibility = View.GONE topContainer.visibility = View.GONE
loadingProgressBar.visibility = View.GONE //加载loaing loadingProgressBar.visibility = View.GONE //加载loaing
progressBar.visibility = View.VISIBLE //控制的 progressBar.visibility = View.VISIBLE //控制的
posterImageView.scaleType = ImageView.ScaleType.FIT_CENTER posterImageView.scaleType = ImageView.ScaleType.CENTER
bottomProgressBar.visibility = View.GONE //最底部的进度 bottomProgressBar.visibility = View.GONE //最底部的进度
......
...@@ -38,7 +38,7 @@ class RecommendVideoAdapter(var activity: Activity) : ...@@ -38,7 +38,7 @@ class RecommendVideoAdapter(var activity: Activity) :
holder.setText(R.id.usertitle_tv, "第" + item.recommendIndex + "集") holder.setText(R.id.usertitle_tv, "第" + item.recommendIndex + "集")
//缩略图 //缩略图
val posterImageView = holder.getView<JzvdStdTikTok>(R.id.jz_video).posterImageView val posterImageView = holder.getView<JzvdStdTikTok>(R.id.jz_video).posterImageView
posterImageView.scaleType= ImageView.ScaleType.FIT_XY // posterImageView.scaleType= ImageView.ScaleType.FIT_XY
Glide.with(context).load(item.coverImage) Glide.with(context).load(item.coverImage)
.into(posterImageView) .into(posterImageView)
...@@ -91,7 +91,7 @@ class RecommendVideoAdapter(var activity: Activity) : ...@@ -91,7 +91,7 @@ class RecommendVideoAdapter(var activity: Activity) :
jzvdStdTikTok.setUp(path, "", JzvdStd.SCREEN_NORMAL) jzvdStdTikTok.setUp(path, "", JzvdStd.SCREEN_NORMAL)
// 设置全屏拉伸 // 设置全屏拉伸
Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_FILL_PARENT) // Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_FILL_PARENT)
jzvdStdTikTok.setOnVideoCompletion(onVideoCompletion) jzvdStdTikTok.setOnVideoCompletion(onVideoCompletion)
} }
......
...@@ -67,7 +67,7 @@ class VideoAdapter(private var vedioBean: VedioBean) : ...@@ -67,7 +67,7 @@ class VideoAdapter(private var vedioBean: VedioBean) :
holder.setText(R.id.zan_num_tv, "" + vedioBean.hot) holder.setText(R.id.zan_num_tv, "" + vedioBean.hot)
//缩略图 //缩略图
val posterImageView = holder.getView<JzvdStdTikTok>(R.id.jz_video).posterImageView val posterImageView = holder.getView<JzvdStdTikTok>(R.id.jz_video).posterImageView
posterImageView.scaleType=ImageView.ScaleType.FIT_XY // posterImageView.scaleType=ImageView.ScaleType.FIT_XY
Glide.with(context).load(vedioBean.coverImage) Glide.with(context).load(vedioBean.coverImage)
.into(posterImageView) .into(posterImageView)
...@@ -119,7 +119,7 @@ class VideoAdapter(private var vedioBean: VedioBean) : ...@@ -119,7 +119,7 @@ class VideoAdapter(private var vedioBean: VedioBean) :
jzvdStdTikTok.setUp(path, "", JzvdStd.SCREEN_NORMAL) jzvdStdTikTok.setUp(path, "", JzvdStd.SCREEN_NORMAL)
// 设置全屏拉伸 // 设置全屏拉伸
Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_FILL_PARENT) // Jzvd.setVideoImageDisplayType(Jzvd.VIDEO_IMAGE_DISPLAY_TYPE_FILL_PARENT)
jzvdStdTikTok.setOnVideoCompletion(onVideoCompletion) jzvdStdTikTok.setOnVideoCompletion(onVideoCompletion)
} }
......
...@@ -31,13 +31,13 @@ RELEASE_STORE_PASSWORD=mintshelivideo ...@@ -31,13 +31,13 @@ RELEASE_STORE_PASSWORD=mintshelivideo
RELEASE_STORE_FILE=mints_helivideo.jks RELEASE_STORE_FILE=mints_helivideo.jks
#ShareSDK #ShareSDK
RELEASE_SHARESDK_KEY=381ca97ef616d RELEASE_SHARESDK_KEY=3845c0fde1969
RELEASE_SHARESDK_SECRET=de4c99c606d4e1895673e3682666c0a8 RELEASE_SHARESDK_SECRET=8e1f2a0e4b0ec6ec8404edfabe0cdf61
#weixin #weixin
WEIXIN_APP_PAY_ID ="wx6830d86ba20be254" WEIXIN_APP_PAY_ID ="wxf1d2f4fe2f3e7e4e"
WEIXIN_APP_ID =wx6830d86ba20be254 WEIXIN_APP_ID =wxf1d2f4fe2f3e7e4e
WEIXIN_APP_SECRET =91f91c0721bd989cf8b9c9b8dc8a5e9c WEIXIN_APP_SECRET =73b068bd35f147ba29b648c157ea28a8
#umeng #umeng
RELEASE_UMENG_KEY=64a67d4fa1a164591b44f0e8 RELEASE_UMENG_KEY=64a67d4fa1a164591b44f0e8
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<Tumblr Enable="false" /> <Tumblr Enable="false" />
<Email Enable="false" /> <Email Enable="false" />
<ShortMessage Enable="false" /> <ShortMessage Enable="false" />
<Wechat AppId="wx6830d86ba20be254" AppSecret="91f91c0721bd989cf8b9c9b8dc8a5e9c" userName="gh_afb25ac019c9" path="pages/index/index.html?id=1" WithShareTicket="true" MiniprogramType="0" /> <Wechat AppId="wxf1d2f4fe2f3e7e4e" AppSecret="73b068bd35f147ba29b648c157ea28a8" userName="gh_afb25ac019c9" path="pages/index/index.html?id=1" WithShareTicket="true" MiniprogramType="0" />
<WechatMoments AppId="wx6830d86ba20be254" AppSecret="91f91c0721bd989cf8b9c9b8dc8a5e9c" /> <WechatMoments AppId="wxf1d2f4fe2f3e7e4e" AppSecret="73b068bd35f147ba29b648c157ea28a8" />
<QQ Enable="false" /> <QQ Enable="false" />
<Instapaper Enable="false" /> <Instapaper Enable="false" />
<Pocket Enable="false" /> <Pocket Enable="false" />
......
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