Compare commits

...

33 Commits

Author SHA1 Message Date
811e1bf875 tinker_base-3.7.3-splash 2020-02-19 17:17:59 +08:00
5c929ba308 更换引导图 2020-02-19 16:46:08 +08:00
3c4cc4ff7f tinker-3.7.3-base 2020-01-21 16:03:35 +08:00
150d640977 处理标记下载红点闪退问题 2020-01-21 15:30:45 +08:00
a3599af9d1 修改视频预加载闪退问题 2020-01-21 15:23:53 +08:00
1ac1196b20 处理闪退问题 2020-01-21 14:43:03 +08:00
6c5e863a5b 处理MTA分享事件统计错乱问题 2020-01-21 14:19:35 +08:00
15376a5e13 创建 tinker_3.7.3 标记 2020-01-21 11:13:55 +08:00
eaf5b24044 处理看大图的闪退问题 2020-01-21 10:41:53 +08:00
f05c6540f1 Merge branch '3.7.2-bugfix' of gitlab.ghzhushou.com:halo/assistant-android into 3.7.2-bugfix 2020-01-21 10:18:24 +08:00
25dd3ca4df 完成首页游戏评分显示规则调整 https://gitlab.ghzs.com/pm/halo-app-issues/issues/765 2020-01-21 10:16:51 +08:00
6281b4f510 tinker_base 3.7.2-fix_download 2020-01-20 18:17:33 +08:00
2cbc0b0e17 关闭bugly的Crash处理,统一由AppUncaughtHandler处理 2020-01-20 17:10:25 +08:00
f18a0ef72c Merge branch '3.7.2-bugfix' of gitlab.ghzs.com:halo/assistant-android into 3.7.2-bugfix 2020-01-20 17:04:59 +08:00
98fb4fc412 开启bugly的错误上报 2020-01-20 17:03:52 +08:00
73c995c31f Merge branch '3.7.2-bugfix' of gitlab.ghzhushou.com:halo/assistant-android into 3.7.2-bugfix 2020-01-20 16:28:02 +08:00
60dcafe0c1 处理无参启动 DownloadService 会闪退的问题 2020-01-20 16:27:44 +08:00
c118d7e4ad tinker_base 3.7.2-bugfix 2020-01-20 09:02:42 +08:00
babc55739b Merge branch '3.7.2-bugfix' of gitlab.ghzs.com:halo/assistant-android into 3.7.2-bugfix 2020-01-19 16:53:03 +08:00
df8790c6ff 更改首页我的光环tab小红点大小 2020-01-19 16:52:57 +08:00
30ccdcd750 Merge branch '3.7.2-bugfix' of gitlab.ghzhushou.com:halo/assistant-android into 3.7.2-bugfix 2020-01-19 16:44:23 +08:00
79d23bb203 兼容新游戏详情视频数量字段 2020-01-19 16:42:13 +08:00
b2c5e6551b 去掉预加载5M限制 2020-01-19 15:59:56 +08:00
ec49d7f20a 处理AndroidVideoCache异常问题 2020-01-19 15:39:51 +08:00
5a35d13d70 Merge branch '3.7.2-bugfix' of gitlab.ghzs.com:halo/assistant-android into 3.7.2-bugfix 2020-01-19 15:34:30 +08:00
dcfa4fdaaf 光环助手V3.7.2 RELEASE 20200117-1830 测试汇总 3,4 https://gitlab.ghzs.com/pm/halo-app-issues/issues/764 2020-01-19 15:34:26 +08:00
43324ca44e Merge branch '3.7.2-bugfix' of gitlab.ghzhushou.com:halo/assistant-android into 3.7.2-bugfix 2020-01-19 15:02:58 +08:00
8e778e8172 修复日志触发上传过于频繁的问题 2020-01-19 14:59:22 +08:00
928a98831e Merge branch '3.7.2-bugfix' of gitlab.ghzs.com:halo/assistant-android into 3.7.2-bugfix 2020-01-19 12:21:15 +08:00
3dc678bc27 修复游戏详情加载变慢问题 2020-01-19 12:21:03 +08:00
d2b19a128d 修复初始化下载服务时可能的闪退问题 2020-01-19 11:50:20 +08:00
cc75cb497d 屏蔽下载限速,修复专题详情闪退问题 2020-01-19 11:13:17 +08:00
4840c5c604 修复插件化弹窗闪退的问题 2020-01-19 10:17:22 +08:00
23 changed files with 132 additions and 102 deletions

View File

@ -133,9 +133,9 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Easy
shareSummary,
shareType);
if (shareType == ShareUtils.ShareType.game || shareType == ShareUtils.ShareType.plugin) {
MtaHelper.onEvent("内容分享", shareTitle + shareSummary);
MtaHelper.onEvent("内容分享", "内容分享", shareTitle + shareSummary);
} else {
MtaHelper.onEvent("内容分享", shareTitle);
MtaHelper.onEvent("内容分享", "内容分享", shareTitle);
}
}

View File

@ -56,6 +56,8 @@ object LoghubUtils {
private fun commitSavedLoghubEvents() {
loghubEventExecutor.execute {
if (loghubEventSet.isEmpty()) return@execute
val exposureList = loghubEventSet.toList()
createLogGroupAndUpload()

View File

@ -238,18 +238,12 @@ public class DataUtils {
}
public static void onError(Context context, Throwable throwable) {
// MTA主动上传错误
//bugly 作为默认处理异常的类库,已经上报了,此处不重复上报
try {
StatService.reportException(context, throwable);
CrashReport.postCatchedException(throwable);
} catch (Exception e) {
}
// //bugly 作为默认处理异常的类库,已经上报了,此处不重复上报
// try {
// CrashReport.postCatchedException(throwable);
// } catch (Exception e) {
// }
//talkingdata
try {
TCAgent.onError(context, throwable);

View File

@ -39,7 +39,6 @@ import com.lightgame.download.DownloadConfig;
import com.lightgame.download.DownloadDao;
import com.lightgame.download.DownloadEntity;
import com.lightgame.download.DownloadService;
import com.lightgame.download.DownloadSpeedController;
import com.lightgame.download.DownloadStatus;
import com.lightgame.download.DownloadStatusListener;
import com.lightgame.download.DownloadStatusManager;
@ -622,8 +621,8 @@ public class DownloadManager implements DownloadStatusListener {
}
}
// 开启下载服务
startDownloadServiceInBackground();
// 开启下载服务, Fuck me, 即便是在启动页调用的方法,依然有可能触发 `unable is in background`
startDownloadService();
}
public void addObserver(DataWatcher dataWatcher) {
@ -636,11 +635,19 @@ public class DownloadManager implements DownloadStatusListener {
DataChanger.INSTANCE.deleteObserver(dataWatcher);
}
public void startDownloadServiceInBackground() {
mContext.startService(new Intent(mContext, DownloadService.class));
private void startDownloadService() {
Intent serviceIntent = new Intent(mContext, DownloadService.class);
// 当满足系统版本大于 8.0 、应用在后台运行时以前台服务开启
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
&& !HaloApp.getInstance().isRunningForeground) {
serviceIntent.putExtra(DownloadService.KEY_SERVICE_ACTION, DownloadService.START_FOREGROUND);
mContext.startForegroundService(serviceIntent);
} else {
mContext.startService(serviceIntent);
}
}
public void startDownloadService(DownloadEntity downloadEntity, DownloadStatus status) {
private void startDownloadService(DownloadEntity downloadEntity, DownloadStatus status) {
// 在启动服务时添加该条下载的网络状态
if (status == DownloadStatus.add || status == DownloadStatus.resume) {
String network = DeviceUtils.getNetwork(mContext);
@ -664,11 +671,11 @@ public class DownloadManager implements DownloadStatusListener {
}
public void disableDownloadSpeedLimit() {
DownloadSpeedController.disableSpeedLimit();
// DownloadSpeedController.disableSpeedLimit();
}
public void updateSpeedLimitationReleaseDelay(int delay) {
DownloadSpeedController.updateLimitationReleaseDelay(delay);
// DownloadSpeedController.updateLimitationReleaseDelay(delay);
}
public void checkRetryDownload() {

View File

@ -2,6 +2,7 @@ package com.gh.download.cache;
import com.danikula.videocache.file.FileNameGenerator;
import com.danikula.videocache.file.Md5FileNameGenerator;
import com.gh.common.AppExecutor;
import com.halo.assistant.HaloApp;
import com.shuyu.gsyvideoplayer.utils.StorageUtils;
@ -11,9 +12,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference;
import io.reactivex.Observable;
@ -29,12 +30,12 @@ import okhttp3.Response;
public class CacheManager {
private static final AtomicReference<CacheManager> INSTANCE = new AtomicReference<>();
private volatile HashMap<String, Call> downCalls;
private volatile ConcurrentHashMap<String, Call> downCalls;
private OkHttpClient mClient;
private File cacheDirectory = StorageUtils.getIndividualCacheDirectory(HaloApp.getInstance().getApplication());
private FileNameGenerator generator = new Md5FileNameGenerator();
private final String TEMP_POSTFIX = ".download";
private final int preLength = 5 * 1024 * 1024;//预加载大小
// private final int preLength = 5 * 1024 * 1024;//预加载大小
public static CacheManager getInstance() {
@ -51,11 +52,11 @@ public class CacheManager {
}
private CacheManager() {
downCalls = new HashMap<>();
downCalls = new ConcurrentHashMap<>();
mClient = new OkHttpClient.Builder().build();
}
private synchronized HashMap<String, Call> getDownCalls() {
private synchronized ConcurrentHashMap<String, Call> getDownCalls() {
return downCalls;
}
@ -130,13 +131,15 @@ public class CacheManager {
String url = cacheInfo.getUrl();
final long[] downloadLength = {cacheInfo.getProgress()};//已经下载好的长度
long contentLength = cacheInfo.getTotal();//文件的总长度
if (downloadLength[0] >= preLength) {
// if (downloadLength[0] >= preLength) {
if (downloadLength[0] >= contentLength) {
e.onComplete();
return;
}
e.onNext(cacheInfo);
Request request = new Request.Builder()
.addHeader("RANGE", "bytes=" + downloadLength[0] + "-" + (contentLength > preLength ? preLength : contentLength))
// .addHeader("RANGE", "bytes=" + downloadLength[0] + "-" + (contentLength > preLength ? preLength : contentLength))
.addHeader("RANGE", "bytes=" + downloadLength[0] + "-" + contentLength)
.url(url)
.build();
Call call = mClient.newCall(request);
@ -214,10 +217,12 @@ public class CacheManager {
}
public void removeAllCall() {
for (Map.Entry<String, Call> entry : getDownCalls().entrySet()) {
entry.getValue().cancel();
}
getDownCalls().clear();
AppExecutor.getIoExecutor().execute(() -> {
for (Map.Entry<String, Call> entry : getDownCalls().entrySet()) {
entry.getValue().cancel();
}
AppExecutor.getUiExecutor().execute(() -> getDownCalls().clear());
});
}
private List<File> getAllFile() {

View File

@ -25,9 +25,6 @@ import android.view.View;
import android.view.Window;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModelProviders;
import com.gh.base.AppUncaughtHandler;
import com.gh.base.BaseActivity;
import com.gh.base.fragment.BaseFragment_ViewPager;
@ -130,6 +127,8 @@ import java.util.UUID;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModelProviders;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import okhttp3.MediaType;
@ -391,23 +390,24 @@ public class MainActivity extends BaseActivity {
//启动app删除视频缓存文件
AppExecutor.getIoExecutor().execute(() -> {
File cacheFileDirectory = StorageUtils.getIndividualCacheDirectory(this);
if (cacheFileDirectory.exists() && cacheFileDirectory.isDirectory()) {
for (File file : cacheFileDirectory.listFiles()) {
FileUtils.deleteFile(file.getPath());
}
}
//创建nomedia文件
File noMediaFile = new File(cacheFileDirectory.getParent(), ".nomedia");
if (!cacheFileDirectory.exists()) {
cacheFileDirectory.mkdirs();
}
try {
File cacheFileDirectory = StorageUtils.getIndividualCacheDirectory(this);
if (cacheFileDirectory.exists() && cacheFileDirectory.isDirectory()) {
for (File file : cacheFileDirectory.listFiles()) {
FileUtils.deleteFile(file.getPath());
}
}
//创建nomedia文件
File noMediaFile = new File(cacheFileDirectory.getParent(), ".nomedia");
if (!cacheFileDirectory.exists()) {
cacheFileDirectory.mkdirs();
}
if (!noMediaFile.exists()) {
noMediaFile.createNewFile();
}
} catch (IOException e) {
} catch (Exception e) {
e.printStackTrace();
}
});

View File

@ -19,12 +19,6 @@ import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager.OnPageChangeListener;
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.core.ImagePipeline;
@ -60,6 +54,11 @@ import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager.OnPageChangeListener;
import butterknife.BindView;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
@ -291,8 +290,13 @@ public class ViewImageActivity extends BaseActivity implements OnPageChangeListe
private void loadImage(String url, final BigImageView imageView) {
// 添加GIF支持
imageView.setImageViewFactory(new FrescoImageViewFactory());
imageView.showImage(Uri.parse(url));
try {
imageView.setImageViewFactory(new FrescoImageViewFactory());
imageView.showImage(Uri.parse(url));
} catch (Exception ignored) {
// parse Uri 可能会有异常 java.lang.NullPointerException
// url 为 null? 暂时不管了,统一捕抓异常
}
}
private class ViewImageAdapter extends PagerAdapter implements OnSingleTapListener {

View File

@ -508,7 +508,7 @@ public class PlatformAdapter extends BaseRecyclerAdapter<PlatformViewHolder> {
if (downloadEntity == null) return;
String path = mEntryMap.get(downloadEntity).getPath();
String path = downloadEntity.getPath();
if (FileUtils.isEmptyFile(path)) {
Utils.toast(mContext, R.string.install_failure_hint);
mEntryMap.remove(apkEntity.getUrl());

View File

@ -131,7 +131,7 @@ public class GameDownloadFragment extends BaseFragment implements View.OnClickLi
downloadEntity.getPath()), downloadEntity.getUrl());
// 用户焦点在下载管理页面时有任务完成,直接把所有下载完成的任务标记为已读
DownloadManager.getInstance(requireContext()).markDownloadedTaskAsRead();
DownloadManager.getInstance(HaloApp.getInstance().getApplication()).markDownloadedTaskAsRead();
} else if (DownloadStatus.cancel.equals(downloadEntity.getStatus())) { // 有可能由于网络劫持造成的
adapter.initMap();
adapter.notifyDataSetChanged();

View File

@ -124,7 +124,7 @@ class GameDetailEntity(
data class Video(
@SerializedName("video_id")
var videoId: String = "",
@SerializedName("video_count")
@SerializedName("new_video_count", alternate = ["video_count"]) // 选用 JSON 最后一个值作为 videoCount 的值
var videoCount: Int = 0,
var poster: String = "",
var title: String = "",

View File

@ -1,6 +1,5 @@
package com.gh.gamecenter.gamedetail
import android.annotation.SuppressLint
import android.app.Application
import android.os.Build
import androidx.lifecycle.AndroidViewModel
@ -13,9 +12,7 @@ import com.gh.common.util.ConcernUtils
import com.gh.common.util.DataUtils
import com.gh.gamecenter.entity.GameDetailEntity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.GameVideoInfo
import com.gh.gamecenter.mvvm.Resource
import com.gh.gamecenter.retrofit.BiResponse
import com.gh.gamecenter.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import io.reactivex.android.schedulers.AndroidSchedulers
@ -96,8 +93,7 @@ class GameDetailViewModel(application: Application,
displayTopVideo = response.topVideo != null
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
getGameVideoInfo(response)
// gameDetailLiveData.postValue(Resource.success(response))
gameDetailLiveData.postValue(Resource.success(response))
}
override fun onFailure(e: HttpException?) {
@ -106,25 +102,6 @@ class GameDetailViewModel(application: Application,
})
}
@SuppressLint("CheckResult")
private fun getGameVideoInfo(response: GameDetailEntity) {
mApi.getGameVideoInfo(game?.id)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : BiResponse<GameVideoInfo>() {
override fun onSuccess(data: GameVideoInfo) {
response.introVideo?.videoCount = data.videoCount
gameDetailLiveData.postValue(Resource.success(response))
}
override fun onFailure(exception: Exception) {
gameDetailLiveData.postValue(Resource.success(response))
}
})
}
fun concernCommand(isConcern: Boolean) {
val listener = object : ConcernUtils.onConcernListener {
override fun onSuccess() {

View File

@ -185,6 +185,7 @@ class DescViewModel(application: Application,
}
})
}
fun unvoteComment(commentId: String, callback: () -> Unit) {
RetrofitManager.getInstance(getApplication())
.api

View File

@ -28,9 +28,11 @@ import com.gh.gamecenter.adapter.OnCommentCallBackListener
import com.gh.gamecenter.baselist.ListAdapter
import com.gh.gamecenter.baselist.ListFragment
import com.gh.gamecenter.entity.CommentEntity
import com.gh.gamecenter.eventbus.EBReuse
import com.gh.gamecenter.qa.answer.detail.AnswerDetailFragment
import com.halo.assistant.HaloApp
import com.lightgame.utils.Util_System_Keyboard
import org.greenrobot.eventbus.EventBus
open class NewCommentFragment : ListFragment<CommentEntity, NewCommentViewModel>(), OnCommentCallBackListener, KeyboardHeightObserver {
@ -172,11 +174,14 @@ open class NewCommentFragment : ListFragment<CommentEntity, NewCommentViewModel>
if (this !is NewCommentConversationFragment) {
mKeyboardHeightProvider?.setKeyboardHeightObserver(this)
}
EventBus.getDefault().post(EBReuse(COMMENT_RESUME))
}
override fun onPause() {
super.onPause()
mKeyboardHeightProvider?.setKeyboardHeightObserver(null)
mBaseHandler.postDelayed({EventBus.getDefault().post(EBReuse(COMMENT_PAUSE))},1000)
}
override fun onDestroy() {
@ -351,6 +356,10 @@ open class NewCommentFragment : ListFragment<CommentEntity, NewCommentViewModel>
}
companion object {
const val COMMENT_PAUSE = "comment_pause"
const val COMMENT_RESUME = "comment_resume"
fun getAnswerCommentInstance(answerId: String,
showSoftKeyboardOnStartUp: Boolean,
commentCount: Int,

View File

@ -13,6 +13,7 @@ import com.gh.gamecenter.R
import com.gh.gamecenter.baselist.ListFragment
import com.gh.gamecenter.baselist.LoadType
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.SubjectData
import com.gh.gamecenter.eventbus.EBDownloadStatus
import com.gh.gamecenter.eventbus.EBPackage
import com.gh.gamecenter.game.columncollection.detail.ColumnCollectionDetailActivity
@ -66,7 +67,10 @@ class SubjectListFragment : ListFragment<GameEntity, SubjectListViewModel>(), On
val factory = SubjectListViewModel.Factory(HaloApp.getInstance().application
, arguments?.getParcelable(EntranceUtils.KEY_SUBJECT_DATA)!!)
if (requireContext() is SubjectActivity) {
mSubjectViewModel = viewModelProviderFromParent()
requireActivity().intent.getParcelableExtra<SubjectData>(EntranceUtils.KEY_SUBJECT_DATA)?.let {
val f = SubjectViewModel.Factory(HaloApp.getInstance().application, it)
mSubjectViewModel = viewModelProviderFromParent(f)
}
}
return ViewModelProviders.of(this, factory).get(SubjectListViewModel::class.java)
}

View File

@ -31,8 +31,11 @@ import com.gh.gamecenter.entity.LinkEntity
import com.gh.gamecenter.entity.VideoEntity
import com.gh.gamecenter.eventbus.EBDownloadStatus
import com.gh.gamecenter.eventbus.EBPackage
import com.gh.gamecenter.eventbus.EBReuse
import com.gh.gamecenter.manager.UserManager
import com.gh.gamecenter.qa.comment.CommentActivity
import com.gh.gamecenter.qa.comment.NewCommentFragment
import com.halo.assistant.HaloApp
import com.lightgame.download.DataWatcher
import com.lightgame.download.DownloadEntity
import com.lightgame.listeners.OnBackPressedListener
@ -142,6 +145,9 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
if (!isShowSlide) {
showSlideGuide()
}
if (mIsHomeVideo) {
setAdvertisement(0)
}
}
}
@ -184,10 +190,6 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
mViewModel.needToUpdateVideoInfo.observeNonNull(this) {
findFirstCompletelyVisibleVideoViewByPosition()?.updateViewDetail(it)
}
if (mIsHomeVideo) {
setAdvertisement(0)
}
}
private fun initListener() {
@ -439,7 +441,6 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
val videoView = findFirstCompletelyVisibleVideoViewByPosition()
videoView?.run {
if (videoView.isInPlayingState) {
// CustomManager.onResume("detail_${mViewModel.uuid}", false)
videoView.onVideoResume(false)
} else {//快速切换视频后再切换页面可能没有播放
videoView.startButton?.performClick()
@ -469,7 +470,6 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
videoView.uploadVideoStreamingPlaying("暂停页面")
if (pauseVideo[mViewModel.uuid] == true) {
if (videoView.isInPlayingState) {
// CustomManager.onPause("detail_${mViewModel.uuid}")
videoView.onVideoPause()
} else {
CustomManager.releaseAllVideos("detail_${mViewModel.uuid}")
@ -482,7 +482,6 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
}
SPUtils.setBoolean(Constants.SP_SHOW_SLIDE_GUIDE, true)
CacheManager.getInstance().removeAllCall()
val proxy = CustomProxyCacheManager.getProxy(requireContext(), null)
runOnIoThread {
proxy.allClients.forEach {
@ -497,6 +496,7 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
serverSocket.close()
}*/
super.onPause()
CacheManager.getInstance().removeAllCall()
}
override fun onDestroyView() {
@ -505,12 +505,12 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
mBaseHandler.postDelayed({
CustomManager.releaseAllVideos("detail_${mViewModel.uuid}")
}, 500)
CacheManager.getInstance().removeAllCall()
if (mAdCountDownTimer != null && !mAdCountDownTimer!!.isDisposed) {
mAdCountDownTimer?.dispose()
}
pauseVideo.remove(mViewModel.uuid)
super.onDestroyView()
CacheManager.getInstance().removeAllCall()
}
private fun findFirstCompletelyVisibleVideoViewByPosition(): DetailPlayerView? {
@ -654,6 +654,32 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(status: EBReuse) {
val videoView = findFirstCompletelyVisibleVideoViewByPosition()
//处理打开评论页面按手机Home键回到桌面还会听到视频的声音
if (NewCommentFragment.COMMENT_PAUSE == status.type) {
if (!HaloApp.getInstance().isRunningForeground) {
videoView?.onVideoPause()
}
}
//产品没说回到前台需要继续恢复播放,先注释掉
/*else if (NewCommentFragment.COMMENT_RESUME == status.type) {
val activityStack = AppManager.getInstance().activityStack
var i = activityStack.size - 1
while (i >= 0) {
val activity = activityStack[i]
if (activity is VideoDetailActivity || activity is MainActivity) {
if (requireActivity().componentName == activity.componentName) {
videoView?.onVideoResume(false)
}
break
}
i--
}
}*/
}
override fun onHandleBackPressed(): Boolean {
if (::mAdapter.isInitialized) {
return mAdapter.onBackPressed(findFirstCompletelyVisibleVideoViewByPosition())

Binary file not shown.

Before

Width:  |  Height:  |  Size: 919 KiB

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -227,8 +227,8 @@
<View
android:id="@+id/main_iv_message_hint"
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_width="4dp"
android:layout_height="4dp"
android:layout_alignParentRight="true"
android:background="@drawable/oval_message_hint_bg"
android:visibility="gone" />

View File

@ -86,7 +86,7 @@
<TextView
android:id="@+id/game_rating"
visibleGone="@{game.commentCount >= 10 &amp;&amp; game.star >= 7}"
visibleGone="@{game.commentCount >= 3 &amp;&amp; game.star >= 7}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/home_game_rating"

View File

@ -144,7 +144,7 @@
<TextView
android:id="@+id/game_rating"
visibleGone="@{data.commentCount >= 10 &amp;&amp; data.star >= 7}"
visibleGone="@{data.commentCount >= 3 &amp;&amp; data.star >= 7}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/home_game_rating"

View File

@ -7,8 +7,8 @@ ext {
targetSdkVersion = 26
// application info
versionCode = 130
versionName = "3.7.2"
versionCode = 131
versionName = "3.7.3"
applicationId = "com.gh.gamecenter"
// AndroidX

View File

@ -54,8 +54,8 @@ DATA_HOST=https\://data.ghzs.com/
# 请不要手动改动下面的值除非你明确需要以某个apk作为基准包需要打包请以scripts/tinker*.sh为准
TINKER_ENABLE=
TINKER_ID=06ec87b
TINKER_BASE_APK_DIR=app-0117-15-19-59_06ec87b
TINKER_ID=5c929ba30
TINKER_BASE_APK_DIR=app-0219-17-08-22_5c929ba30
android.useAndroidX=true
android.enableJetifier=true

View File

@ -98,17 +98,18 @@ public class HttpUrlSource implements Source {
if (connection != null) {
try {
connection.disconnect();
} catch (NullPointerException | IllegalArgumentException e) {
} catch (Exception e) {
String message = "Wait... but why? WTF!? " +
"Really shouldn't happen any more after fixing https://github.com/danikula/AndroidVideoCache/issues/43. " +
"If you read it on your device log, please, notify me danikula@gmail.com or create issue here " +
"https://github.com/danikula/AndroidVideoCache/issues.";
throw new RuntimeException(message, e);
} catch (ArrayIndexOutOfBoundsException e) {
e.printStackTrace();
// throw new RuntimeException(message, e);
} /*catch (ArrayIndexOutOfBoundsException e) {
HttpProxyCacheDebuger.printfError("Error closing connection correctly. Should happen only on Android L. " +
"If anybody know how to fix it, please visit https://github.com/danikula/AndroidVideoCache/issues/88. " +
"Until good solution is not know, just ignore this issue :(", e);
}
}*/
}
}