fixed memory leak

changed icon - thanks to @novadng
This commit is contained in:
Mariotaku Lee 2016-12-16 18:56:16 +08:00
parent 3de385694d
commit f632276ca4
11 changed files with 8 additions and 9 deletions

View File

@ -184,24 +184,23 @@ abstract class AbsStatusesFragment protected constructor() :
super.onStart()
recyclerView.addOnScrollListener(onScrollListener)
recyclerView.addOnScrollListener(pauseOnScrollListener)
val task = object : AbstractTask<Any?, Boolean, RecyclerView>() {
val task = object : AbstractTask<Any?, Boolean, AbsStatusesFragment>() {
public override fun doLongOperation(params: Any?): Boolean {
val context = context ?: return false
val prefs = context.getSharedPreferences(TwidereConstants.SHARED_PREFERENCES_NAME,
Context.MODE_PRIVATE)
val context = callback?.context ?: return false
val prefs = callback?.preferences ?: return false
if (!prefs.getBoolean(Constants.KEY_USAGE_STATISTICS, false)) return false
val logFile = HotMobiLogger.getLogFile(context, null, "scroll")
return logFile.length() < 131072
}
public override fun afterExecute(recyclerView: RecyclerView?, result: Boolean?) {
if (result!!) {
activeHotMobiScrollTracker = hotMobiScrollTracker
recyclerView!!.addOnScrollListener(activeHotMobiScrollTracker)
public override fun afterExecute(fragment: AbsStatusesFragment?, result: Boolean) {
if (result && fragment != null) {
fragment.activeHotMobiScrollTracker = fragment.hotMobiScrollTracker
fragment.recyclerView.addOnScrollListener(fragment.activeHotMobiScrollTracker)
}
}
}
task.callback = recyclerView
task.callback = this
TaskStarter.execute(task)
bus.register(statusesBusCallback)
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 25 KiB