fix(输入法): 消除RTOS和Android文字键盘间距
这个提交包含在:
1 父节点
87aa966a51
当前提交
bce6f8083b
27 个文件已更改
+406
-253
没有与搜索条件相匹配的文件
@@ -17,12 +17,13 @@ def inspect(path,profile):
|
||||
visible_pages(frame['widgets'])
|
||||
page=pages[-1]
|
||||
circle=profile.startswith('round');width=466 if circle else 390;height=466 if circle else 450
|
||||
failures=[];buttons=[];icons=[]
|
||||
failures=[];buttons=[];icons=[];regions={}
|
||||
def visit(node,ancestors=(),px=0,py=0,visible=True):
|
||||
g=node['geometry'];x=px+g['x'];y=py+g['y'];w=g['w'];h=g['h']
|
||||
visible=visible and node.get('visible',True)
|
||||
if not visible:return
|
||||
box=[x,y,w,h];kind=node['class'];identifier=node.get('id','')
|
||||
if identifier in ['ime-preview','ime-composition','ime-keypad','ime-candidate-strip']:regions[identifier]=box
|
||||
if kind in ['Button','ImageBox','Label']:
|
||||
for ancestor in ancestors:
|
||||
ax,ay,aw,ah=ancestor['box']
|
||||
@@ -36,4 +37,12 @@ def inspect(path,profile):
|
||||
(buttons if kind=='Button'else icons).append(record)
|
||||
for child in node.get('children',[]):visit(child,ancestors+({'class':kind,'id':identifier,'box':box},),x,y,visible)
|
||||
visit(page)
|
||||
return {'page':page.get('id'),'buttons':len(buttons),'icons':len(icons),'max_button_radius':round(max([b['radius']or 0 for b in buttons],default=0),2),'failures':failures,'passed':not failures}
|
||||
gaps={}
|
||||
if 'ime-composition' in regions and 'ime-keypad' in regions:
|
||||
compose=regions['ime-composition'];keys=regions['ime-keypad']
|
||||
gap=keys[1]-compose[1]-compose[3];gaps['composition_to_keys']=gap
|
||||
# Account for the actual visible strip; direct entry may leave at most
|
||||
# one rounding pixel, never an unused candidate-sized band.
|
||||
maximum=(48 if circle else 53)if 'ime-candidate-strip' in regions else 1
|
||||
if gap < -1 or gap > maximum:failures.append({'reason':'extra gap before keyboard','gap':gap,'maximum':maximum})
|
||||
return {'page':page.get('id'),'buttons':len(buttons),'icons':len(icons),'gaps':gaps,'max_button_radius':round(max([b['radius']or 0 for b in buttons],default=0),2),'failures':failures,'passed':not failures}
|
||||
在新工单中引用
屏蔽一个用户