Compare commits

...

3 Commits

6 changed files with 32 additions and 14 deletions

View File

@ -4,13 +4,10 @@ import android.content.Context
import android.content.Intent
import android.net.Uri
import android.text.TextUtils
import com.gh.common.util.CheckLoginUtils
import com.gh.common.util.DialogUtils
import com.gh.common.util.DirectUtils
import com.gh.common.util.*
import com.gh.common.util.DirectUtils.directToGameDetailVideoStreaming
import com.gh.common.util.DirectUtils.directToGameVideo
import com.gh.common.util.DirectUtils.directToVideoDetail
import com.gh.common.util.EntranceUtils
import com.gh.gamecenter.*
import com.gh.gamecenter.entity.CommunityEntity
import com.gh.gamecenter.entity.VideoLinkEntity
@ -18,6 +15,7 @@ import com.gh.gamecenter.subject.SubjectActivity
import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel
import com.lightgame.utils.Utils
object DefaultWebViewUrlHandler {
@JvmStatic
@ -178,7 +176,7 @@ object DefaultWebViewUrlHandler {
val tag = uri.getQueryParameter("tag") ?: ""
DirectUtils.directAskColumnLabelDetail(context, tag, community, entrance, "")
}
EntranceUtils.HOST_COMMUNITY_COLUMN_DETAIL->{
EntranceUtils.HOST_COMMUNITY_COLUMN_DETAIL -> {
val community = CommunityEntity()
community.id = uri.getQueryParameter("community_id") ?: ""
community.name = uri.getQueryParameter("community_name") ?: ""
@ -190,6 +188,23 @@ object DefaultWebViewUrlHandler {
}
return true
}
if (url.startsWith("alipays:") || url.startsWith("alipay")) {
try {
context.startActivity(Intent("android.intent.action.VIEW", Uri.parse(url)))
} catch (e: java.lang.Exception) {
ToastUtils.showToast("请安装支付宝客户端")
}
return true
} else if (url.startsWith("weixin")) {
try {
context.startActivity(Intent("android.intent.action.VIEW", Uri.parse(url)))
} catch (e: java.lang.Exception) {
ToastUtils.showToast("请安装微信客户端")
}
return true
}
if ("http" != uri.scheme && "https" != uri.scheme) return true
return false
}

View File

@ -8,7 +8,9 @@ import android.widget.LinearLayout
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.common.util.DisplayUtils
import com.gh.common.util.ImageUtils
import com.gh.common.util.rxTimer
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.SettingsEntity
@ -188,8 +190,8 @@ class AdBannerView : LinearLayout {
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
val ad = mDatas[position % mDatas.size]
val view = holder.itemView as ImageView
Picasso.with(context).load(ad.image).into(view)
val view = holder.itemView as SimpleDraweeView
ImageUtils.display(view,ad.image)
holder.itemView.setOnClickListener {
onItemClick?.invoke(position % mDatas.size)
}

View File

@ -44,10 +44,10 @@ class HomeVideoFragment : BaseLazyFragment() {
//预加载广告图片
val videoAdvertisement = Config.getSettings()?.videoAdvertisement
videoAdvertisement?.left?.let { ads ->
ads.forEach { Picasso.with(requireContext()).load(it.image).fetch() }
ads.forEach { ImageUtils.prefetchToDiskCache(it.image) }
}
videoAdvertisement?.right?.let { ads ->
ads.forEach { Picasso.with(requireContext()).load(it.image).fetch() }
ads.forEach { ImageUtils.prefetchToDiskCache(it.image) }
}
}

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
<com.facebook.drawee.view.SimpleDraweeView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/icon_ad"
app:roundedCornerRadius="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"/>
app:placeholderImageScaleType="fitXY"/>

View File

@ -7,7 +7,7 @@ ext {
targetSdkVersion = 26
// application info
versionCode = 170
versionCode = 171
versionName = "4.0.1"
applicationId = "com.gh.gamecenter"

View File

@ -52,8 +52,8 @@ API_HOST=https\://api.ghzs.com/v4d0d1/
# 请不要手动改动下面的值除非你明确需要以某个apk作为基准包需要打包请以scripts/tinker*.sh为准
TINKER_ENABLE=
TINKER_ID=a3d693d
TINKER_BASE_APK_DIR=app-0605-10-00-18_a3d693d
TINKER_ID=2d551a3
TINKER_BASE_APK_DIR=app-0617-17-45-58_2d551a3
android.useAndroidX=true
android.enableJetifier=true