Compare commits

...

6 Commits

Author SHA1 Message Date
f826dc07c6 版本更新至 4.9.6 2021-06-08 10:23:08 +08:00
34670d08c0 Merge branch 'hotfix-v4.9.5-335-crash' into 'release'
Hotfix v4.9.5 335 crash

See merge request halo/android/assistant-android!113
2021-06-08 10:22:04 +08:00
5e5646468e 1. 捕抓分类2.0页面延迟操作造成的闪退异常
2. 修复首页滑动 tab 时偶发的闪退
3. 捕抓模拟器游戏延迟操作造成的闪退异常
4. 捕抓礼包详情页延迟操作造成的闪退异常
2021-06-08 10:22:04 +08:00
039203408a 版本更新至 4.9.5 2021-05-31 10:32:07 +08:00
60b325812e Merge branch 'hotfix-v4.9.4-334-crash' into 'release'
Hotfix v4.9.4 334 crash

See merge request halo/android/assistant-android!112
2021-05-31 10:29:00 +08:00
06a43f617b 处理闪退
1. 处理首页 tab 触摸时某些设备可能会闪退的问题
2. 修复游戏库刷新按钮被遮盖的问题
3. 尝试修复游戏库横向列表因恢复滚动状态而出现的闪退
4. 修复偶发的因为获取不到渠道号而触发的闪退
5. 尝试修复启动时偶发的初始化图片加载库触发的闪退
6. 修复 Android 11 首次安装 XAPK 获取权限回到页面时的闪退问题
2021-05-31 10:29:00 +08:00
11 changed files with 50 additions and 23 deletions

View File

@ -158,9 +158,11 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Easy
}
if (this.getClass().getName().equals(xapkUnzipActivity) && !TextUtils.isEmpty(xapkUrl)) {
DownloadEntity downloadEntity = DownloadManager.getInstance(this).getDownloadEntityByUrl(xapkUrl);
PackageInstaller.install(this, downloadEntity, false);
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, "");
SPUtils.setString(Constants.SP_XAPK_URL, "");
if (downloadEntity != null) {
PackageInstaller.install(this, downloadEntity, false);
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, "");
SPUtils.setString(Constants.SP_XAPK_URL, "");
}
}
}

View File

@ -321,7 +321,11 @@ public class LibaoDetailActivity extends ToolBarActivity implements LibaoDetailA
CheckLoginUtils.checkLogin(this, mEntrance, () ->
mLibaoDetailRv.postDelayed(() -> {
if (mAdapter.libaoDetailTopViewHolder != null) {
mAdapter.libaoDetailTopViewHolder.libaoCopyBtn.performClick();
try {
mAdapter.libaoDetailTopViewHolder.libaoCopyBtn.performClick();
} catch (Exception e) {
e.printStackTrace();
}
}
}, 200)
);

View File

@ -24,7 +24,6 @@ import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders;
import com.facebook.drawee.view.SimpleDraweeView;
import com.gh.base.AppUncaughtHandler;
import com.gh.base.BaseActivity;
import com.gh.base.fragment.BaseFragment_ViewPager;
@ -178,7 +177,11 @@ public class MainActivity extends BaseActivity {
setStatusBarColor(Color.TRANSPARENT);
if (!ImageUtils.isFrescoInitialized()) {
BigImageViewer.initialize(FrescoImageLoader.with(this));
try {
BigImageViewer.initialize(FrescoImageLoader.with(this));
} catch (Throwable e) {
e.printStackTrace();
}
}
Fragment fragmentFromFM = getSupportFragmentManager().findFragmentById(R.id.layout_activity_content);

View File

@ -276,7 +276,7 @@ class CategoryV2Fragment : LazyFragment() {
if (position == 1 && SPUtils.getBoolean(Constants.SP_FIRST_ENTER_CATEGORY_V2, true)) {
SPUtils.setBoolean(Constants.SP_FIRST_ENTER_CATEGORY_V2, false)
mBinding?.drawerLayout?.postDelayed({
openDrawer()
tryCatchInRelease { openDrawer() }
}, 200L)
}
} else {

View File

@ -174,8 +174,8 @@ class HomeSearchToolWrapperFragment : SearchToolWrapperFragment() {
},
onPageScrolled = { position, positionOffset, _ ->
if (position + 1 != mTabTitleList.size) {
val currentAppBarColor = tabList[position].primaryColor
val incomingAppBarColor = tabList[position + 1].primaryColor
val currentAppBarColor = tabList.safelyGetInRelease(position)?.primaryColor ?: Color.WHITE
val incomingAppBarColor = tabList.safelyGetInRelease(position + 1)?.primaryColor ?: Color.WHITE
val proximatelySelectedPosition = if (positionOffset < 0.5) position else position + 1
@ -186,8 +186,8 @@ class HomeSearchToolWrapperFragment : SearchToolWrapperFragment() {
}
// 颜色显示是否变更
val isContentStyleChanged = tabList[proximatelySelectedPosition].useLightStyle != mIsDisplayingLightContent
mIsDisplayingLightContent = tabList[proximatelySelectedPosition].useLightStyle
val isContentStyleChanged = tabList.safelyGetInRelease(proximatelySelectedPosition)?.useLightStyle != mIsDisplayingLightContent
mIsDisplayingLightContent = tabList.safelyGetInRelease(proximatelySelectedPosition)?.useLightStyle ?: false
mTabSelectedColor = if (mIsDisplayingLightContent) TAB_DEFAULT_COLOR_LIGHT else TAB_SELECTED_COLOR
mTabDefaultColor = if (mIsDisplayingLightContent) TAB_DEFAULT_COLOR_LIGHT else TAB_DEFAULT_COLOR

View File

@ -61,6 +61,13 @@ public class SearchToolWrapperFragment extends LazyFragment {
.replace(R.id.wrapper_toolbar, mSearchToolbarFragment)
.replace(R.id.wrapper_main_content, Objects.requireNonNull(mContentFragment)).commitAllowingStateLoss();
// 补上底部 tab 的高度
inflatedView.findViewById(R.id.wrapperLl).setPadding(
0,
0,
0,
(int) requireContext().getResources().getDimension(R.dimen.main_bottom_tab_height));
mCachedView.post(() -> mSearchToolbarFragment.updateSearchToolbarColor(Color.WHITE));
}

View File

@ -10,6 +10,7 @@ import com.gh.base.BaseRecyclerViewHolder
import com.gh.common.iinterface.IOffsetable
import com.gh.common.util.TimeUtils
import com.gh.common.util.dip2px
import com.gh.common.util.tryCatchInRelease
import com.gh.gamecenter.R
import com.gh.gamecenter.databinding.GameHorizontalListBinding
import com.gh.gamecenter.entity.GameEntity
@ -51,7 +52,10 @@ class GameHorizontalSlideListViewHolder(val binding: GameHorizontalListBinding)
binding.horizontalRv.scrollToPosition(0)
}
} else {
binding.horizontalRv.scrollBy(offset, offset)
// 可能会因为上下复用数据变化而出现 IndexOutOfBoundsException 异常,毕竟有局部更新功能...
tryCatchInRelease {
binding.horizontalRv.scrollBy(offset, offset)
}
}
}
}

View File

@ -1,17 +1,15 @@
package com.gh.gamecenter.simulatorgame
import android.app.Dialog
import android.graphics.Color
import android.graphics.Paint
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.MenuItem
import android.view.View
import android.widget.*
import androidx.core.content.ContextCompat
import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentStatePagerAdapter
@ -122,7 +120,7 @@ class SimulatorGameFragment : NormalFragment() {
})
mViewModel.simulatorGameLoadSuccess.observe(viewLifecycleOwner, Observer {
AppExecutor.uiExecutor.executeWithDelay(Runnable {
showSimulatorGuide(it)
tryCatchInRelease { showSimulatorGuide(it) }
},500)
})
}

View File

@ -105,7 +105,12 @@ public class HaloApp extends MultiDexApplication {
}
public String getChannel() {
return mChannel;
// 存在 IO 初始化线程阻塞(万物皆可阻塞)导致 mChannel 为空的情况,这里特殊处理下
if (TextUtils.isEmpty(mChannel)) {
return "";
} else {
return mChannel;
}
}
public void setOAID(String oaid) {
@ -144,7 +149,11 @@ public class HaloApp extends MultiDexApplication {
// 初始化 Fresco(BigImageViewer 已包含Fresco)
if (!ImageUtils.isFrescoInitialized()) {
BigImageViewer.initialize(FrescoImageLoader.with(this));
try {
BigImageViewer.initialize(FrescoImageLoader.with(this));
} catch (Throwable e) {
e.printStackTrace();
}
}
deviceRamSize = DeviceUtils.getTotalRamSizeOfDevice(this);

View File

@ -71,7 +71,7 @@
</RelativeLayout>
<androidx.viewpager.widget.ViewPager
<com.gh.common.view.Gh_ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@ -7,8 +7,8 @@ ext {
targetSdkVersion = 26
// application info (每个大版本之间的 versionCode 增加 20)
versionCode = 334
versionName = "4.9.4"
versionCode = 336
versionName = "4.9.6"
applicationId = "com.gh.gamecenter"
// AndroidX