Commit 770f50fd authored by 李康's avatar 李康

support non-scrollable filter pane

parent 3f908459
......@@ -51,11 +51,11 @@ def getAllFilterTypes(d):
filter.click()
ftype_names = []
filter_pane = d(scrollable=True)
if filter_pane.count != 1:
print("filter pane is invalid!")
if filter_pane.count not in [0, 1]:
print("filter pane is invalid(with count %d)!" % filter_pane.count)
return
while True:
ftypes = filter_pane.child(resourceId="org.c2h4.afei.beauty:id/tv_type")
ftypes = d(resourceId="org.c2h4.afei.beauty:id/tv_type")
new_flag = False
for ftype in ftypes:
if ftype.get_text() == "全部品类":
......@@ -65,11 +65,13 @@ def getAllFilterTypes(d):
else:
new_flag = True
ftype_names.append(ftype.get_text())
if new_flag:
if new_flag and filter_pane.count:
filter_pane.scroll.vert(steps=filter_scroll_steps)
else:
break
filter_pane.scroll.vert.backward()
if filter_pane.count:
filter_pane.scroll.vert.backward()
return ftype_names
def filterProduct(d, ftype_name):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment