A scroll bar display method and electronic device
By obtaining the hiding parameters for the application, constructing animations with different durations and transparency changes, and optimizing the display and disappearance process of the scroll bar, the problem of high device power consumption when the page is scrolled is solved, and the user experience and device performance are improved.
Patent Information
- Application Number
- CN202310852422.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-11
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-07-11
AI Technical Summary
In the existing technology, the animation display process and disappearance process of the scroll bar when the page slides lead to high power consumption of the device, affecting the user experience and device performance.
By obtaining canceling parameters for preset applications and non-default applications respectively, construct disappearing animations of different durations and transparency changes, shorten the time for the scroll bar to gradually disappear after it is stationary, reduce unnecessary I/O operations, and optimize the display of the scroll bar. and disappearance process.
The power consumption during page sliding is reduced and the user experience is improved. In particular, by shortening the scroll bar disappearing time, the overall power consumption and dragging feeling of the device are reduced.
Smart Images

Figure CN117076017B
Abstract
Description
Technical Field
[0001] The present application relates to the field of display technology, and in particular to a scroll bar display method and electronic device. Background Art
[0002] With the continuous development of technology, terminal devices can display various acquired information to users in the form of page content through various applications (such as browser applications, social applications, etc.). When the page content is so large that the display screen of the terminal device cannot display all the page content at once, part of the page content is usually hidden and a scroll bar is displayed on the page. The scroll bar is used to represent the position of the currently displayed page content in all the page content. When the user slides the page, the currently displayed page content will be adjusted according to the sliding of the page, and the scroll bar will change its position according to the sliding of the page. When the sliding page is stationary, the scroll bar will also be stationary and gradually disappear.
[0003] Currently, when a page is slid, the scroll bar will change position according to the sliding of the page, and the scroll bar will gradually disappear after the page is still. Among them, the process of the scroll bar changing position and the process of the scroll bar disappearing are animation display processes, and the power consumption of the device is relatively large. Summary of the invention
[0004] The embodiments of the present application provide a scroll bar display method and an electronic device for reducing power consumption during page sliding.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, the present application provides a method for displaying a scroll bar, which is applied to an electronic device, and the method includes: displaying a first interface of a first application, wherein the first interface includes a corresponding scroll bar and a first area. The first area may be a partial area of the first interface or the entire area of the first interface. A first operation of sliding the first area is received; in response to the first operation, the first area and the scroll bar slide; when the first area is stationary, the scroll bar is stationary, and a disappearing animation is displayed on the first interface; if the first application is a preset application, the disappearing animation is a first disappearing animation, and the duration of the first disappearing animation is a first duration; if the first application is not a preset application, the disappearing animation is a second disappearing animation, and the duration of the second disappearing animation is a second duration, and the first duration is less than the second duration.
[0007] Among them, since the first duration is shorter than the second duration, the power consumption of the preset application during the page sliding process is shorter than the power consumption of the non-preset application during the page sliding process. In other words, the present application reduces the power consumption of the electronic device as a whole by reducing the power consumption of the preset application.
[0008] In an embodiment provided in the first aspect, before displaying the first interface of the first application, the method also includes: obtaining a hidden parameter of the first application; wherein, if the first application is a preset application, the hidden parameter of the first application includes a first hidden parameter; if the first application is not a preset application, the hidden parameter of the first application includes a second hidden parameter, and the first hidden parameter is different from the second hidden parameter; before displaying a disappearing animation on the first interface, the method also includes: constructing a disappearing animation according to the hidden parameter of the first application.
[0009] In an embodiment of the present application, the electronic device can construct a disappearing animation according to the blanking parameters of the first application, and because the first blanking parameters and the second blanking parameters are different, the power consumption of the preset application and the non-preset application during the page sliding process is also different.
[0010] In an implementation manner provided in the first aspect, the first concealing parameter includes a first duration and first transparency change information, the second concealing parameter includes a second duration and second transparency change information, the first transparency change information and the second transparency change information are both used to indicate the transparency change of the scroll bar, and the transparency mean corresponding to the first transparency change information is greater than the transparency mean corresponding to the second transparency change information; if the first application is a preset application, constructing a disappearing animation according to the concealing parameters of the first application includes: constructing a first disappearing animation according to the first duration and the first transparency change information; if the first application is not a preset application, constructing a disappearing animation according to the concealing parameters of the first application includes: constructing a second disappearing animation according to the second duration and the second transparency change information.
[0011] Among them, since the first duration is shorter than the second duration, the power consumption of the electronic device displaying the first disappearing animation can be lower than the power consumption of the electronic device displaying the second disappearing animation. Furthermore, since the average transparency value corresponding to the first transparency change information is lower than the average transparency value corresponding to the second transparency change information, and considering that the higher the transparency, the lower the visibility of the scroll bar, and the lower the power consumption, the power consumption of the electronic device displaying the first disappearing animation is lower than the power consumption of the electronic device displaying the second disappearing animation, so the power consumption of the preset application is lower than the power consumption of the non-preset application.
[0012] In an implementation scheme provided in the first aspect, the first blanking parameter package also includes a third duration, the second blanking parameter package also includes a fourth duration, and the third duration is less than the fourth duration; if the first application is a preset application, a disappearing animation is displayed on the first interface, including: at the end of the third duration from the time the scroll bar is stationary, a first disappearing animation is displayed on the first interface; if the first application is not a preset application, a disappearing animation is displayed on the first interface, including: at the end of the fourth duration from the time the scroll bar is stationary, a second disappearing animation is displayed on the first interface.
[0013] In an embodiment of the present application, by shortening the time it takes for the scroll bar to gradually disappear after it becomes stationary (i.e., the third time duration is less than the fourth time duration), the scroll bar of the preset application can disappear quickly after scrolling, thereby reducing the feeling of sluggishness caused by the scroll bar's delay in disappearing and improving the user experience.
[0014] In an embodiment provided in the first aspect, the method also includes: obtaining interface configuration information of the first application, the interface configuration information of the first application including controls included in the interface of the first application and the display method adopted by the controls; obtaining hidden parameters of the first application, including: if the interface of the first application includes a scroll bar using a preset display method, obtaining the hidden parameters of the first application.
[0015] It can be understood that for applications whose interface does not include a scroll bar with a preset display mode, the interface of the application does not involve the sliding process of the scroll bar or the process of the scroll bar disappearing after it becomes stationary, so there is no need to obtain its blanking parameters, thereby reducing unnecessary I / O operations and saving I / O resources.
[0016] In an implementation provided in the first aspect, the method further includes: when the scroll bar slides, displaying a sliding animation on the first interface, the sliding animation including an animation of sliding of the first area and the scroll bar.
[0017] In an embodiment provided in the first aspect, an electronic device includes a sliding control and a view controller, and constructs a disappearing animation according to the hiding parameters of a first application, including: the sliding control sends a parameter acquisition request to the view controller; if the hiding parameters of the first application include a first hiding parameter, the view controller sends the first hiding parameter to the sliding control, and the first hiding parameter includes a first duration, first transparency change information and a third duration; the sliding control constructs a first disappearing animation according to the first duration and the first transparency change information; and displays the disappearing animation on the first interface, including: the sliding control displays the first disappearing animation at the end of the third duration since the scroll bar is stationary.
[0018] According to the foregoing, if the first application is a preset application, the first application's hidden parameter includes the first hidden parameter, otherwise it includes the second hidden parameter. When the view controller includes the first hidden parameter in the hidden parameters of the first application, the first hidden parameter is sent to the slide control first, and when the first application's hidden parameters do not include the first hidden parameter, the view controller sends the second hidden parameter to the slide control, thereby achieving the effect of providing the first hidden parameter to the preset application and providing the second hidden parameter to the non-preset application.
[0019] In an implementation provided in the first aspect, a disappearing animation is constructed according to the disappearing parameters of a first application, and further includes: if the first disappearing parameters of the first application do not include the first disappearing parameters, the view controller sends a second disappearing parameter to the sliding control, the second hiding parameter includes a second duration, second transparency change information and a fourth duration; the sliding control constructs a second disappearing animation according to the second duration and the second transparency change information; and displaying the disappearing animation on the first interface includes: the sliding control displays the second disappearing animation at the end of the fourth duration from the time the scroll bar becomes stationary.
[0020] In one embodiment provided in the first aspect, the electronic device also includes a power consumption strategy application, which obtains a blanking parameter of a first application, including: in response to an operation of starting the first application, the first application sends a drawing instruction to the view controller; the view controller obtains interface configuration information of the first application, the interface configuration information of the first application includes controls included in the interface of the first application and the display method used by the controls; the view controller determines whether the interface of the first application includes a scroll bar using a preset display method; if the interface of the first application includes a scroll bar using a preset display method, the view controller sends an instruction to obtain the blanking parameter to the power consumption strategy application; if the first application is a preset application, the power consumption strategy application sends the first blanking parameter to the view controller.
[0021] In an implementation provided by the first aspect, obtaining the blanking parameter of the first application also includes: if the first application is not a preset application, the power consumption strategy application sends feedback information to the view controller, and the feedback information does not carry the first blanking parameter; the view controller obtains the second blanking parameter.
[0022] In a second aspect, the present application further provides a scroll bar display method, which is applied to an electronic device, and the method comprises: displaying a first interface of a first application, the first interface comprising a scroll bar; receiving a first operation of sliding the scroll bar; in response to the first operation, when the scroll bar slides, displaying a scrolling animation on the first interface, and when the scroll bar is stationary, displaying a disappearing animation on the first interface;
[0023] Among them, when the first application is a preset application, the disappearance animation is a first disappearance animation, and the duration of the first disappearance animation is the first disappearance duration; when the first application is not a preset application, the disappearance animation is a second disappearance animation, and the duration of the second disappearance animation is the second disappearance duration, and the first disappearance duration is less than the second disappearance duration.
[0024] In the third aspect, the present application also provides an electronic device, the electronic device comprising: a memory and a processor; the processor is coupled to the memory; wherein the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the electronic device executes a method as in any one of the embodiments of the first aspect and the second aspect.
[0025] In a fourth aspect, the present application further provides a computer-readable storage medium, comprising computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes a method as in any one of the embodiments of the first aspect or the second aspect.
[0026] In a fifth aspect, the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the method of the first aspect, the second aspect, and any one of their implementations.
[0027] Among them, the technical effects brought about by any design method in the second to fifth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A schematic diagram of a page sliding process;
[0029] Figure 2 A set of interface schematic diagrams;
[0030] Figure 3 A schematic diagram of an interface;
[0031] Figure 4 A current consumption diagram of the related art;
[0032] Figure 5A A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0033] Figure 5B A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0034] Figure 6 A set of interface schematic diagrams provided for embodiments of the present application;
[0035] Figure 7 A flowchart of a method for displaying a scroll bar provided in an embodiment of the present application Figure 1 ;
[0036] Figure 8 A flowchart of a method for displaying a scroll bar provided in an embodiment of the present application Figure 2 ;
[0037] Fig. 9 A flowchart of a method for displaying a scroll bar provided in an embodiment of the present application Figure 3 ;
[0038] Fig.10 A schematic diagram of a page sliding process provided in an embodiment of the present application;
[0039] Fig.11 A current consumption diagram provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0041] At present, when there is so much content that the display screen of an electronic device cannot display all the content at once, the electronic device can hide part of the content and display a scroll bar on the page, which is used to represent the position of the content currently displayed on the display screen among all the content. In response to receiving an operation of sliding a page by a user, the electronic device can adjust the currently displayed content according to the operation of sliding the page, and adjust the position of the scroll bar according to the operation of sliding the page. When the page slides, the scroll bar will also scroll; when the page is stationary, the scroll bar will be stationary and gradually disappear.
[0042] See also Figure 1 , is a schematic diagram of a page sliding process. Figure 1 Taking the search page of the browser as an example, the sliding process of the page is exemplified. Figure 1 As shown in (a) in the figure, the interface 101 is a search page of the browser. The interface 101 may include a scroll bar 102. The scroll bar 102 is used to indicate the position of the content currently displayed on the display screen among all the content. The position of the scroll bar 102 changes as the position of the currently displayed content among all the content changes. Optionally, the interface 101 may also include a search box and a content display area. The search box is used for users to enter keywords, such as "cat". The content display area is used to display content related to the keyword "cat".
[0043] In response to the user's upward sliding operation, such as Figure 1 As shown in (b), the position of the scroll bar 102 changes from the position in the interface 101 to the position in the interface 103, and the currently displayed content changes from the content in the interface 101 to the content in the interface 103. It should be noted that the interface 103 can be any interface in the process of page sliding, such as the interface when the page is sliding, or the interface when the page is stationary.
[0044] When the page is stationary, the scroll bar 102 is also stationary, and begins to gradually disappear at the first moment after the scroll bar 102 is stationary. Figure 2As shown, taking interface 103 as an example of an interface when the page is stationary, the interface after the scroll bar 102 disappears is, for example, interface 104, wherein two stages are required from interface 102 to interface 104, namely: stage 1, including the moment when the scroll bar 102 just stops to the first moment, during which the scroll bar 102 is in a stationary state; and stage 2, including the first moment to the second moment, during which the scroll bar 102 gradually disappears. For example, the time difference between the moment when the scroll bar 102 just stops and the first moment is 300ms, and the time difference between the second moment and the first moment is 250ms, then the mobile phone switches from interface 102 to interface 104 after 550ms of displaying interface 102.
[0045] After the scroll bar 102 disappears, the user operates the page again and the scroll bar 102 can be displayed again. Figure 3 As shown in the interface 105 in FIG. 1 , when the user re-operates the page, the scroll bar 102 will be redisplayed, and the position of the scroll bar 102 is as shown in the interface 105 .
[0046] See also Figure 4 , which is a schematic diagram of current consumption during page sliding. There is a page sliding during 0-t4. During 0-t1, the page and scroll bar slide; at t1, the page and scroll bar stop sliding (i.e., the page and scroll bar are stationary); during t1-t2, the page and scroll bar remain stationary; during t2-t3, the scroll bar gradually disappears and completely disappears at t3; during t3-t4, the page remains stationary.
[0047] according to Figure 4 It can be seen that there are two current consumptions during the page sliding process, namely during the period from 0 to t1, and during the period from t1 to t2. Among them, taking the time difference between t1 and t2 as 0.25s, the average current during t2 to t3 is 441.23mA (milliamperes), and the average current during t1 to t2 is 325mA as an example, the current consumption during t1 to t2 is: (441.23-325)*(0.25)≈29mAs≈0.008mAh. In other words, every time the page slides, it will cause a loss of 0.008mAh, which increases the power consumption of electronic equipment.
[0048] It can be seen that in the related art, since there is a process in which the scroll bar gradually disappears after the page is stationary, the power consumption of the electronic device increases.
[0049] In view of this, the embodiment of the present application provides a method for displaying a scroll bar, by shortening the time required for the scroll bar to disappear (i.e. Figure 4 The scroll bar disappears quickly, thereby reducing power consumption.
[0050] In the embodiment of the present application, the electronic device can also shorten the time difference between the moment when the scroll bar is stationary and the moment when the scroll bar begins to disappear (ie Figure 4 The scroll bar disappears synchronously when the page is still, thus improving the user's human-computer interaction experience.
[0051] It should be noted that the electronic device provided in the embodiments of the present application may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device, and the embodiments of the present application do not impose any special restrictions on the specific type of the electronic device.
[0052] Figure 5A This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5A As shown, the electronic device 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 button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0053] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0054] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0055] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0056] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0057] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0058] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0059] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.
[0060] Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. For another example, the internal memory 121 may store power consumption strategy configuration information, application information, etc.
[0061] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the electronic device through the power management module 141.
[0062] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. In some embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0063] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc. In some embodiments, the antenna 1 of the electronic device is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology.
[0064] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0065] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
[0066] The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the same device as at least some modules of the processor 110.
[0067] The wireless communication module 160 can provide wireless communication solutions for electronic devices including WLAN (such as wireless fidelity, Wi-Fi) network, Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), nearfield communication technology (NFC), infrared technology (IR), etc.
[0068] The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 may also receive a signal to be sent from the processor 110, modulate the signal, amplify the signal, and convert it into an electromagnetic wave for radiation via the antenna 2.
[0069] The electronic device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the 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 change display information.
[0070] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display screen 194 can be used to display pages, display sliding animations during the sliding of the scroll bar, display disappearing animations after the scroll bar is stationary, and display other interfaces.
[0071] The electronic device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor. ISP is used to process the data fed back by camera 193. Camera 193 is used to capture static images or videos. In some embodiments, the electronic device may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0072] The electronic device can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, and an application processor. For example, music playback, recording, etc. The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, or for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device. The electronic device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0073] Among them, the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
[0074] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0075] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Figure 5B The layered architecture shown is used to exemplify the software structure of the electronic device.
[0076] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through interfaces. In some embodiments, the terminal device may include an application layer, an application framework layer, and a kernel layer. It should be noted that Figure 5B The layered architecture shown is for illustrative purposes only and may vary from one operating system to another (e.g. Android TM system, IOS system, etc.), as long as the functions implemented by each functional module are similar to the embodiments of the present application, the solution of the present application can also be implemented.
[0077] The application layer can include a series of applications. Figure 5B As shown, the application layer may include applications such as desktop (Launcher), browser, power consumption policy, etc. Among them, the power consumption policy application may be used to provide various policies for reducing device power consumption, such as power consumption policy configuration information.
[0078] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer also includes some predefined functions. Figure 5B As shown, the application framework layer may include a view controller (ViewRootImpl), an activity manager service (activitymanager service, AMS), and a sliding control, etc.
[0079] The view controller is used to load the page layout of the application, draw the page, etc. The activity management service is used to pull up (start) the application. The sliding control is used to construct and display the sliding animation, disappearing animation, etc. according to the sliding configuration information of the application.
[0080] The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, etc.
[0081] like Figure 5B As shown, the electronic device further includes a hardware layer. The hardware layer may include the display screen 194 described above.
[0082] The following describes in detail the scroll bar display method provided by the embodiment of the present application in conjunction with the accompanying drawings.
[0083] The scroll bar display method provided in the embodiment of the present application can be divided into two processes: obtaining a hidden parameter, and constructing and displaying a disappearing animation according to the hidden parameter. The above two processes will be described in detail below.
[0084] In an embodiment of the present application, the electronic device can obtain the blanking parameters of the first application after starting the first application.
[0085] The disappearance parameters include the disappearance duration of the scroll bar, the time interval between the moment when the scroll bar is stationary and the moment when the scroll bar starts to disappear (hereinafter referred to as the time interval), and the transparency change information of the scroll bar, etc. The moment when the scroll bar is stationary is the moment when the scroll bar switches from the sliding state to the stationary state.
[0086] The disappearance process of the scroll bar can be reflected by a disappearance animation, which includes all image frames from the beginning of the disappearance of the scroll bar to the complete disappearance. The disappearance duration of the scroll bar is the duration of the disappearance animation, which is used to represent the time required for the scroll bar to disappear completely.
[0087] In an optional implementation, the disappearance process of the scroll bar can be achieved by adjusting the transparency of the scroll bar. The process of the scroll bar disappearing from the beginning to completely disappearing can be understood as the process of the transparency of the scroll bar changing from a maximum value (not 0) to 0.
[0088] The time interval can be used to determine the moment when the scroll bar starts to disappear. For example, if the time interval is 0ms, the mobile phone can play the disappearance animation when the scroll bar is stationary, so that the scroll bar gradually disappears when it is stationary. For another example, if the disappearance timing is 30ms, the mobile phone can play the disappearance animation at the 30th ms after the scroll bar is stationary, so that the scroll bar gradually disappears at the 30th ms after it is stationary.
[0089] The transparency change information of the scroll bar is used to reflect the transparency of the scroll bar at each moment in the process of the scroll bar gradually disappearing. As time goes by, the transparency of the scroll bar gradually increases to achieve the effect of the scroll bar gradually disappearing. It can be understood that the greater the transparency of the scroll bar, the lower the visibility of the scroll bar. For example, the transparency of the scroll bar is 0% when it just starts to disappear, and the transparency of the scroll bar is 100% when it disappears, so that the scroll bar changes from visible to invisible.
[0090] In an optional implementation, the transparency change information may be presented in the form of a curve.
[0091] In an optional implementation, the electronic device pre-stores a first blanking parameter and a second blanking parameter, wherein the first blanking parameter is a blanking parameter that can be used by a preset application, and the second blanking parameter is a blanking parameter that can be used by all applications (including preset applications and non-preset applications), for example, a system default blanking parameter.
[0092] Among them, the first blanking parameters include the first disappearance duration (also called the first duration), the first time interval (also called the third duration) and the first transparency change information, and the second blanking parameters include the second disappearance duration (also called the second duration), the second time interval (also called the fourth duration) and the second transparency change information.
[0093] In an optional implementation, the first disappearance duration may be identified by android:scrollbarFadeDuration, in milliseconds; the first time interval may be identified by android:scrollbarDefaultDelayBeforeFade, in milliseconds.
[0094] The first disappearance duration is shorter than the second disappearance duration, the first time interval is shorter than the second time interval, the first transparency change information is the same as the second transparency change information, or the transparency mean corresponding to the first transparency change information is greater than the transparency mean corresponding to the second transparency change information.
[0095] In the embodiment of the present application, the electronic device can determine whether the first application is a preset application. If the first application is a preset application, the electronic device can obtain the first blanking parameter, that is, the blanking parameter of the first application includes the first blanking parameter; if the first application is not a preset application, the electronic device can obtain the second blanking parameter, that is, the blanking parameter of the first application includes the second blanking parameter.
[0096] The electronic device pre-stores application information, which includes an application identifier of a preset application. The electronic device can determine whether the application information includes the application identifier of the first application. If the application information includes the application identifier of the first application, it indicates that the first application is the preset application; if the application information does not include the application identifier of the first application, it indicates that the first application is not the preset application.
[0097] It should be noted that the application identifier may include an application ID, an application name, an application data package name, etc., and no specific limitation is made here.
[0098] In another optional implementation, power consumption policy configuration information is stored in the electronic device, and the power consumption policy configuration information includes an application identifier and its corresponding blanking parameter.
[0099] In the embodiment of the present application, the power consumption strategy configuration information may be in the form of a table. Exemplarily, the power consumption strategy configuration information may include content as shown in Table 1.
[0100] Table 1
[0101]
[0102] Exemplarily, if the application identifier of the first application is ID1, the electronic device can obtain blanking parameter 1 from the power consumption strategy configuration information, that is, the blanking parameters of the first application include: the disappearance duration is 20ms, the time interval is 0ms, and the transparency change information is curve 1. If the application identifier of the first application is not ID1, ID2, and ID3, the electronic device can obtain blanking parameter 2 from the power consumption strategy configuration information, that is, the blanking parameters of the first application include: the disappearance duration is 250ms, the time interval is 300ms, and the transparency change information is curve 2.
[0103] Among them, the application whose application identifier is ID1, ID2 or ID3 is the aforementioned preset application, and its corresponding hidden parameter 1 is the first hidden parameter; the application whose application identifier is not ID1, ID2 and ID3 is a non-preset application, and its corresponding hidden parameter 2 is the second hidden parameter.
[0104] In an embodiment of the present application, after the electronic device starts the first application, it can display the first interface, which includes a corresponding scroll bar and a first area. The corresponding scroll bar and the first area can be understood as the scroll bar used to indicate the position of the content displayed in the first area in all content.
[0105] The electronic device may receive a first operation of a user sliding a first area, and in response to the first operation, the first area and the scroll bar slide.
[0106] In an optional implementation, the first area may be the entire area where the first interface is located. Figure 1 The browser application shown in FIG. 1 may be a first interface. Figure 1 In the interface 101 , the first area is the area where the interface 101 is located, and the first operation of the user sliding the first area may be a sliding operation of the user on the interface 101 .
[0107] In another optional embodiment, the first region may be a partial region of the first interface. Figure 6 As shown in (a) of FIG. 5 , the first interface may be an interface 601, and the interface 601 includes a scroll bar 602 and a first area 603. Figure 6 As shown in (b) in FIG. 5 , in response to the user sliding the first area 603 , both the first area 603 and the scroll bar 602 slide.
[0108] In an embodiment of the present application, when the first area and the scroll bar slide, the electronic device can display a sliding animation on the first interface.
[0109] The sliding animation includes a sliding animation of elements on the first interface, and the elements on the first interface may include a scroll bar, content displayed on the first interface, and the like.
[0110] In an embodiment of the present application, when the first area and the scroll bar are stationary, the electronic device can construct a disappearing animation according to the blanking parameters of the first application and display the disappearing animation on the first interface.
[0111] In the embodiment of the present application, if the first application is a preset application, the disappearance parameters of the first application include the first disappearance duration, the first transparency change information and the first time interval. Thus, the electronic device can construct a first disappearance animation according to the first disappearance duration and the first transparency change information, and display the first disappearance animation at the end of the first time interval from when the scroll bar is stationary.
[0112] If the first application is not a preset application, the first application's fading parameters include the second fading duration, the second transparency change information, and the second time interval. Thus, the electronic device can construct a second fading animation according to the second fading duration and the second transparency change information, and display the second fading animation at the end of the second time interval from when the scroll bar is stationary.
[0113] It can be seen that the present application achieves the effect of reducing the power consumption of the device by shortening the disappearance time of the scroll bar of the preset application.
[0114] Optionally, before obtaining the blanking parameters of the first application, the electronic device may first obtain the interface configuration information of the first application.
[0115] In an optional implementation, the electronic device may obtain the interface configuration information of the first application from the data packets of the multiple applications according to the application identifier of the first application. The interface configuration information includes the page layout of the multiple interfaces involved in the first application, such as the controls included in each interface, the display mode of the controls, the position and size of the controls, etc.
[0116] Among them, the controls included in the interface may include scroll bars, text controls, button controls, image controls, etc. For example, a scroll bar can be represented by a scroll view (ScrollView) field, a text control can be represented by a text box (TextView) field, a button control can be represented by a button (Button) field, and an image control can be represented by an image view (ImageView) field.
[0117] Among them, different values of the field can be used to indicate whether the interface includes the control corresponding to the field. For example, the value of the ScrollView field is 1, which can indicate that the interface of the first application includes a scroll bar; the value of the ScrollView field is 0, which can indicate that the interface of the first application does not include a scroll bar. The same is true for other fields, which will not be described here. In addition, the value of the field can also be other, such as true, false, etc.
[0118] The display modes of the control may include a mode in which the control can disappear after being displayed (also referred to as a first display mode or a preset display mode) and a mode in which the control cannot disappear after being displayed (also referred to as a second display mode).
[0119] Among them, "disappearable after display" means that the control can disappear after being displayed; "non-disappearable after display" means that the control will not disappear after being displayed. For example, if the display mode of the scroll view in the interface configuration information is fade, it means that the display mode of the scroll bar is that it can disappear after being displayed; if the display mode of the scroll view in the interface configuration information is unfade, it means that the display mode of the scroll bar is that it will not disappear after being displayed.
[0120] The position of the control can be represented by coordinates, which can be represented by the upper left corner of the display screen as the coordinate origin, the width of the display screen as the x-axis, and the height of the display screen as the y-axis as the reference coordinate system.
[0121] The size of a control can be expressed as width*height.
[0122] In an optional implementation, the electronic device may obtain the hiding parameter of the first application when the interface of the first application includes a scroll bar, and may not obtain the hiding parameter of the first application when the interface of the first application does not include a scroll bar.
[0123] It is understandable that when the interface of the first application does not include a scroll bar, the user will not be required to operate the scroll bar when using the first application. After the page is static, the electronic device does not need to display the disappearing animation of the scroll bar. Therefore, not obtaining the blanking parameters of the first application can reduce unnecessary actions of the electronic device and reduce the consumption of CPU resources and memory resources.
[0124] In an optional implementation, the electronic device may obtain the blanking parameter of the first application when the interface of the first application includes a scroll bar and the scroll bar is displayed in a manner that it can disappear after being displayed. Also, when the interface of the first application does not include a scroll bar, or the interface of the first application includes a scroll bar and the scroll bar is displayed in a manner that it cannot disappear after being displayed, the blanking parameter of the first application is not obtained.
[0125] It can be understood that when the interface of the first application does not include a scroll bar, or when the interface of the first application includes a scroll bar and the scroll bar is displayed in a manner that does not disappear after being displayed, the electronic device does not need to display the disappearing animation of the scroll bar after the page is static. Therefore, not obtaining the blanking parameters of the first application can reduce unnecessary actions of the electronic device and reduce the consumption of CPU resources and memory resources.
[0126] Optionally, if the first application is a preset application, the electronic device may also obtain a second blanking parameter, that is, the blanking parameter of the first application includes a first blanking parameter and a second blanking parameter. In this way, if the electronic device fails to obtain the first blanking parameter when constructing a disappearing animation, it may also construct a disappearing animation according to the second blanking parameter, thereby reducing the risk of the scroll bar failing to disappear due to missing blanking parameters.
[0127] See also Figure 7 , which is a flow chart of a method for displaying a scroll bar provided in an embodiment of the present application Figure 1 . Figure 7 The specific process of the electronic device obtaining the blanking parameters of the first application is shown. Figure 7 As shown, the scroll bar display method includes S701 to S712.
[0128] S701, the desktop receives an operation from a user to start a first application.
[0129] The desktop includes icons of multiple applications, and the multiple applications include a first application. The operation of the user starting the first application may be an operation of the user clicking the icon of the first application.
[0130] S702: The desktop sends an instruction to start a first application to the activity management service.
[0131] In an optional implementation, the instruction to start the first application includes an application identifier of the first application.
[0132] S703: The activity management service starts the first application.
[0133] The activity manager may start an activity of the first application according to the application identifier of the first application, so as to start the first application.
[0134] S704: The first application sends a drawing instruction to the view controller.
[0135] The drawing instruction carries the application identifier of the first application.
[0136] S705: The view controller obtains interface configuration information of the first application.
[0137] In an embodiment of the present application, the view controller can query the data packet of the first application according to the application identifier of the first application, and obtain the interface configuration information of the first application from the data packet of the first application.
[0138] S706: The view controller draws the second interface of the first application according to the interface configuration information of the first application.
[0139] The second interface may be the first interface displayed after the first application is started.
[0140] It should be noted that the first interface and the second interface can be the same interface or different interfaces, and no specific limitation is made here.
[0141] S707: The view controller determines whether the interface of the first application includes a scroll bar using the first display mode.
[0142] If the interface of the first application includes a scroll bar using the first display mode, execute S708; if the interface of the first application does not include a scroll bar using the first display mode, it means that the interface of the first application does not involve the process of the scroll bar disappearing, so the view controller does not need to obtain the hidden parameters.
[0143] S708: The view controller sends an instruction to obtain blanking parameters to the power consumption strategy application.
[0144] The instruction for obtaining the blanking parameter carries an application identifier of the first application, such as the name of the data packet of the first application.
[0145] S709: The power consumption strategy application determines whether the first application is a preset application.
[0146] In an optional implementation, after receiving the instruction to obtain the blanking parameter, the power consumption policy application may obtain application information, where the application information includes an application identifier of a preset application.
[0147] The power consumption strategy application can determine whether the application information includes the application identifier of the first application. If the application information includes the application identifier of the first application, it means that the first application is a preset application; if the application information does not include the application identifier of the first application, it means that the first application is not a preset application.
[0148] In the embodiment of the present application, if the first application is a preset application, the power consumption strategy application executes S710; if the first application is not a preset application, the power consumption strategy application may send feedback information to the view controller, and the feedback information may be null.
[0149] S710 , the power consumption strategy application sends a first blanking parameter to the view controller.
[0150] S711, the view controller obtains the second hidden parameter.
[0151] In an optional implementation, the view controller may obtain the second hidden parameter from a configuration file of the operating system.
[0152] If the interface of the first application includes a scroll bar using the first display mode, the view controller may further execute S711.
[0153] It should be noted that there is no strict order between S711 and S708-S710. The view controller may execute S711 first and then S708-S710, or execute S708-S710 first and then S711, or may execute them simultaneously. No specific limitation is made here.
[0154] S712: The view controller stores the first hiding parameter and the second hiding parameter.
[0155] It can be understood that if the first application is not a preset application, S710 can be replaced by the power consumption policy application sending feedback information to the view controller, and the feedback information can be empty (null); S712 can be replaced by: the view controller stores the second blanking parameter.
[0156] That is to say, after the first application is revealed, the electronic device can obtain the blanking parameters of the first application. In addition, according to the type of the first application (preset application / non-preset application), the blanking parameters of the first application are also different.
[0157] See also Figure 8 , which is a flow chart of a method for displaying a scroll bar provided in an embodiment of the present application Figure 2 . Figure 8 The specific process of constructing and displaying the disappearing animation according to the blanking parameters of the electronic device is shown. Figure 8 As shown, the scroll bar display method includes S801 to S811.
[0158] S801, a first application receives a first operation of a user sliding a page.
[0159] For example, the first application is Figure 1 In the browser application shown in FIG. , the first operation of the user sliding the page can be Figure 1 The user performs a sliding operation on the interface 101.
[0160] S802: The first application sends a sliding instruction to the sliding control.
[0161] The sliding instruction carries sliding parameters, which may include a sliding distance corresponding to the first operation, a starting coordinate of the first operation, and an ending coordinate of the first operation.
[0162] S803: The sliding control constructs a sliding animation according to the sliding parameters and displays it.
[0163] In an embodiment of the present application, the sliding animation includes a sliding animation of elements on the first interface, and the elements on the first interface may include a scroll bar, content displayed on the first interface, and the like.
[0164] The sliding distance of the element on the first interface corresponds to the sliding distance corresponding to the first operation.
[0165] S804, the sliding control sends a parameter acquisition request to the view controller.
[0166] The parameter acquisition request carries the application identifier of the first application.
[0167] S805: The view controller determines whether the hiding parameters of the first application include the first hiding parameters.
[0168] As can be seen from the foregoing, depending on whether the first application is a preset application or a non-preset application, the blanking parameter of the first application includes the second blanking parameter or the first blanking parameter and the second blanking parameter.
[0169] If the concealment parameters of the first application include the first concealment parameter, execute S806; if the concealment parameters of the first application do not include the first concealment parameter, execute S809.
[0170] S806: The view controller sends a first hidden parameter to the sliding control.
[0171] S807: The sliding control constructs a first disappearing animation according to the first disappearing duration and the first transparency change information.
[0172] S808: The sliding control displays a first disappearing animation when a first time interval from when the scroll bar stops is over.
[0173] S809: The view controller sends a second hidden parameter to the sliding control.
[0174] S810: The sliding control constructs a second disappearing animation according to the second disappearing duration and the second transparency change information.
[0175] S811, the sliding control displays a second disappearing animation at the end of a second time interval from when the scroll bar stops.
[0176] It can be understood that since the first disappearance time is shorter than the second disappearance time by default of the system, the power consumption caused by the disappearance of the scroll bar can be effectively reduced. In addition, since the first time interval is shorter than the second time interval, the scroll bar can disappear as soon as possible when it is stationary, avoiding the user's feeling of delay that the scroll bar has not disappeared for a long time, thereby improving the user's human-computer interaction experience.
[0177] See also Fig. 9 , which is a flow chart of a method for displaying a scroll bar provided in an embodiment of the present application Figure 3 .
[0178] like Fig. 9 As shown, after starting the first application, the electronic device can determine whether the interface of the first application includes a scroll bar. If the interface of the first application includes a scroll bar, it is further determined whether the display mode of the scroll bar is to disappear after being displayed. If the interface of the first application does not include a scroll bar or the interface of the first application includes a scroll bar but the display mode is not to disappear after being displayed, the electronic device does not obtain the blanking parameter of the first application. If the interface of the first application includes a scroll bar and the display mode of the scroll bar is to disappear after being displayed, the electronic device can obtain the first blanking parameter and the second blanking parameter.
[0179] Furthermore, the electronic device can detect whether the scroll bar slides, and after detecting the sliding of the scroll bar, it can determine whether the first blanking parameter is obtained. If the electronic device obtains the first blanking parameter, the electronic device can construct a first disappearing animation according to the first disappearing duration and the first transparency change information, and display the first disappearing animation at the end of the first time interval since the scroll bar is stationary. If the electronic device obtains the second blanking parameter, the electronic device can construct a second disappearing animation according to the second disappearing duration and the second transparency change information, and display the second disappearing animation at the end of the second time interval since the scroll bar is stationary.
[0180] For example, see Fig.10 , is a schematic diagram of a page sliding process provided by an embodiment of the present application. Fig.10 As shown in (a) of FIG. 1 , the interface 301 is a search page of the browser. The interface 301 may include a scroll bar 302. In response to the user's upward sliding operation, as shown in FIG. Fig.10As shown in (b) of FIG. 3 , the position of the scroll bar 302 changes from the position in the interface 301 to the position in the interface 303, and the currently displayed content changes from the content in the interface 301 to the content in the interface 303. Taking the interface 303 as an example when the page is static, the electronic device can display the interface 304 20ms after displaying the interface 303. Fig.10 As shown in (c) in FIG. 3 , the scroll bar 302 is no longer included in the interface 304 , that is, the scroll bar 302 has disappeared.
[0181] See also Fig.11 ,for Fig.10 The current consumption diagram of the page sliding process is shown. Among them, the period from 0 to t4' corresponds to one page sliding. Among them, during the period from 0 to t1', the page and the scroll bar slide; at t1', the page and the scroll bar stop sliding; during t2' to t3', the scroll bar disappears quickly, and the current consumed is close to the current when the scroll bar is stationary.
[0182] according to Fig.11 It can be seen that the current consumed when the scroll bar disappears is close to the current consumed when the scroll bar is stationary. Figure 4 The current consumed during the disappearance of the scroll bar is higher than the current consumed when the scroll bar is stationary. Fig.11 The page sliding process shown consumes significantly less power.
[0183] In general, the present application reduces the power consumption of the preset application by shortening the disappearance time of the scroll bar of the preset application.
[0184] The embodiment of the present application also provides a chip system, which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected by lines. For example, the interface circuit can be used to receive signals from other devices (such as the memory of the electronic device). For another example, the interface circuit can be used to send signals to other devices (such as processors). Exemplarily, the interface circuit can read the instructions stored in the memory and send the instructions to the processor. When the instructions are executed by the processor, the electronic device or server can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
[0185] This embodiment also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes each function or step in the above method embodiment.
[0186] This embodiment also provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes each function or step in the above method embodiment.
[0187] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes each function or step performed by the mobile phone in the above method embodiment.
[0188] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0189] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0190] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0191] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
[0192] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0193] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0194] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A method for displaying a scroll bar, It is characterized in that Applied to electronic equipment, the method comprises: Display a first interface of a first application, wherein the first interface includes a corresponding scroll bar and a first area; receiving a first operation of sliding the first area; In response to the first operation, the first area and the scroll bar slide; wherein, when the first area is stationary, the scroll bar is stationary, and a disappearing animation is displayed on the first interface; the duration of the disappearing animation corresponds to the disappearance duration of the scroll bar; If the first application is a preset application, the disappearance animation is a first disappearance animation, and the duration of the first disappearance animation is a first duration; If the first application is not a preset application, the disappearing animation is a second disappearing animation, the duration of the second disappearing animation is a second duration, and the first duration is shorter than the second duration.
2. The method according to claim 1, It is characterized in that Before displaying the first interface of the first application, the method further includes: Obtaining a concealment parameter of the first application; wherein, if the first application is a preset application, the concealment parameter of the first application includes a first concealment parameter; if the first application is not a preset application, the concealment parameter of the first application includes a second concealment parameter, and the first concealment parameter is different from the second concealment parameter; Before the first interface displays a disappearing animation, the method further includes: The disappearing animation is constructed according to the fading parameters of the first application.
3. The method according to claim 2, It is characterized in that The first hiding parameter includes the first duration and first transparency change information, the second hiding parameter includes the second duration and second transparency change information, the first transparency change information and the second transparency change information are both used to indicate the transparency change of the scroll bar, and the transparency mean value corresponding to the first transparency change information is greater than the transparency mean value corresponding to the second transparency change information; If the first application is a preset application, constructing the disappearing animation according to the blanking parameters of the first application includes: constructing the first disappearing animation according to the first duration and the first transparency change information; If the first application is not a preset application, constructing the disappearing animation according to the blanking parameters of the first application includes: The second disappearing animation is constructed according to the second duration and the second transparency change information.
4. The method according to claim 3, It is characterized in that The first blanking parameter package further includes a third duration, the second blanking parameter package further includes a fourth duration, and the third duration is shorter than the fourth duration; If the first application is a preset application, displaying a disappearing animation on the first interface includes: When the third time period from when the scroll bar is stationary ends, displaying the first disappearing animation on the first interface; If the first application is not a preset application, displaying a disappearing animation on the first interface includes: When the fourth time period since the scroll bar comes to rest ends, the second disappearing animation is displayed on the first interface.
5. The method according to any one of claims 2 to 4, It is characterized in that The method further comprises: Acquire interface configuration information of the first application, where the interface configuration information of the first application includes controls included in the interface of the first application and display modes adopted by the controls; The obtaining of the blanking parameter of the first application includes: If the interface of the first application includes a scroll bar in a preset display mode, a hidden parameter of the first application is obtained.
6. The method according to any one of claims 1 to 5, It is characterized in that The method further comprises: When the scroll bar slides, a sliding animation is displayed on the first interface, and the sliding animation includes an animation of the sliding of the first area and the scroll bar.
7. The method according to any one of claims 2 to 6, It is characterized in that The electronic device includes a sliding control and a view controller, and constructing the disappearing animation according to the disappearing parameter of the first application includes: The sliding control sends a parameter acquisition request to the view controller; If the first application's hiding parameters include a first hiding parameter, the view controller sends the first hiding parameter to the sliding control, where the first hiding parameter includes the first duration, first transparency change information, and a third duration; The sliding control constructs the first disappearing animation according to the first duration and the first transparency change information; The displaying of the disappearing animation on the first interface includes: The sliding control displays the first disappearing animation when the third time period since the scroll bar comes to rest ends.
8. The method according to claim 7, It is characterized in that The step of constructing the disappearing animation according to the first application's fading parameters further includes: If the first hiding parameter is not included in the hiding parameter of the first application, the view controller sends a second hiding parameter to the sliding control, where the second hiding parameter includes the second duration, second transparency change information and a fourth duration; The sliding control constructs the second disappearing animation according to the second duration and the second transparency change information; The displaying of the disappearing animation on the first interface includes: The sliding control displays the second disappearing animation when the fourth time period since the scroll bar comes to rest ends.
9. The method according to claim 7 or 8, It is characterized in that The electronic device further includes a power consumption strategy application, and obtaining the blanking parameter of the first application includes: In response to an operation of starting the first application, the first application sends a drawing instruction to the view controller; The view controller obtains interface configuration information of the first application, where the interface configuration information of the first application includes controls included in the interface of the first application and display modes adopted by the controls; The view controller determines whether the interface of the first application includes a scroll bar using a preset display mode; If the interface of the first application includes a scroll bar using a preset display mode, the view controller sends an instruction to obtain a blanking parameter to the power consumption strategy application; If the first application is a preset application, the power consumption strategy application sends the first blanking parameter to the view controller.
10. The method according to claim 9, It is characterized in that The acquiring of the blanking parameter of the first application further includes: If the first application is not a preset application, the power consumption strategy application sends feedback information to the view controller, and the feedback information does not carry the first blanking parameter; The view controller obtains a second blanking parameter.
11. An electronic device, It is characterized in that The electronic device comprises: a memory and a processor; the processor is coupled to the memory; wherein the memory is used to store computer program code, the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-10.
12. A computer-readable storage medium, It is characterized in that The method comprises computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 10.
