CN114995929A - Popup window display method and device - Google Patents

Popup window display method and device Download PDF

Info

Publication number
CN114995929A
CN114995929A CN202111365121.2A CN202111365121A CN114995929A CN 114995929 A CN114995929 A CN 114995929A CN 202111365121 A CN202111365121 A CN 202111365121A CN 114995929 A CN114995929 A CN 114995929A
Authority
CN
China
Prior art keywords
window
animation
parameters
parameter
height
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111365121.2A
Other languages
Chinese (zh)
Other versions
CN114995929B (en
Inventor
何旭
刘晶
胡建沛
汤阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202111365121.2A priority Critical patent/CN114995929B/en
Publication of CN114995929A publication Critical patent/CN114995929A/en
Application granted granted Critical
Publication of CN114995929B publication Critical patent/CN114995929B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a popup display method and device, a computer readable storage medium and a computer program product, which can enable the popup to be more smooth and natural when popped up, and improve user experience. The method comprises the following steps: receiving the operation of a user; responding to the operation, and generating a window to be displayed; determining dynamic effect parameters of the window, wherein the dynamic effect parameters comprise scaling parameters, and the values of the scaling parameters are determined based on an elastic curve; determining the animation effect of the window by using the dynamic effect parameters, wherein the motion trail of the animation effect of the window is determined based on the elastic curve; and displaying the animation effect of the window.

Description

Popup window display method and device
Technical Field
The present application relates to the field of electronic devices, and in particular, to a pop-up window display method and apparatus.
Background
A pop-up is a type of view used to present information to a user. On the terminal equipment, various prompt widgets are often popped up. These widgets may be used to prompt the user for certain information, or to provide the user with certain operational options, etc. The animation effect currently used when these small windows pop up is a combination of zoom and transparency. The pop-up effect of the dynamic effect is more abrupt and unnatural when the window is popped up, and the user experience is influenced.
Disclosure of Invention
In view of this, the present application provides a pop-up window display method, device, computer-readable storage medium, and computer program product, which can make the pop-up window more fluent and natural when popped up, and improve user experience.
In a first aspect, a popup window display method is provided, including:
receiving the operation of a user;
responding to the operation, and generating a window to be displayed;
determining dynamic effect parameters of the window, wherein the dynamic effect parameters comprise scaling parameters, and the values of the scaling parameters are determined based on an elastic curve;
determining the animation effect of the window by using the dynamic effect parameters, wherein the motion trail of the animation effect of the window is determined based on the elastic curve;
and displaying the animation effect of the window.
The embodiment of the application provides a display method of a popup window, the dynamic effect parameters of the window are determined through elasticity, the dynamic effect parameters comprise zoom parameters, the animation effect of the window is generated by the dynamic effect parameters, the movement track of the popup window is enabled to be more in line with the physics elastic movement law, the animation effect of the popup window is enabled to be smoother and more natural, and user experience is improved.
The elasticity curve is generated according to elasticity curve parameters. The embodiment of the present application does not specifically limit how the elasticity curve parameter is determined. One way, regardless of the height of the window, uses a preset set of fixed elasticity curve parameters. Alternatively, the window animation extension module determines an elasticity curve parameter corresponding to the height of the window based on the height of the window.
In a possible implementation, the elasticity curve parameter is determined according to the height of the window. Therefore, different elastic curve parameters can be configured for different window heights, so that the popup of the window is more in line with the physical law, and the real feeling of a user is improved.
It should be noted that, generally speaking, the size of the window is composed of a height and a width, and the height of the window can be considered when determining the elasticity curve parameter in the embodiment of the present application. For example, the larger the height of the window is, the smaller the rebound amplitude of the overshoot during the pop-up is, the fewer the rebound times are, and the shorter the animation duration is; the smaller the height of the window is, the larger the rebound amplitude of the overshoot during the pop-up, the larger the rebound frequency and the longer the animation time duration.
In one possible implementation, the elasticity curve parameter is determined according to the height of the window, and includes:
the elastic curve parameters are obtained from a parameter rule model library, which includes elastic curve parameters corresponding to the height of the window.
In a possible implementation manner, the parameter rule model base is determined according to any one of the following manners:
the parameter rule model base is determined based on a height interval where the height of the window is located, and comprises different height intervals and elastic curve parameters corresponding to each height interval;
the parameter rule model base is determined based on the proportion of the height of the window occupying the height of the display screen of the terminal, and the parameter rule model base comprises different proportion intervals and elastic curve parameters corresponding to each proportion interval.
In one possible implementation, the animation effect of the window is composed of a plurality of frames; wherein the determining the animation effect of the window by using the dynamic effect parameter comprises:
the window animation module sends the dynamic effect parameters of each frame to the display synthesis system;
the display synthesis system correspondingly processes the layers based on the dynamic effect parameters of each frame, and the processing comprises any one of the following operations: zoom out, or zoom in;
the display synthesis system executes layer mixing operation on each processed frame image layer to obtain the image content of each frame;
wherein the displaying the animation effect of the window comprises:
and displaying the picture content of each frame in the plurality of frames on the display screen frame by frame.
In one possible implementation, the method further includes:
judging the type of the window;
and when the type of the window is determined to be a small window type, acquiring the height of the window.
The window types applied by the embodiment of the present application are small window types, such as a dialog window and a pop-up window. According to the popup window display method, the popup window can be more fluent and natural when popped up.
Optionally, the elasticity curve parameters include a damping coefficient and a stiffness coefficient. The elasticity curve can be determined based on the damping coefficient and the stiffness coefficient. It should be understood that determining the elasticity curve may also include other parameters, which may be set as default values, and is not particularly limited in this regard.
Optionally, the dynamic effect parameter further comprises a transparency parameter. It is understood that the animation parameters may also include parameters of other animation elements to provide a rich experience for the user, which is not particularly limited.
In a second aspect, an electronic device is provided that includes means for performing any of the methods of the first aspect. The electronic device may be a terminal device or a chip in the terminal device. The electronic device includes an input unit, a display unit, and a processing unit.
When the electronic device is a terminal device, the processing unit may be a processor, the input unit may be a communication interface, and the display unit may be a graphic processing module and a screen; the terminal device may further comprise a memory for storing computer program code which, when executed by the processor, causes the terminal device to perform any of the methods of the first aspect.
When the electronic device is a chip in a terminal device, the processing unit may be a logic processing unit inside the chip, the input unit may be an output interface, a pin, a circuit, or the like, and the display unit may be a graphic processing unit inside the chip; the chip may also include a memory, which may be a memory within the chip (e.g., registers, cache, etc.) or a memory external to the chip (e.g., read-only memory, random access memory, etc.); the memory is adapted to store computer program code which, when executed by the processor, causes the chip to perform any of the methods of the first aspect.
In one implementation, the input unit is used for receiving an operation of a user;
the processing unit is used for responding to the operation and generating a window to be displayed; determining dynamic effect parameters of the window, wherein the dynamic effect parameters comprise scaling parameters, and the values of the scaling parameters are determined based on an elastic curve; determining the animation effect of the window by using the dynamic effect parameters, wherein the motion trail of the animation effect of the window is determined based on the elastic curve;
the display unit is used for displaying the animation effect of the window.
In one possible implementation, the elasticity curve is generated according to an elasticity curve parameter, which is determined according to the height of the window.
In one possible implementation, the elasticity curve parameter is determined according to the height of the window, and includes:
the elastic curve parameters are obtained from a parameter rule model library, which includes elastic curve parameters corresponding to the height of the window.
In a possible implementation manner, the parameter rule model base is determined according to any one of the following manners:
the parameter rule model base is determined based on a height interval where the height of the window is located, and comprises different height intervals and elastic curve parameters corresponding to each height interval;
the parameter rule model base is determined based on the proportion of the height of the window occupying the height of the display screen of the terminal, and the parameter rule model base comprises different proportion intervals and elastic curve parameters corresponding to the proportion intervals.
In one possible implementation, the animation effect of the window is composed of a plurality of frames; the processing unit determines the animation effect of the window by using the dynamic effect parameter, and specifically includes:
calling a window animation module to send the dynamic effect parameters of each frame to a display synthesis system;
the display synthesis system is used for carrying out corresponding processing on the layers based on the dynamic effect parameters of each frame, and the processing comprises any one of the following operations: zoom out, or zoom in;
the display synthesis system is used for executing layer mixing operation on each processed frame image layer to obtain the image content of each frame;
the display unit is used for displaying the animation effect of the window, and specifically comprises:
the picture content of each frame of the plurality of frames is shown on the display screen frame by frame.
In one possible implementation, the processing unit is further configured to:
judging the type of the window;
and when the type of the window is determined to be a small window type, acquiring the height of the window.
Optionally, the elasticity curve parameters include a damping coefficient and a stiffness coefficient. The elasticity curve can be determined based on the damping coefficient and the stiffness coefficient. It should be understood that determining the elasticity curve may also include other parameters, which may be set as default values, and is not particularly limited in this regard.
Optionally, the dynamic effect parameter further comprises a transparency parameter. It is understood that the animation parameters may also include parameters of other animation elements to provide a rich experience for the user, which is not particularly limited.
In a third aspect, a computer-readable storage medium is provided, which stores computer program code that, when executed by an electronic device, causes the electronic device to perform any of the methods of the first aspect.
In a fourth aspect, there is provided a computer program product comprising: computer program code which, when run by an electronic device, causes the electronic device to perform any of the methods of the first aspect.
Drawings
FIG. 1 is a diagram of an example of window types applied by an embodiment of the present application;
FIG. 2 is a graphical illustration of an underdamped condition;
FIG. 3 is a schematic diagram of a hardware system suitable for use in the apparatus of the present application;
FIG. 4 is a schematic diagram of a software system suitable for use with the apparatus of the present application;
FIG. 5 is a schematic interaction diagram of a Dialog window display of an embodiment of the present application;
FIG. 6 is an exemplary diagram of an interface for presenting reminder information to a user;
FIG. 7 is an exemplary interface diagram of a window animation effect according to an embodiment of the application;
FIG. 8 is an exemplary graph of an elasticity curve;
fig. 9 is a schematic view of a display method of a pop-up window according to an embodiment of the present application;
fig. 10 is a flowchart illustrating an example of a pop-up window display method according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
In the embodiments of the present application, "a plurality" may mean two or more unless otherwise specified.
The pop-up window display method provided by the embodiment of the application can be applied to the following pop-up window types: dialog windows (e.g., Dialog), pop-up windows (e.g., popwindow), and derivatives of Dialog and popwindow, etc. Such windows are also referred to as pop-up window types or portlet types.
And (4) pop-up window: which may be understood as a view displayed in a particular scene for presenting information to a user. For example, when the server sends a notification message to the terminal, the terminal displays the notification message through a popup window. For another example, when the user triggers some operations, the terminal feeds back information related to the operations to the user through a popup window.
Referring to fig. 1, fig. 1 illustrates an exemplary view of a window type applied by an embodiment of the present application.
The window 11 shown in (1) in fig. 1 is an example of a Dialog window. As shown in fig. 1 (1), when the user selects the text (glory) 10 in the interface, a pop-up window 11 is formed in the interface. The content displayed in the window 11 contains operation options for the text 10. Operational options for text 10 include, but are not limited to, the following: full selection, cutting, copying, pasting, and sharing. Window 11 is an example of a Dialog window.
The window 12 shown in (2) in fig. 1 is an example of a PopupWindow. As shown in the window 12 of the interface (2) in fig. 1, the window 12 includes buttons provided by the terminal to the user, for example, a highlight button and other buttons.
It should be understood that the example in fig. 1 is only for easy understanding and does not limit the embodiments of the present application.
After the user operates the application, the application presents information (e.g., prompts or operation options, etc.) to the user. The information may be presented to the user in a window for the carrier. The terminal can add animation effect to the window, so that the window can be dynamically displayed on the interface according to the animation effect.
In order to enable a window to be more natural when the window pops up, the embodiment of the application provides a display method of a popup window, dynamic effect parameters of the window are determined through an elastic curve, the dynamic effect parameters comprise scaling parameters, and an animation effect of the window is generated by utilizing the dynamic effect parameters, so that the motion track of the popup window is more consistent with the physics elastic motion law, the animation effect of the popup window is smoother and more natural, and the user experience is improved.
The embodiment of the application relates to a spring model algorithm. The knowledge about the spring model algorithm is briefly introduced here.
The mathematical principle of the elasticity curve is to damp the vibrations. The elastic curve can be understood as the curve generated by the object connected with the spring under the damping vibration. The damping states include critical damping, under-damping, and over-damping. The embodiment of the application utilizes the elastic curve of the spring in an underdamped state.
The elasticity curve is constructed based on elasticity curve parameters. The elastic curve parameters of the embodiments of the present application may include a spring stiffness parameter (or referred to as a stiffness coefficient, which may be referred to as k) and a damping parameter (or referred to as a damping coefficient, which may be referred to as γ).
Alternatively, the elasticity curve parameters may also include the mass m of the object, the initial displacement p of the equilibrium point, and the initial velocity v. In actual use, the object mass m, the initial displacement p of the equilibrium point, and the initial velocity v may be considered as initial conditions, and may take default values. Based on the spring stiffness parameter and the damping coefficient, the spring curve can be determined.
Taking the body connected with the spring as an example, the force applied to the body connected with the spring includes a tension and a friction, wherein the tension is expressed as follows:
F tension =-kx
in the above formula, F tension Representing the tension experienced by the object and x representing the elastic displacement of the object.
The friction force is expressed as follows:
Figure BDA0003360390370000051
in the above formula, F friction Representing the friction force on the object, v is the initial velocity (which may default to 0, or may be set to some other value),
Figure BDA0003360390370000052
representing the first derivative of x, and may also be expressed as
Figure BDA0003360390370000053
t is time.
Meanwhile, according to the relationship between the force applied to the object and the acceleration, the following formula can be obtained:
Figure BDA0003360390370000054
in the above equation, m is the mass of the object (generally regarded as 1 by default), a is the acceleration of the object,
Figure BDA0003360390370000055
representing the second derivative of x.
Therefore, the displacement of the object is related to time by a second order ordinary differential equation:
Figure BDA0003360390370000056
Figure BDA0003360390370000057
the under-damped condition is as follows: gamma ray 2 <4mk, i.e. damping ratio of
Figure BDA0003360390370000058
The displacement formula of the spring in the under-damped state is as follows:
x(t)=e βt (c 1 cosωt+c 2 sinωt)
wherein x (t) represents the elastic displacement of the object, t is time,
Figure BDA0003360390370000059
c 1 =p,
Figure BDA00033603903700000510
Figure BDA00033603903700000511
p is relative toInitial displacement of the balance point (generally defaults to 1.0).
An exemplary graph of one spring curve in an underdamped state is shown in fig. 2. As shown in fig. 2, the horizontal axis represents time, and the vertical axis represents amplitude. As can be seen from fig. 2, the object may vibrate many times in an underdamped state. And, as time goes by, the amplitude of the object gradually decreases, eventually reaching an equilibrium position.
The over-damping condition and the critical damping condition can be derived by referring to the prior art, and are not described in detail in the present application.
Fig. 3 shows a hardware system suitable for the device of the present application.
The apparatus 100 may be a mobile phone, a smart screen, a tablet computer, a wearable electronic device, an in-vehicle electronic device, an Augmented Reality (AR) device, a Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), a projector, and the like, and the specific type of the apparatus 100 is not limited in this embodiment.
The apparatus 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
The configuration shown in fig. 3 is not intended to specifically limit the apparatus 100. In other embodiments of the present application, the apparatus 100 may include more or fewer components than those shown in FIG. 3, or the apparatus 100 may include a combination of some of the components shown in FIG. 3, or the apparatus 100 may include sub-components of some of the components shown in FIG. 3. The components shown in fig. 3 may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units. For example, the processor 110 may include at least one of the following processing units: an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and a neural Network Processor (NPU). The different processing units may be independent devices or integrated devices.
In some possible embodiments, the processor 110 is configured to determine a dynamic effect parameter of the window, where the dynamic effect parameter includes a scaling parameter, and a value of the scaling parameter is determined based on the elasticity curve; and determining the animation effect of the window by using the dynamic effect parameters, wherein the motion trail of the animation effect of the window is determined based on the elastic curve.
Illustratively, the processor 110 is configured to determine the elasticity curve parameter based on the height of the window.
The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces.
The connection relationship between the modules shown in fig. 3 is only illustrative and does not limit the connection relationship between the modules of the apparatus 100. Alternatively, the modules of the apparatus 100 may also adopt a combination of the connection manners in the above embodiments.
The device 100 may implement display functionality through the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 may be used to display images or video. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini light-emitting diode (Mini LED), a Micro light-emitting diode (Micro LED), a Micro OLED (Micro OLED), or a quantum dot light-emitting diode (QLED). In some embodiments, the apparatus 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
In some embodiments, the display screen 194 may be used to display an animation effect of a window, the motion trajectory of which is determined based on an elasticity curve.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A may be of a wide variety, and may be, for example, a resistive pressure sensor, an inductive pressure sensor, or a capacitive pressure sensor. The capacitive pressure sensor may be a sensor that includes at least two parallel plates having conductive material, and when a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes, and the apparatus 100 determines the strength of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 194, the device 100 detects the touch operation from the pressure sensor 180A. The apparatus 100 may also calculate the position of the touch from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message; and when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The touch sensor 180K is also referred to as a touch device. The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also referred to as a touch screen. The touch sensor 180K is used to detect a touch operation applied thereto or in the vicinity thereof. The touch sensor 180K may pass the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the device 100 at a different location than the display screen 194.
The hardware system of the apparatus 100 is described in detail above, and the software system of the apparatus 100 is described below. The software system may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture or a cloud architecture, and the software system of the apparatus 100 is exemplarily described in the embodiment of the present application by taking the layered architecture as an example.
As shown in fig. 4, the software system adopting the layered architecture is divided into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the software system may be divided into five layers, which are an application layer, an application framework layer, a java system service layer, a local service layer (native services or native libraries), a hardware abstraction layer, and a driver layer from top to bottom.
Illustratively, the application layer may include camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc. applications.
In order to present some selection information or prompt information to the user, the terminal dynamically presents some small windows. As shown in fig. 4, the application layer may include an Activity (Activity) module (or component), a Dialog module, a popwindow module, a View (View) module, and a View group (ViewGroup).
Activity is used to expose an interface for interaction with a user. For example, Activity is an interface for a full screen or split screen. Dialog or PopupWindow is a window used to prompt or notify a user of information, which may be exposed or attached in Activity. Stated another way, Activity can also be considered a different type of window than Dialog or PopupWindow.
View and ViewGroup may be included in the Dialog or PopupWindow windows. Wherein View is the basic element constituting the interface. View contains rich controls which can respond to user operation events. For example, when the system interacts with a user, the system may pass an event to the View module, and the View module then performs a corresponding response operation. Stated another way, View is the basic building block of user interface components, responsible for image interface rendering and event processing. Illustratively, View occupies a rectangular area in the screen, such as a button or text box. The user can operate the interface through the View module. For example, the window 11 shown in (1) in fig. 1 is a Dialog window, and options (e.g., all-select, cut, copy, paste, and share) contained in the window 11 can be considered as multiple views.
The ViewGroup includes a plurality of views (child controls). The ViewGroup may be considered a special View that can accommodate other views.
It will be appreciated that View and ViewGroup (not shown in FIG. 4 for simplicity) may also be included in Activity.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer may include some predefined functions.
As shown in fig. 4, the application framework layer and the java system service layer include an activity manager, a Window Management Service (WMS), a Window Animation (Window Animation) module, a resource module, a Packet Manager Service (PMS), and an input manager.
The campaign manager may provide a campaign management service (AMS), which may be used for the start-up, switching, scheduling of system components (e.g., campaigns, services, content providers, broadcast receivers), and management and scheduling of application processes.
The WMS may be used for window management, window animation management, surface management, and a transfer station as an input system. The WMS may create and manage windows. WMS is a service provided by a window manager. The window manager can also obtain the size of the display screen and judge whether a status bar, a lock screen and a capture screen exist.
And the window animation module is used for adding corresponding animation for displaying, disappearing, hiding and the like of the window after the window is created, and displaying the whole animation process on the screen.
The resource module is used for loading animation resources, for example, for Scale animation, a change rate curve of the Scale animation can be loaded.
In the embodiment of the application, the application framework layer and the java system service layer also provide a Window Animation Extension (Window Animation Extension) module. The window animation expansion module is used for determining elastic curve parameters according to the height of the window and configuring an elastic curve (or an elastic interpolator) by using the elastic curve parameters. The embodiment of the present application applies the elastic interpolator to the pop window display of the small window type (Dialog, PopupWindow) described above. It can be understood that the form of the window animation extension module is not limited in the present application, for example, the window animation extension module may be provided independently from the existing window animation module, or may also be a function of extending the window animation extension module on the existing window animation module.
The input manager may provide an Input Management Service (IMS). The IMS may be used to manage inputs to the system, such as touch screen inputs, key inputs, sensor inputs, and the like. The IMS takes the event from the input device node and assigns the event to the appropriate window by interacting with the WMS.
Optionally, the application framework layer further comprises a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and answered, browsing history and bookmarks, and phone books.
The view system includes visual controls such as controls to display text and controls to display pictures. The view system may be used to build applications. The display interface may be composed of one or more views, for example, a display interface including a short message notification icon, which may include a view displaying text and a view displaying pictures.
The phone manager is used to provide communication functions of the device 100, such as management of call status (on or off).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, and video files.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as notification managers, are used for download completion notifications and message reminders. The notification manager may also manage notifications that appear in a chart or scrollbar text form in a status bar at the top of the system, such as notifications for applications running in the background. The notification manager may also manage notifications that appear on the screen in dialog windows, such as prompting for text messages in a status bar, sounding a prompt tone, vibrating the electronic device, and flashing an indicator light.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used to perform the functions of object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
The local service layer may include a plurality of functional modules, such as: three-dimensional graphics processing Libraries (e.g., open graphics library for embedded systems, OpenGL ES), 2D graphics engines (e.g., Skin Graphics Library (SGL)), display composition system (surface flickers) modules, Media Libraries, browser kernel (Webkit), Android Runtime (Android Runtime), and kernel Libraries.
An Android Runtime (Android Runtime) includes a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The three-dimensional graphics processing library may be used to implement three-dimensional graphics drawing, image rendering, compositing, and layer processing.
The two-dimensional graphics engine is a drawing engine for 2D drawing.
The surface flickers may also be referred to as an image layer blending module. And the surface flicker module is used for mixing layers and displaying the mixed layers so that the content in the window is displayed on the display screen. Both Dialog and Popupwindow correspond to an instance of a layer (layer) in the surface flanger module.
The media library supports playback and recording of multiple audio formats, playback and recording of multiple video formats, and still image files. The media library may support a variety of audiovisual coding formats, such as MPEG4, h.264, moving picture experts group audio layer 3 (MP 3), Advanced Audio Coding (AAC), adaptive multi-rate (AMR), joint picture experts group (JPG), and Portable Network Graphics (PNG).
The browser kernel is used for calling the system browser.
The hardware abstraction layer is used for encapsulating the hardware driver and providing a uniform universal interface for the upper layer. As shown in fig. 4, the hardware abstraction layer includes a camera HAL, a display HAL, an audio HAL, a sensor HAL, and the like.
The driver layer is the lowest layer of the software stack. The driver layer is used for managing and controlling the hardware equipment. The driving layer can comprise driving modules such as a camera driver, a display driver, a Binder driver, an audio driver and a sensor driver.
In the software architecture shown in fig. 4, the application layer and the system services layer may communicate across processes. The communication mode can adopt an inter-process communication mechanism (Binder) and can also realize communication by depending on a Binder driver.
The modules connected by the dotted lines shown in fig. 4 are the modules to which the embodiments of the present application mainly relate. An interaction diagram of modules involved in the embodiment of the present application in fig. 4 is described below in conjunction with fig. 5.
Referring to fig. 5, fig. 5 shows a schematic interaction diagram of a Dialog window display of an embodiment of the present application. As shown in fig. 5, includes:
and step 0, receiving the operation of the user by the application program.
For example, the user's operation means: the user clicks a certain button or the user triggers a certain scenario.
For example, taking the application as a short message as an example, if the user can click on a certain text in the short message, the application may create a window and prompt the user for some operations that may be directed to the text (including but not limited to full selection, cutting, copying, pasting, sharing, etc., such as the window 11 shown in fig. 1).
As an example, when a user operates an application, the application may perform some information prompting in a certain scenario. These information prompts are presented to the user through a popup window (e.g., a Dialog window).
An example of the terminal prompting the user for information is briefly described herein in connection with fig. 6. Fig. 6 is a schematic diagram of an interface for prompting a user for information.
Taking an application program in the terminal including a memo as an example, as shown in (1) in fig. 6, for a certain text in the memo displayed in the interface, the user may click a share button to share the memo text. After the user clicks the share button shown in (1) in fig. 6, the interface displays an interface shown in (2) in fig. 6. After the application program receives the sharing operation of the user, the information related to sharing is displayed to the user. For example, as shown in (2) in fig. 6, the terminal presents information on selection of a sharing method to the user through a window 301. The information for selecting the sharing mode comprises sharing pictures, sharing texts, exporting documents, sharing to other equipment and the like.
In this embodiment of the application, the terminal may determine the dynamic effect parameter of the window 301, a value of a scaling parameter in the dynamic effect parameter is determined based on the elastic curve, and then an animation effect of the window is generated based on the dynamic effect parameter, and the animation effect is displayed on the interface. The motion trajectory of the window 301 at the pop-up is determined based on the elasticity curve. Therefore, the motion track of the window 301 can better accord with the physics elastic motion rule, and the effect of the window 301 can be more fluent and natural in vision, so that the user experience is improved.
Step 1, the application program sends a first notification to the WMS. The first notification is used to notify the WMS of the newly created window instance, e.g., the Dialog window.
Wherein, the application program and the WMS communicate with each other in a cross-process mode (such as Binder) through a cross-process communication mechanism.
And step 2, the WMS returns a response to the application program. The response is used to inform the application WMS that the creation of the Dialog window instance was successful in response to the first notification in step 1.
And 3, measuring an interface by the application program.
And 4, after the interface measurement is finished, the application program applies for resetting the dimension window size to the WMS.
In step 5, WMS applies for layer creation from the display composition system (e.g., surfefinger). The layer can be understood as a buffer or a memory.
And 6, displaying the layer creation success notified by the synthesis system to the WMS.
And 7, the WMS sends the layer (or the memory) to the application program.
And 8, after the application program obtains the layer, the interface is laid out and drawn.
The above steps 1 to 8 are specific steps of drawing the Dialog window by the application program.
And 9, after the application program finishes drawing, sending a second notice to the WMS. The second notification is used to notify the WMS that the Dialog window has been drawn.
And step 10, after receiving the drawing completion notification, the WMS initiates window animation to a window animation module, or triggers the window animation.
And step 11, the window animation module calls a resource module to load animation resources.
Animation resource loading refers to building the basic elements in an animation. For example, the basic elements in the animation include a combination of alpha and Scale animations.
And step 12, the resource module informs the window animation module that the animation resources are loaded successfully.
And step 13, the window animation module acquires the elastic curve parameters from the window animation expansion module.
The elasticity curve parameters are determined by the window animation expansion module. The elasticity curve parameters are used to construct the elasticity curve. The present application does not specifically limit how the elasticity curve parameter is determined. One way, regardless of the height of the window, uses a preset set of fixed elasticity curve parameters. In another way, the window animation expansion module determines the elastic curve parameter corresponding to the height of the window based on the height of the window, and the specific determination method is described in detail later.
One possible example is to use an elasticity curve as the change rate curve for each frame in the Scale animation.
It is to be understood that, for convenience of understanding, the window animation extension module is introduced here, and in fact, the function of the window animation extension module may be added to the window animation module, that is, the window animation module performs the function of the window animation extension module, which is not particularly limited.
And step 14, after the elastic curve configuration is completed, the window animation module starts to execute the animation effect.
Step 15, the window animation module sends the animation effect parameter (or the parameter value of the animation effect) to the display synthesis system.
The window animation module and the display composition system can perform cross-process communication (such as Binder) through a cross-process communication mechanism. And the window animation module sends the dynamic effect parameter value of each frame to the display synthesis system.
For example, the animation parameters include a transparency (alpha) parameter value and a Scale (Scale) parameter value. In the embodiment of the present application, the Scale parameter value is determined based on the elastic curve, or the change of the Scale parameter value is changed according to the elastic curve. The elasticity curve is constructed based on the elasticity curve parameters (i.e., the elasticity curve parameters obtained in step 13).
It should be understood that in each subsequent frame, the window animation module issues the dynamic effect parameter value to the display composition system through binder communication.
And step 16, displaying the layer mixing of the synthesis system.
Specifically, after receiving the dynamic effect parameters sent by the window animation module, the display composition system performs corresponding processing (for example, scaling) on the layer, and performs mixing and display. And the mixed display sending means that the processed layer is mixed with other layers, and then the display HAL is called to send the display. And the layer mixing is to mix the layer of each frame with other layers to obtain a complete interface diagram finally presented to a user. For example, a layer of a certain frame may be mixed with a layer of a status bar, an Activity layer.
And step 17, after the layers are mixed, displaying and synthesizing the system call display HAL and sending the HAL to the display.
And step 18, displaying an interface by the display HAL through the display driving module, namely playing animation effect.
Based on the above steps 17 and 18, the display composition system gradually (specifically, one frame by one frame) displays the animation effect of the Dialog window on the terminal screen through the display HAL and the display driver module.
It should be understood that the above interaction flow is only described by way of example, and is not limited to the embodiments of the present application. In fact, the animation effect display process of other windows, including but not limited to popupWindow, can also be known to those skilled in the art based on the above flow. Illustratively, the interaction flow of the PopupWindow display is substantially the same as the interaction flow in fig. 5.
FIG. 7 illustrates an example interface diagram of animation effects for a window in accordance with an embodiment of the present application. As can be seen from the window 401 in (1) in fig. 7, the window 402 in (2) in fig. 7, and the window 403 in (3) in fig. 7, the windows are displayed or played in sequence in a trend from small to large. As can be seen from the window 403 shown in (3) in fig. 7, the window 404 shown in (4) in fig. 7, and (5) in fig. 7, the window is shown or played in a trend from large to small. Finally, after the animation playback is completed, the interface presented to the user is a window 405 shown in (5) in fig. 7.
Here, the window 405 shown in (5) of fig. 7 may be regarded as an original window (or the actual size of the window). The window 402 shown in fig. 7 (2) is the same size as the window 405 shown in fig. 7 (5) (the size is the area of the window). The same window size includes the same height of the window. The windows 401, 403, 404 shown in fig. 7 may be considered to oscillate back and forth with reference to the original window to achieve the effect of elastic animation, as compared to the original window. In the interfaces shown in fig. 7 (1) to 7 (5), the tendency or movement locus of the window to oscillate is an elastic curve. That is, the effect of the overshoot rebound is achieved by using the principle of change of the physical spring. For example, the elasticity curve parameter may be determined by the height of the window 405 (or the window 402).
It should be understood that fig. 7 only shows a part of the window variation trend when the window 405 plays the animation effect based on the elasticity curve, and the present application is not limited thereto.
It is understood that the window shown in fig. 7 is only an exemplary description and is not limited to the embodiment of the present application, for example, the window 11 or the window 12 in fig. 1 may also use the change principle of the spring to achieve a corresponding animation effect, so as to obtain a more natural user experience.
It should also be understood that the duration of the animation effect is not limited in the embodiments of the present application. For example, the overall duration of the animation effect may be between 280ms and 330 ms. The total duration of the animation effect is referred to as animation duration. Animation duration refers to the duration of time that a window spends from popping up to last resting on the screen. The animation duration comes from the physical spring model. As described below in connection with the example of fig. 8.
Referring to fig. 8, an exemplary graph of the spring curve is shown in fig. 8. The motion trajectory of the window shown in fig. 7 may be determined by the elasticity curve shown in fig. 8. It should be understood that the variation trend of only a portion of the windows is shown in fig. 7, and not the entire variation trend of the windows corresponding to the elasticity curve shown in fig. 8, and the present application is not limited thereto.
As shown in fig. 8, the animation duration is the time span when the spring reaches the equilibrium point position again after offsetting the equilibrium point for a certain distance and finally stops. In fig. 8, the elasticity curve has a plurality of peaks, each peak being referred to as an overshoot rebound amplitude with respect to the equilibrium point position. The equilibrium point position is the position at which the object to which the spring is attached is at rest. The equilibrium point position shown in fig. 8 is the position where the object is at rest after vibration. For the window shown in fig. 7, the balance point position is the original size of the window, i.e., the window 402 shown in (2) in fig. 7 and the window 405 shown in (5) in fig. 7.
Fig. 9 is a schematic diagram of a display method of a pop-up window according to an embodiment of the present application. As shown in fig. 9, the method includes:
s601, receiving the operation of the user.
The operation may be some operation of the user while using the application. The embodiment of the present application does not limit the specific content of the operation. Illustratively, the operations include: manual operation by a user, or an operation instruction by the user through voice, and the like. Illustratively, the manual operations of the user include: clicking a key or screen, sliding a screen, touching a screen, long pressing a screen, etc.
After the user performs the operation or in some scenarios where the user triggers, the application program may present some information to the user. In one example, as shown in (2) in fig. 6, the terminal prompts the user for information through window 301.
As a possible example, reference may be made to the description of step 0 in fig. 5 in S601, which is not described herein again.
In one example, the operation of the user may be a click sharing button operation shown in (1) in fig. 6.
And S602, responding to the operation, and generating (or drawing) a window to be displayed.
After receiving the operation of the user, the operation of generating the window can be executed, and then some prompt messages are shown to the user through the window.
The embodiment of the present application is applied to a small window type, where the generated window to be displayed is the aforementioned pop-up window type (or small pop-up window). Detailed description is not repeated here.
The window generation mainly comprises the following steps: measurement, layout, drawing, etc. The manner in which the window is created is not particularly limited in this application.
In a possible implementation manner, the generating the window to be displayed may specifically include the following steps: creating a window instance; measuring an interface; resetting the size of the window instance; obtaining a layer of a window; and after obtaining the layer of the window, carrying out interface layout and drawing the window.
In some embodiments, reference may be made to the description of step 1 to step 8 in fig. 5, which is not described herein again.
S603, determining dynamic effect parameters of the window, wherein the dynamic effect parameters comprise scaling parameters, and the values of the scaling parameters are determined according to an elastic curve.
The dynamic effect parameters are used for generating the animation effect of the window. The dynamic effect parameters can be understood as parameters of animation effects. Animation effects may be added to the window based on the animation parameters.
In this embodiment, the dynamic effect parameter may include a scaling parameter, and a value of the scaling parameter is determined based on the elastic curve, or the value of the scaling parameter varies according to the elastic curve.
As a possible implementation, the scaling parameter may be a Scale parameter. The change of the sampling value of the Scale parameter is changed according to an elastic curve.
It is understood that the animation effect parameters may also include other animation original parameters, which are not limited in particular.
In a possible implementation manner, optionally, the dynamic effect parameter may further include a transparency parameter.
As previously described, the elasticity curve is constructed based on the elasticity curve parameters. Optionally, the elasticity curve parameters may include a stiffness parameter and a damping parameter. The stiffness parameter and the damping parameter can be used to construct an elasticity curve, or to construct an elasticity interpolator. Of course, the elasticity curve parameters may also include other parameters, such as the mass m of the object, the initial displacement p of the equilibrium point, and the initial velocity v. As previously mentioned, these parameters may be defaulted as initial conditions in a particular application.
In the embodiment of the present application, the window height may be taken into consideration when determining the elasticity curve parameter, and may also be not considered, which is not particularly limited.
As a possible implementation, for windows of different heights, fixed elasticity curve parameters may be used, or animation effects of windows may be presented using the same elasticity curve. I.e. the above-mentioned elasticity curve parameters do not follow the height variations of the window.
As a possible implementation, the elastic curve parameters may be dynamically adjusted according to the height of the window, or the windows with different heights may be displayed by using different elastic curves.
Exemplarily, determining an elasticity curve parameter from the height of the window comprises: and acquiring an elastic curve parameter corresponding to the height of the window from a parameter rule model library according to the height of the window.
The parameter rule model library is constructed based on the height of the window. And obtaining corresponding elastic curve parameters in a parameter rule model library through the height of the window. The embodiment of the application does not limit how to determine the form of the parameter rule model library based on the height of the window.
For example, the corresponding elasticity curve (or elasticity curve parameter) may be determined (or customized) for different heights, and the elasticity curve corresponding to the height is the dynamic effect curve that is best experienced. The determination of the elasticity curve can be based on the following principle: the smaller the overshoot rebound amplitude is, the fewer the times of the overshoot rebound crossing the position of the balance point are; and in the window with smaller height, the larger the rebound amplitude of the overshoot is, the more the number of times of the rebound of the overshoot crosses the position of the balance point is. The embodiment of the application can determine the elastic curve parameters corresponding to different heights by taking the principle as a principle. Or, the embodiment of the application can debug the elastic curve parameters corresponding to different heights based on human feelings or prior values, so as to achieve the purpose of establishing a parameter rule model base in advance. The parameter rule model library comprises different heights and an elasticity curve parameter customized for each height.
Wherein, the overshoot rebound amplitude refers to the maximum amplitude of the position of the object offset balance point, and in combination with the curve in fig. 8, the overshoot rebound amplitude refers to the distance between a certain peak of the elastic curve and the balance point; for a window, the overshoot rebound amplitude refers to the maximum scaling of the pop-up window. Taking the example in fig. 8, the position of each peak compared to the equilibrium point is the overshoot rebound amplitude. The position of the balance point refers to the position of an object connected with the spring when the object is static (the friction force is consistent with the elastic force of the spring at the moment); in a pop-up window scenario, the equilibrium point position may be understood as the actual size of the window.
In one possible implementation, the height of the window may be divided into different height intervals. The parameter rule model base is created based on the height interval in which the height of the window is located. The parameter rule model base comprises a plurality of height intervals and a set of elastic curve parameters corresponding to each height interval.
For example, the corresponding elasticity curves (or elasticity curve parameters) can be determined (or tailored) for different height intervals. The principle of determining the elasticity curve can refer to the above description, and is not repeated here.
In another possible implementation manner, the parameter rule model library is created based on the ratio of the height of the window to the height of the display screen of the terminal (referred to as the height ratio of the window). The parameter rule model base comprises a plurality of height proportion intervals and a set of elastic curve parameters corresponding to each height proportion interval.
For example, the corresponding elasticity curve (or elasticity curve parameter) can also be determined for different height scale intervals. The principle of determining the elasticity curve can refer to the above description, and is not repeated here.
For example, the overshoot amplitude and the time (i.e., animation duration) of the spring may be layered according to the height scale of the window, so as to obtain the elastic curve parameter corresponding to each height scale interval.
For example, table 1 below gives an example of the interval of the height ratio of the window and the elasticity curve parameter.
TABLE 1
Figure BDA0003360390370000131
Taking the first set of elastic curve parameters in Table 1 as an example, for a window having a height lower than the window
Figure BDA0003360390370000132
In terms of screen height (i.e. the ratio of the height of the window is located at
Figure BDA0003360390370000141
In the interval), the first set of elasticity curve parameters can achieve the following effects: the maximum ratio of window enlargement is larger, the rebound times (i.e. the times of window enlargement exceeding the window size) are more, and the animation duration is longer.
Taking the third set of elasticity curve parameters in Table 1 as an example, the height of the window is higher than that of the window
Figure BDA0003360390370000142
In terms of screen height (i.e. the ratio of the height of the window is located at
Figure BDA0003360390370000143
In interval), the third set of elasticity curve parameters can achieve the following effects: the maximum ratio of window enlargement is smaller, the rebound times (i.e. the times of window enlargement exceeding the window size) are smaller, and the animation duration is shorter.
It should be understood that the examples in table 1 are only examples and do not limit the embodiments of the present application.
It is to be understood that the above description of the parameter rule model base is only an example description, and the present application is not limited thereto.
After the elasticity curve parameters corresponding to the height of the window are obtained, the elasticity curve parameters can be used to construct an elasticity curve so as to cover the original animation effect curve (for example, to cover the change rate curve of the Scale animation in the loaded animation effect) based on the elasticity curve.
S604, determining the animation effect of the window by using the dynamic effect parameters, wherein the motion trail of the animation effect of the window is determined based on the elastic curve parameters. In other words, the motion trajectory of the animation effect of the window is the elasticity curve in S603, and the elasticity curve is constructed based on the elasticity curve parameters.
Specifically, the determining the animation effect of the window by using the dynamic effect parameter comprises the following steps: and firstly, constructing an elasticity curve by using the elasticity curve parameters, and then covering or replacing a change curve in the loaded animation effect by using the constructed elasticity curve.
For example, S604 includes: the window animation module sends the dynamic effect parameters of each frame to the display synthesis system;
the display synthesis system performs corresponding processing on the layer based on the dynamic effect parameter of each frame to obtain the window content corresponding to each frame, and the processing includes any one of the following operations: zooming out, or magnifying;
and the display synthesis system executes layer mixing operation on each processed frame image layer to obtain the image content of each frame.
It should be noted that the window animation module may send the motion effect parameter value of each frame to the display composition system module (i.e., the surfefinger shown in fig. 4). After receiving the dynamic effect parameter value of each frame sent by the window animation module, the surfaceFlinger can correspondingly process the layer of each frame. For example, the window animation module sends the scaling parameter to the surface flicker; for example, assuming that the drawing data of the layer is 1, if the surfefinger receives that the scaling parameter is 0.5, the drawing data of the current layer is scaled to 0.5, that is, the display area of the layer is scaled to 0.5 times of the original layer. Wherein the value of the scaling parameter is determined based on the elasticity curve. Further, the surfaceFlinger performs layer mixing on the processed layers so as to facilitate subsequent display. The description of layer mixing may refer to the foregoing, and is not described herein again.
S605, displaying the animation effect of the window.
In particular, the animation effect of the window is composed of a plurality of frames. The animation effect of the display window is as follows: and gradually (or frame by frame) displaying or playing the picture content of each frame in the plurality of frames on a display screen of the terminal. And the motion trail of the animation effect of the window during playing is determined according to the elastic curve parameters.
Optionally, displaying the animated results of the window comprises: and calling a display HAL and a display driver to play the animation effect. The display HAL and display driving are as shown in fig. 4.
As one possible example, the animation effect of displaying the window may be as described above with reference to steps 17 and 18 in FIG. 5.
In the embodiment of the application, the elastic curve parameters can be determined, and the elastic curve is used for replacing the change curve of the loaded animation effect, so that the motion trail of the popup window is more in line with the physical law, the animation effect of the popup window can be smoother and more natural when played, and the user experience is improved. Furthermore, the elastic curve parameters can be dynamically adjusted according to the height of the window, so that the animation effect of the heights of different windows can better accord with the real feeling, and the user experience is greatly improved.
Illustratively, by adopting the technical scheme of the embodiment of the application to determine the animation effect of the window 301 in fig. 6, the motion track of the window 301 in fig. 6 when popping up is more in accordance with the physical laws. The animation effect of the window 301 is more natural when playing, thereby improving the user experience.
The embodiment of the application is suitable for small window types. In a specific implementation, the type of the window may be determined first, or what type of window the window is.
Optionally, before S603, the method further includes: judging the type of the window; upon determining that the type of the window is the widget type, S603 is performed.
That is to say, it may be determined which type of window the window drawn by the application program is, and if the window is a small window type (for example, the aforementioned Dialog window, PopupWindow, and derivative windows of the Dialog window and PopupWindow), the technical solution of the embodiment of the present application may be applied; if not, no modification is required to the animation resources of the window.
As one implementation, when it is determined that the type of the window is a small window type, the height of the window is obtained. Stated another way, the height of the window is obtained when the current window is determined to be of the small window type, so that the elastic curve parameter is determined based on the height of the window.
It should be noted that, here, when the window is determined to be of the small window type, the height of the acquisition window is for an implementation manner of determining the elastic curve parameter based on the height of the window. For the implementation mode without considering the window height when determining the elastic curve parameter, the height of the window may not be obtained when the window is judged to be of a small window type.
For ease of understanding, the following description is made in conjunction with the flowchart in fig. 10. As shown in fig. 10, the flow includes steps 801-808. Illustratively, steps 802 through 806 referred to in FIG. 10 may be performed by the window animation extension module shown in FIG. 4 or FIG. 5, supra; step 801 is performed by the resource module shown in FIG. 4 or FIG. 5 above; step 808 may be performed by the display composition system shown in fig. 4 or fig. 5 above.
Step 801, loading animation resources.
Loading an animation resource may be understood as loading the basic elements or attributes that build an animation effect. Optionally, the animation resource includes Scale animation.
It is to be understood that the content of the animation resource is not particularly limited, and the animation resource may also include other animation effect resources. For example, animation effects may also include animations that fade in and out (i.e., changes in transparency), and the like.
As one possible example, step 801 may be as previously described with reference to step 11 in FIG. 5.
Step 802, determine whether the window is a small window.
The embodiment of the application is applied to small window types. The purpose of this setup step 802 is to: the type of window is identified. If the type of the window is a small window type, the height of the window is required to be obtained, and then the elastic curve parameter can be determined based on the height of the window, so that the animation resource can be modified subsequently; if not, no animation resources need to be modified.
Illustratively, for implementations where the elasticity curve parameter is determined based on the height of the window, if step 802 determines that the window is a small window, then step 803 is performed. If not, step 807 is performed.
Step 803, the height of the window is obtained.
The size (or dimension) of the window may include a height and a width.
In one implementation, the height of the window is obtained, and then the elastic curve parameter is determined according to the height of the window.
And step 804, determining elastic curve parameters according to the height of the window.
As a possible implementation manner, determining the elasticity curve parameter according to the height of the window includes: and acquiring an elastic curve parameter corresponding to the height of the window from a parameter rule model library. For the related description of the parameter rule model library, reference may be made to the description at S603, and details are not repeated here.
Of course, for the implementation without considering the window height when determining the elasticity curve parameter, the step 803 may be omitted, and the step 804 may be replaced by obtaining the preset elasticity curve parameter. That is, after step 802, the height of the window need not be obtained, and a set of fixed elasticity curve parameters may be used.
At step 805, an elasticity curve (i.e., an elasticity interpolator) is constructed based on the elasticity curve parameters.
For example, if the elasticity curve parameters determined in step 804 include a stiffness coefficient and a damping coefficient, an elasticity curve may be constructed based on the stiffness coefficient and the damping coefficient.
Step 806, the animation curves in the animation resources which have been loaded are covered by the elasticity curves.
For example, assuming that the animation resources loaded in step 801 include Scale animation, the change rate curve of the Scale animation that has been loaded may be overlaid with an elastic curve, or in other words, the Scale interpolator may be overlaid with an elastic interpolator, at step 806.
Step 807, the animation resources that have been loaded are not modified.
Step 808, performing animation effects.
With respect to step 806, step 808 executes the animation effect of the window according to the animation resource in step 806 (i.e. the animation resource after the animation curve that has been loaded is covered by the elasticity curve).
With respect to step 807, i.e., if not a widget type, the animation resource loaded in step 801 does not need to be modified, and step 808 performs an animation effect according to the animation resource loaded in step 801.
It should be understood that the flow shown in fig. 10 is a specific exemplary flow for determining the elastic curve parameter by considering the height of the window in the embodiment of the present application, but the flow is not limited to the embodiment of the present application. In fact, the height of the window may also be disregarded when determining the elasticity curve parameter, i.e. a preset elasticity curve parameter is used regardless of the height of the window.
Therefore, the pop-up window display method can enable the pop-up window to be smoother and more natural when popped up, and improves user experience.
The present application also provides a computer program product which, when executed by a processor, implements the method of any of the method embodiments of the present application.
The computer program product may be stored in a memory and eventually transformed into an executable object file that can be executed by a processor via preprocessing, compiling, assembling and linking.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a computer, implements the method of any of the method embodiments of the present application. The computer program may be a high-level language program or an executable object program.
The computer readable storage medium may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), double data rate SDRAM, enhanced SDRAM, SLDRAM, Synchronous Link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes and the generated technical effects of the above-described apparatuses and devices may refer to the corresponding processes and technical effects in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the disclosed system, apparatus and method can be implemented in other ways. For example, some features of the method embodiments described above may be omitted, or not performed. The above-described embodiments of the apparatus are merely exemplary, the division of the unit is only one logical function division, and there may be other division ways in actual implementation, and a plurality of units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the coupling includes electrical, mechanical, or other forms of connection.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the processes do not mean the execution sequence, and the execution sequence of the processes should be determined by the functions and the inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Additionally, the terms "system" and "network" are often used interchangeably herein. The term "and/or" herein is only one kind of association relationship describing the association object, and means that there may be three kinds of relationships, for example, a and/or B, and may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A pop-up window display method, comprising:
receiving the operation of a user;
responding to the operation, and generating a window to be displayed;
determining dynamic effect parameters of the window, wherein the dynamic effect parameters comprise scaling parameters, and the values of the scaling parameters are determined based on an elastic curve;
determining the animation effect of the window by using the dynamic effect parameters, wherein the motion trail of the animation effect of the window is determined based on the elastic curve;
and displaying the animation effect of the window.
2. The method of claim 1, wherein the elasticity curve is generated according to an elasticity curve parameter determined according to a height of the window.
3. The method of claim 2, wherein the elasticity curve parameter is determined from a height of the window, comprising:
the elastic curve parameters are obtained from a parameter rule model library, which includes elastic curve parameters corresponding to the height of the window.
4. The method of claim 3, wherein the parameter rule model library is determined by any one of:
the parameter rule model base is determined based on a height interval where the height of the window is located, and comprises different height intervals and elastic curve parameters corresponding to each height interval;
the parameter rule model base is determined based on the proportion of the height of the window occupying the height of the display screen of the terminal, and the parameter rule model base comprises different proportion intervals and elastic curve parameters corresponding to each proportion interval.
5. The method of any of claims 1 to 4, wherein the animation effect of the window is comprised of a plurality of frames; wherein the determining the animation effect of the window by using the dynamic effect parameter comprises:
the window animation module sends the dynamic effect parameters of each frame to the display synthesis system;
the display synthesis system carries out corresponding processing on the layer based on the dynamic effect parameter of each frame, and the processing comprises any one of the following operations: zooming out, or magnifying;
the display synthesis system executes layer mixing operation on each processed frame image layer to obtain the image content of each frame;
wherein the displaying the animation effect of the window comprises:
the picture content of each frame of the plurality of frames is shown on the display screen frame by frame.
6. The method of any of claims 1 to 5, wherein prior to determining the window's dynamic effect parameters, the method further comprises:
judging the type of the window;
wherein the determining the dynamic effect parameter of the window comprises:
when the type of the window is determined to be the small window type, determining the dynamic effect parameters of the window.
7. The method of any one of claims 2 to 6, wherein the elasticity curve parameters comprise a damping coefficient and a stiffness coefficient.
8. The method according to any one of claims 1 to 7, wherein the dynamic effect parameters further comprise a transparency parameter.
9. An electronic device comprising a processor and a memory, the processor and the memory being coupled, the memory for storing a computer program that, when executed by the processor, causes the electronic device to perform the method of any of claims 1 to 8.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to carry out the method of any one of claims 1 to 8.
11. A chip comprising a processor that, when executing instructions, performs the method of any one of claims 1 to 8.
12. A computer program product, comprising a computer program which, when executed, causes a computer to perform the method of any one of claims 1 to 8.
CN202111365121.2A 2021-11-17 2021-11-17 Popup window display method and device Active CN114995929B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111365121.2A CN114995929B (en) 2021-11-17 2021-11-17 Popup window display method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111365121.2A CN114995929B (en) 2021-11-17 2021-11-17 Popup window display method and device

Publications (2)

Publication Number Publication Date
CN114995929A true CN114995929A (en) 2022-09-02
CN114995929B CN114995929B (en) 2023-04-21

Family

ID=83017921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111365121.2A Active CN114995929B (en) 2021-11-17 2021-11-17 Popup window display method and device

Country Status (1)

Country Link
CN (1) CN114995929B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117271042A (en) * 2023-11-08 2023-12-22 荣耀终端有限公司 Application switching method and electronic equipment
WO2024098713A1 (en) * 2022-11-11 2024-05-16 中兴通讯股份有限公司 Terminal desktop display method, terminal and computer-readable medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130086516A1 (en) * 2011-10-01 2013-04-04 Oracle International Corporation Moving an object about a display frame by combining classical mechanics of motion
CN107317853A (en) * 2017-06-20 2017-11-03 北京金山安全软件有限公司 Method, device and system for displaying dynamic effect of message popup window
CA3054877A1 (en) * 2018-09-13 2020-03-13 10353744 Canada Ltd. Method, apparatus and computer device for implementing pop-up window in hybrid interface application
CN111552425A (en) * 2020-04-24 2020-08-18 北京小米移动软件有限公司 Method and device for controlling small window display and storage medium
CN112051952A (en) * 2020-09-27 2020-12-08 平安普惠企业管理有限公司 Picture dynamic browsing method and device, electronic equipment and readable storage medium
CN113298916A (en) * 2020-07-14 2021-08-24 阿里巴巴集团控股有限公司 Interaction method and device for adjusting curve and electronic equipment
CN113552987A (en) * 2021-04-20 2021-10-26 华为技术有限公司 Graphical interface display method, electronic device, medium, and program product
CN113568549A (en) * 2021-04-20 2021-10-29 华为技术有限公司 Graphical interface display method, electronic device, medium, and program product

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130086516A1 (en) * 2011-10-01 2013-04-04 Oracle International Corporation Moving an object about a display frame by combining classical mechanics of motion
CN103842952A (en) * 2011-10-01 2014-06-04 甲骨文国际公司 Moving an object about a display frame by combining classical mechanics of motion
CN107317853A (en) * 2017-06-20 2017-11-03 北京金山安全软件有限公司 Method, device and system for displaying dynamic effect of message popup window
CA3054877A1 (en) * 2018-09-13 2020-03-13 10353744 Canada Ltd. Method, apparatus and computer device for implementing pop-up window in hybrid interface application
CN111552425A (en) * 2020-04-24 2020-08-18 北京小米移动软件有限公司 Method and device for controlling small window display and storage medium
CN113298916A (en) * 2020-07-14 2021-08-24 阿里巴巴集团控股有限公司 Interaction method and device for adjusting curve and electronic equipment
CN112051952A (en) * 2020-09-27 2020-12-08 平安普惠企业管理有限公司 Picture dynamic browsing method and device, electronic equipment and readable storage medium
CN113552987A (en) * 2021-04-20 2021-10-26 华为技术有限公司 Graphical interface display method, electronic device, medium, and program product
CN113568549A (en) * 2021-04-20 2021-10-29 华为技术有限公司 Graphical interface display method, electronic device, medium, and program product

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
夏德冰等: "Android应用中一种Activity窗口管理系统", 《计算机系统应用》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024098713A1 (en) * 2022-11-11 2024-05-16 中兴通讯股份有限公司 Terminal desktop display method, terminal and computer-readable medium
CN117271042A (en) * 2023-11-08 2023-12-22 荣耀终端有限公司 Application switching method and electronic equipment
CN117271042B (en) * 2023-11-08 2024-04-19 荣耀终端有限公司 Application switching method and electronic equipment

Also Published As

Publication number Publication date
CN114995929B (en) 2023-04-21

Similar Documents

Publication Publication Date Title
JP6516790B2 (en) Device, method and graphical user interface for adjusting the appearance of a control
US20220191653A1 (en) Layers in messaging applications
US9418171B2 (en) Acceleration of rendering of web-based content
US7536645B2 (en) System and method for customizing layer based themes
KR101025949B1 (en) Fine-grained control of z-order elements in a xml presentation
KR100992022B1 (en) System and method for dynamic mapping of abstract user interface to a mobile device at run time
US20190324777A1 (en) System and methods for a run time configurable user interface controller
CN114995929B (en) Popup window display method and device
WO2021008334A1 (en) Data binding method, apparatus, and device of mini program, and storage medium
JP5249686B2 (en) Information processing apparatus and program
WO2021008295A1 (en) Mini-program production method and apparatus, and terminal and storage medium
CN109445891B (en) Picture configuration and display method, device and computer readable storage medium
WO2022247541A1 (en) Method and apparatus for application animation linking
CN114115870A (en) User interface implementation method and device
CN115640083A (en) Screen refreshing method and equipment capable of improving dynamic performance
CN113934340B (en) Terminal equipment and progress bar display method
CN113676677B (en) Dynamic picture synthesis method and device, electronic equipment and readable storage medium
CN115220621A (en) Graphical interface display method, electronic device, medium, and program product
CN116974446B (en) Animation effect display method and device
CN108509331A (en) test method and device
CN117806744A (en) Control display method and electronic equipment
CN115617427A (en) Cross-platform display method of application, readable medium and electronic device
CN116450066A (en) Split screen display method, electronic device and readable storage medium
Rischpater et al. Doing More with Qt
CN116048373A (en) Display method of suspension ball control, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant