Interface processing method and device, equipment, storage medium and computer program product
By displaying a second interface floating on top of the first interface and adjusting its display position based on pixel values within the target area, the problem of mismatch between display effect and visual effect is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202410822922.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2025-12-26
AI Technical Summary
In the prior art, setting fixed display parameters at the target position of the floating second interface on the first interface results in a mismatch between the display effect and the user's visual experience.
The second interface is displayed by floating on the first interface, and the display position of the second interface is adjusted based on the pixel value of the pixel in the target area to correspond to the pixel value in the target area. This includes determining the brightness value and difference of the target area and dynamically adjusting the position of the second interface to match the visual effect.
The display position of the second interface was matched with the user's visual effect, thus improving the user experience.
Smart Images

Figure CN121209720A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of computer communication, and particularly relates to an interface processing method and device, equipment, storage medium and computer program product. BACKGROUND
[0002] At present, in the electronic device, when multiple interfaces are displayed, part of the interface can be displayed on the upper layer of other interfaces, and the lower layer interface is used as the background of the upper layer interface. For example, application controls can be displayed on the upper layer of the application interface.
[0003] In the related art, a fixed display parameter is set to display the upper layer interface at the target position of the lower layer interface, which can cause the display effect to be mismatched with the visual effect of the user. SUMMARY
[0004] To overcome the problems in the related art, the present disclosure provides an interface processing method, device, equipment, storage medium and computer program product. The display effect of the second interface can be matched with the visual effect of the user on the basis of flexible adjustment of the display position of the second interface.
[0005] According to a first aspect of an embodiment of the present disclosure, an interface processing method is provided, comprising:
[0006] displaying a second interface on a first interface; wherein the size of the second interface is smaller than the size of the first interface;
[0007] determining a target area in the first interface that is not covered by the second interface;
[0008] adjusting the display position of the second interface on the first interface based on the pixel value of the pixel in the target area.
[0009] In some embodiments, the target area includes a first sub-area and a second sub-area located on opposite sides of the second interface, respectively; and adjusting the display position of the second interface on the first interface based on the pixel value of the pixel in the target area includes:
[0010] when the width of the first sub-area and the width of the second sub-area are the same, determining a first brightness value corresponding to the first sub-area based on the pixel value of each pixel in the first sub-area, and determining a second brightness value corresponding to the first sub-area based on the pixel value of each pixel in the second sub-area;
[0011] adjusting the display position of the second interface on the first interface based on the first brightness value and the second brightness value;
[0012] The width of the region is a vertical distance from a side of the first interface to a side of the second interface.
[0013] In some embodiments, the adjusting the display position of the second interface on the first interface based on the first luminance value and the second luminance value comprises:
[0014] In a case where the first luminance value and the second luminance value are different, determining a difference between the first luminance value and the second luminance value;
[0015] In a case where the difference is greater than a preset deviation threshold, adjusting the display position of the second interface on the first interface.
[0016] In some embodiments, the adjusting the display position of the second interface on the first interface in the case where the difference is greater than the preset deviation threshold comprises:
[0017] In the case where the difference is greater than the preset deviation threshold, comparing the first luminance value and the second luminance value to obtain a comparison result;
[0018] moving the second interface in a moving direction corresponding to the comparison result;
[0019] The moving distance of the second interface is positively correlated with the difference.
[0020] In some embodiments, the moving the second interface in the moving direction corresponding to the comparison result comprises:
[0021] In a case where the comparison result indicates that the first luminance value is less than the second luminance value, moving the second interface in a direction towards the second sub-region until the difference is less than or equal to the preset deviation threshold;
[0022] In a case where the comparison result indicates that the first luminance value is greater than the second luminance value, moving the second interface in a direction towards the first sub-region until the difference is less than or equal to the preset deviation threshold.
[0023] In some embodiments, the method further comprises:
[0024] In a case where the difference is less than or equal to the preset deviation threshold, maintaining the current display position of the second interface on the first interface.
[0025] According to a second aspect of the present disclosure, there is provided an interface processing apparatus, comprising:
[0026] The first display module is configured to display the second interface in suspension on the first interface; wherein the size of the second interface is smaller than the size of the first interface.
[0027] The determining module is configured to determine a target region in the first interface which is not covered by the second interface.
[0028] The adjusting module is configured to adjust the display position of the second interface on the first interface based on the pixel values of the pixels in the target region.
[0029] In some embodiments, the target region includes a first sub-region and a second sub-region respectively located at opposite sides of the second interface; and the adjusting module is configured to:
[0030] determine a first brightness value corresponding to the first sub-region based on the pixel values of the pixels in the first sub-region, and determine a second brightness value corresponding to the first sub-region based on the pixel values of the pixels in the second sub-region, in a case where the width of the first sub-region and the width of the second sub-region are the same.
[0031] adjust the display position of the second interface on the first interface based on the first brightness value and the second brightness value.
[0032] wherein the width of the region is a vertical distance from a side of the first interface to a side of the second interface.
[0033] In some embodiments, the adjusting module is configured to include:
[0034] determine a difference between the first brightness value and the second brightness value, in a case where the first brightness value and the second brightness value are different.
[0035] adjust the display position of the second interface on the first interface, in a case where the difference is greater than a preset deviation threshold.
[0036] In some embodiments, the adjusting module is configured to include:
[0037] compare the first brightness value and the second brightness value to obtain a comparison result, in a case where the difference is greater than the preset deviation threshold.
[0038] move the second interface in a moving direction corresponding to the comparison result.
[0039] wherein the moving distance of the second interface is positively correlated with the difference.
[0040] In some embodiments, the adjusting module is configured to include:
[0041] in a case where the comparison result indicates that the first luminance value is less than the second luminance value, moving the second interface toward a direction of the second sub-region until the difference value is less than or equal to the preset deviation threshold value;
[0042] in a case where the comparison result indicates that the first luminance value is greater than the second luminance value, moving the second interface toward a direction of the first sub-region until the difference value is less than or equal to the preset deviation threshold value.
[0043] In some embodiments, the apparatus further includes:
[0044] a second display module, configured to maintain a display position of the second interface on the first interface in a case where the difference value is less than or equal to the preset deviation threshold value.
[0045] According to a third aspect of embodiments of the present disclosure, an electronic device is provided, including:
[0046] a processor;
[0047] a memory for storing computer programs or instructions;
[0048] The processor executes the computer programs or instructions to implement the steps of the method according to any one of the first aspect.
[0049] According to a fourth aspect of embodiments of the present disclosure, a non-transitory computer readable storage medium is provided, which stores computer programs or instructions, and when the computer programs or instructions in the storage medium are executed by a processor, the steps of the method according to any one of the first aspect are implemented.
[0050] According to a fifth aspect of embodiments of the present disclosure, a computer program product is provided, including computer programs or instructions, and when the computer programs or instructions are executed by a processor, the steps of the method according to any one of the first aspect are implemented.
[0051] The technical solutions provided by the embodiments of the present disclosure can include the following beneficial effects:
[0052] In the embodiments of the present disclosure, the pixel value of the pixel in the target region can be determined, and the display position of the second interface on the first interface is adjusted based on the pixel value of the pixel in the target region, so that the display position of the second interface on the first interface corresponds to the pixel value of the pixel in the target region.
[0053] Compared with the prior art of setting fixed display parameters to display the second interface on the target position of the first interface, the display position of the second interface on the first interface is adjusted to correspond to the pixel value of the pixel in the target region in the present disclosure. Since the pixel value of the pixel in the target region can affect the visual effect of the user, the display effect of the second interface can be matched with the visual effect of the user on the basis of realizing flexible adjustment of the display position of the second interface.
[0054] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and serve to explain the principles of the present disclosure, together with the description.
[0056] Figure 1 is a flow of an interface processing method according to an exemplary embodiment Figure One .
[0057] Figure 2 is an interface diagram according to an exemplary embodiment Figure One .
[0058] Figure 3 is an interface diagram according to an exemplary embodiment Figure Two .
[0059] Figure 4 is a flow of an interface processing method according to an exemplary embodiment Figure Two .
[0060] Figure 5 is a block diagram of a processing device for application data according to an exemplary embodiment.
[0061] Figure 6 is a structural block diagram of a device 600 according to an exemplary embodiment. DETAILED DESCRIPTION
[0062] The exemplary embodiments will be described in detail herein with reference to the attached drawings. In the following description, the same numbers are used to indicate the same elements throughout the several figures. The embodiments described in the following exemplary embodiments are not meant to represent all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0063] Figure 1 is a flow of an interface processing method according to an exemplary embodiment Figure OneAs shown in Figure 1 The method mainly includes the following steps:
[0064] In step 101, the second interface is displayed in suspension on the first interface; wherein the size of the second interface is smaller than the size of the first interface;
[0065] In step 102, a target region in the first interface which is not covered by the second interface is determined;
[0066] In step 103, the display position of the second interface on the first interface is adjusted based on the pixel value of the pixels in the target region.
[0067] It should be noted that the interface processing method proposed in the present disclosure can be applied to an electronic device. Here, the electronic device can include a terminal device, such as a mobile terminal or a fixed terminal. The mobile terminal can include a mobile phone, a tablet computer, a notebook computer, a wearable electronic device, etc. The fixed terminal can include a desktop computer, a smart television, a vehicle-mounted device, etc.
[0068] In some embodiments, the first interface can be displayed on the display screen of the electronic device, and the second interface can be displayed in suspension on the first interface. Here, the first interface can be an application interface of an application program running on the electronic device, and the second interface can be an interface displayed in suspension on the upper layer of the application interface, such as an application control, a message pop-up window, a prompt box, etc. In other embodiments, the first interface can also be a home screen interface of the electronic device, and the second interface can be an interface displayed in suspension on the upper layer of the home screen interface, such as a message push interface, an application icon, etc. As long as the second interface is displayed in suspension on the first interface, and the size of the second interface is smaller than the size of the first interface, the types of the first interface and the second interface are not listed one by one here. In other embodiments, there can be at least two second interfaces, as long as the first interface is not completely covered by the second interface.
[0069] Figure 2 is a schematic diagram of an interface according to an exemplary embodiment Figure One As shown in Figure 2 The present disclosure can display the second interface 202 in suspension on the first interface 201. In the case of displaying the second interface 202 in suspension on the first interface 201, since the size of the second interface 202 is smaller than the size of the first interface 201, there will be a region in the first interface 201 which is not covered by the second interface 202, i.e. a target region 203.
[0070] In the embodiments of the present disclosure, the pixel value of the pixel in the target region can be determined, and the display position of the second interface on the first interface is adjusted based on the pixel value of the pixel in the target region. In some embodiments, after the pixel value of the pixel in the target region is determined, the gray value (grayscale value) of the pixel in the target region can be obtained based on the pixel value of the pixel in the target region, and the display position of the second interface on the first interface is adjusted based on the gray value of the pixel in the target region. The pixel value of the pixel in the target region can represent the brightness of each part of the target region.
[0071] Since the corresponding brightness will be different when the pixel value of the pixel is different, in order to present different visual effects, the display position of the second interface on the first interface can be adjusted based on the pixel value of the pixel to meet the required visual effects in different use scenarios. In some embodiments, taking the first interface as an application interface of an application program as an example, the current use scenario can be determined based on the application type of the application program, and then the display position of the second interface on the first interface is adjusted based on the current use scenario and the pixel value of the pixel in the target region.
[0072] For example, the current use scenario needs to present that the second interface is located at a left position on the first interface, and then the display position of the second interface on the first interface can be adjusted based on the pixel value of the pixel in the target region, so that the second interface is visually left. For another example, the current use scenario needs to present that the second interface is located at a middle position on the first interface, and then the display position of the second interface on the first interface can be adjusted based on the pixel value of the pixel in the target region, so that the second interface is visually centered.
[0073] For example, in a case that the first average value of the pixel value of each pixel in the first sub-region located at the first side (upper side) of the second interface in the target region is less than the second average value of the pixel value of each pixel in the second sub-region located at the second side (lower side) of the second interface in the target region, it indicates that the brightness of the first sub-region is lower than the brightness of the second sub-region. At this time, in order to make the second interface visually in the middle position of the first interface, the second interface can be moved towards the direction of the second sub-region.
[0074] In the embodiments of the present disclosure, the pixel value of the pixel in the target region can be determined, and the display position of the second interface on the first interface is adjusted based on the pixel value of the pixel in the target region, and then the display position of the second interface on the first interface corresponds to the pixel value of the pixel in the target region.
[0075] Compared with setting a fixed display parameter to display the second interface on the target position on the first interface in the related art, the display position of the second interface on the first interface is adjusted to correspond to the pixel value of the pixel in the target region in the present disclosure. Since the pixel value of the pixel in the target region can affect the visual effect of the user, the display effect of the second interface can be matched with the visual effect of the user on the basis of flexible adjustment of the display position of the second interface.
[0076] In some embodiments, the target region includes a first sub-region and a second sub-region located at opposite sides of the second interface respectively; the display position of the second interface on the first interface is adjusted based on the pixel value of the pixel in the target region, including:
[0077] In the case where the width of the first sub-region and the width of the second sub-region are the same, a first luminance value corresponding to the first sub-region is determined based on the pixel value of each pixel in the first sub-region, and a second luminance value corresponding to the first sub-region is determined based on the pixel value of each pixel in the second sub-region.
[0078] The display position of the second interface on the first interface is adjusted based on the first luminance value and the second luminance value.
[0079] The width of the region is the vertical distance from the side of the first interface to the side of the second interface.
[0080] In some embodiments, after obtaining the pixel value of each pixel in the first sub-region, the gray scale value of each pixel can be obtained based on the pixel value of each pixel. After obtaining the gray scale value of each pixel, the first luminance value corresponding to the first sub-region can be determined based on the gray scale value of each pixel in the first sub-region. For example, the first luminance value is determined based on the average value of the gray scale value of each pixel in the first sub-region. Illustratively, the average value of the gray scale value of each pixel in the first sub-region is determined as the first luminance value of the first sub-region.
[0081] After obtaining the pixel value of each pixel in the second sub-region, the gray scale value of each pixel can be obtained based on the pixel value of each pixel. After obtaining the gray scale value of each pixel, the second luminance value corresponding to the second sub-region can be determined based on the gray scale value of each pixel in the second sub-region. For example, the second luminance value is determined based on the average value of the gray scale value of each pixel in the second sub-region. Illustratively, the average value of the gray scale value of each pixel in the second sub-region is determined as the second luminance value of the second sub-region.
[0082] Exemplarily, the first sub-region can be a region on the first interface located left of the second interface, and the second sub-region can be a region on the first interface located right of the second interface. In order to make the second interface display centrally on the second interface, the width of the first sub-region and the width of the second sub-region can be set to be the same, but in the case that the content in the first sub-region and the second sub-region is different, the brightness of the first sub-region and the second sub-region will also be different, at this time, even if the width of the first sub-region and the width of the second sub-region are set to be the same, the visual width of the first sub-region and the second sub-region will also be different.
[0083] In other embodiments, the first sub-region can also be a region on the first interface located above the second interface, and the second sub-region can be a region on the first interface located below the second interface.
[0084] In some embodiments, the height of the first sub-region and the second sub-region is the same, by setting the height of the first sub-region and the second sub-region to be the same and making the width of the first sub-region and the second sub-region the same, when adjusting the display position of the second interface, the final visual effect can be more objective and realistic.
[0085] In the embodiments of the present disclosure, in the case that the width of the first sub-region and the second sub-region is set to be the same, the pixel value of the pixel in the first sub-region and the pixel value of the pixel in the second sub-region are further determined, the first brightness value corresponding to the first sub-region is determined based on the pixel value of each pixel in the first sub-region, and the second brightness value corresponding to the first sub-region is determined based on the pixel value of each pixel in the second sub-region, and then the display position of the second interface on the first interface is adjusted based on the first brightness value and the second brightness value. Since the width of the region is the vertical distance of the side of the first interface to the side of the second interface, by adjusting the display position of the second interface, the visual effect of the width of the gap on the left and right sides can be adjusted, so that the display position of the second interface on the first interface is more matched with the visual effect of the user.
[0086] By first setting the width of the first sub-region and the second sub-region to be the same, then determining the first brightness value and the second brightness value, and adjusting the display position of the second interface on the first interface based on the first brightness value and the second brightness value, it is determined that the first sub-region and the second sub-region are substantially symmetrical, but the visual effect is asymmetrical, and then the display position of the second interface is adjusted. Compared with directly adjusting the display position of the second interface on the first interface based on the first brightness value and the second brightness value, the invalid adjustment can be reduced.
[0087] In some embodiments, adjusting the display position of the second interface on the first interface based on the first brightness value and the second brightness value comprises:
[0088] In a case where the first luminance value and the second luminance value are different, a difference between the first luminance value and the second luminance value is determined.
[0089] In a case where the difference is greater than a preset deviation threshold, a display position of the second interface on the first interface is adjusted.
[0090] Exemplarily, in a case where the first luminance value and the second luminance value are different, it indicates that the light and dark degrees of the first sub-region and the second sub-region are different, and at this time, the display position of the second interface on the first interface can be directly adjusted to make the display effect of the second interface on the first interface meet the user demand. For example, in a case where the first luminance value is less than the second luminance value, in order to make the second interface centered on the first interface, the second interface can be moved towards the direction of the second sub-region, and the like.
[0091] In the embodiments of the present disclosure, in a case where the first luminance value and the second luminance value are different, a difference between the first luminance value and the second luminance value can also be determined, and in a case where the difference is greater than a preset deviation threshold, the display position of the second interface on the first interface can be adjusted. It can be understood that, in a case where the first luminance value and the second luminance value are different, it indicates that the light and dark degrees of the first sub-region and the second sub-region are different, and at this time, the difference between the first luminance value and the second luminance value can be determined, and then the deviation value of the light and dark degrees between the first sub-region and the second sub-region is determined. By comparing the difference between the first luminance value and the second luminance value with the preset deviation threshold, in a case where the difference is greater than the preset deviation threshold, it indicates that the deviation value of the light and dark degrees between the first sub-region and the second sub-region is relatively large, and has already affected the visual effect of the second interface. At this time, adjusting the display position of the second interface on the first interface can improve the accuracy of adjusting the display position of the second interface.
[0092] The preset deviation threshold can be a critical value set in advance, and when the critical value is reached, it indicates that the light and dark degrees will affect the visual effect. The preset deviation threshold can also be a value customized by the user based on his own needs, or obtained through experiments.
[0093] In some embodiments, the method further includes:
[0094] In a case where the difference is less than or equal to the preset deviation threshold, the current display position of the second interface on the first interface is maintained.
[0095] In some other embodiments, in a case where the difference between the first luminance value and the second luminance value is less than or equal to the preset deviation threshold, it indicates that the deviation value of the light and dark degrees between the first sub-region and the second sub-region is relatively small, and will not greatly affect the visual effect of the second interface. At this time, the display position of the second interface on the first interface can be maintained, and invalid adjustment can be reduced.
[0096] In some embodiments, in a case where the difference is greater than the preset deviation threshold, the display position of the second interface on the first interface is adjusted, including:
[0097] In a case where the difference is greater than the preset deviation threshold, the first brightness value and the second brightness value are compared to obtain a comparison result.
[0098] The second interface is moved in a moving direction corresponding to the comparison result.
[0099] The moving distance of the second interface is positively correlated with the difference.
[0100] It should be noted that, in a case where the difference between the first brightness value and the second brightness value is greater than the preset deviation threshold, the first brightness value and the second brightness value can be compared to obtain a comparison result, and the second interface is moved in a moving direction corresponding to the comparison result. The comparison result is used to determine the moving direction of the second interface.
[0101] In some embodiments, the moving distance of the second interface can be positively correlated with the difference between the first brightness value and the second brightness value. That is, the greater the difference between the first brightness value and the second brightness value, the greater the moving distance of the second interface, and the smaller the difference between the first brightness value and the second brightness value, the smaller the moving distance of the second interface. By correlating the difference between the first brightness value and the second brightness value with the moving distance of the second interface, the moving distance of the second interface can be determined more finely, and compared with moving the second interface based on an empirical value, the final visual effect presented can be more in line with user needs.
[0102] In some embodiments, a mapping relationship between the difference and the moving distance can be preset, and in a scenario where the second interface needs to be moved, if the difference between the first brightness value and the second brightness value is determined, the corresponding moving distance can be determined based on the difference and the preset mapping relationship, and then the display position of the second interface on the first interface is moved based on the moving distance.
[0103] In some embodiments, the second interface is moved in a moving direction corresponding to the comparison result, including:
[0104] In a case where the comparison result indicates that the first brightness value is less than the second brightness value, the second interface is moved in a direction towards the second sub-region until the difference is less than or equal to the preset deviation threshold.
[0105] In a case where the comparison result indicates that the first brightness value is greater than the second brightness value, the second interface is moved in a direction towards the first sub-region until the difference is less than or equal to the preset deviation threshold.
[0106] In the case that the first luminance value is less than the second luminance value, it indicates that the first sub-region is darker than the second sub-region, and the first sub-region is visually narrower than the second sub-region. At this time, the second interface is moved towards the direction of the second sub-region until the difference between the first luminance value and the second luminance value is less than or equal to the preset deviation threshold, and then the second interface is visually located in the middle of the first interface.
[0107] In the case that the first luminance value is greater than the second luminance value, it indicates that the second sub-region is darker than the first sub-region, and the second sub-region is visually narrower than the first sub-region. At this time, the second interface is moved towards the direction of the first sub-region until the difference between the first luminance value and the second luminance value is less than or equal to the preset deviation threshold, and then the second interface is visually located in the middle of the first interface.
[0108] In the embodiments of the present disclosure, in the process of moving the second interface, the first luminance value of the first sub-region and the second luminance value of the second sub-region can be acquired in real time, and the second interface is adjusted based on the latest acquired first luminance value and second luminance value until the difference between the first luminance value and the second luminance value is less than or equal to the preset deviation threshold, so as to realize dynamic adjustment of the second interface and then realize the centered display of the second interface in visual effect.
[0109] In some embodiments, taking the need to display an application control in the middle of a mobile terminal as an example, the application control can be directly displayed in the middle by setting the same gap on the left and right sides of the application control, without considering whether the background content of the gap is the same. The gap can be understood as the part of the interface where the application control is located and is not covered by the application control. For example, for two vertical rectangles with the same height and width, when the background colors are different and the light-dark difference is large, the user will feel that the vertical bar with a darker background is slightly narrower and the vertical bar with a brighter background is slightly wider due to visual illusion, so that the user feels that the application control is not displayed in the middle, which seriously affects the user experience.
[0110] Figure 3 is a schematic interface according to an example embodiment Figure Two As shown in Figure 3 In the electronic device, the second interface 301 (application control) needs to be displayed in the middle, the widths of the first sub-region 302 and the second sub-region 303 (the gaps on the left and right sides of the application control) are the same, but the background image content in the first sub-region 302 and the second sub-region 303 is not quite the same, the pixel value (image gray scale) difference is large, and the light-dark difference of the image is large. Due to visual illusion, the user feels that the widths of the first sub-region 302 and the second sub-region 303 are not the same, and the second interface 301 is not centered.
[0111] In the embodiments of the present disclosure, the width of the first sub-region and the second sub-region can be dynamically adjusted by calculating the brightness values (gray scale values of the background image in the left and right gaps) of the first sub-region and the second sub-region, so that the second interface is visually displayed in the center.
[0112] Figure 4 is a flowchart of an interface processing method according to an exemplary embodiment Figure Two . As Figure 4 shown, the method mainly includes the following steps:
[0113] In step 401, the second interface is displayed in suspension on the first interface.
[0114] Here, taking the electronic device as a mobile terminal for example, the first interface can be displayed on the display screen of the mobile terminal, and the second interface can be displayed in suspension on the first interface. For example, the first interface is an application interface of an application program, and one or more application controls can be displayed on the application interface.
[0115] In step 402, it is determined whether the widths of the first sub-region and the second sub-region located on the opposite sides of the second interface are the same, and if so, step 403 is performed.
[0116] Here, it can be determined whether the second interface is displayed at the middle position of the first interface. That is, it is determined whether the widths of the first sub-region and the second sub-region located on the opposite sides of the second interface are the same, without being covered by the second interface on the first interface.
[0117] In step 403, the widths of the first sub-region and the second sub-region are adjusted to be the same.
[0118] Exemplarily, the first sub-region can be a region (also referred to as a gap on the upper and lower sides) on the first interface which is not covered by the second interface and is located on the upper and lower sides of the second interface, or a region (also referred to as a gap on the left and right sides) on the first interface which is not covered by the second interface and is located on the left and right sides of the second interface. In some embodiments, the width of the first sub-region and the second sub-region can be determined by the number of pixels in the first sub-region and the second sub-region.
[0119] Still taking the first interface as an application interface and the second interface as an application control for example, the first sub-region and the second sub-region can be regions on the application interface located on the opposite sides of the application control. Taking one application control for example, when the application control needs to be displayed in the center, the gap widths on the two sides of the application control can be set to be the same.
[0120] Taking the first sub-region as a gap on the left side of the second interface and the second sub-region as a gap on the right side of the second interface as an example, the width of the first sub-region can be calculated as marginLeft, the width of the second sub-region can be calculated as marginRight, and marginLeft = marginRight, that is, the width of the first sub-region is the same as the width of the second sub-region.
[0121] In step 404, a first brightness value corresponding to the first sub-region is determined, and a second brightness value corresponding to the first sub-region is determined.
[0122] Here, the first brightness value corresponding to the first sub-region can be determined based on the pixel values of the pixels in the first sub-region, and the second brightness value corresponding to the first sub-region can be determined based on the pixel values of the pixels in the second sub-region.
[0123] Here, the gray scale value (first brightness value) corresponding to the first sub-region (first background image) can be determined based on the pixel values of the pixels in the first sub-region, which can be denoted as grayLeft, and the gray scale value (second brightness value) corresponding to the second sub-region (second background image) can be determined based on the pixel values of the pixels in the second sub-region, which can be denoted as grayRight.
[0124] In step 405, it is determined whether the difference between the first brightness value and the second brightness value is greater than a preset deviation threshold value. If yes, step 406 is performed.
[0125] Here, in the case where the first brightness value and the second brightness value are different, the difference between the first brightness value and the second brightness value can be determined. After obtaining the difference between the first brightness value and the second brightness value, the absolute value of the difference (|grayLeft-grayRight|) can be taken, and the absolute value of the difference is compared with the preset deviation threshold value (gray(0)) to determine whether the absolute value of the difference is greater than the preset deviation threshold value.
[0126] In step 406, in the case where the difference is greater than the preset deviation threshold value, it is determined whether the first brightness value is less than the second brightness value. If yes, step 407 is performed, otherwise step 408 is performed.
[0127] In step 407, in the case where the first brightness value is less than the second brightness value, the second interface is moved towards the second sub-region.
[0128] Here, in the case where |grayLeft-grayRight|>gray(0) and grayLeft<grayRight, it indicates that the first sub-region is darker than the second sub-region, and the first sub-region is visually narrower than the second sub-region. At this time, the second interface is moved towards the second sub-region.
[0129] In some embodiments, the second interface can be moved x pixels towards the direction of the first sub-region, so that the width of the first sub-region increases by x pixels and the width of the second sub-region decreases by x pixels, that is, the width of the first sub-region is increased and the width of the second sub-region is decreased.
[0130] In step 408, the second interface is moved towards the direction of the first sub-region if the first luminance value is greater than the second luminance value.
[0131] Here, in the case of |grayLeft-grayRight|>gray(0) and grayLeft>grayRight, it indicates that the first sub-region is brighter than the second sub-region, and the first sub-region is visually wider than the second sub-region. At this time, the second interface is moved towards the direction of the first sub-region.
[0132] In some embodiments, the second interface can be moved x pixels towards the direction of the first sub-region, so that the width of the first sub-region decreases by x pixels and the width of the second sub-region increases by x pixels, that is, the width of the first sub-region is decreased and the width of the second sub-region is increased.
[0133] In some embodiments, the number x of pixels to be increased or decreased can be calculated according to experimental data or according to a preset algorithm, as long as the two vertical bars with the same height and different gray scale values can be set to have the same width in the eyes of the human, so as to achieve the effect of visually displaying the application control in the center.
[0134] In other embodiments, if the difference is less than or equal to the preset deviation threshold, the display position of the second interface on the first interface is maintained.
[0135] Here, in the case of |grayLeft-grayRight|≤gray(0), that is, if the difference between the first luminance value and the second luminance value is less than or equal to the preset deviation threshold, it indicates that the deviation of the brightness between the first sub-region and the second sub-region is relatively small, which will not have too much impact on the visual effect of the second interface, and the user will not feel that the gap on one side is narrow and the gap on the other side is wide in vision.
[0136] In some embodiments, the gray scale values of the first sub-region and the second sub-region can be obtained through a relevant interface integrated in the electronic device, and after the gray scale values are obtained, the adjustment of the display position of the second interface can be realized through code logic, without relying on additional hardware resources, and the cost is low. Moreover, in the current application control center display, the left and right gaps are set to be the same, without considering the problem that the left and right widths are not the same due to the large image gray scale difference (i.e., large light and dark difference) of the left and right gap backgrounds and the human eye visual illusion, thereby reducing the user experience problem. The present disclosure can set different gap widths according to different gray scale values, so that the user sees that the left and right gaps are the same width, thereby improving the user experience.
[0137] Figure 5 is a block diagram of a processing device for application data according to an example embodiment. As shown in Figure 5 the device 500 mainly includes:
[0138] The first display module 501 is configured to display the second interface in suspension on the first interface; wherein the size of the second interface is smaller than the size of the first interface;
[0139] The determination module 502 is configured to determine a target region in the first interface that is not covered by the second interface;
[0140] The adjustment module 503 is configured to adjust the display position of the second interface on the first interface based on the pixel values of the pixels in the target region.
[0141] In some embodiments, the target region includes a first sub-region and a second sub-region respectively located on opposite sides of the second interface; the adjustment module 503 is configured to:
[0142] In the case where the width of the first sub-region and the width of the second sub-region are the same, determine a first brightness value corresponding to the first sub-region based on the pixel values of the pixels in the first sub-region, and determine a second brightness value corresponding to the first sub-region based on the pixel values of the pixels in the second sub-region;
[0143] Adjust the display position of the second interface on the first interface based on the first brightness value and the second brightness value;
[0144] Wherein, the width of the region is the vertical distance from the side of the first interface to the side of the second interface.
[0145] In some embodiments, the adjustment module 503 is configured to include:
[0146] In the case where the first brightness value and the second brightness value are different, determine the difference between the first brightness value and the second brightness value;
[0147] In a case where the difference is greater than the preset deviation threshold, the display position of the second interface on the first interface is adjusted.
[0148] In some embodiments, the adjusting module 503 is configured to include:
[0149] In a case where the difference is greater than the preset deviation threshold, the first luminance value and the second luminance value are compared to obtain a comparison result.
[0150] The second interface is moved in a moving direction corresponding to the comparison result.
[0151] The moving distance of the second interface is positively correlated with the difference.
[0152] In some embodiments, the adjusting module 503 is configured to include:
[0153] In a case where the comparison result indicates that the first luminance value is less than the second luminance value, the second interface is moved in a direction towards the second sub-region until the difference is less than or equal to the preset deviation threshold.
[0154] In a case where the comparison result indicates that the first luminance value is greater than the second luminance value, the second interface is moved in a direction towards the first sub-region until the difference is less than or equal to the preset deviation threshold.
[0155] In some embodiments, the apparatus 500 further includes:
[0156] The second display module is configured to maintain the current display position of the second interface on the first interface in a case where the difference is less than or equal to the preset deviation threshold.
[0157] As to the apparatus in the above-described embodiments, the specific manners in which various modules perform operations have been described in detail in the embodiments of the method, and thus will not be described here in detail.
[0158] Figure 6 is a structural block diagram of an apparatus 600 according to an exemplary embodiment. The apparatus 600 can be, for example, a mobile phone, a computer, a digital broadcast terminal, a message transmission device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0159] Referring to Figure 6 , the apparatus 600 can include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.
[0160] The processing component 602 generally controls the overall operations of the device 600, such as operations associated with display, telephony calls, data communication, camera operations, and recording operations. The processing component 602 can include one or more processors 620 to execute instructions to complete all or part of steps of the above methods. In addition, the processing component 602 can include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0161] The memory 604 is configured to store various types of data to support operations on the device 600. Examples of these data include at least one of the following: instructions for any application or methods operating on the device 600, contact data, phonebook data, messages, pictures, and videos. The memory 604 can be implemented by any type of volatile or nonvolatile storage devices 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.
[0162] The power component 606 provides power to the various components of the device 600. The power component 606 can 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 for the device 600.
[0163] The multimedia component 608 includes a screen providing an output interface between the device 600 and a user. In some embodiments, the screen includes a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swiping, and gestures on the touch panel. The touch sensor can not only sense a boundary of a touching or swiping action, but also detect duration and pressure related to the touching or swiping action. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the device 600 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zooming capability.
[0164] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC) that is configured to receive external audio signals when the device 600 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0165] The I / O interface 612 provides an interface between the processing component 602 and peripheral interface modules, such as a keyboard, a click wheel, and buttons. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0166] The sensor component 614 includes one or more sensors for providing status assessments for various aspects of the device 600. For example, the sensor component 614 can detect an open / closed position of the device 600, relative positioning of components, such as a display and keypad of the device 600, changes in position of the device 600 or a component of the device 600, presence or absence of user contact with the device 600, orientation or acceleration / deceleration of the device 600, and temperature changes of the device 600. The sensor component 614 can include proximity sensor(s) configured to detect presence of a proximity object without any physical contact. The sensor component 614 can also include an optical sensor, such as a complementary metal-oxide semiconductor (CMOS) or charge coupled device (CCD) image sensor, utilized in imaging applications. In some embodiments, the sensor component 614 can further include at least one of an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, and a temperature sensor, among others.
[0167] The communication component 616 is configured to facilitate wired or wireless communication between the device 600 and another device. The device 600 can access a wireless network based on a communication standard, such as Wi-Fi, 4G, 5G, or a combination thereof. In an example embodiment, the communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 616 can further include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, Infrared Data Association (IrDA) techniques, Ultra-WideBand (UWB) techniques, Bluetooth (BT) techniques, and other techniques.
[0168] In exemplary embodiments, the apparatus 600 can 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, micro-controllers, microprocessors, or other electronic elements.
[0169] In exemplary embodiments, a non-transitory computer-readable storage medium including instructions, such as the memory 604 including executable instructions or a computer program, is also provided, which can be executed by the processor 620 of the apparatus 600 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0170] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to perform any one of the interface processing methods according to the embodiments of the present disclosure. For example, the method includes:
[0171] suspended display of a second interface on a first interface; wherein the size of the second interface is smaller than the size of the first interface;
[0172] determining a target region in the first interface that is not covered by the second interface;
[0173] adjusting the display position of the second interface on the first interface based on the pixel value of the pixel in the target region.
[0174] The embodiment of the disclosure provides a computer program product, which comprises a computer program or executable instruction stored in a computer readable storage medium. The processor of the computer device reads the computer program or executable instruction from the computer readable storage medium, and the processor executes the computer program or executable instruction, so that the computer device executes any one of the interface processing methods provided in the embodiment of the disclosure. Other embodiments of the disclosure will be readily apparent to those skilled in the art upon considering the specification and practicing the disclosure disclosed herein. The disclosure is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common knowledge or conventional technical means in the art that are not disclosed in the disclosure. The specification and embodiments are only considered to be exemplary, and the true scope and spirit of the disclosure are indicated by the claims.
[0175] It should be understood that the disclosure is not limited to the precise structures described above and shown in the drawings and that various modifications and changes can be made without departing from its scope. The scope of the disclosure is limited only by the claims that follow.
Claims
1. An interface processing method characterized by, The method comprises: displaying a second interface on a first interface in a suspended manner; wherein the size of the second interface is smaller than the size of the first interface; determining a target region in the first interface that is not covered by the second interface; adjusting the display position of the second interface on the first interface based on the pixel values of the pixels in the target region.
2. The method of claim 1, wherein, The target region comprises a first sub-region and a second sub-region located on opposite sides of the second interface respectively; the adjusting of the display position of the second interface on the first interface based on the pixel values of the pixels in the target region comprises: in the case where the width of the first sub-region and the width of the second sub-region are the same, determining a first luminance value corresponding to the first sub-region based on the pixel values of the pixels in the first sub-region, and determining a second luminance value corresponding to the first sub-region based on the pixel values of the pixels in the second sub-region; adjusting the display position of the second interface on the first interface based on the first luminance value and the second luminance value; wherein the width of the region is the vertical distance from the side of the first interface to the side of the second interface.
3. The method of claim 2, wherein, The adjusting of the display position of the second interface on the first interface based on the first luminance value and the second luminance value comprises: in the case where the first luminance value and the second luminance value are different, determining the difference between the first luminance value and the second luminance value; in the case where the difference is greater than a preset deviation threshold, adjusting the display position of the second interface on the first interface.
4. The method of claim 3, wherein, The adjusting of the display position of the second interface on the first interface in the case where the difference is greater than the preset deviation threshold comprises: in the case where the difference is greater than the preset deviation threshold, comparing the first luminance value and the second luminance value to obtain a comparison result; moving the second interface in a moving direction corresponding to the comparison result; wherein the moving distance of the second interface is positively correlated with the difference.
5. The method of claim 4, wherein, The moving of the second interface in the moving direction corresponding to the comparison result comprises: in the case where the comparison result indicates that the first luminance value is less than the second luminance value, moving the second interface towards the second sub-region until the difference is less than or equal to the preset deviation threshold; in the case where the comparison result indicates that the first luminance value is greater than the second luminance value, moving the second interface towards the first sub-region until the difference is less than or equal to the preset deviation threshold.
6. The method of claim 3, wherein, The method further comprises: in the case where the difference is less than or equal to the preset deviation threshold, maintaining the current display position of the second interface on the first interface.
7. An interface processing device, characterized by The method comprises: a first display module configured to display a second interface on a first interface in a suspended manner; wherein the size of the second interface is smaller than the size of the first interface; a determination module configured to determine a target region in the first interface that is not covered by the second interface; a first display module configured to display a second interface on a first interface in a suspended manner; wherein the size of the second interface is smaller than the size of the first interface; a determination module configured to determine a target region in the first interface that is not covered by the second interface; An adjusting module configured to adjust a display position of the second interface on the first interface based on pixel values of pixels in the target region.
8. An electronic device, comprising: Comprise: a processor; a memory for storing computer programs or instructions; wherein the processor executes the computer programs or instructions to implement the steps of the method of any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing a computer program or instructions, the computer program or instructions comprising the steps of: When the computer programs or instructions in the storage medium are executed by the processor, the steps of the method of any one of claims 1 to 6 are implemented.
10. A computer program product comprising computer programs or instructions, characterized in that, The computer programs or instructions are executed by the processor to implement the steps of the method of any one of claims 1 to 6.