Compare commits

...

14 Commits

Author SHA1 Message Date
895d4d5cf1 tinker_base 4.0.3 2020-07-21 17:18:49 +08:00
801f0b95e7 版本改为4.0.3 2020-07-21 17:01:07 +08:00
11979240ab Merge branch 'dev_4.0.1_bugfix' into dev
# Conflicts:
#	app/src/main/java/com/gh/common/DefaultUrlHandler.kt
#	dependencies.gradle
#	gradle.properties
2020-07-20 15:57:50 +08:00
bef6cbb212 tinker_base 4.0.2-183 2020-07-15 17:00:17 +08:00
032a89e0cd versionCode 改为183 2020-07-15 16:48:28 +08:00
c9afb6df02 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-15 16:30:50 +08:00
b8092447ff 游戏列表默认不显示评分 2020-07-15 16:30:43 +08:00
bff20bea49 修复 7.1.1 系统上 toast 可能出现的闪退问题 2020-07-15 16:29:34 +08:00
87f2d9c85f Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2020-07-15 15:04:43 +08:00
154dfc8538 DsBridge原生Api支持无参方法 2020-07-15 15:03:56 +08:00
fddcdfb3aa 更改今日头条SDK的初始化位置 2020-07-15 09:41:29 +08:00
e1fc23a1bb tinker_base-4.0.1_bugfix 2020-06-17 17:51:22 +08:00
2d551a3f73 VersionCode 改为171 2020-06-17 17:42:37 +08:00
9b205366f7 1.修改视频流广告gif不播放 2.添加网页跳转支付宝微信支付 2020-06-16 18:29:20 +08:00
11 changed files with 70 additions and 36 deletions

View File

@ -4,9 +4,7 @@ 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
@ -223,6 +221,23 @@ object DefaultUrlHandler {
}
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

@ -190,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

@ -75,6 +75,12 @@ public class DWebView extends WebView {
}
}
@Keep
@JavascriptInterface
public String call(String methodName) {
return call(methodName, "");
}
@Keep
@JavascriptInterface
public String call(String methodName, String argStr) {
@ -93,7 +99,7 @@ public class DWebView extends WebView {
PrintDebugInfo(error);
return ret.toString();
}
Object arg=null;
Object arg = null;
Method method = null;
String callback = null;
@ -102,7 +108,7 @@ public class DWebView extends WebView {
if (args.has("_dscbstub")) {
callback = args.getString("_dscbstub");
}
if(args.has("data")) {
if (args.has("data")) {
arg = args.get("data");
}
} catch (JSONException e) {
@ -123,7 +129,10 @@ public class DWebView extends WebView {
try {
method = cls.getMethod(methodName, new Class[]{Object.class});
} catch (Exception ex) {
try {
method = cls.getMethod(methodName, new Class[]{});
} catch (Exception ignore) {
}
}
}
@ -187,7 +196,12 @@ public class DWebView extends WebView {
}
});
} else {
retData = method.invoke(jsb, arg);
Class<?>[] methodParameterTypes = method.getParameterTypes();
if (methodParameterTypes.length == 0) {
retData = method.invoke(jsb);
} else {
retData = method.invoke(jsb, arg);
}
ret.put("code", 0);
ret.put("data", retData);
return ret.toString();
@ -307,7 +321,10 @@ public class DWebView extends WebView {
try {
method = cls.getMethod(nameStr[1], new Class[]{Object.class});
} catch (Exception ex) {
try {
method = cls.getMethod(nameStr[1], new Class[]{});
} catch (Exception ignore) {
}
}
}
if (method != null) {
@ -336,7 +353,7 @@ public class DWebView extends WebView {
|| javascriptCloseWindowListener.onClose()) {
Context context = getContext();
if (context instanceof Activity) {
((Activity)context).onBackPressed();
((Activity) context).onBackPressed();
}
}
}
@ -359,7 +376,7 @@ public class DWebView extends WebView {
@Keep
@JavascriptInterface
public void returnValue(final Object obj){
public void returnValue(final Object obj) {
runOnMainThread(new Runnable() {
@Override
public void run() {
@ -422,9 +439,9 @@ public class DWebView extends WebView {
runOnMainThread(new Runnable() {
@Override
public void run() {
if (url != null && url.startsWith("javascript:")){
if (url != null && url.startsWith("javascript:")) {
DWebView.super.loadUrl(url);
}else{
} else {
callInfoList = new ArrayList<>();
DWebView.super.loadUrl(url);
}
@ -444,9 +461,9 @@ public class DWebView extends WebView {
runOnMainThread(new Runnable() {
@Override
public void run() {
if (url != null && url.startsWith("javascript:")){
if (url != null && url.startsWith("javascript:")) {
DWebView.super.loadUrl(url, additionalHttpHeaders);
}else{
} else {
callInfoList = new ArrayList<>();
DWebView.super.loadUrl(url, additionalHttpHeaders);
}
@ -996,7 +1013,4 @@ public class DWebView extends WebView {
mainHandler.post(runnable);
}
}

View File

@ -15,6 +15,12 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.g00fy2.versioncompare.Version;
import com.gh.base.BaseActivity;
import com.gh.common.AppExecutor;
@ -33,6 +39,7 @@ import com.gh.common.util.PackageUtils;
import com.gh.common.util.PlatformUtils;
import com.gh.common.util.SPUtils;
import com.gh.common.util.TagUtils;
import com.gh.common.util.TeaHelper;
import com.gh.common.util.UsageStatsHelper;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.entity.AuthDialogEntity;
@ -56,11 +63,6 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import pub.devrel.easypermissions.AfterPermissionGranted;
@ -276,6 +278,9 @@ public class SplashScreenActivity extends BaseActivity {
private void launchMainActivity() {
getUniqueId();
// 在可能获取了相关权限后才初始化今日头条SDK
TeaHelper.init(getApplication(), HaloApp.getInstance().getChannel());
Bundle bundle = getIntent().getExtras();
Intent intent = new Intent(SplashScreenActivity.this, MainActivity.class);
if (bundle != null) intent.putExtras(bundle);

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

@ -28,7 +28,6 @@ import com.gh.common.util.DownloadObserver;
import com.gh.common.util.GdtHelper;
import com.gh.common.util.HomeBottomBarHelper;
import com.gh.common.util.PackageHelper;
import com.gh.common.util.TeaHelper;
import com.gh.common.util.TimestampUtils;
import com.gh.common.videolog.VideoRecordUtils;
import com.gh.gamecenter.BuildConfig;
@ -138,7 +137,6 @@ public class HaloApp extends TinkerAppLike {
PushManager.init(mChannel);
TeaHelper.init(getApplication(), mChannel);
DataUtils.init(getApplication(), mChannel);
GidHelper.getInstance().init(getApplication());
// TTAdSdk.init(getApplication(), new TTAdConfig.Builder().appId(Config.TTAD_APPID)

View File

@ -121,7 +121,8 @@
android:paddingRight="8dp"
android:text="@{game.commentCount > 3?game.star + ``: `评分过少`}"
android:textColor="@{Color.parseColor(game.commentCount > 3?`#1383EB`:`#2496FF`)}"
android:textStyle="bold" />
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/game_des"

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,8 +7,8 @@ ext {
targetSdkVersion = 26
// application info
versionCode = 182
versionName = "4.0.2"
versionCode = 184
versionName = "4.0.3"
applicationId = "com.gh.gamecenter"
// AndroidX

View File

@ -51,8 +51,8 @@ SENSITIVE_API_HOST=https\://and-core-api.ghzs.com/v4d0d2/
# 请不要手动改动下面的值除非你明确需要以某个apk作为基准包需要打包请以scripts/tinker*.sh为准
TINKER_ENABLE=
TINKER_ID=58b1cd4
TINKER_BASE_APK_DIR=app-0713-16-50-31_58b1cd4
TINKER_ID=801f0b9
TINKER_BASE_APK_DIR=app-0721-17-12-02_801f0b9
android.useAndroidX=true
android.enableJetifier=true