修复 社区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); zipAndSha1(dir, zos, dos, manifest);
Attributes main = manifest.getMainAttributes(); Attributes main = manifest.getMainAttributes();
main.putValue("Manifest-Version", "1.0"); 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")); zos.putNextEntry(new ZipEntry("META-INF/MANIFEST.MF"));
manifest.write(dos); manifest.write(dos);
zos.closeEntry(); zos.closeEntry();

View File

@@ -129,12 +129,12 @@ public class CommunityFragment extends ViewPagerFragment implements BackPressedH
@Override @Override
public void onPageShow() { public void onPageShow() {
super.onPageShow(); super.onPageShow();
EventBus.getDefault().post(new VisibilityChange(true)); //EventBus.getDefault().post(new VisibilityChange(true));
} }
@Override @Override
public void onPageHide() { public void onPageHide() {
super.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) { if (online) {
refreshNotificationCount(adapter); refreshNotificationCount(adapter);
} }
}); }, Throwable::printStackTrace);
} }

View File

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