US 11,755,177 B2
Method and apparatus for adjusting window, electronic device, and computer readable storage medium
Jubao Hu, Beijing (CN); Jianjiang Qu, Beijing (CN); and Jian Miao, Beijing (CN)
Assigned to Beijing Xiaomi Mobile Software Co., Ltd., Beijing (CN)
Filed by BEIJING XIAOMI MOBILE SOFTWARE CO., LTD, Beijing (CN)
Filed on Apr. 27, 2022, as Appl. No. 17/730,185.
Claims priority of application No. 202111307985.9 (CN), filed on Nov. 5, 2021.
Prior Publication US 2023/0146334 A1, May 11, 2023
Int. Cl. G06F 3/0482 (2013.01); G06F 3/04847 (2022.01); G06F 3/04812 (2022.01)
CPC G06F 3/0482 (2013.01) [G06F 3/04812 (2013.01); G06F 3/04847 (2013.01)] 15 Claims
OG exemplary drawing
 
1. A method for adjusting a window, comprising:
in response to detecting a first operation for triggering a specified position of the window, obtaining, by an electronic device, at least one candidate proportion of the window based on a type of the window, and obtaining an actual proportion of the window, wherein the actual proportion of the window obtained varies with the first operation;
in response to detecting a second operation for stopping triggering the window, obtaining, by the electronic device, a difference between the at least one candidate proportion and the actual proportion, and determining a candidate proportion with a smallest difference as a target proportion; and
adjusting, by the electronic device, a proportion of the window from the actual proportion to the target proportion;
wherein obtaining at least one candidate proportion of the window comprises:
in response to the window being not a type of game window or a type of video full screen window, obtaining attribute information of the window;
in response to the attribute information of the window meeting a first set condition, determining that the window corresponds to a landscape screen mode and the candidate proportion of the window is a first proportion;
in response to the attribute information of the window meeting a second set condition, determining that the window corresponds to a portrait screen mode and the candidate proportion& of the window are a second proportion and a third proportion;
in response to the attribute information of the window not meeting the first set condition or the second set condition, determining that the candidate proportions of the window are the first proportion, the second proportion and the third proportion;
wherein the first proportion, the second proportion and the third proportion are preset in a native scheme in an Android system of the electronic device to enable an application in the window to adapt to the Android system.