修复 社区Tab崩溃的问题

This commit is contained in:
hyb1996
2019-02-03 14:27:47 +08:00
parent 402a78c354
commit 876e9235f6
5 changed files with 13 additions and 9 deletions

Binary file not shown.

View File

@@ -131,7 +131,7 @@ public class TinySign {
zipAndSha1(dir, zos, dos, manifest);
Attributes main = manifest.getMainAttributes();
main.putValue("Manifest-Version", "1.0");
main.putValue("Created-By", "tiny-sign-" + TinySign.class.getPackage().getImplementationVersion());
main.putValue("Created-By", "Auto.js");
zos.putNextEntry(new ZipEntry("META-INF/MANIFEST.MF"));
manifest.write(dos);
zos.closeEntry();

View File

@@ -129,12 +129,12 @@ public class CommunityFragment extends ViewPagerFragment implements BackPressedH
@Override
public void onPageShow() {
super.onPageShow();
EventBus.getDefault().post(new VisibilityChange(true));
//EventBus.getDefault().post(new VisibilityChange(true));
}
@Override
public void onPageHide() {
super.onPageHide();
EventBus.getDefault().post(new VisibilityChange(false));
//EventBus.getDefault().post(new VisibilityChange(false));
}
}

View File

@@ -68,7 +68,7 @@ public class CommunityDrawerMenu {
if (online) {
refreshNotificationCount(adapter);
}
});
}, Throwable::printStackTrace);
}

View File

@@ -44,11 +44,15 @@ class MarketFragment : ViewPagerFragment(0) {
private fun refresh() {
GlobalScope.launch(Dispatchers.Main) {
swipeRefreshLayout.isRefreshing = true
val topics = TopicService.getScriptsTopics()
mTopics.clear()
mTopics.addAll(topics)
topicsView.adapter!!.notifyDataSetChanged()
swipeRefreshLayout.isRefreshing = false
try {
val topics = TopicService.getScriptsTopics()
mTopics.clear()
mTopics.addAll(topics)
topicsView.adapter!!.notifyDataSetChanged()
swipeRefreshLayout.isRefreshing = false
} catch (e: Exception) {
e.printStackTrace()
}
}
}