Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Commit

Permalink
优化排行榜触底判断
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyJiangWJ committed Jun 27, 2019
1 parent 2a688d3 commit 4a1ea9e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions core/Ant_forest.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,23 +583,21 @@ function Ant_forest(automator, unlock) {
}

const foundNoMoreWidget = function () {
let height = device.height
height = height < 10 ? 2300 : height
let noMoreWidgetCenterY = 0

let noMoreWidgetHeight = 0
let bounds = null
if (descEndsWith('没有更多了').exists()) {
noMoreWidgetCenterY = descEndsWith('没有更多了')
bounds = descEndsWith('没有更多了')
.findOne(_config.get("timeout_findOne"))
.bounds()
.centerY()
} else if (textEndsWith('没有更多了').exists()) {
noMoreWidgetCenterY = textEndsWith('没有更多了')
bounds = textEndsWith('没有更多了')
.findOne(_config.get("timeout_findOne"))
.bounds()
.centerY()
}
// todo 该校验并不完美,当列表已经加载过之后,明明没有在视野中的控件,位置centerY还是能够获取到,而且非0
if (noMoreWidgetCenterY !== 0 && noMoreWidgetCenterY < height) {
if (bounds) {
noMoreWidgetHeight = bounds.bottom - bounds.top
}
if (noMoreWidgetHeight > 50) {
return true
} else {
return false
Expand Down

0 comments on commit 4a1ea9e

Please sign in to comment.