Page sliding control method and device, electronic equipment, storage medium and product
By dividing the swiping process into multiple time periods and combining it with the screen refresh rate, the swiping speed and direction are optimized, solving the problem of poor swiping smoothness on electronic devices and achieving a smoother swiping effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2024-10-17
- Publication Date
- 2026-04-17
AI Technical Summary
When scrolling through application pages on electronic devices, there are issues such as poor scrolling smoothness, excessively fast scrolling speed at the end causing users to be unable to see the page content clearly, and the scrolling direction being opposite to the user's operation direction.
By dividing the sliding process into multiple time periods, with the duration of each time period equal to the screen's frame interval, the page content is updated based on the sliding distance and speed of each time period. The sliding effect is optimized using nonlinear fitting and drag coefficient, while maintaining consistency with the screen refresh rate.
It improves the smoothness of page scrolling, reduces lag and jitter, optimizes scrolling speed, and makes the user experience smoother.
Smart Images

Figure CN121879652A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of electronic technology, and in particular to a method, apparatus, electronic device, storage medium, and product for controlling page scrolling. Background Technology
[0002] With the continuous development of electronic technology, most mobile phones and other electronic devices have page scrolling functionality. Therefore, when the length of an application page exceeds the length of the screen, users can use swiping to control the page's inertial scrolling and browse the entire page's content.
[0003] However, currently, when electronic devices swipe application pages based on user swipe gestures, the application pages suffer from poor scrolling smoothness. Summary of the Invention
[0004] To overcome the problems existing in the related technologies, this disclosure provides a page sliding control method, device, electronic device storage medium and product, which can improve the sliding flow of the displayed page.
[0005] According to a first aspect of the present disclosure, a page sliding control method is provided, the method comprising: upon detecting a sliding operation on a displayed page on a screen, determining a first sliding distance corresponding to multiple time periods during the sliding process of the displayed page, wherein the duration of each time period is equal to the frame interval of the screen; and updating the page content displayed on the displayed page in each time period based on the first sliding distance corresponding to each time period.
[0006] In some embodiments, determining the first sliding distance corresponding to multiple time periods during the sliding process of the display page includes: determining the sliding speed corresponding to each time period based on the time difference between the end time of each time period and the end time of the sliding operation; and determining the first sliding distance corresponding to each time period based on the sliding speed corresponding to each time period.
[0007] In some embodiments, the number of multiple time periods is N, where N is an integer greater than 1. The sliding speed corresponding to each time period is determined based on the time difference between the end time of each time period and the end time of the sliding operation. This includes: determining the sliding speed of the display page corresponding to the i-th time period based on the time difference between the end time of the i-th time period and the end time of the sliding operation, the sliding speed of the display page corresponding to the i-1-th time period, and the resistance coefficient. Here, i is an integer greater than 0 and less than or equal to N. When i is 1, the sliding speed corresponding to the i-1-th time period is the initial sliding speed, which is obtained by nonlinear fitting of the report coordinates generated based on the sliding operation. The resistance coefficient is used to indicate the magnitude of the assumed resistance experienced by the page content during the sliding process.
[0008] In some embodiments, the number of multiple time periods is N, where N is an integer greater than 1. Based on the sliding speed corresponding to each time period, the first sliding distance corresponding to each time period is determined, including: based on the sliding speed of the display page in the i-th time period and the sliding speed of the display page in the (i-1)-th time period, the first sliding distance of the display page in the i-th time period is determined; where i is an integer greater than 0 and less than or equal to N. When i is 1, the sliding speed corresponding to the (i-1)-th time period is the initial sliding speed, which is obtained by nonlinear fitting of the reporting coordinates generated based on the sliding operation.
[0009] In some embodiments, when a swipe operation is detected on a display page on the screen, determining a first swipe distance corresponding to multiple time periods during the swipe process includes: when a swipe operation is detected on a display page on the screen, obtaining the coordinates of the reporting point generated by the swipe operation; performing nonlinear fitting on the reporting point coordinates to obtain an initial swipe speed; and when the initial swipe speed is greater than a preset threshold, determining the first swipe distance corresponding to multiple time periods during the swipe process.
[0010] In some embodiments, determining the first sliding distance corresponding to multiple time periods during the sliding process of the display page includes: determining the direction of the sliding operation based on the reported coordinates; and determining the first sliding distance corresponding to multiple time periods during the sliding process of the display page when the direction of the initial sliding speed is the same as the direction of the sliding operation.
[0011] In some embodiments, the method further includes: determining a second sliding distance from the end time of the sliding operation to the end time of the sliding operation using a first algorithm based on an initial sliding speed and a preset cutoff sliding speed; determining a first sliding duration from the end time of the sliding operation to the end time of the sliding operation using a second algorithm based on the initial sliding speed and the preset cutoff sliding speed, wherein the second algorithm is different from the first algorithm; and stopping updating the page content of the displayed page when the sliding distance from the end time of the sliding operation to the current time reaches the second sliding distance, and / or the sliding duration from the end time of the sliding operation to the current time reaches the first sliding duration.
[0012] In some embodiments, the time accuracy of the frame spacing is at the nanosecond level.
[0013] According to a second aspect of the present disclosure, a page sliding control device is provided, the device comprising:
[0014] The first determining module is configured to, upon detecting a swipe operation on the displayed page on the screen, determine the first swipe distance corresponding to multiple time periods during the swipe process, wherein the duration of each time period is equal to the frame interval of the screen; the updating module is configured to update the page content displayed on the displayed page within each time period based on the first swipe distance corresponding to each time period.
[0015] In some embodiments, the first determining module is configured to: determine the sliding speed corresponding to each time period based on the time difference between the end time of each time period and the end time of the sliding operation; and determine the first sliding distance corresponding to each time period based on the sliding speed corresponding to each time period.
[0016] In some embodiments, the number of multiple time periods is N, where N is an integer greater than 1. The first determining module is configured to: determine the sliding speed of the display page in the i-th time period based on the time difference between the end time of the i-th time period and the end time of the sliding operation, the sliding speed of the display page in the (i-1)-th time period, and the resistance coefficient; where i is an integer greater than 0 and less than or equal to N. When i is 1, the sliding speed in the (i-1)-th time period is the initial sliding speed, which is obtained by nonlinear fitting of the report coordinates generated based on the sliding operation; the resistance coefficient is used to indicate the magnitude of the assumed resistance experienced by the page content during the sliding process.
[0017] In some embodiments, the number of multiple time periods is N, where N is an integer greater than 1. The first determining module is configured to: determine the first sliding distance of the display page in the i-th time period based on the sliding speed of the display page in the i-th time period and the sliding speed of the display page in the (i-1)-th time period; where i is an integer greater than 0 and less than or equal to N. When i is 1, the sliding speed in the (i-1)-th time period is the initial sliding speed, which is obtained by nonlinear fitting of the reported coordinates generated based on the sliding operation.
[0018] In some embodiments, the first determining module is configured to: upon detecting a sliding operation on a display page on the screen, obtain the coordinates of the reported point generated by the sliding operation; perform nonlinear fitting on the reported point coordinates to obtain an initial sliding speed; and when the initial sliding speed is greater than a preset threshold, determine the first sliding distance corresponding to multiple time periods during the sliding process of the display page.
[0019] In some embodiments, the first determining module is configured to: determine the direction of the sliding operation based on the reported coordinates; and determine the first sliding distance corresponding to multiple time periods during the sliding process when the direction of the initial sliding speed is the same as the direction of the sliding operation.
[0020] In some embodiments, the device further includes: a second determining module configured to determine a second sliding distance from the end time of the sliding operation to the end time of the sliding operation based on an initial sliding speed and a preset cutoff sliding speed, using a first algorithm; a third determining module configured to determine a first sliding duration from the end time of the sliding operation to the end time of the sliding operation based on an initial sliding speed and a preset cutoff sliding speed, using a second algorithm, wherein the second algorithm is different from the first algorithm; and when the sliding distance of the displayed page from the end time of the sliding operation to the current time reaches the second sliding distance, and / or the sliding duration of the displayed page from the end time of the sliding operation to the current time reaches the first sliding duration, the updating of the page content of the displayed page is stopped.
[0021] In some embodiments, the time accuracy of the frame spacing is at the nanosecond level.
[0022] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing computer programs or instructions; wherein the processor executes the computer programs or instructions to implement the steps of the method described above.
[0023] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, which stores executable instructions or a computer program that, when executed by a processor, implements the steps of the method described above.
[0024] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the method described above.
[0025] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0026] In this disclosure, the screen frame interval is the duration between the start of displaying one frame and the start of displaying the next frame. The scrolling effect of the displayed page is essentially an update of the page content displayed on the screen through frame switching, and the visual smoothness of the scrolling is related to the content updated within each frame interval. In this disclosure, determining the scrolling distance of the displayed page within each frame interval ensures that the obtained scrolling distance for each frame interval is consistent with the screen refresh rate. This, in turn, ensures that the page content determined based on the scrolling distance for each frame interval is consistent with the screen refresh rate, thereby improving the scrolling smoothness of the displayed page.
[0027] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0028] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0029] Figure 1 This is a flowchart illustrating a first page sliding control method according to an exemplary embodiment.
[0030] Figure 2 This is a flowchart illustrating a second page sliding control method according to an exemplary embodiment.
[0031] Figure 3 This is a flowchart illustrating a third page sliding control method according to an exemplary embodiment.
[0032] Figure 4 This is a scene diagram illustrating a page sliding control method according to an exemplary embodiment.
[0033] Figure 5 This is a flowchart illustrating a fourth page sliding control method according to an exemplary embodiment.
[0034] Figure 6 This is a flowchart illustrating a fifth page sliding control method according to an exemplary embodiment.
[0035] Figure 7 This is a block diagram illustrating a page sliding control device according to an exemplary embodiment.
[0036] Figure 8 This is a structural block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation
[0037] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0038] With the continuous development of electronic technology, most mobile phones and other electronic devices now have page scrolling functionality. Therefore, when the length of an application page exceeds the length of the screen, users can use swiping to control the page's inertial scrolling, facilitating browsing of the entire application's content.
[0039] However, currently, electronic devices have the following problems when scrolling application pages based on user swipe operations: (i) the application page may lag during the swipe process, and the scrolling smoothness is poor; (ii) the scrolling speed of the application page at the end of the swipe is too fast, causing the user to be unable to see the page content clearly; (iii) the swipe direction of the application page is opposite to the direction of the user's swipe operation.
[0040] To address the aforementioned problems, this disclosure provides a page scrolling control method. This method can be executed by an electronic device. Exemplarily, the executing entity for the page scrolling control method provided in this disclosure can be an electronic device. This electronic device can include mobile terminals and fixed terminals. Mobile terminals can include smartphones, tablets, laptops, digital cameras, and wearable electronic devices, etc. Fixed terminals can include desktop computers, all-in-one computers, etc.
[0041] refer to Figure 1 , Figure 1 This is a flowchart illustrating a first page swiping control method according to an exemplary embodiment. In the following text, an electronic device will be used as the execution subject, with reference to... Figure 1 The steps shown illustrate the page sliding control method provided in this disclosure embodiment. This page sliding control method mainly includes the following steps:
[0042] In step 101, when a swipe operation is detected on the display page on the screen, a first swipe distance corresponding to multiple time periods during the swipe process is determined.
[0043] In some embodiments, the duration of each time period is equal to the screen's frame interval.
[0044] Understandably, when the length of the displayed page exceeds the length of the screen, users can slide their fingers or styluses across the screen to trigger the scrolling of the displayed page, allowing undisplayed content to be shown. Based on this, the electronic device can detect the scrolling action when a user scrolls the displayed page. Upon detecting this scrolling action, the electronic device can determine the frame interval based on the screen's refresh rate. Then, the electronic device can divide the scrolling process into multiple time periods, with each time period equal to a frame interval, and determine the scrolling distance of the displayed page within each frame interval; that is, determine the first scrolling distance corresponding to each time period in the scrolling process.
[0045] In some embodiments, the frame interval can be understood as the duration between the start of displaying one frame on the screen and the start of displaying the next frame.
[0046] In some embodiments, the screen refresh rate can be understood as the number of times the screen refreshes its image within 1000ms. Based on this, after obtaining the screen refresh rate, the electronic device can divide 1000ms by the screen refresh rate to obtain the frame interval.
[0047] For example, when an electronic device determines that the screen refresh rate is 120Hz, it can divide 1000ms by 120 to obtain a frame interval of approximately 8.333ms. When an electronic device determines that the screen refresh rate is 60Hz, it can divide 1000ms by 60 to obtain a frame interval of approximately 16.667ms.
[0048] In some embodiments, the displayed page can be an application page of any application installed on the electronic device. For example, the displayed page can be a news page, product introduction page, or other application displayed on the screen.
[0049] In some embodiments, swiping operations on a displayed page on the screen include, but are not limited to, swiping up, swiping down, swiping left, and swiping right on a displayed page on the screen.
[0050] In some embodiments, an electronic device may detect swipe actions on a displayed page based on a swipe detection control. For example, the swipe detection control may be a RecyclerView control.
[0051] In some embodiments, the scrolling process of the display page includes a first scrolling phase and a second scrolling phase, wherein the first scrolling phase is the phase in which the display page scrolls based on a scrolling operation, and the second scrolling phase is the phase in which the display page continues to scroll due to inertia after the scrolling operation ends. Multiple time periods during the scrolling process of the display page are multiple time periods during the scrolling process of the display page in the second scrolling phase. Therefore, the electronic device determining the first scrolling distance corresponding to each time period of the display page in the multiple time periods can be used to determine the scrolling distance of each time period when the display page performs the second scrolling phase.
[0052] In some embodiments, the electronic device may determine that the first sliding distance of the display page in each time period can be the number of pixel rows that the display page slides in each time period.
[0053] In some embodiments, the electronic device may determine the sliding distance of the display page based on the sliding operation within each time period based on the time difference between the end time of each time period and the end time of the sliding operation.
[0054] In some embodiments, after obtaining the time difference between the end time of each time period and the end time of the swipe operation, the electronic device looks up the swipe distance corresponding to each time difference from the first mapping relationship to obtain the first swipe distance of the display page for each time period. The first mapping relationship is a mapping relationship between duration and distance.
[0055] In some embodiments, the first mapping relationship can be an inertial slip curve. For example, the first mapping relationship can be an ease-out velocity curve.
[0056] In some embodiments, the sliding of the display page in the second sliding phase can be a fling.
[0057] In some embodiments, after the electronic device displays a frame for a duration equal to a frame interval, it generates a vertical synchronization signal (Vsycn) to allow the screen to update the current display to the next frame based on the Vsycn. Therefore, after receiving the Vsycn, the electronic device can determine the duration between the end of the swipe operation and the receipt of the Vsycn, and determine the content to be displayed in the next frame based on the sum of the duration between the end of the swipe operation and the receipt of the Vsycn and the duration of a frame interval.
[0058] In step 102, based on the first sliding distance corresponding to each time period, the page content displayed on the display page within each time period is updated.
[0059] Understandably, since the scrolling effect of a displayed page is essentially an update of the page content shown on the screen, after obtaining the first scrolling distance of the displayed page for each time period, the electronic device can determine the page content displayed on the screen within each time period based on the first scrolling distance, and update the page content displayed on the screen accordingly.
[0060] In some embodiments, after obtaining the first sliding distance of the display page corresponding to each time period, the electronic device can determine the position of the page content of the current screen in the next frame based on the first sliding distance corresponding to each time period, and draw and display the next frame based on the position of the page content of the current screen in the next frame.
[0061] It should be noted that the images in this embodiment are frames displayed on the screen during the process of creating the sliding effect of the display page.
[0062] In this embodiment, the screen frame interval is the duration between the start of displaying one frame and the start of displaying the next frame. The scrolling effect of the displayed page is essentially an update of the page content displayed on the screen through frame switching, and the visual smoothness of the scrolling is related to the content updated within each frame interval. In this disclosure, determining the scrolling distance of the displayed page within each frame interval ensures that the obtained scrolling distance for each frame interval is consistent with the screen refresh rate. This, in turn, ensures that the page content determined based on the scrolling distance for each frame interval is consistent with the screen refresh rate, thereby improving the scrolling smoothness of the displayed page.
[0063] In addition, since the first sliding distance corresponding to each time period is the sliding distance of the display page within a frame interval, and since the frame interval is fixed, the first sliding distance determined based on the method provided in this embodiment can be evenly distributed on a smooth curve. Updating the page content displayed on the display page in each time period based on such a first sliding distance can effectively reduce the probability of the display page jittering or stuttering during the sliding process, and improve the smoothness of the display page sliding.
[0064] In some embodiments, step 102 includes: determining the sliding speed corresponding to each time period based on the time difference between the end time of each time period and the end time of the sliding operation; and determining the first sliding distance corresponding to each time period based on the sliding speed corresponding to each time period.
[0065] Understandably, electronic devices divide the scrolling process of the displayed page into multiple time periods based on the screen's frame interval, ensuring that the duration of each time period is equal to the frame interval. They can then obtain the time difference between the end of each time period and the end of the scrolling operation, and determine the scrolling speed of the displayed page for each time period based on this time difference. After obtaining the scrolling speed for each time period, the electronic device can determine the first scrolling distance for each time period.
[0066] In some embodiments, the scrolling speed of the display page in each time period can be understood as the speed required for the display page to scroll a first scrolling distance in each time period.
[0067] In some embodiments, when the electronic device divides the scrolling process of the display page into N time periods, for the i-th time period, the electronic device can determine the time difference between the end time of the i-th time period and the end time of the scrolling operation. Since the duration of one time period is one frame interval, the time difference between the end time of the i-th time period and the end time of the scrolling operation is i frame intervals. Here, N is an integer greater than 0, and i is an integer greater than 1 and less than or equal to N.
[0068] For example, with a frame interval of 8ms, the time difference between the end of the i-th time period and the end of the sliding operation is 8ms.
[0069] In some embodiments, after obtaining the sliding speed of the display page corresponding to each time period, the electronic device can calculate the time difference between the end time of the i-th time period and the end time of the sliding operation to obtain the i-th time difference, and determine the product of the obtained i-th time difference and the sliding speed corresponding to the i-th time period as the first sliding distance of the display page corresponding to the i-th time period.
[0070] In some embodiments, since the screen of the electronic device is a touch screen, the end time of the swipe operation can be the moment when the touch signal generated by the swipe operation disappears.
[0071] In some embodiments, the number of multiple time periods is N, where N is an integer greater than 1. The sliding speed corresponding to each time period is determined based on the time difference between the end time of each time period and the end time of the sliding operation. This includes: determining the sliding speed of the display page corresponding to the i-th time period based on the time difference between the end time of the i-th time period and the end time of the sliding operation, the sliding speed of the display page corresponding to the i-1-th time period, and the resistance coefficient. Here, i is an integer greater than 0 and less than or equal to N. When i is 1, the sliding speed corresponding to the i-1-th time period is the initial sliding speed, which is obtained by nonlinear fitting of the report coordinates generated based on the sliding operation. The resistance coefficient is used to indicate the magnitude of the assumed resistance experienced by the page content during the sliding process.
[0072] Understandably, the electronic device can also store a resistance coefficient to indicate the magnitude of resistance encountered by the display page during the sliding process. Based on this, when the sliding process of the display page comprises N time periods, for the i-th time period, the electronic device can determine the sliding speed of the display page in the i-th time period based on the time difference between the end of the i-th time period and the end of the sliding operation, the sliding speed of the display page in the (i-1)-th time period, and the resistance coefficient. Here, i can be 1, 2, 3, up to N, where N is an integer greater than 1. When i is 1, since the first time period is the first time period in which the display page slides, there is no preceding time period. Therefore, the electronic device can also obtain the coordinates of the reporting point generated by the sliding operation and perform nonlinear fitting on these coordinates to obtain the initial sliding speed of the display page at the end of the sliding operation. After obtaining the initial sliding speed, the electronic device can use this initial sliding speed as the sliding speed corresponding to the preceding time period of the first time period. That is, the electronic device can determine the first sliding distance corresponding to the first time period based on the time difference between the end of the first time period and the end of the sliding operation, the initial sliding speed, and the resistance coefficient. When i is greater than 1, the electronic device can determine the first sliding distance corresponding to the i-th time period based on the time difference between the end time of the i-th time period and the end time of the sliding operation, the sliding speed of the display page in the previous time period (i-1 time period) and the resistance coefficient.
[0073] In some embodiments, the electronic device can determine the sliding speed of the display page in the i-1 time period based on the sliding speed of the display page in the i-1 time period, the time difference between the end of the i-1 time period and the end of the sliding operation, and the drag coefficient, using a third algorithm.
[0074] In some embodiments, the third algorithm for determining the sliding speed of the display page in the i-th time period can be the algorithm shown in the following formula (1).
[0075]
[0076] Among them, v i To display the page's scrolling speed in the i-th time period; v0 is the scrolling speed in the (i-1)-th time period. When i is 1, the scrolling speed in the (i-1)-th time period is the initial scrolling speed, t i is the time difference between the end time of the i-th time period and the end time of the sliding operation; F is the resistance coefficient.
[0077] In some embodiments, the reporting coordinates used to determine the initial sliding speed can be all reporting coordinates generated based on the sliding operation, or it can be a portion of the reporting coordinates generated based on the sliding operation. This disclosure does not limit this.
[0078] In some embodiments, the electronic device can obtain the initial sliding speed by nonlinearly fitting the coordinates of the reporting point generated based on the sliding operation using a quadratic curve.
[0079] In some embodiments, the initial swiping speed of the displayed page can be the initial swiping speed at which the displayed page enters the fling state.
[0080] In some embodiments, the electronic device can set the drag coefficient as needed. A higher drag coefficient indicates greater resistance to the display page during swiping. Therefore, when the display page needs to slide a longer distance or for a longer period after the swiping operation, a smaller drag coefficient can be set; conversely, when the display page needs to slide a shorter distance or for a shorter period after the swiping operation, a smaller drag coefficient can be used.
[0081] In some embodiments, different resistance coefficients can be set for application pages of different applications, or different resistance coefficients can be set for different application pages of the same application.
[0082] In this embodiment of the disclosure, by setting different resistance coefficients for the application pages of different applications, users can slide different distances for the application pages of different applications when performing the same swipe operation.
[0083] In some embodiments, determining the first sliding distance for each time period based on the sliding speed for each time period includes: determining the first sliding distance for the display page in the i-th time period based on the sliding speed of the display page in the i-th time period and the sliding speed of the display page in the (i-1)-th time period; wherein i is an integer greater than 0 and less than or equal to N, and when i is 1, the sliding speed for the (i-1)-th time period is the initial sliding speed, which is obtained by nonlinear fitting of the reporting coordinates generated based on the sliding operation.
[0084] Understandably, after obtaining the sliding speed corresponding to each of the N time periods, the electronic device can determine the first sliding distance corresponding to the i-th time period based on the sliding speed corresponding to the i-th time period and the sliding speed corresponding to the (i-1)-th time period. When i is 1, the electronic device can perform non-linear fitting on the coordinates of the reported points generated by the sliding operation to obtain the initial sliding speed of the display page at the end of the sliding operation, and determine the first sliding distance corresponding to the first time period based on the sliding speed corresponding to the first time period and the initial sliding speed. When i is greater than 1, the electronic device can determine the first sliding distance corresponding to the i-th time period based on the sliding speed corresponding to the i-th time period and the sliding speed corresponding to the previous time period.
[0085] In some embodiments, the electronic device can determine the scrolling speed and scrolling distance of the displayed page in each time period by using the speed and scrolling distance update method (ComputeScrollerOffSet method) in the run method.
[0086] In some embodiments, the electronic device may determine the first sliding distance corresponding to the i-th time period based on the sliding speed corresponding to the i-th time period, the sliding speed corresponding to the (i-1)-th time period, and the drag coefficient.
[0087] In some embodiments, the electronic device may determine the first sliding distance of the display page in the i-th time period based on the sliding speed corresponding to the i-th time period, the sliding speed corresponding to the (i-1)-th time period, and the drag coefficient, using a fourth algorithm.
[0088] For example, the fourth algorithm can be the algorithm shown in the following formula (2).
[0089]
[0090] Among them, flingD i To display the first swipe distance of the page in the i-th time period; cv i To display the page scrolling speed corresponding to the i-th time period, lv i To display the sliding speed of the page in the (i-1)th time period, when i is 1, the sliding speed of the page in the (i-1)th time period is the initial sliding speed; F is the drag coefficient.
[0091] In this embodiment, by setting the drag coefficient to a larger value, the scrolling distance of the displayed page within a frame interval will be relatively small. Based on this, the displayed page can have a visually lower scrolling speed, thereby optimizing the problem of users being unable to clearly see the page content due to excessively fast scrolling speed.
[0092] In some embodiments, since the scrolling effect of the displayed page is essentially achieved by updating multiple frames with different page content, if the scrolling process of the displayed page after the scrolling operation has N time periods, it means that the displayed page has switched N frames during the scrolling process after the scrolling operation, where one time period corresponds to one frame. The following description uses the example of achieving the scrolling effect of the displayed page through the switching of N frames to further illustrate the page scrolling control method provided in this disclosure.
[0093] Before displaying the first frame of an N-frame display, the electronic device can perform nonlinear fitting on the coordinates of the points generated based on the sliding operation to obtain the initial sliding speed. Additionally, the electronic device can determine the time difference between the end of the first time period and the end of the sliding operation. Then, based on the initial sliding speed, the time difference between the end of the first time period and the end of the sliding operation, and the drag coefficient, the electronic device can calculate the sliding speed of the display page corresponding to the first time period using the above formula (1). After obtaining the sliding speed corresponding to the first time period, the electronic device can calculate the first sliding distance corresponding to the first time period using the above formula (2) based on the sliding speed corresponding to the first time period, the initial sliding speed, and the drag coefficient. Then, based on the first sliding distance corresponding to the first time period, the electronic device can determine the page content of the first frame and draw and display the first frame based on the determined page content.
[0094] During the display of the first frame, the electronic device can calculate the time difference between the end of the second time period and the end of the sliding operation. Then, based on the sliding speed corresponding to the first time period, the time difference between the end of the second time period and the end of the sliding operation, and the drag coefficient, the electronic device can calculate the sliding speed of the displayed page in the second time period using the formula (1) above. After obtaining the sliding speed corresponding to the second time period, the electronic device can calculate the first sliding distance corresponding to the second time period using the formula (2) above, based on the sliding speed corresponding to the second time period, the sliding speed corresponding to the first time period, and the drag coefficient. Then, based on the first sliding distance corresponding to the second time period, the electronic device can determine the page content of the second frame, draw the second frame, and update the first frame displayed on the screen to the second frame when the display duration of the first frame reaches a frame interval. Subsequently, the electronic device can calculate the first sliding distance corresponding to the third time period based on the above method, determine the page content of the third frame based on the first sliding distance corresponding to the third time period, and update the second frame displayed on the screen to the third frame when the display duration of the second frame reaches a frame interval. This process can be repeated to achieve a sliding effect on the displayed page.
[0095] In some embodiments, the electronic device can also determine the time difference between the end time of each time period and the end time of the sliding operation to obtain the time difference corresponding to each time period. After obtaining the time difference corresponding to each time period, the electronic device can search for the sliding speed corresponding to each time difference from the second preset mapping relationship based on the time difference corresponding to each time period to obtain the sliding speed corresponding to each time period.
[0096] In some embodiments, the method further includes: determining a second sliding distance from the end time of the sliding operation to the end time of the sliding operation using a first algorithm based on an initial sliding speed and a preset cutoff sliding speed; determining a first sliding duration from the end time of the sliding operation to the end time of the sliding operation using a second algorithm based on the initial sliding speed and the preset cutoff sliding speed; and stopping updating the page content of the displayed page when the sliding distance from the end time of the sliding operation to the current time reaches the second sliding distance, and / or the sliding duration from the end time of the sliding operation to the current time reaches the first sliding duration.
[0097] Understandably, after a swipe operation ends, the display page cannot swipe indefinitely; instead, the swipe speed gradually decreases. Therefore, the electronic device can determine the total swipe distance from the end of the swipe operation to the end of the swipe itself, based on the initial swipe speed and a preset cutoff swipe speed, using a first algorithm. For ease of explanation, this total swipe distance is referred to as the second swipe distance. Additionally, the electronic device can also determine the total swipe duration from the end of the swipe operation to the end of the swipe itself, based on the initial swipe speed and the preset cutoff swipe speed, using a second algorithm. For ease of explanation, this total swipe duration is referred to as the first swipe duration.
[0098] After obtaining the second sliding distance and the first sliding duration, the electronic device can determine, during the sliding process of the displayed page, whether the sliding distance from the end of the sliding operation to the current time has reached the second sliding distance, and whether the sliding duration from the end of the sliding operation to the current time has reached the first sliding duration. If the electronic device determines that the sliding distance from the end of the sliding operation to the current time has reached the second sliding distance, and / or the sliding duration from the end of the sliding operation to the current time has reached the first sliding duration, it stops sliding the displayed page.
[0099] In some embodiments, the sliding of the display page after the sliding operation ends is an inertial sliding. Based on this, the sliding operation is the driving force propelling the display page to slide, and during the sliding process, there is also a virtual resistance that hinders the sliding of the display page. Based on this, the electronic device can determine a second sliding distance using a first algorithm based on the initial sliding speed, a preset cutoff sliding speed, and a resistance coefficient indicating the magnitude of the virtual resistance. The electronic device can also determine a first sliding duration using a second algorithm based on the initial sliding speed, the cutoff sliding speed, and the resistance coefficient.
[0100] In some embodiments, the first algorithm may be the algorithm shown in the following formula (3).
[0101]
[0102] Where flingD is the second sliding distance; cv is the initial sliding velocity; lv is the cutoff sliding velocity; and F is the drag coefficient.
[0103] In some embodiments, the second algorithm may be the algorithm shown in the following formula (4).
[0104]
[0105] Where flingT is the first sliding duration.
[0106] In some embodiments, when an electronic device detects a swipe operation on the displayed page based on the RecyclerView control, it can send a request message to the speed calculation class based on the RecyclerView control to determine the initial swipe speed of the displayed page in the X-axis direction and / or Y-axis direction, and obtain the initial swipe speed of the displayed page entering the fling state returned by the speed calculation class.
[0107] For example, the speed calculation class can be the VelocityTracke class.
[0108] In some embodiments, after determining that the display page has entered the fling state, the electronic device can use a sliding auxiliary class and an instrumentation class to obtain the second sliding distance and the first sliding duration of the display page in the fling state.
[0109] For example, the sliding helper class can be the OverScroller class, and the instrumentation class can be the OverScrollerSplineOverScrollerStub class.
[0110] In some embodiments, the electronic device can determine the sliding distance and duration of the display page from the end of the sliding operation to the current time after each receipt of a vertical synchronization signal.
[0111] In this embodiment of the disclosure, the problem of abrupt page stopping can be optimized by setting the sliding stop speed to a smaller value, which can further improve the user experience.
[0112] In some embodiments, the time precision of the frame interval is on the nanosecond level.
[0113] Understandably, electronic devices can obtain the screen's frame interval based on the screen's refresh rate and measure the screen's frame interval to the nanosecond level.
[0114] For example, when the screen refresh rate is 120Hz, the electronic device can determine that the screen frame spacing is approximately 8333ns. When the screen refresh rate is 60Hz, the electronic device can determine that the screen frame spacing is approximately 16667ns.
[0115] In some embodiments, the electronic device can obtain nanosecond-level frame intervals in the doFrame stage of the choreographer, and calculate the time difference between the end of each time period and the end of the sliding operation only in the main thread, fling state, and doFrame case.
[0116] In this embodiment, assuming a screen refresh rate of 120Hz, the screen frame interval is approximately 8.333ms. Since one time interval is one period during the scrolling process of the display page, the electronic device can determine that the time difference between the end of the first time interval of the scrolling in the inertial scrolling state and the end of the scrolling operation is approximately 8.333ms, accurate to the millisecond level (8ms); the time difference between the end of the second time interval of the scrolling in the inertial scrolling state and the end of the scrolling operation is approximately 16.667ms, accurate to the millisecond level (17ms). Therefore, the duration of the first time interval is 8ms, and the duration of the second time interval is 17-8=9ms. Based on this, the first scrolling distance corresponding to the first time interval is the scrolling distance of the display page within 8ms, and the first distance corresponding to the second time interval is the scrolling distance of the display page within 9ms. It is evident that dividing the page scrolling process using a frame interval with millisecond-level precision does not perfectly align with the duration of one frame displayed on the screen (8.333ms). Consequently, the calculated scrolling distance also does not perfectly match the duration of one frame displayed on the screen (8.333ms). When the frame interval is at the nanosecond level, the time difference between the end of the first scrolling period and the end of the scrolling operation under inertial scrolling is approximately 8.333ms, accurate to a nanosecond level of 8333ns. The time difference between the end of the second scrolling period and the end of the scrolling operation is approximately 16.667ms, accurate to a nanosecond level of 16667ns. Therefore, the duration of the first scrolling period is 8.333ns, and the duration of the second scrolling period is 16.667 - 8.333 = 8.3334ns. Based on this, the first sliding distance corresponding to the first time period is the sliding distance of the displayed page within 8.333ns, and the first sliding distance corresponding to the second time period is the sliding distance of the displayed page within 8.3334ns. It can be seen that using a frame interval with nanosecond-level precision to divide the sliding process of the displayed page results in time periods that are closer to the duration of one frame displayed on the screen (8.333ms). This makes the calculated sliding distance also closer to the duration of one frame displayed on the screen (8.333ms), further improving the visual smoothness of the page's sliding.
[0117] For example, refer to Figure 2 , Figure 2 This is a flowchart illustrating a second page sliding control method according to an exemplary embodiment. In the following text, it will be combined with... Figure 2 Taking the controls and classes shown in the figure as examples, the specific implementation process of determining the scrolling speed corresponding to multiple time periods during the scrolling process of the display page, and the first scrolling distance corresponding to multiple time periods during the scrolling process of the display page will be further explained.
[0118] When a user swipes on a displayed page on the screen, the electronic device can detect the swipe operation on the displayed page based on the swipe detection control 201. If the electronic device detects a swipe operation on the displayed page based on the swipe detection control 201, it can send a request message to the speed calculation class 202 to determine the initial swipe speed, and receive the initial swipe speed returned by the speed calculation class 202. Then, the electronic device can use the swipe detection control 201 to determine whether the displayed page meets the conditions for entering the inertial swipe state based on the obtained initial swipe speed. If the electronic device determines that the displayed page meets the conditions for entering the inertial swipe state, it can notify the swipe control class 203 that the displayed page meets the conditions for entering the inertial swipe state, and calculate the second swipe distance and the first swipe duration based on the swipe assistance class 204 and the staking class 205.
[0119] After obtaining the second sliding distance and the first sliding duration, the electronic device can register the vertical synchronization signal callback (onVsync) with the choreographer 206 through the postOnAnimation method. Based on the sliding auxiliary class 204, it registers the drawing task and requests the vertical synchronization signal through the PostCallback method. When the vertical synchronization signal callback occurs, the electronic device calls the speed and distance update method (ComputeScrollerOffSet method) in the run method based on the sliding control class 203. It then calculates the sliding speed and the first sliding distance of the display page in each time period through the sliding auxiliary class 204. Based on the first sliding distance in each time period, it updates the page content displayed in each time period through the sliding detection control 201 to achieve a visual sliding effect on the display page.
[0120] For example, the sliding control class 203 can be a ViewFlinger.
[0121] In some embodiments, step 101 includes: when a swipe operation is detected on a display page on the screen, obtaining the coordinates of the reporting point generated by the swipe operation; performing nonlinear fitting on the reporting point coordinates to obtain an initial swipe speed; and when the initial swipe speed is greater than a preset threshold, determining a first swipe distance corresponding to multiple time periods during the swipe process of the display page.
[0122] Understandably, when an electronic device detects a swipe operation on the displayed page, it can obtain the coordinates of the reported points generated by the swipe operation and perform non-linear fitting on these coordinates to obtain the initial swipe speed of the displayed page at the end of the swipe operation. Then, the electronic device can determine whether the obtained initial swipe speed is greater than a preset threshold. If the electronic device determines that the initial swipe speed is greater than the preset threshold, it determines the first swipe distance corresponding to each of the multiple time periods during the swipe process.
[0123] In some embodiments, the size of the preset threshold can be set as needed, and this disclosure does not limit this.
[0124] In some embodiments, when the initial swiping speed of the displayed page exceeds a preset threshold, the electronic device determines that the displayed page meets the conditions for entering the fling state. Upon determining that the displayed page meets the conditions for entering the fling state, the electronic device can determine the first swiping distance corresponding to multiple time periods during which the displayed page swipes in the fling state, and update the page content displayed in each time period based on the first swiping distance for each of the multiple time periods, so that the displayed page has a swiping effect.
[0125] In some embodiments, when the electronic device determines that the initial sliding speed is less than or equal to a preset threshold, it slides the display page based on other non-inertial sliding methods or stops sliding the display page after the sliding operation ends.
[0126] Figure 3 This is a flowchart illustrating a third page sliding control method according to an exemplary embodiment; Figure 4 This is a scene diagram illustrating a page sliding control method according to an exemplary embodiment. In the following text, it will be combined with... Figure 3 and Figure 4 The page sliding control method provided in the above embodiments will be further described.
[0127] In step 301, the electronic device detects a swipe operation on the display page on screen 401.
[0128] In step 302, when the electronic device detects a sliding operation, it determines the initial sliding speed based on the reported coordinates generated by the sliding operation, and determines whether the initial sliding speed is greater than a preset threshold. If not, step 303 is executed; if so, step 304 is executed.
[0129] In step 303, the electronic device determines that the display page is slid in a non-inertial sliding state.
[0130] In step 304, the electronic device determines that the display page meets the conditions for entering the inertial sliding state.
[0131] In step 305, the electronic device calculates the first sliding duration and the second sliding distance.
[0132] In step 306, when the electronic device detects the Vsync signal, it calculates the sliding speed of the display page in each time period and the first sliding distance of the display page in each time period.
[0133] In step 307, the electronic device slides the display page based on the first sliding distance corresponding to each time period, and stops sliding when the page content 402 slides from position A to position B.
[0134] In this embodiment, considering that sometimes the screen may be accidentally touched or a small swipe is needed to display the page, it is unnecessary for the display page to enter an inertial swipe state. However, if the electronic device directly enters an inertial swipe state upon detecting a user's swipe operation, it would negatively impact the user experience. Therefore, the electronic device uses linear fitting to the coordinates of the points generated by the swipe operation to obtain the initial swipe speed of the display page. When the initial swipe speed is greater than a preset threshold, the electronic device controls the display page to enter an inertial swipe state; when the initial swipe speed is less than or equal to the preset threshold, it does not perform an inertial swipe. This reduces the probability of inertial swipes caused by accidental screen touches, further improving the user experience.
[0135] In some embodiments, determining the first sliding distance corresponding to multiple time periods during the sliding process of the display page includes: determining the direction of the sliding operation based on the reported coordinates; and determining the first sliding distance corresponding to multiple time periods during the sliding process of the display page when the direction of the initial sliding speed is the same as the direction of the sliding operation.
[0136] Understandably, the direction of the swipe on the display page is determined by the direction of the initial swipe speed, which is determined by non-linear fitting of the coordinates of the touch points generated by the touch operation. Therefore, if the direction of the initial swipe speed determined by non-linear fitting is inconsistent with the direction of the swipe operation, the display page will swipe in the opposite direction. To solve this problem, the electronic device can also determine the direction of the swipe operation based on the coordinates of the touch points when it detects a swipe operation on the display page. When the electronic device determines that the direction of the initial swipe speed is the same as the direction of the swipe operation, it can determine the first swipe distance corresponding to multiple time periods during the swipe process, and update the page content displayed in each time period based on the first swipe distance corresponding to each time period.
[0137] In some embodiments, if the electronic device determines that the direction of the initial sliding speed is different from the direction of the sliding operation, it may not perform inertial sliding on the displayed page.
[0138] In some embodiments, the direction of the initial sliding speed is different from the direction of the sliding operation, including when the direction of the initial sliding speed is opposite to the direction of the sliding operation, or when the electronic device cannot determine the direction of the sliding operation.
[0139] In some embodiments, if the coordinates of the reporting points used to determine the direction of the sliding operation are the same, the electronic device cannot determine the direction of the sliding operation.
[0140] In some embodiments, the electronic device may first determine whether the direction of the initial sliding speed is the same as the direction of the sliding operation. If the direction of the initial sliding speed is the same as the direction of the sliding operation, it may then determine whether the initial sliding speed is greater than a preset threshold. Alternatively, the electronic device may first determine whether the initial sliding speed is greater than a preset threshold. If the initial sliding speed is greater than the preset threshold, it may then determine whether the direction of the initial sliding speed is the same as the direction of the sliding operation. This disclosure does not limit the execution order of determining whether the direction of the initial sliding speed is the same as the direction of the sliding operation, or whether the initial sliding speed is greater than a preset threshold.
[0141] In some embodiments, the electronic device may determine the direction of the sliding operation based on all the reported coordinates generated by the sliding operation, or it may determine the direction of the sliding operation based on some of the reported coordinates generated by the sliding operation. This disclosure does not limit this aspect.
[0142] For example, an electronic device can acquire partial coordinates of the reporting points near the end time of the sliding operation, and determine the direction of the sliding operation based on these coordinates. For instance, the electronic device can determine the direction of the sliding operation based on the coordinates of the last two reporting points generated by the sliding operation.
[0143] In this embodiment of the disclosure, by determining whether the direction of the initial sliding speed is the same as the direction of the sliding operation, the probability of the event that the sliding direction of the displayed page is opposite to the direction of the sliding operation can be reduced.
[0144] The following text is for reference only. Figure 5 , Figure 5 This is a flowchart illustrating a fourth page sliding control method according to an exemplary embodiment. In the following text, it will be combined with... Figure 5 The steps in the document describe the specific implementation process for determining whether the direction of the sliding operation is consistent with the direction of the fitted velocity.
[0145] In step 501, the electronic device detects a swipe operation on a page displayed on the screen.
[0146] In step 502, the electronic device obtains the fitted speed and the direction of the fitted speed based on the nonlinear fitting of the reported coordinates generated by the sliding operation, based on the created speed monitoring class instance.
[0147] In step 503, the electronic device obtains the coordinates of the last two reporting points generated based on the sliding operation and determines the direction of the sliding operation.
[0148] In step 504, the electronic device determines whether the direction of the sliding operation is consistent with the direction of the fitted velocity. If yes, step 505 is executed; otherwise, step 506 is executed.
[0149] In step 505, the electronic device uses the current fitted speed as the initial sliding speed.
[0150] In step 506, the electronic device discards the current fitting speed, that is, sets the current fitting speed to 0 and does not slide the display page.
[0151] For example, refer to Figure 6 , Figure 6 This is a flowchart illustrating a fifth page sliding control method according to an exemplary embodiment. In the following text, it will be referred to as... Figure 6 Using the controls and classes shown in the image as examples, this section further explains the specific implementation process for determining whether the direction of the initial scrolling speed on the displayed page is consistent with the direction of the scrolling operation.
[0152] 1. The electronic device uses a swipe detection control 201 to detect swipe operations on the display page shown on the screen.
[0153] 2. Electronic devices create instances for calculating page scrolling speed, for example, creating a VelocityTracker instance.
[0154] 3. When the electronic device detects a sliding operation on the display page based on the sliding detection control 201, it can add the sliding operation event to the newly created VelocityTracker instance by adding a motion function (addMovement function), so that the VelocityTracker instance can record the reporting coordinates generated based on the sliding operation and the initial sliding speed determined based on the reporting coordinates.
[0155] 4. The electronic device requests the speed calculation class 202 based on the sliding detection control 201, and calculates the initial sliding speed of the displayed page through the current speed calculation (ComputeCurrentVelocity method).
[0156] 5. The electronic device obtains the underlying current speed calculation method (nativeComputeCurrentVelocity method) based on the speed calculation class 202.
[0157] In some embodiments, electronic devices can access the native (lower-level) side through the JNI underlying interface.
[0158] 6. The electronic device calculates the initial sliding speed based on the current speed calculation method (ComputeVelocit y) obtained from the underlying layer by the speed calculation class 202.
[0159] 7. The electronic device obtains the initial sliding speed based on speed calculation class 202.
[0160] 8. Electronic devices obtain estimated values based on speed calculation class 202.
[0161] 9. Electronic equipment based on speed calculation class 202 uses the unweighted least squares method based on solution g2 to determine whether the direction of the initial sliding velocity is consistent with the direction indicated by the coordinates of the last two reported points of the sliding operation.
[0162] 10. The speed calculation class 202 returns the judgment result of step 9 to the sliding detection control 201.
[0163] refer to Figure 7 , Figure 7 This is a block diagram illustrating a page sliding control device according to an exemplary embodiment. Figure 7 As shown, the sliding control device 700 of this page includes:
[0164] The first determining module 701 is configured to, upon detecting a swipe operation on a display page on the screen, determine a first swipe distance corresponding to multiple time periods during the swipe process, wherein the duration of each time period is equal to the frame interval of the screen; the updating module 702 is configured to update the page content displayed on the display page within each time period based on the first swipe distance corresponding to each time period.
[0165] In some embodiments, the first determining module 701 is configured to: determine the sliding speed corresponding to each time period based on the time difference between the end time of each time period and the end time of the sliding operation; and determine the first sliding distance corresponding to each time period based on the sliding speed corresponding to each time period.
[0166] In some embodiments, the number of multiple time periods is N, where N is an integer greater than 1. The first determining module 701 is configured to: determine the sliding speed of the display page in the i-th time period based on the time difference between the end time of the i-th time period and the end time of the sliding operation, the sliding speed of the display page in the (i-1)-th time period, and the resistance coefficient; where i is an integer greater than 0 and less than or equal to N. When i is 1, the sliding speed in the (i-1)-th time period is the initial sliding speed, which is obtained by nonlinear fitting of the report coordinates generated based on the sliding operation; the resistance coefficient is used to indicate the magnitude of the assumed resistance experienced by the page content during the sliding process.
[0167] In some embodiments, the number of multiple time periods is N, where N is an integer greater than 1. The first determining module 701 is configured to: determine the first sliding distance of the display page in the i-th time period based on the sliding speed of the display page in the i-th time period and the sliding speed of the display page in the (i-1)-th time period; where i is an integer greater than 0 and less than or equal to N. When i is 1, the sliding speed in the (i-1)-th time period is the initial sliding speed, which is obtained by nonlinear fitting of the reporting coordinates generated based on the sliding operation.
[0168] In some embodiments, the first determining module 701 is configured to: when a sliding operation is detected on a display page on the screen, obtain the coordinates of the reporting point generated by the sliding operation; perform nonlinear fitting on the reporting point coordinates to obtain an initial sliding speed; and when the initial sliding speed is greater than a preset threshold, determine the first sliding distance corresponding to multiple time periods during the sliding process of the display page.
[0169] In some embodiments, the first determining module 701 is configured to: determine the direction of the sliding operation based on the reported coordinates; and determine the first sliding distance corresponding to multiple time periods during the sliding process when the direction of the initial sliding speed is the same as the direction of the sliding operation.
[0170] In some embodiments, the device further includes: a second determining module configured to determine a second sliding distance from the end time of the sliding operation to the end time of the sliding operation based on an initial sliding speed and a preset cutoff sliding speed, using a first algorithm; a third determining module configured to determine a first sliding duration from the end time of the sliding operation to the end time of the sliding operation based on an initial sliding speed and a preset cutoff sliding speed, using a second algorithm, wherein the second algorithm is different from the first algorithm; and when the sliding distance of the displayed page from the end time of the sliding operation to the current time reaches the second sliding distance, and / or the sliding duration of the displayed page from the end time of the sliding operation to the current time reaches the first sliding duration, the updating of the page content of the displayed page is stopped.
[0171] In some embodiments, the time accuracy of the frame spacing is at the nanosecond level.
[0172] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0173] Figure 8 This is a structural block diagram illustrating an electronic device 800 according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, tablet computer, smartwatch, in-vehicle device, or other communication device.
[0174] Reference Figure 8 The electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input / output (I / O) interface 812, sensor component 814, and communication component 816.
[0175] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. Processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0176] Memory 804 is configured to store various types of data to support operation on electronic device 800. Examples of such data include at least one of the following: instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, and videos. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0177] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0178] Multimedia component 808 includes a screen that provides an output interface between electronic device 800 and user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When electronic device 800 is in an operating mode, such as a shooting mode or video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0179] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0180] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, and buttons. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0181] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 may detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or one of its components, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include, but is not limited to, at least one of the following: an accelerometer, a gyroscope, a magnetometer, a pressure sensor, and a temperature sensor.
[0182] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as Wi-Fi, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.
[0183] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.
[0184] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including executable instructions or a computer program, which can be executed by a processor 820 of an electronic device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0185] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform any of the page scrolling control methods described in the embodiments of this disclosure. For example, the method includes:
[0186] Upon detecting a swipe operation on the displayed page on the screen, determine the first swipe distance corresponding to multiple time periods during the swipe process, with the duration of each time period being equal to the screen's frame interval;
[0187] Based on the first swipe distance corresponding to each time period, update the page content displayed in each time period.
[0188] This disclosure provides a computer program product comprising a computer program or executable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program or executable instructions from the computer-readable storage medium and executes the computer program or executable instructions, causing the computer device to perform any of the page scrolling control methods described in this disclosure.
[0189] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0190] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method of controlling a page scroll, the method comprising: The method includes: Upon detecting a swipe operation on a page displayed on the screen, a first swipe distance is determined for multiple time periods during the swipe process, the duration of each time period being equal to the frame interval of the screen; Based on the first sliding distance corresponding to each time period, the page content displayed on the display page within each time period is updated.
2. The method of claim 1, wherein, Determining the first sliding distance corresponding to multiple time periods during the sliding process of the display page includes: The sliding speed corresponding to each time period is determined based on the time difference between the end time of each time period and the end time of the sliding operation; Based on the sliding speed corresponding to each time period, the first sliding distance corresponding to each time period is determined.
3. The method of claim 2, wherein, The number of the plurality of time periods is N, where N is an integer greater than 1. Determining the sliding speed corresponding to each time period based on the time difference between the end time of each time period and the end time of the sliding operation includes: Based on the time difference between the end time of the i-th time period and the end time of the sliding operation, the sliding speed of the display page in the (i-1)-th time period, and the resistance coefficient, the sliding speed of the display page in the i-th time period is determined. Where i is an integer greater than 0 and less than or equal to N, when i is 1, the sliding speed corresponding to the (i-1)th time period is the initial sliding speed, which is obtained by nonlinear fitting of the report coordinates generated based on the sliding operation; the resistance coefficient is used to indicate the magnitude of the assumed resistance experienced by the page content during the sliding process.
4. The method of claim 2, wherein, The number of the plurality of time periods is N, where N is an integer greater than 1. Determining the first sliding distance corresponding to each time period based on the sliding speed corresponding to each time period includes: Based on the scrolling speed of the display page in the i-th time period and the scrolling speed of the display page in the (i-1)-th time period, determine the first scrolling distance of the display page in the i-th time period; Where i is an integer greater than 0 and less than or equal to N. When i is 1, the sliding speed corresponding to the (i-1)th time period is the initial sliding speed, which is obtained by nonlinear fitting of the reporting coordinates generated based on the sliding operation.
5. The method of claim 1, wherein, The step of determining the first sliding distance of the display page during multiple time periods in the sliding process when a sliding operation on the screen is detected includes: If a swipe operation is detected on the displayed page on the screen, the coordinates of the reported point generated by the swipe operation are obtained; The initial sliding velocity is obtained by performing nonlinear fitting on the coordinates of the reported points. When the initial sliding speed is greater than a preset threshold, the first sliding distance corresponding to multiple time periods during the sliding process of the display page is determined.
6. The method of claim 5, wherein, Determining the first sliding distance corresponding to multiple time periods during the sliding process of the display page includes: Based on the reported coordinates, determine the direction of the sliding operation; When the direction of the initial sliding speed is the same as the direction of the sliding operation, the first sliding distance corresponding to multiple time periods during the sliding process of the display page is determined.
7. The method according to claim 5, characterized in that, The method further includes: Based on the initial sliding speed and the preset cutoff sliding speed, a second sliding distance from the end time of the sliding operation to the end time of the sliding operation is determined by a first algorithm; Based on the initial sliding speed and the preset cutoff sliding speed, a first sliding duration from the end time of the sliding operation to the end time of the sliding operation is determined by a second algorithm, wherein the second algorithm is different from the first algorithm; When the sliding distance of the display page from the end of the sliding operation to the current time reaches the second sliding distance, and / or the sliding duration of the display page from the end of the sliding operation to the current time reaches the first sliding duration, the page content of the display page shall be stopped from being updated.
8. The method according to any one of claims 1 to 7, characterized in that, The time precision of the frame spacing is at the nanosecond level.
9. A page slide control apparatus, characterized by comprising: The device includes: The first determining module is configured to, upon detecting a swipe operation on a display page on the screen, determine a first swipe distance corresponding to multiple time periods during the swipe process of the display page, wherein the duration of each time period is equal to the frame interval of the screen; The update module is configured to update the page content displayed on the display page within each time period based on the first sliding distance corresponding to each time period.
10. An electronic device, comprising: include: processor; Memory used to store computer programs or instructions; The processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing a computer program or instructions, wherein, When the computer program or instructions in the storage medium are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product comprising computer programs or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.