Method and apparatus for resizing window, electronic device, and readable storage medium
AssigneeBeijing Xiaomi Mobile Software Co., Ltd.
InventorsYuan Gao, Wenbai Zheng
Life of this patent
Estimating the term…
Abstract
The present disclosure relates to a method for resizing a window, an electronic device, and a readable storage medium. The method includes: obtaining, in response to an operation triggered for rotating a roll-up shaft being detected, a stretching rate and duration of the roll-up screen; and resizing the window of a current application displayed by the roll-up screen based on the stretching rate and duration of the roll-up screen.
Claims9
A method for resizing a window, comprising:
- obtaining, by an electronic device with a roll-up screen, a stretching rate and duration of the roll-up screen in response to detecting an operation triggered for rotating a roll-up shaft;
- and
- resizing an application window of a current application displayed on the roll-up screen based on the stretching rate and the duration of the roll-up screen, by
- acquiring an initial size of the application window of the current application;
- obtaining size compensation for the application window based on the stretching rate and the duration, wherein the stretching rate is preset;
- obtaining a target size for the application window based on the initial size and the size compensation;
- acquiring an application type of the current application;
- and
- adjusting the application window from being of the initial size to being of the target size according to the application type,
- wherein when the application type is a third-party application type, adjusting the application window from being of the initial size to being of the target size according to the application type, comprises:
- creating a temporary layer at a top layer of one or more system layers, the temporary layer comprising a mapping window corresponding to the application window, the mapping window being in a same location as the application window;
- and
- adjusting the temporary layer from being of the initial size to being of the target size according to a preset animation effect, and adjusting the application window from being of the initial size to being of the target size.
An electronic device comprising:
- a roll-up screen, a memory, and a processor, wherein the memory is configured to store a computer program executable by the processor;
- and
- the processor is configured to:
- obtain, in response to an operation triggered for rotating a roll-up shaft being detected, a stretching rate and duration of the roll-up screen;
- and
- resize an application window of a current application displayed on the roll-up screen based on the stretching rate and the duration of the roll-up screen, by
- acquiring an initial size of the application window of the current application;
- obtaining size compensation for the application window based on the stretching rate and the duration, wherein the stretching rate is preset
- obtaining a target size for the application window based on the initial size and the size compensation;
- and
- adjusting the application window from being of the initial size to being of the target size;
- wherein when the application type is a third-party application type, the processor is further configured to:
- create a temporary layer at a top layer of one or more system layers, the temporary layer comprising a mapping window corresponding to the application window, the mapping window being in a same location as the application window;
- and
- adjust the temporary layer from being of the initial size to being of the target size according to a preset animation effect, and adjusting the application window from being of the initial size to being of the target size.
A non-transitory computer-readable storage medium that, when an executable computer program therein is executed by a processor of an electronic device provided with a roll-up screen, implements the method comprising:
- obtaining, in response to an operation triggered for rotating a roll-up shaft being detected, a stretching rate and duration of the roll-up screen;
- and
- resizing an application window of a current application displayed on the roll-up screen based on the stretching rate and the duration of the roll-up screen by
- acquiring an initial size of the application window of the current application;
- obtaining size compensation for the application window based on the stretching rate and the duration, wherein the stretching rate is preset
- obtaining a target size for the application window based on the initial size and the size compensation;
- and
- adjusting the application window from being of the initial size to being of the target size;
- wherein when the application type is a third-party application type, adjusting the application window from being of the initial size to being of the target size according to the application type, comprises:
- creating a temporary layer at a top layer of one or more system layers, the temporary layer comprising a mapping window corresponding to the application window, the mapping window being in a same location as the application window;
- and
- adjusting the temporary layer from being of the initial size to being of the target size according to a preset animation effect, and adjusting the application window from being of the initial size to being of the target size.
Dependencies are inferred from the claim text.