修复总开服表下载刷新问题
This commit is contained in:
@ -18,7 +18,6 @@ import com.gh.common.util.dip2px
|
||||
import com.gh.common.util.toColor
|
||||
import com.gh.common.view.DrawableView
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.kaifu.KaiFuVpFragment
|
||||
import com.halo.assistant.HaloApp
|
||||
import kotterknife.bindView
|
||||
|
||||
@ -71,12 +70,10 @@ class GameServersActivity : BaseActivity() {
|
||||
HaloApp.getInstance().mainExecutor.execute {
|
||||
for (fragment in mFragments) {
|
||||
if (fragment.userVisibleHint) {
|
||||
val fragments = fragment.fragmentManager?.fragments
|
||||
if (fragments != null) {
|
||||
for (childFragment in fragments) {
|
||||
if (childFragment is GameServersContentFragment) {
|
||||
childFragment.vpScrollState(state)
|
||||
}
|
||||
val fragments = fragment.childFragmentManager.fragments
|
||||
for (childFragment in fragments) {
|
||||
if (childFragment is GameServersContentFragment) {
|
||||
childFragment.vpScrollState(state)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ public class GameServersContentFragment extends BaseFragment {
|
||||
private String mTags;
|
||||
private String mType;
|
||||
|
||||
private boolean mIsRefreshDownload;
|
||||
private boolean mIsRefreshDownload = true;
|
||||
|
||||
private DataWatcher dataWatcher = new DataWatcher() {
|
||||
@Override
|
||||
@ -215,7 +215,7 @@ public class GameServersContentFragment extends BaseFragment {
|
||||
Fragment parentFragment = getParentFragment();
|
||||
if (parentFragment instanceof GameServersTestFragment) {
|
||||
((GameServersTestFragment) parentFragment).resetFilter();
|
||||
} else if (parentFragment instanceof GameServersPublishFragment) {
|
||||
} else if (parentFragment instanceof GameServersPublishFragment) {
|
||||
((GameServersPublishFragment) parentFragment).resetFilter();
|
||||
}
|
||||
});
|
||||
@ -229,30 +229,12 @@ public class GameServersContentFragment extends BaseFragment {
|
||||
onRefreshPage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
if (getUserVisibleHint()) {
|
||||
mIsRefreshDownload = true;
|
||||
if (mLoading == null) {
|
||||
mBaseHandler.postDelayed(() -> setUserVisibleHint(true), 500);
|
||||
} else if (mLoading.getVisibility() == View.VISIBLE) {
|
||||
mAdapter.addList();
|
||||
}
|
||||
} else {
|
||||
mIsRefreshDownload = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void vpScrollState(int status) {
|
||||
if (status == ViewPager.SCROLL_STATE_IDLE) {
|
||||
if (getUserVisibleHint()) {
|
||||
mIsRefreshDownload = true;
|
||||
}
|
||||
mIsRefreshDownload = true;
|
||||
|
||||
} else if (status == ViewPager.SCROLL_STATE_DRAGGING) {
|
||||
if (getUserVisibleHint()) {
|
||||
mIsRefreshDownload = false;
|
||||
}
|
||||
mIsRefreshDownload = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/kaifu_item_time_tv"
|
||||
android:layout_width = "wrap_content"
|
||||
android:layout_width = "match_parent"
|
||||
android:layout_height = "wrap_content"
|
||||
android:textColor = "@color/black"
|
||||
android:textSize = "14sp"
|
||||
|
||||
Reference in New Issue
Block a user