WO2017049436A1 - Method and device for arranging icons on an android device - Google Patents

Method and device for arranging icons on an android device Download PDF

Info

Publication number
WO2017049436A1
WO2017049436A1 PCT/CN2015/090156 CN2015090156W WO2017049436A1 WO 2017049436 A1 WO2017049436 A1 WO 2017049436A1 CN 2015090156 W CN2015090156 W CN 2015090156W WO 2017049436 A1 WO2017049436 A1 WO 2017049436A1
Authority
WO
WIPO (PCT)
Prior art keywords
icon
color
color component
value
array
Prior art date
Application number
PCT/CN2015/090156
Other languages
French (fr)
Chinese (zh)
Inventor
谢峰
Original Assignee
上海欧拉网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海欧拉网络技术有限公司 filed Critical 上海欧拉网络技术有限公司
Priority to CN201580006079.1A priority Critical patent/CN105960631B/en
Priority to PCT/CN2015/090156 priority patent/WO2017049436A1/en
Publication of WO2017049436A1 publication Critical patent/WO2017049436A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop

Definitions

  • the present invention relates to the field of icon arrangement, and in particular, to a method and apparatus for performing icon arrangement on an Android device.
  • the technical problem to be solved by the present invention is that the space utilization rate of the above-mentioned screens of the prior art is not high, and the defects of multiple icons cannot be displayed in a limited area, and the space utilization rate of the screen is high and can be limited.
  • the technical solution adopted by the present invention to solve the technical problem is: constructing a method for performing icon arrangement on an Android device, comprising the following steps:
  • step B determining whether there is a gesture in the designated area on the application interface of the Android device, and if yes, performing step B); otherwise, proceeding to determine the step;
  • the panel includes three sub-panels, each of which is filled with different types of icons.
  • the step C) further includes:
  • the maximum pixel point color value count array includes an R color component maximum pixel point color value count array, a G color component maximum pixel point color value count array, and a B color a component maximum pixel point color value count array, the average color value array comprising an R color component value, a G color component value, and a B color component value;
  • step C6 determining whether the maximum pixel point color value count array has a color value whose number of pixel points is greater than a set number, and if so, performing step C7); otherwise, averaging the R color component average value and the G color component a combination of the value and the average of the B color components as the color of the back panel;
  • step D) further includes:
  • the initialization angle is 10800 degrees
  • the current angle of the icon is obtained from the phase of the overall layout of the icon according to a key frame property set in advance.
  • the step E) further includes:
  • step E3 determining whether the current angle of the icon is between 0 degrees and 90 degrees, and if so, calculating a difference between the current angle of the icon and 45 degrees, and calculating a coordinate position of the icon according to the difference Offset, and the coordinate position of the icon is offset according to the calculated offset; otherwise, step E4) is performed;
  • step E4) determining whether the current angle of the icon is equal to 0 degrees, and if so, shifting the coordinate position of the icon according to the first set offset; otherwise, performing step E5);
  • E3' determining whether the current angle of the icon is between 0 degrees and 90 degrees, and if so, dividing the screen in which the icon is located into the first area, the second area, and the third area, and setting the first An angle threshold of a region, a second region, and a third region, and a scaling ratio of the second region and the third region, and correspondingly scaling an icon located in the corresponding region; otherwise, correcting the size of the icon .
  • the set number is 40% of the total number of sampled pixels, and the threshold is 5.
  • the present invention also relates to an apparatus for implementing the above method for icon arrangement on an Android device, comprising:
  • a gesture action determining unit configured to determine whether a specified area on the application interface of the Android device has a gesture
  • Data structure loading unit a data structure for loading a three-screen icon
  • a backplane icon matching unit configured to add a corresponding backplane to each icon according to the data structure of the three-screen icon, and match a color of the backboard with a color of the icon;
  • An icon current angle calculation unit configured to calculate a current angle of each of the icons in each screen according to a screen on which the icon is located, an initial position, and an angle that follows the gesture;
  • a position size transparency calculation unit configured to respectively acquire a position, a size, and a transparency of each of the icons according to a current angle of each of the icons;
  • a panel open display unit configured to open a panel on an application interface of the Android device, and display each of the icons on the panel; the panel includes three sub-panels, each sub-panel respectively filling different types of icons .
  • the backplane icon matching unit further includes:
  • Array creation module used to create a maximum pixel color value count array and an average color value array;
  • the maximum pixel color value count array includes an R color component maximum pixel point color value count array, a G color component maximum pixel point color value count Array and B color component maximum pixel point color value count array, the average color value array including R color component value, G color component value, and B color component value;
  • Loading sampling module an icon for loading an application, and sampling pixels of different areas of the icon using different sampling rates;
  • a pixel traversal module traversing each sample pixel, respectively obtaining an R color component, a G color component, and a B color component of each of the sampled pixel points, so that the maximum color of the pixel value in the array is counted
  • the component maximum pixel dot color value count array, the G color component maximum pixel dot color value count array, and the B color component maximum pixel value count array are incremented by 1, respectively, and the R color component array in the average color value array, G
  • the color component array and the B color component array are respectively superimposed with the R color component, the G color component, and the B color component of each sample pixel;
  • a component average calculation module configured to respectively divide the superimposed R color component value, G color component value, and B color component value in the average color value array by the number of the sampled pixel points, respectively, to obtain an R color Component average, G color component average, and B color component average;
  • a maximum pixel point color value calculation module configured to respectively calculate an R color component maximum pixel point color value, a G color component maximum pixel point color value, and a B color component maximum pixel point color value in the maximum pixel point color value count array;
  • the color value judging module is configured to determine whether the maximum pixel color value count array has a color value whose number of pixel points is greater than a set number, and if so, the average color value array and the maximum pixel color value count array Performing conversion of color space; otherwise, combining the R color component average, the G color component average, and the B color component average as the color of the backboard;
  • a color space conversion module configured to convert an R color component average value, a G color component average value, and a B color component average value in the average color value array into an HSV color space, and calculate the maximum pixel color value in an array
  • the R color component maximum pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value are converted to the HSV color space;
  • a difference judging module configured to determine whether a difference between an H color component of the average color value array and an H color component of the most pixel color value count array is less than a threshold, and if so, the R color component maximum pixel point a combination of a color value, a G color component maximum pixel point color value, and a B color component maximum pixel point color value as a color of the back sheet; otherwise, the R color component average value, the G color component average value, and the B color component The combination of the average values is used as the color of the back sheet.
  • the icon current angle calculation unit further includes:
  • Initialization module used for initialization angle of 10800 degrees
  • Icon current angle acquisition module used to obtain the current angle of the icon from the phase of the overall layout of the icon according to a key frame property set in advance.
  • the location size transparency calculation unit further includes:
  • An icon coordinate position calculation module configured to calculate a coordinate position of the icon according to a current angle of the icon
  • the first icon current angle determining module is configured to determine whether the current angle of the icon is greater than 90 degrees, and if not, correct the coordinate position of the icon; otherwise, continue to determine the current angle of the icon;
  • a second icon current angle determining module configured to determine whether a current angle of the icon is between 0 degrees and 90 degrees, and if so, calculating a difference between a current angle of the icon and 45 degrees, and according to the difference Calculating an offset of the coordinate position of the icon, and causing the coordinate position of the icon to be offset according to the calculated offset; otherwise, continuing to determine the size of the current angle of the icon;
  • a third icon current angle determining module configured to determine whether the current angle of the icon is equal to 0 degrees, and if so, to offset the coordinate position of the icon according to the first set offset; otherwise, continue to determine the icon The size of the current angle;
  • a fourth icon current angle determining module configured to determine whether a current angle of the icon is equal to 90 degrees, and if so, shifting a coordinate position of the icon according to a second set offset; otherwise, the icon is The coordinate position is not corrected; it also includes:
  • the fifth icon current angle determining module is configured to determine whether the current angle of the icon is greater than 90 degrees, and if so, correct the size of the icon; otherwise, continue to determine the current angle of the icon;
  • a sixth icon current angle determining module configured to determine whether the current angle of the icon is between 0 degrees and 90 degrees, and if yes, dividing the screen where the icon is located into the first area, the second area, and the third area, And respectively setting an angle threshold of the first area, the second area, and the third area, and a scaling ratio of the second area and the third area, and respectively scaling an icon located in the corresponding area; otherwise, The size of the icon is not corrected.
  • the set number is 40% of the total number of sampled pixels, and the threshold is 5.
  • the method and apparatus for performing icon arrangement on an Android device embodying the present invention have the following beneficial effects: since the position, size, and transparency of each icon can be separately obtained according to the current angle of each icon; that is, the size of the icon is Variable, the panel opened on the application interface of the Android device can display each icon; and the panel includes three sub-panels, each of which is filled with different types of icons, so that the icons can be effectively arranged, so The screen has a high space utilization and can display multiple icons in a limited area.
  • FIG. 1 is a flowchart of a method and an apparatus for performing icon arrangement on an Android device according to an embodiment of the present invention
  • FIG. 2 is a specific flowchart of adding a corresponding backplane to each icon according to the data structure of the three-screen icon in the embodiment, and matching the color of the backboard with the color of the icon;
  • FIG. 3 is a specific flowchart of calculating the current angle of each icon in each screen according to the screen where the icon is located, the initial position, and the angle swept by the following gesture;
  • Figure 4 is a sequence diagram showing the arrangement of icons per screen in the embodiment
  • Figure 5 is a layout diagram of a three-screen icon in the embodiment
  • FIG. 6 is a specific flowchart of obtaining the position, size, and transparency of each icon according to the current angle of each icon in the embodiment
  • Figure 7 is a schematic diagram of each screen divided into three regions in the embodiment.
  • Figure 8 is a schematic view showing the structure of the apparatus in the embodiment.
  • FIG. 1 a flowchart of a method for performing icon arrangement on an Android device is shown in FIG. 1 .
  • the method for performing icon arrangement on an Android device includes the following steps:
  • Step S01 determining whether there is a gesture in the designated area on the application interface of the Android device: in this step, first entering the application interface of the Android device, and then determining whether there is a gesture sliding in the designated area on the application interface of the Android device, the designated area is prior For example, the designated area may be the lower right corner of the application interface. In this step, if the result of the determination is yes, step S02 is performed; otherwise, the determination of this step is continued.
  • Step S02 loads the data structure of the three-screen icon: if the result of the above step S01 is YES, the step is executed. In this step, the data structure of the three-screen icon is loaded.
  • the above three screens include the current screen, the previous screen and the next screen, and each screen has an icon corresponding to the screen to be displayed. After performing this step, go to step S03.
  • Step S03 According to the data structure of the three-screen icon, the corresponding backplane is added for each icon, and the color of the backboard is matched with the color of the icon: in this step, according to the data structure of the three-screen icon, each icon is added separately. Corresponding backplanes and matching the color of the backboard to the color of the icon. It is worth mentioning that the color and shape of the icon (application icon) plus the color backboard will look neat and Uniform with the original icon color.
  • Step S04 Calculate the current angle of each icon in each screen according to the screen where the icon is located, the initial position, and the angle swept by the following gesture: in this step, according to the screen where the icon is located (current screen, previous screen or next screen), The initial position and the angle over which the gesture is swiped, respectively, calculate the current angle of each icon in each screen.
  • Step S05 respectively obtains the position, size, and transparency of each icon according to the current angle of each icon: in this step, the position, size, and transparency of each icon are respectively obtained according to the current angle of each icon, because each icon
  • the size and position can be adjusted according to the specific situation, so that the icons can be effectively arranged according to the actual situation.
  • a panel is opened on the application interface of the Android device, and each icon is displayed on the panel: in this step, a panel is opened on the application interface of the Android device, and each icon is displayed on the panel, that is, in the panel.
  • the icon can be displayed on the same size.
  • the above panel includes three sub-panels, each of which is filled with different types of icons. When the gesture is swiped on the panel, each slides 90 degrees, and switches to the next sub-panel (previous one) Screen or next screen).
  • 13 icons can be displayed per screen, and 39 icons are displayed on three screens.
  • the present invention needs to cache 39 icons and their corresponding data structures at the same time, so it may occupy a large memory and is poor in some configurations. The device may cause poor sliding screen efficiency.
  • the icons can be effectively arranged, so the space utilization of the screen is high, and multiple icons can be displayed in a limited area.
  • the above step S03 can be further refined, and the refined flowchart is as shown in FIG. 2 .
  • the embodiment loads the original icon bitmap of the application in the memory, and then analyzes pixel by pixel to find the RGB color closest to the icon pixel. In this way, you need to follow the following principles: try to find the color value of the most pixels in the original icon bitmap. If the number of pixels with one color value is much larger than the number of pixels of other color values, then the color of the back panel uses the color value of the maximum number of pixels; if the color value of the largest pixel number is not found, then the color value is selected. The average color value of all pixels in the icon is used as the color of the back panel.
  • the foregoing step S03 further includes:
  • Step S301 Create a maximum pixel color value count array and an average color value array: In order to find the color value of the largest pixel number, you need to create a 255*255*255 int array as a complete RGB vector, then traverse the icon all pixels, for each The RGB color of one pixel is counted, and finally the array subscript with the largest count is returned as the RGB color. But consider saving memory, you can use the approximate method, just create three 255 int arrays, you can approximate the color value of the largest number of pixels.
  • a maximum pixel color value count array and an average color value array are created, wherein the maximum pixel color value count array includes an R color component maximum pixel point color value count array, a G color component maximum pixel point color value count array, and B color component maximum pixel point color value count array, respectively as R, G, B three color sub-vector counter, used to find the maximum pixel color value, R color component maximum pixel point color value count array, G color component
  • the maximum pixel dot color count array and the B color component maximum pixel dot color value count array are labeled as mostR[], mostG[], mostB[], respectively.
  • the average color value array includes an R color component value, a G color component value, and a B color component value, and the R color component value, the G color component value, and the B color component value are 3 int variables for accumulating R, G on all pixels. , the sum of the B color components to calculate the average color in the icon.
  • the R color component value, the G color component value, and the B color component are respectively labeled as sumR, sumG, and sumB.
  • Step S302 Load the icon of the app and sample the pixels in different areas of the icon with different sampling rates: because the back panel is an extension of the outer edge of the original icon, the color of the pixel near the edge in the original icon takes precedence over the color of the icon near the center. In this way, a higher weight of the icon edge pixels can be achieved by different sampling rates of pixels at different positions of the original icon.
  • the icon of the application is loaded, and the pixel points in different areas of the icon are sampled using different sampling rates.
  • the distance of the pixel from the edge is less than the icon width *0.16, it indicates that the pixel is the edge point, 50% sampling is used; the other pixels are 3% sampling.
  • the sampling rate can also be increased.
  • Step S303 Traversing each sampled pixel, respectively obtaining the R color component, the G color component, and the B color component of each sampled pixel point, so that the R color component of the maximum pixel point color value count array has the largest pixel point color value count array, G color
  • the counts of the component maximum pixel point color value count array and the B color component maximum pixel value count array are respectively incremented by 1, and the R color component array, the G color component array, and the B color component array in the average color value array are respectively sampled with each
  • the R color component, the G color component, and the B color component of the pixel are superimposed: in this step, each sample pixel of the icon is traversed according to the sampling rate in the above step S302, and the pixel point is respectively obtained for each sample pixel point.
  • the R color component, the G color component, and the B color component respectively add 1 to the subscripts of mostR[], mostG[], and mostB[], respectively, and count the R color component and the G color component of the pixel point.
  • the B color components are superimposed with sumR, sumG, and sumB, respectively.
  • Step S304 The superimposed R color component value, G color component value, and B color component value in the average color value array are respectively divided by the number of sampled pixel points, and the R color component average value, the G color component average value, and the B color are respectively obtained.
  • Component average value In this step, after the traversal is completed, sumR, sumG, and sumB are respectively divided by the number of sampled pixels, and the R color component average value, the G color component average value, and the B color component average value are respectively obtained.
  • the R color component average, the G color component average, and the B color component average are labeled as averageR, averageG, and averageB, respectively, and averageR, averageG, and averageB constitute the RGB color averageRGB.
  • Step S305 respectively calculates an R color component maximum pixel point color value, a G color component maximum pixel point color value, and a B color component maximum pixel point color value in the maximum pixel point color value count array: in this step, respectively find the mostR[] The most subscripts in mostG[] and mostB[], which are the R, G, and B with the most pixels, that is, the maximum pixel color value of the R color component, the maximum pixel color value of the G color component, and B color component maximum pixel point color value.
  • Step S306 determining whether the maximum number of pixels of the color point count array has a color value whose number of pixels is greater than a set number: in this step, determining whether the maximum number of pixels of the color point count array exists is greater than the set number of pixels
  • the set number is 40% of the total number of sampled pixels. Of course, in some cases of the embodiment, the number of the above settings may be adjusted accordingly according to specific conditions. In this step, if the result of the determination is yes, then step S308 is performed; otherwise, step S307 is performed.
  • step S307 the R color component average value, the G color component average value, and the B color component average value are used as the color of the backboard: if the determination result of the above step S306 is NO, this step is performed. In this step, it is considered that none of the icons is farther than the other colors, and the combination of the R color component average, the G color component average, and the B color component average is used as the color of the back panel.
  • Step S308 Converting the R color component average value, the G color component average value, and the B color component average value in the average color value array to the HSV color space, and the R color component maximum pixel dot color value in the maximum pixel dot color value count array, G Color component maximum pixel point color value and B color component maximum pixel point color value are converted to HSV color space: if the result of the above step S306 is YES, that is, the number of pixel points is greater than 40% of the total number of sampled pixel points, then this step is performed. .
  • this color value can be included in the candidate best matching color, which is composed into the RGB color mostRGB, in order to compare the average color of the average color value array with the maximum count color in the most pixel color value count array.
  • the G color component maximum pixel point color value and the B color component maximum pixel point color value are converted to the HSV color space.
  • Step S309 determines whether the difference between the H color component of the average color value array and the H color component of the most pixel color value count array is less than a threshold: in this step, determining the H color component of the average color value array and the maximum pixel color value count The difference between the H color components of the array is less than the threshold.
  • the threshold is 5. If the result of the determination is yes, step S310 is performed; otherwise, the process returns to step S307.
  • Step S310 The combination of the R color component maximum pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value is used as the color of the backboard: if the determination result of the above step S309 is YES, this step is performed. In this step, a combination of the R color component maximum pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value is used as the color of the back plate.
  • FIG. 3 is a flowchart of further refinement of the above step S04.
  • the above step S04 further includes:
  • Step S401 The initialization angle is 10800 degrees: In this step, when the fan-shaped interface is slid out, the initialization angle is 10800 degrees. It is worth mentioning that the fan-shaped interface is an application. The fan-shaped interface should be called out from the corner of the screen by gesture. After the call is made, the angle is 10800 degrees without doing anything.
  • Step S402 When the gesture is started to slide, the angle at which the gesture slides is recorded.
  • the gesture slides clockwise the current overall angle of the icon increases.
  • the current overall angle of the icon increases.
  • degree is the current overall angle of the icon.
  • phase is the phase of the overall layout of the icon
  • degree is the current overall angle of the icon.
  • Step S404 obtains the current angle of the icon from the phase of the overall layout of the icon according to the key frame attribute set in advance: in this step, according to the key frame attribute set in advance, the current angle of the icon is obtained from the phase of the overall layout of the icon, Specifically, each icon has an intrinsic keyframe property, which is actually a set of mapping mappings [key, Value], where key is the phase of the overall layout of the icon, and value is the angle of the icon under the phase of the overall layout.
  • the present invention provides three screen icons, which respectively represent "recently opened applications", “common applications” and “quick switches", and there are at most 13 icons per screen. Since the icons of different locations are different in size, the present embodiment arranges the relative positions of each group of icons according to the following principles: First, leaving the large icons to the effective application, leaving the small icons to the placeholders; it is worth mentioning that The size of the icon has a relationship with its coordinate position. Second, it is arranged as symmetrically as possible. According to the above principle, the arrangement order of each screen icon is as shown in FIG. 4. In Figure 4, there are 0-12 icons, each of which represents an icon. The size of these icons is different. Among them, there are 0, 1, 2, 3, 4, and 5; the other icons are relatively small. The layout of the three-screen icon is shown in Figure 5.
  • the keyframes for the A6 icon are: [0, 45], [90, 135], [180, 315], [270, 45], indicating that when the phase of the overall layout of the icon is 0 degrees, A6 is at 45 degrees; when the phase of the overall layout of the icon is 90 degrees, the A6 icon is at 135 degrees; when the overall layout of the icon is 180 degrees The A6 icon is at 315 degrees; when the overall layout of the icon is at 270 degrees, since the icon's revolution period is 270 degrees, it is back to the original 45 degrees.
  • the key frame of the B6 icon is: [0, 315], [90, 45], [180, 135], [270, 315], and the special speed of the A11 icon, the key frames are: [0, 72], [45, 90], [90, 135], [172, 0], [180, 5], [244, 30], [245, 60], [270, 72].
  • the difference angle of the key frame can be generated according to the phase of the current overall layout of the icon, and the current angle of the icon can be calculated.
  • step S05 can be further refined, and the refined flowchart is as shown in FIG. 6.
  • the above step S05 further includes:
  • Step S501 According to the current angle of the icon, the coordinate position of the icon is calculated: in this step, the coordinate position of the icon is calculated according to the current angle of the icon.
  • each icon is made more compact and the whole looks more like a circle.
  • the coordinate position of the icon is corrected based on the basic coordinate position. Please see the steps below for details.
  • Step S502 determining whether the current angle of the icon is greater than 90 degrees: in this step, determining whether the current angle of the icon is greater than 90 degrees, and if the result of the determination is yes, indicating that the visible area (upper screen or next screen) has been drawn, Then, step S503 is performed; otherwise, step S504 is performed.
  • Step S503 The coordinate position of the icon is not corrected: if the result of the above step S502 is YES, then this step is performed. In this step, the coordinate position of the icon is not corrected.
  • Step S504 It is judged whether the current angle of the icon is between 0 degrees and 90 degrees: if the result of the above step S503 is NO, the step is executed. In this step, it is determined whether the current angle of the icon is between 0 degrees and 90 degrees. If the result of the determination is yes, step S505 is performed; otherwise, step S506 is performed.
  • Step S505 calculates a difference between the current angle of the icon and 45 degrees, and calculates an offset of the coordinate position of the icon according to the difference, and offsets the coordinate position of the icon according to the calculated offset: if the above steps If the result of the determination in S504 is YES, the present step is executed. In this step, the difference between the current angle of the icon and 45 degrees is calculated, and the offset of the coordinate position of the icon is calculated according to the difference, and the coordinate position of the icon is offset according to the calculated offset.
  • the current angle of the icon is at 45 degrees, no offset occurs; when the current angle of the icon is between 0 degrees and 45 degrees, the x position is received at the center of the circle, and the closer to 0 degrees, the more powerful it is.
  • the present embodiment defines a maximum offset for each circle of the four-circle icon, indicating an offset when the current angle of the icon is at 0 or 90 degrees, and an offset at 0 degrees.
  • the offset at 90 degrees is referred to as the second set offset.
  • Step S506 It is judged whether the current angle of the icon is equal to 0 degrees: if the result of the above step S504 is NO, the present step is executed. In this step, it is determined whether the current angle of the icon is equal to 0 degrees. If the result of the determination is yes, step S507 is performed; otherwise, step S508 is performed.
  • Step S507 The coordinate position of the icon is offset according to the first set offset: if the result of the above step S506 is YES, the step is executed. In this step, the coordinate position of the icon is offset according to the first set offset. It is worth mentioning that the size of the first set offset can be adjusted accordingly.
  • Step S508 It is judged whether the current angle of the icon is equal to 90 degrees: if the result of the above step S506 is NO, the present step is executed. In this step, it is determined whether the current angle of the icon is equal to 90 degrees. If the result of the determination is yes, step S509 is performed; otherwise, the process returns to step S503.
  • Step S509 shifts the coordinate position of the icon according to the second set offset: if the result of the above step S508 is YES, the present step is executed. In this step, the coordinate position of the icon is offset according to the second set offset. It is worth mentioning that the size of the second set offset can be adjusted accordingly.
  • Step S502 ′ determining whether the current angle of the icon is greater than 90 degrees: in this step, determining whether the current angle of the icon is greater than 90 degrees, and if the result of the determination is yes, indicating that the visible area has been drawn (upper screen or next screen) Then, step S503' is performed; otherwise, step S504' is performed.
  • Step S503' does not correct the size of the icon: if the result of the above step S502' is YES, then this step is performed. In this step, the size of the icon is not corrected.
  • Step S504' determines whether the current angle of the icon is between 0 degrees and 90 degrees: if the result of the above step S502' is negative, the step is performed. In this step, it is determined whether the current angle of the icon is between 0 degrees and 90 degrees. If the result of the determination is yes, then step S505' is performed; otherwise, the process returns to step S503'.
  • Step S505' divides the screen in which the icon is located into the first area, the second area, and the third area, and sets an angle threshold of the first area, the second area, and the third area, respectively, and the second area and the third area.
  • the scaling is performed, and the icon located for the area is scaled accordingly: if the result of the above step S504' is YES, then this step is performed.
  • the screen in which the icon is located is divided into a first area A, a second area B, and a third area C (see FIG. 7), and the first area A, the second area B, and the third area C are respectively set.
  • the angle threshold, and the scaling of the second region B and the third region C and then generate a segmentation difference, and scale the icons located in the corresponding regions accordingly.
  • the icon When the current angle of the icon is in the first area A, the icon is not scaled.
  • the icon When the current angle of the icon is in the second area B, the icon is slowly zoomed; when the current angle of the icon is in the third area C, the icon is sharply zoomed. .
  • the first area A can be considered to be between 15 degrees and 75 degrees; the second area B is 7 degrees to 15 degrees, and 75 degrees to Between 83 degrees; the third region C is between 0 degrees and 7 degrees, and between 83 degrees and 90 degrees.
  • the icon size is always the same; in the second area B, the reduction ratio of the icon size is reduced from 1 to 0.8 of the icon, and in the third area C, the reduction ratio of the icon size is reduced from 0.8 to 0. In this way, the size of the icon can be adjusted according to the actual situation, which not only effectively improves the utilization of the screen space, but also displays multiple icons in a limited area.
  • the embodiment further relates to an apparatus for implementing the method for performing icon arrangement on an Android device, and a schematic structural diagram thereof is shown in FIG. 7.
  • the above apparatus includes a gesture action determining unit 1, a data structure loading unit 2, a backboard icon matching unit 3, an icon current angle calculating unit 4, a position size transparency calculating unit 5, and a panel open display unit 6;
  • the determining unit 1 is configured to determine whether there is a gesture in the designated area on the application interface of the Android device;
  • the data structure loading unit 2 is configured to load the data structure of the three-screen icon;
  • the backboard icon matching unit 3 is configured to use the data structure of the three-screen icon Adding a corresponding backplane to each icon, and matching the color of the backboard with the color of the icon;
  • the icon current angle calculating unit 4 is configured to calculate respectively according to the screen where the icon is located, the initial position, and the angle swept by the following gesture.
  • the current angle of each icon in each screen; the position size transparency calculation unit 5 is configured to respectively acquire the position, size and transparency of each icon according to the current angle of each icon;
  • the panel open display unit 6 is used in the Android device Open a panel on the application interface and display each icon on the panel; the above panel includes three Sub-panels, each of which is populated with different types of icons.
  • the screen has a high space utilization and can display multiple icons in a limited area.
  • the backplane icon matching unit 3 further includes an array creation module 31, a load sampling module 32, a pixel traversal module 33, a component average calculation module 34, a maximum pixel color value calculation module 35, and a color value determination module 36. , the color space conversion module 37 and the difference judgment module 38; wherein, the array creation module 31 is configured to create a maximum pixel point color value count array and an average color value array; the maximum pixel point color value count array includes the R color component maximum pixel point color The value count array, the G color component maximum pixel point color value count array, and the B color component maximum pixel point color value count array, the average color value array includes an R color component value, a G color component value, and a B color component value; the loading sampling module 32 An icon for loading an application, using different sampling rates for sampling pixels in different areas of the icon; The pixel traversal module 33 is configured to traverse each sampled pixel point, respectively obtain the R color component, the G color component, and the B color component of each sampled pixel point,
  • the component arrays are respectively superimposed with the R color component, the G color component, and the B color component of each sampled pixel point; the component average value calculation module 34 is configured to make the superimposed R color component value and the G color component in the average color value array.
  • the value and the B color component value are respectively divided by the number of sampled pixel points, and the R color component average value, the G color component average value, and the B color component average value are respectively obtained; the maximum pixel point color value calculation module 35 is configured to calculate the maximum pixel respectively.
  • the determining module 36 is configured to determine whether the maximum pixel point color value count array has a color value whose number of pixel points is greater than a set number, and if so, convert the average color value array and the maximum pixel point color value count array into a color space; Otherwise, the combination of the R color component average, the G color component average, and the B color component average is used as the color of the backboard;
  • the color space conversion module 37 is configured to average the R color components in the average color value array, The average value of the G color component and the average of the B color component are converted to the HSV color space, and the R color component maximum pixel dot color value, the G color component maximum pixel dot color value, and the B color component maximum pixel in the maximum pixel dot color value counting array.
  • the point color value is converted to the HSV color space; the difference determining module 38 is configured to determine whether the difference between the H color component of the average color value array and the H color component of the most pixel color value count array is less than a threshold, and if so, the R color component The combination of the maximum pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value as the color of the back plate; otherwise, R Average color component, G component average value of the color and B color components and an average of color as the backsheet.
  • the above set number is 40% of the total number of sampled pixels, and the threshold is 5. Certainly, in some cases in this embodiment, the number of the above settings and the size of the threshold may be adjusted accordingly according to specific conditions.
  • the icon current angle calculation unit 4 further includes an initialization module 41, an icon current overall angle calculation module 42, an overall layout phase calculation module 43, and an icon current angle acquisition module 44; wherein the initialization module 41 is used to initialize the angle to 10800.
  • the icon current overall angle calculation module 42 is used to record the angle at which the gesture slides when the gesture is started to slide. When the gesture slides clockwise, the current overall angle of the icon increases. When the gesture slides counterclockwise, the current overall angle of the icon is decreased.
  • the icon current angle obtaining module 44 is configured to obtain the current angle of the icon from the phase of the overall layout of the icon according to the key frame property set in advance. .
  • the location size transparency calculation unit 5 further includes an icon coordinate position calculation module 51, a first icon current angle determination module 52, a second icon current angle determination module 53, a third icon current angle determination module 54, and a fourth icon.
  • the second icon current angle determining module 53 is used for determining Whether the current angle of the icon is between 0 degrees and 90 degrees, and if so, calculating the difference between the current angle of the icon and 45 degrees, and calculating the offset of the coordinate position of the icon according to the difference, and making the coordinate position of the icon Offset according to the calculated offset; otherwise, continue to determine the size of the current angle of the icon;
  • the third icon current angle determining module 54 is configured to determine whether the current angle of the icon is equal to 0 degrees, and if so, to offset the coordinate position of the icon according to the first set offset; otherwise, continue to determine the current angle of the icon;
  • the fourth icon current angle determining module 55 is configured to determine whether the current angle of the icon is equal to 90 degrees.
  • the fifth icon current angle determining module 56 is configured to determine whether the current angle of the icon is greater than 90 degrees. If yes, the size of the icon is not corrected; otherwise, the size of the current angle of the icon is continuously determined; and the sixth icon is used by the current angle determining module 57.
  • the angle threshold of the three regions, and the scaling of the second region and the third region, and the icons located in the corresponding regions are scaled accordingly; otherwise, The size of the icon is not corrected.
  • a panel can be opened by a gesture in the lower right corner of an arbitrary application on the Android device, and an icon of similar size is displayed on the panel.
  • an icon of similar size is displayed on the panel.

Landscapes

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

Abstract

A method and device for arranging icons on an Android device. The method comprises: determining whether a gesture is made in a designated region of an application interface of an Android device (S01); if yes, loading data structures of icons on three screens (S02), or otherwise, determining again; adding a corresponding background plate for each icon according to the data structures of the icons on the three screens, and enabling the color of the background plate to match that of the icon (S03); calculating the current angle of each icon on each screen according to the screen on which the icon is located, an initial position of the icon, and a sliding angle of the gesture (S04); obtaining the position, size, and transparency of each icon according to the current angle of each icon (S05); opening a panel on the application interface of the Android device, and displaying each icon on the panel (S06), wherein the panel comprises three sub-panels, and each sub-panel is filled with the icons of different types. The method and device for arranging icons on an Android device provided by this solution have the following advantages: the space utilization rate of a screen is high, and multiple icons can be displayed in a limited area.

Description

一种在安卓设备上进行图标排布的方法及装置  Method and device for performing icon arrangement on Android device 技术领域Technical field
本发明涉及图标排布领域,特别涉及一种在安卓设备上进行图标排布的方法及装置。  The present invention relates to the field of icon arrangement, and in particular, to a method and apparatus for performing icon arrangement on an Android device.
背景技术Background technique
人们在使用安卓设备时,通常都有在安卓设备上实现“找应用”的需求,现有的做法就是把应用放到桌面上,按照m*n的格子对应用进行排布。这样就会存在如下问题:占用屏幕面积大、屏幕空间利用率不高。另外,当用户需要查找更多的应用时,过多的应用就需要占用更多的屏幕面积,给用户的体验造成影响,同时在有限的屏幕上放置过多的应用,也就是其不能有效的在有限的面积内展示多个图标。 When people use Android devices, they usually have the requirement of “finding applications” on Android devices. The existing method is to put the applications on the desktop and arrange the applications according to the m*n grid. This will have the following problems: occupying a large screen area and not utilizing a large screen space. In addition, when users need to find more applications, too many applications need to occupy more screen area, affecting the user's experience, and placing too many applications on a limited screen, that is, it can not be effective. Display multiple icons in a limited area.
技术问题technical problem
由于现有技术中没有有效的图标排布方式,其不仅影响外观,同时也给用户在查找应用图标时也造成不便。  Since there is no effective icon arrangement in the prior art, it not only affects the appearance, but also causes inconvenience to the user when searching for an application icon.
技术解决方案Technical solution
本发明要解决的技术问题在于,针对现有技术的上述屏幕的空间利用率不高、不能在有限的面积内展示多个图标的缺陷,提供一种屏幕的空间利用率较高、能在有限的面积内展示多个图标的在安卓设备上进行图标排布的方法及装置。The technical problem to be solved by the present invention is that the space utilization rate of the above-mentioned screens of the prior art is not high, and the defects of multiple icons cannot be displayed in a limited area, and the space utilization rate of the screen is high and can be limited. A method and apparatus for displaying icons on an Android device displaying a plurality of icons in an area.
本发明解决其技术问题所采用的技术方案是:构造一种在安卓设备上进行图标排布的方法,包括如下步骤:The technical solution adopted by the present invention to solve the technical problem is: constructing a method for performing icon arrangement on an Android device, comprising the following steps:
A)判断在所述安卓设备的应用界面上的指定区域是否有手势,如是,执行步骤B);否则,继续进行本步骤的判断;A) determining whether there is a gesture in the designated area on the application interface of the Android device, and if yes, performing step B); otherwise, proceeding to determine the step;
B)加载三屏图标的数据结构;B) loading the data structure of the three-screen icon;
C)根据所述三屏图标的数据结构,分别为每个图标增加相应的背板,并使所述背板的颜色与所述图标的颜色相匹配;C) according to the data structure of the three-screen icon, respectively adding a corresponding backplane for each icon, and matching the color of the backboard with the color of the icon;
D)根据所述图标所在屏、初始位置以及跟随所述手势滑动过的角度,分别计算出每个屏中每个所述图标的当前角度;D) calculating a current angle of each of the icons in each screen according to a screen on which the icon is located, an initial position, and an angle swept by the gesture;
E)根据每个所述图标的当前角度,分别获取每个所述图标的位置、大小和透明度;E) obtaining the position, size and transparency of each of the icons according to the current angle of each of the icons;
F)在所述安卓设备的应用界面上开启一个面板,并在所述面板上显示每个所述图标;所述面板包括三个子面板,每个子面板分别填充不同类型的图标。F) opening a panel on the application interface of the Android device, and displaying each of the icons on the panel; the panel includes three sub-panels, each of which is filled with different types of icons.
在本发明所述的在安卓设备上进行图标排布的方法中,所述步骤C)进一步包括:In the method for performing icon arrangement on an Android device according to the present invention, the step C) further includes:
C1)创建最多像素点色值计数数组和平均颜色值数组;所述最多像素点色值计数数组包括R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素点色值计数数组,所述平均颜色值数组包括R颜色分量值、G颜色分量值和B颜色分量值;C1) creating a maximum pixel point color value count array and an average color value array; the maximum pixel point color value count array includes an R color component maximum pixel point color value count array, a G color component maximum pixel point color value count array, and a B color a component maximum pixel point color value count array, the average color value array comprising an R color component value, a G color component value, and a B color component value;
C2)加载应用的图标,对所述图标不同区域的像素点使用不同的采样率进行采样; C2) loading an icon of the application, and sampling pixels of different areas of the icon using different sampling rates;
C3)遍历每个抽样像素点,分别取得每个所述抽样像素点的R颜色分量、G颜色分量和B颜色分量,使所述最多像素点色值计数数组中的R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素值计数数组的计数分别加1,并使所述平均颜色值数组中的R颜色分量数组、G颜色分量数组和B颜色分量数组分别与每个抽样像素点的R颜色分量、G颜色分量和B颜色分量进行叠加;C3) traversing each sampled pixel point, respectively obtaining an R color component, a G color component, and a B color component of each of the sampled pixel points, so that the maximum color pixel color of the R color component in the maximum pixel color value count array The count of the value count array, the G color component maximum pixel point color value count array, and the B color component maximum pixel value count array are respectively incremented by 1, and the R color component array, the G color component array, and the B in the average color value array are added. The color component array is superimposed with the R color component, the G color component, and the B color component of each sampled pixel;
C4)使所述平均颜色值数组中的叠加后的R颜色分量值、G颜色分量值和B颜色分量值分别除以所述抽样像素点的个数,分别得到R颜色分量平均值、G颜色分量平均值和B颜色分量平均值;C4) dividing the superimposed R color component value, G color component value, and B color component value in the average color value array by the number of the sampled pixel points, respectively, and obtaining the R color component average value and the G color respectively. Average value of component and B color component;
C5)分别计算所述最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值;C5) respectively calculating an R color component maximum pixel point color value, a G color component maximum pixel point color value, and a B color component maximum pixel point color value in the maximum pixel point color value count array;
C6)判断所述最多像素点色值计数数组是否存在其像素点个数大于设定个数的色值,如是,执行步骤C7);否则,将所述R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为所述背板的颜色;C6) determining whether the maximum pixel point color value count array has a color value whose number of pixel points is greater than a set number, and if so, performing step C7); otherwise, averaging the R color component average value and the G color component a combination of the value and the average of the B color components as the color of the back panel;
C7)将所述平均颜色值数组中的R颜色分量平均值、G颜色分量平均值和B颜色分量平均值转换到HSV颜色空间,将所述最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值转换到HSV颜色空间;C7) converting the R color component average value, the G color component average value, and the B color component average value in the average color value array to the HSV color space, and maximizing the R color component in the most pixel color value count array The pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value are converted to the HSV color space;
C8)判断所述平均颜色值数组的H颜色分量与所述最多像素点色值计数数组的H颜色分量的差值是否小于阈值,如是,将所述R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值的组合作为所述背板的颜色;否则,将所述R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为所述背板的颜色。C8) determining whether a difference between the H color component of the average color value array and the H color component of the most pixel color value count array is less than a threshold, and if so, the R color component maximum pixel color value, G color a combination of a component maximum pixel point color value and a B color component maximum pixel point color value as a color of the backboard; otherwise, a combination of the R color component average value, the G color component average value, and the B color component average value is taken as The color of the back panel.
在本发明所述的在安卓设备上进行图标排布的方法中,所述步骤D)进一步包括:In the method for performing icon arrangement on an Android device according to the present invention, the step D) further includes:
D1)初始化角度为10800度;D1) The initialization angle is 10800 degrees;
D2)开始手势滑动时,记录所述手势滑过的角度,当所述手势顺时针滑动时,图标的当前整体角度增加,当所述手势逆时针滑动时,所述图标的当前整体角度减小,所述图标的当前整体角度为:degree = (degree + 10800) % 10800,其中,degree为图标的当前整体角度;D2) when starting the gesture sliding, recording the angle at which the gesture slides, when the gesture slides clockwise, the current overall angle of the icon increases, and when the gesture slides counterclockwise, the current overall angle of the icon decreases , the current overall angle of the icon is: = (degree + 10800) % 10800, where degree is the current overall angle of the icon;
D3)根据所述图标的当前整体角度,得到所述图标的整体布局的相位为phase = degree % 270,其中,phase为图标的整体布局的相位,degree为图标的当前整体角度;D3) according to the current overall angle of the icon, the phase of the overall layout of the icon is obtained as phase = degree % 270, wherein phase is the phase of the overall layout of the icon, and degree is the current overall angle of the icon;
D4)根据事先设定的关键帧属性,由所述图标的整体布局的相位得到所述图标的当前角度。D4) The current angle of the icon is obtained from the phase of the overall layout of the icon according to a key frame property set in advance.
在本发明所述的在安卓设备上进行图标排布的方法中,所述步骤E)进一步包括:In the method for performing icon arrangement on an Android device according to the present invention, the step E) further includes:
E1)根据所述图标的当前角度,计算得到所述图标的坐标位置;E1) calculating a coordinate position of the icon according to a current angle of the icon;
E2)判断所述图标的当前角度是否大于90度,如是,对所述图标的坐标位置不做矫正;否则,执行步骤E3);E2) determining whether the current angle of the icon is greater than 90 degrees, if not, correcting the coordinate position of the icon; otherwise, performing step E3);
E3)判断所述图标的当前角度是否位于0度到90度之间,如是,计算所述图标的当前角度与45度之间的差值,并根据所述差值计算所述图标的坐标位置的偏移量,并使所述图标的坐标位置按照计算出的所述偏移量进行偏移;否则,执行步骤E4);E3) determining whether the current angle of the icon is between 0 degrees and 90 degrees, and if so, calculating a difference between the current angle of the icon and 45 degrees, and calculating a coordinate position of the icon according to the difference Offset, and the coordinate position of the icon is offset according to the calculated offset; otherwise, step E4) is performed;
E4)判断所述图标的当前角度是否等于0度,如是,将所述图标的坐标位置按照第一设定偏移量进行偏移;否则,执行步骤E5);E4) determining whether the current angle of the icon is equal to 0 degrees, and if so, shifting the coordinate position of the icon according to the first set offset; otherwise, performing step E5);
E5)判断所述图标的当前角度是否等于90度,如是,将所述图标的坐标位置按照第二设定偏移量进行偏移;否则,对所述图标的坐标位置不做矫正;还包括:E5) determining whether the current angle of the icon is equal to 90 degrees, and if so, shifting the coordinate position of the icon according to the second set offset; otherwise, correcting the coordinate position of the icon; :
E2')判断所述图标的当前角度是否大于90度,如是,对所述图标的大小不做矫正;否则,执行步骤E3');E2') determining whether the current angle of the icon is greater than 90 degrees, if not, correcting the size of the icon; otherwise, performing step E3');
E3')判断所述图标的当前角度是否位于0度到90度之间,如是,将所述图标所在的屏划分为第一区域、第二区域和第三区域,并分别设定所述第一区域、第二区域和第三区域的角度阈值,以及所述第二区域和第三区域的缩放比例,并将位于对应区域的图标进行相应缩放;否则,对所述图标的大小不做矫正。E3') determining whether the current angle of the icon is between 0 degrees and 90 degrees, and if so, dividing the screen in which the icon is located into the first area, the second area, and the third area, and setting the first An angle threshold of a region, a second region, and a third region, and a scaling ratio of the second region and the third region, and correspondingly scaling an icon located in the corresponding region; otherwise, correcting the size of the icon .
在本发明所述的在安卓设备上进行图标排布的方法中,所述设定个数为抽样像素点总数的40%,所述阈值为5。In the method for performing icon arrangement on an Android device according to the present invention, the set number is 40% of the total number of sampled pixels, and the threshold is 5.
本发明还涉及一种实现上述在安卓设备上进行图标排布的方法的装置,包括:The present invention also relates to an apparatus for implementing the above method for icon arrangement on an Android device, comprising:
手势动作判断单元:用于判断在所述安卓设备的应用界面上的指定区域是否有手势;a gesture action determining unit: configured to determine whether a specified area on the application interface of the Android device has a gesture;
数据结构加载单元:用于加载三屏图标的数据结构;Data structure loading unit: a data structure for loading a three-screen icon;
背板图标匹配单元:用于根据所述三屏图标的数据结构,分别为每个图标增加相应的背板,并使所述背板的颜色与所述图标的颜色相匹配;a backplane icon matching unit: configured to add a corresponding backplane to each icon according to the data structure of the three-screen icon, and match a color of the backboard with a color of the icon;
图标当前角度计算单元:用于根据所述图标所在屏、初始位置以及跟随所述手势滑动过的角度,分别计算出每个屏中每个所述图标的当前角度;An icon current angle calculation unit: configured to calculate a current angle of each of the icons in each screen according to a screen on which the icon is located, an initial position, and an angle that follows the gesture;
位置大小透明度计算单元:用于根据每个所述图标的当前角度,分别获取每个所述图标的位置、大小和透明度;a position size transparency calculation unit: configured to respectively acquire a position, a size, and a transparency of each of the icons according to a current angle of each of the icons;
面板开启显示单元:用于在所述安卓设备的应用界面上开启一个面板,并在所述面板上显示每个所述图标;所述面板包括三个子面板,每个子面板分别填充不同类型的图标。a panel open display unit: configured to open a panel on an application interface of the Android device, and display each of the icons on the panel; the panel includes three sub-panels, each sub-panel respectively filling different types of icons .
在本发明所述的装置中,所述背板图标匹配单元进一步包括:In the device of the present invention, the backplane icon matching unit further includes:
数组创建模块:用于创建最多像素点色值计数数组和平均颜色值数组;所述最多像素点色值计数数组包括R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素点色值计数数组,所述平均颜色值数组包括R颜色分量值、G颜色分量值和B颜色分量值;Array creation module: used to create a maximum pixel color value count array and an average color value array; the maximum pixel color value count array includes an R color component maximum pixel point color value count array, a G color component maximum pixel point color value count Array and B color component maximum pixel point color value count array, the average color value array including R color component value, G color component value, and B color component value;
加载采样模块:用于加载应用的图标,对所述图标不同区域的像素点使用不同的采样率进行采样; Loading sampling module: an icon for loading an application, and sampling pixels of different areas of the icon using different sampling rates;
像素点遍历模块:用于遍历每个抽样像素点,分别取得每个所述抽样像素点的R颜色分量、G颜色分量和B颜色分量,使所述最多像素点色值计数数组中的R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素值计数数组的计数分别加1,并使所述平均颜色值数组中的R颜色分量数组、G颜色分量数组和B颜色分量数组分别与每个抽样像素点的R颜色分量、G颜色分量和B颜色分量进行叠加;a pixel traversal module: traversing each sample pixel, respectively obtaining an R color component, a G color component, and a B color component of each of the sampled pixel points, so that the maximum color of the pixel value in the array is counted The component maximum pixel dot color value count array, the G color component maximum pixel dot color value count array, and the B color component maximum pixel value count array are incremented by 1, respectively, and the R color component array in the average color value array, G The color component array and the B color component array are respectively superimposed with the R color component, the G color component, and the B color component of each sample pixel;
分量平均值计算模块:用于使所述平均颜色值数组中的叠加后的R颜色分量值、G颜色分量值和B颜色分量值分别除以所述抽样像素点的个数,分别得到R颜色分量平均值、G颜色分量平均值和B颜色分量平均值;a component average calculation module: configured to respectively divide the superimposed R color component value, G color component value, and B color component value in the average color value array by the number of the sampled pixel points, respectively, to obtain an R color Component average, G color component average, and B color component average;
最大像素点色值计算模块:用于分别计算所述最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值;a maximum pixel point color value calculation module: configured to respectively calculate an R color component maximum pixel point color value, a G color component maximum pixel point color value, and a B color component maximum pixel point color value in the maximum pixel point color value count array;
色值判断模块:用于判断所述最多像素点色值计数数组是否存在其像素点个数大于设定个数的色值,如是,对所述平均颜色值数组和最多像素点色值计数数组进行颜色空间的转换;否则,将所述R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为所述背板的颜色;The color value judging module is configured to determine whether the maximum pixel color value count array has a color value whose number of pixel points is greater than a set number, and if so, the average color value array and the maximum pixel color value count array Performing conversion of color space; otherwise, combining the R color component average, the G color component average, and the B color component average as the color of the backboard;
颜色空间转换模块:用于将所述平均颜色值数组中的R颜色分量平均值、G颜色分量平均值和B颜色分量平均值转换到HSV颜色空间,将所述最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值转换到HSV颜色空间;a color space conversion module: configured to convert an R color component average value, a G color component average value, and a B color component average value in the average color value array into an HSV color space, and calculate the maximum pixel color value in an array The R color component maximum pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value are converted to the HSV color space;
差值判断模块:用于判断所述平均颜色值数组的H颜色分量与所述最多像素点色值计数数组的H颜色分量的差值是否小于阈值,如是,将所述R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值的组合作为所述背板的颜色;否则,将所述R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为所述背板的颜色。a difference judging module: configured to determine whether a difference between an H color component of the average color value array and an H color component of the most pixel color value count array is less than a threshold, and if so, the R color component maximum pixel point a combination of a color value, a G color component maximum pixel point color value, and a B color component maximum pixel point color value as a color of the back sheet; otherwise, the R color component average value, the G color component average value, and the B color component The combination of the average values is used as the color of the back sheet.
在本发明所述的装置中,所述图标当前角度计算单元进一步包括:In the device of the present invention, the icon current angle calculation unit further includes:
初始化模块:用于初始化角度为10800度;Initialization module: used for initialization angle of 10800 degrees;
图标当前整体角度计算模块:用于开始手势滑动时,记录所述手势滑过的角度,当所述手势顺时针滑动时,图标的当前整体角度增加,当所述手势逆时针滑动时,所述图标的当前整体角度减小,所述图标的当前整体角度为:degree = (degree + 10800) % 10800,其中,degree为图标的当前整体角度;Icon current overall angle calculation module: for starting a gesture slide, recording an angle at which the gesture slides, when the gesture slides clockwise, the current overall angle of the icon increases, when the gesture slides counterclockwise, The current overall angle of the icon is reduced, and the current overall angle of the icon is: = (degree + 10800) % 10800, where degree is the current overall angle of the icon;
整体布局相位计算模块:用于根据所述图标的当前整体角度,得到所述图标的整体布局的相位为phase = degree % 270,其中,phase为图标的整体布局的相位,degree为图标的当前整体角度;The overall layout phase calculation module is configured to obtain a phase of the overall layout of the icon according to the current overall angle of the icon as phase = Degree % 270, where phase is the phase of the overall layout of the icon and degree is the current overall angle of the icon;
图标当前角度获取模块:用于根据事先设定的关键帧属性,由所述图标的整体布局的相位得到所述图标的当前角度。Icon current angle acquisition module: used to obtain the current angle of the icon from the phase of the overall layout of the icon according to a key frame property set in advance.
在本发明所述的装置中,所述位置大小透明度计算单元进一步包括:In the device of the present invention, the location size transparency calculation unit further includes:
图标坐标位置计算模块:用于根据所述图标的当前角度,计算得到所述图标的坐标位置;An icon coordinate position calculation module: configured to calculate a coordinate position of the icon according to a current angle of the icon;
第一图标当前角度判断模块:用于判断所述图标的当前角度是否大于90度,如是,对所述图标的坐标位置不做矫正;否则,继续判断所述图标的当前角度的大小;The first icon current angle determining module is configured to determine whether the current angle of the icon is greater than 90 degrees, and if not, correct the coordinate position of the icon; otherwise, continue to determine the current angle of the icon;
第二图标当前角度判断模块:用于判断所述图标的当前角度是否位于0度到90度之间,如是,计算所述图标的当前角度与45度之间的差值,并根据所述差值计算所述图标的坐标位置的偏移量,并使所述图标的坐标位置按照计算出的所述偏移量进行偏移;否则,继续判断所述图标的当前角度的大小;a second icon current angle determining module: configured to determine whether a current angle of the icon is between 0 degrees and 90 degrees, and if so, calculating a difference between a current angle of the icon and 45 degrees, and according to the difference Calculating an offset of the coordinate position of the icon, and causing the coordinate position of the icon to be offset according to the calculated offset; otherwise, continuing to determine the size of the current angle of the icon;
第三图标当前角度判断模块:用于判断所述图标的当前角度是否等于0度,如是,将所述图标的坐标位置按照第一设定偏移量进行偏移;否则,继续判断所述图标的当前角度的大小;a third icon current angle determining module: configured to determine whether the current angle of the icon is equal to 0 degrees, and if so, to offset the coordinate position of the icon according to the first set offset; otherwise, continue to determine the icon The size of the current angle;
第四图标当前角度判断模块:用于判断所述图标的当前角度是否等于90度,如是,将所述图标的坐标位置按照第二设定偏移量进行偏移;否则,对所述图标的坐标位置不做矫正;还包括:a fourth icon current angle determining module: configured to determine whether a current angle of the icon is equal to 90 degrees, and if so, shifting a coordinate position of the icon according to a second set offset; otherwise, the icon is The coordinate position is not corrected; it also includes:
第五图标当前角度判断模块:用于判断所述图标的当前角度是否大于90度,如是,对所述图标的大小不做矫正;否则,继续判断所述图标的当前角度的大小;The fifth icon current angle determining module is configured to determine whether the current angle of the icon is greater than 90 degrees, and if so, correct the size of the icon; otherwise, continue to determine the current angle of the icon;
第六图标当前角度判断模块:用于判断所述图标的当前角度是否位于0度到90度之间,如是,将所述图标所在的屏划分为第一区域、第二区域和第三区域,并分别设定所述第一区域、第二区域和第三区域的角度阈值,以及所述第二区域和第三区域的缩放比例,并将位于对应区域的图标进行相应缩放;否则,对所述图标的大小不做矫正。a sixth icon current angle determining module: configured to determine whether the current angle of the icon is between 0 degrees and 90 degrees, and if yes, dividing the screen where the icon is located into the first area, the second area, and the third area, And respectively setting an angle threshold of the first area, the second area, and the third area, and a scaling ratio of the second area and the third area, and respectively scaling an icon located in the corresponding area; otherwise, The size of the icon is not corrected.
在本发明所述的装置中,所述设定个数为抽样像素点总数的40%,所述阈值为5。In the apparatus of the present invention, the set number is 40% of the total number of sampled pixels, and the threshold is 5.
有益效果Beneficial effect
实施本发明的在安卓设备上进行图标排布的方法及装置,具有以下有益效果:由于根据每个图标的当前角度,可以分别获取每个图标的位置、大小和透明度;也就是图标的大小是可变的,在安卓设备的应用界面上开启的面板可以显示每个图标;且该面板包括三个子面板,每个子面板分别填充不同类型的图标,这样就可以对图标进行有效的排布,所以屏幕的空间利用率较高、能在有限的面积内展示多个图标。 The method and apparatus for performing icon arrangement on an Android device embodying the present invention have the following beneficial effects: since the position, size, and transparency of each icon can be separately obtained according to the current angle of each icon; that is, the size of the icon is Variable, the panel opened on the application interface of the Android device can display each icon; and the panel includes three sub-panels, each of which is filled with different types of icons, so that the icons can be effectively arranged, so The screen has a high space utilization and can display multiple icons in a limited area.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图1为本发明在安卓设备上进行图标排布的方法及装置一个实施例中方法的流程图;1 is a flowchart of a method and an apparatus for performing icon arrangement on an Android device according to an embodiment of the present invention;
图2为所述实施例中根据三屏图标的数据结构,分别为每个图标增加相应的背板,并使背板的颜色与图标的颜色相匹配的具体流程图;2 is a specific flowchart of adding a corresponding backplane to each icon according to the data structure of the three-screen icon in the embodiment, and matching the color of the backboard with the color of the icon;
图3为所述实施例中根据图标所在屏、初始位置以及跟随手势滑动过的角度,分别计算出每个屏中每个图标的当前角度的具体流程图;FIG. 3 is a specific flowchart of calculating the current angle of each icon in each screen according to the screen where the icon is located, the initial position, and the angle swept by the following gesture;
图4为所述实施例中每屏图标的排列顺序图;Figure 4 is a sequence diagram showing the arrangement of icons per screen in the embodiment;
图5为所述实施例中三屏图标的布局图;Figure 5 is a layout diagram of a three-screen icon in the embodiment;
图6为所述实施例中根据每个图标的当前角度,分别获取每个图标的位置、大小和透明度的具体流程图;FIG. 6 is a specific flowchart of obtaining the position, size, and transparency of each icon according to the current angle of each icon in the embodiment;
图7为所述实施例中每屏划分成三个区域的示意图;Figure 7 is a schematic diagram of each screen divided into three regions in the embodiment;
图8为所述实施例中装置的结构示意图。Figure 8 is a schematic view showing the structure of the apparatus in the embodiment.
本发明的实施方式Embodiments of the invention
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
在本发明在安卓设备上进行图标排布的方法及装置实施例中,其在安卓设备上进行图标排布的方法的流程图如图1所示。图1中,该在安卓设备上进行图标排布的方法包括如下步骤:In the embodiment of the method and apparatus for performing icon arrangement on an Android device according to the present invention, a flowchart of a method for performing icon arrangement on an Android device is shown in FIG. 1 . In FIG. 1, the method for performing icon arrangement on an Android device includes the following steps:
步骤S01判断在安卓设备的应用界面上的指定区域是否有手势:本步骤中,首先进入安卓设备的应用界面,然后判断在安卓设备的应用界面上的指定区域是否有手势滑动,指定区域是事先设定的,例如:指定区域可以是应用界面的右下角,本步骤中,如果判断的结果为是,则执行步骤S02;否则,继续进行本步骤的判断。Step S01: determining whether there is a gesture in the designated area on the application interface of the Android device: in this step, first entering the application interface of the Android device, and then determining whether there is a gesture sliding in the designated area on the application interface of the Android device, the designated area is prior For example, the designated area may be the lower right corner of the application interface. In this step, if the result of the determination is yes, step S02 is performed; otherwise, the determination of this step is continued.
步骤S02加载三屏图标的数据结构:如果上述步骤S01的判断结果为是,则执行本步骤。本步骤中,加载三屏图标的数据结构。上述三屏包括当前屏、上一屏和下一屏,每一屏上都有对应要显示的图标。执行完本步骤,执行步骤S03。Step S02 loads the data structure of the three-screen icon: if the result of the above step S01 is YES, the step is executed. In this step, the data structure of the three-screen icon is loaded. The above three screens include the current screen, the previous screen and the next screen, and each screen has an icon corresponding to the screen to be displayed. After performing this step, go to step S03.
步骤S03 根据三屏图标的数据结构,分别为每个图标增加相应的背板,并使背板的颜色与图标的颜色相匹配:本步骤中,根据三屏图标的数据结构,分别为每个图标增加相应的背板,并使背板的颜色与图标的颜色相匹配,值得一提的是,为颜色、形状各异的图标(应用图标)加上彩色背板,这样就会看上去整齐,且与原图标颜色统一。Step S03 According to the data structure of the three-screen icon, the corresponding backplane is added for each icon, and the color of the backboard is matched with the color of the icon: in this step, according to the data structure of the three-screen icon, each icon is added separately. Corresponding backplanes and matching the color of the backboard to the color of the icon. It is worth mentioning that the color and shape of the icon (application icon) plus the color backboard will look neat and Uniform with the original icon color.
步骤S04 根据图标所在屏、初始位置以及跟随手势滑动过的角度,分别计算出每个屏中每个图标的当前角度:本步骤中,根据图标所在屏(当前屏、上一屏或下一屏)、初始位置以及跟随手势滑动过的角度,分别计算出每个屏中每个图标的当前角度。Step S04 Calculate the current angle of each icon in each screen according to the screen where the icon is located, the initial position, and the angle swept by the following gesture: in this step, according to the screen where the icon is located (current screen, previous screen or next screen), The initial position and the angle over which the gesture is swiped, respectively, calculate the current angle of each icon in each screen.
步骤S05根据每个图标的当前角度,分别获取每个图标的位置、大小和透明度:本步骤中,根据每个图标的当前角度,分别获取每个图标的位置、大小和透明度,由于每个图标的大小和位置是可以根据具体情况进行调整的,这样就可以根据实际情况对图标进行有效排布。Step S05 respectively obtains the position, size, and transparency of each icon according to the current angle of each icon: in this step, the position, size, and transparency of each icon are respectively obtained according to the current angle of each icon, because each icon The size and position can be adjusted according to the specific situation, so that the icons can be effectively arranged according to the actual situation.
步骤S06在安卓设备的应用界面上开启一个面板,并在面板上显示每个图标:本步骤中,在安卓设备的应用界面上开启一个面板,并在面板上显示每个图标,也就是在面板上可以显示类似大小错落的图标,上述面板包括三个子面板,每个子面板分别填充不同类型的图标,当在面板上进行手势滑动操作时,每滑动90度,切换到下一个子面板(上一屏或下一屏)。本实施例中,每屏可以显示13个图标,三屏共有39个图标,本发明需要在同一时刻缓存39个图标及其对应的数据结构,因此可能会占据较大内存,在一些配置比较差的设备上可能会导致滑屏效率不佳。但这样可以对图标进行有效的排布,所以屏幕的空间利用率较高、能在有限的面积内展示多个图标。In step S06, a panel is opened on the application interface of the Android device, and each icon is displayed on the panel: in this step, a panel is opened on the application interface of the Android device, and each icon is displayed on the panel, that is, in the panel. The icon can be displayed on the same size. The above panel includes three sub-panels, each of which is filled with different types of icons. When the gesture is swiped on the panel, each slides 90 degrees, and switches to the next sub-panel (previous one) Screen or next screen). In this embodiment, 13 icons can be displayed per screen, and 39 icons are displayed on three screens. The present invention needs to cache 39 icons and their corresponding data structures at the same time, so it may occupy a large memory and is poor in some configurations. The device may cause poor sliding screen efficiency. However, the icons can be effectively arranged, so the space utilization of the screen is high, and multiple icons can be displayed in a limited area.
对于本实施例而言,上述步骤S03还可进一步细化,其细化后的流程图如图2所示。本实施例中,为了使背板的颜色与图标的颜色相匹配,本实施例会在内存中加载应用的原图标位图,然后逐像素分析,找出和图标像素最接近的RGB颜色。这样就需要遵循以下几点原则:尽可能找到原图标位图中最多像素点的色值。如果有一个色值的像素点个数远远大于其它色值像素点的个数,那么背板的颜色使用这个最大像素点数的色值;如果找不到最大像素点数的色值,那么会选用图标中所有像素点的平均色值作为背板的颜色。具体的,图2中,上述步骤S03进一步包括:For the embodiment, the above step S03 can be further refined, and the refined flowchart is as shown in FIG. 2 . In this embodiment, in order to match the color of the backboard with the color of the icon, the embodiment loads the original icon bitmap of the application in the memory, and then analyzes pixel by pixel to find the RGB color closest to the icon pixel. In this way, you need to follow the following principles: try to find the color value of the most pixels in the original icon bitmap. If the number of pixels with one color value is much larger than the number of pixels of other color values, then the color of the back panel uses the color value of the maximum number of pixels; if the color value of the largest pixel number is not found, then the color value is selected. The average color value of all pixels in the icon is used as the color of the back panel. Specifically, in FIG. 2, the foregoing step S03 further includes:
步骤S301 创建最多像素点色值计数数组和平均颜色值数组:为了实现找到最大像素点数的色值,需要建立一个255*255*255的int数组,作为完整的RGB向量,然后遍历图标所有像素,对每一个像素的RGB颜色进行计数,最后返回计数最大的数组下标作为RGB颜色。但考虑节约内存,可以采用近似的方法,只需建立3个255的int数组,即可近似找出最大像素点数的色值。本步骤中,创建最多像素点色值计数数组和平均颜色值数组,其中,最多像素点色值计数数组包括R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素点色值计数数组,分别作为R、G、B三个颜色分向量的计数器,用于找出最大像素色值,将R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素点色值计数数组分别标记为mostR[]、mostG[]、mostB[]。Step S301 Create a maximum pixel color value count array and an average color value array: In order to find the color value of the largest pixel number, you need to create a 255*255*255 int array as a complete RGB vector, then traverse the icon all pixels, for each The RGB color of one pixel is counted, and finally the array subscript with the largest count is returned as the RGB color. But consider saving memory, you can use the approximate method, just create three 255 int arrays, you can approximate the color value of the largest number of pixels. In this step, a maximum pixel color value count array and an average color value array are created, wherein the maximum pixel color value count array includes an R color component maximum pixel point color value count array, a G color component maximum pixel point color value count array, and B color component maximum pixel point color value count array, respectively as R, G, B three color sub-vector counter, used to find the maximum pixel color value, R color component maximum pixel point color value count array, G color component The maximum pixel dot color count array and the B color component maximum pixel dot color value count array are labeled as mostR[], mostG[], mostB[], respectively.
平均颜色值数组包括R颜色分量值、G颜色分量值和B颜色分量值,R颜色分量值、G颜色分量值和B颜色分量值为3个int变量,用于累计所有像素上的R、G、B颜色分量的和,以便计算出图标中的平均颜色。本实施例将R颜色分量值、G颜色分量值和B颜色分量分别标记为sumR、sumG、sumB。The average color value array includes an R color component value, a G color component value, and a B color component value, and the R color component value, the G color component value, and the B color component value are 3 int variables for accumulating R, G on all pixels. , the sum of the B color components to calculate the average color in the icon. In this embodiment, the R color component value, the G color component value, and the B color component are respectively labeled as sumR, sumG, and sumB.
步骤S302 加载应用的图标,对图标不同区域的像素点使用不同的采样率进行采样:因为背板是原图标外围的扩展,故原图标中靠近边缘的像素颜色,优先于图标靠近中心的颜色。这样可以通过对原图标不同位置的像素不同的采样率,实现图标边缘像素更高的权重。本步骤中,加载应用的图标,对图标不同区域的像素点使用不同的采样率进行采样。本实施例中,如果像素点离边缘的距离小于图标宽度*0.16,说明该像素点是边缘点,则采用50%抽样;其它像素点则采用3%抽样。当然,在本实施例的一些情况下,为了使结果更加准确,也可以增加采样率。Step S302 Load the icon of the app and sample the pixels in different areas of the icon with different sampling rates: because the back panel is an extension of the outer edge of the original icon, the color of the pixel near the edge in the original icon takes precedence over the color of the icon near the center. In this way, a higher weight of the icon edge pixels can be achieved by different sampling rates of pixels at different positions of the original icon. In this step, the icon of the application is loaded, and the pixel points in different areas of the icon are sampled using different sampling rates. In this embodiment, if the distance of the pixel from the edge is less than the icon width *0.16, it indicates that the pixel is the edge point, 50% sampling is used; the other pixels are 3% sampling. Of course, in some cases of this embodiment, in order to make the result more accurate, the sampling rate can also be increased.
步骤S303 遍历每个抽样像素点,分别取得每个抽样像素点的R颜色分量、G颜色分量和B颜色分量,使最多像素点色值计数数组中的R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素值计数数组的计数分别加1,并使平均颜色值数组中的R颜色分量数组、G颜色分量数组和B颜色分量数组分别与每个抽样像素点的R颜色分量、G颜色分量和B颜色分量进行叠加:本步骤中,按照上述步骤S302中的抽样率遍历图标的每个抽样像素点,对于每个抽样像素点,分别取得该像素点的R颜色分量、G颜色分量和B颜色分量,分别对mostR[]、mostG[]、mostB[]的下标加1,累计计数,同时,将该像素点的R颜色分量、G颜色分量和B颜色分量分别与sumR、sumG和sumB进行叠加。Step S303 Traversing each sampled pixel, respectively obtaining the R color component, the G color component, and the B color component of each sampled pixel point, so that the R color component of the maximum pixel point color value count array has the largest pixel point color value count array, G color The counts of the component maximum pixel point color value count array and the B color component maximum pixel value count array are respectively incremented by 1, and the R color component array, the G color component array, and the B color component array in the average color value array are respectively sampled with each The R color component, the G color component, and the B color component of the pixel are superimposed: in this step, each sample pixel of the icon is traversed according to the sampling rate in the above step S302, and the pixel point is respectively obtained for each sample pixel point. The R color component, the G color component, and the B color component respectively add 1 to the subscripts of mostR[], mostG[], and mostB[], respectively, and count the R color component and the G color component of the pixel point. The B color components are superimposed with sumR, sumG, and sumB, respectively.
步骤S304 使平均颜色值数组中的叠加后的R颜色分量值、G颜色分量值和B颜色分量值分别除以抽样像素点的个数,分别得到R颜色分量平均值、G颜色分量平均值和B颜色分量平均值:本步骤中,遍历结束后,分别使sumR、sumG和sumB分别除以抽样像素点的个数,分别得到R颜色分量平均值、G颜色分量平均值和B颜色分量平均值,将R颜色分量平均值、G颜色分量平均值和B颜色分量平均值分别标记为averageR、averageG和averageB,averageR、averageG和averageB组成RGB颜色averageRGB。Step S304 The superimposed R color component value, G color component value, and B color component value in the average color value array are respectively divided by the number of sampled pixel points, and the R color component average value, the G color component average value, and the B color are respectively obtained. Component average value: In this step, after the traversal is completed, sumR, sumG, and sumB are respectively divided by the number of sampled pixels, and the R color component average value, the G color component average value, and the B color component average value are respectively obtained. The R color component average, the G color component average, and the B color component average are labeled as averageR, averageG, and averageB, respectively, and averageR, averageG, and averageB constitute the RGB color averageRGB.
步骤S305分别计算最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值:本步骤中,分别找出mostR[]、mostG[]和mostB[]中计数最大的下标,这三个下标就是像素点最多的R、G、B,即R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值。Step S305 respectively calculates an R color component maximum pixel point color value, a G color component maximum pixel point color value, and a B color component maximum pixel point color value in the maximum pixel point color value count array: in this step, respectively find the mostR[] The most subscripts in mostG[] and mostB[], which are the R, G, and B with the most pixels, that is, the maximum pixel color value of the R color component, the maximum pixel color value of the G color component, and B color component maximum pixel point color value.
步骤S306判断最多像素点色值计数数组是否存在其像素点个数大于设定个数的色值:本步骤中,判断最多像素点色值计数数组是否存在其像素点个数大于设定个数的色值,例如:mostR[170]=1800,就表示R=170的像素点的个数有1800个,1800就是计数。本实施例中,该设定个数为抽样像素点总数的40%。当然,在本实施例的一些情况下,上述设定个数可以根据具体情况进行相应调整。本步骤中,如果判断的结果为是,则执行步骤S308;否则,执行步骤S307。Step S306: determining whether the maximum number of pixels of the color point count array has a color value whose number of pixels is greater than a set number: in this step, determining whether the maximum number of pixels of the color point count array exists is greater than the set number of pixels The color value, for example: mostR[170]=1800, means that there are 1800 pixel points of R=170, and 1800 is the count. In this embodiment, the set number is 40% of the total number of sampled pixels. Of course, in some cases of the embodiment, the number of the above settings may be adjusted accordingly according to specific conditions. In this step, if the result of the determination is yes, then step S308 is performed; otherwise, step S307 is performed.
步骤S307将R颜色分量平均值、G颜色分量平均值和B颜色分量平均值作为背板的颜色:如果上述步骤S306的判断结果为否,则执行本步骤。本步骤中,认为这个图标没有一个颜色远超出其它颜色,将R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为背板的颜色。In step S307, the R color component average value, the G color component average value, and the B color component average value are used as the color of the backboard: if the determination result of the above step S306 is NO, this step is performed. In this step, it is considered that none of the icons is farther than the other colors, and the combination of the R color component average, the G color component average, and the B color component average is used as the color of the back panel.
步骤S308 将平均颜色值数组中的R颜色分量平均值、G颜色分量平均值和B颜色分量平均值转换到HSV颜色空间,将最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值转换到HSV颜色空间:如果上述步骤S306的判断结果为是,即像素点个数大于抽样像素点总数的40%,则执行本步骤。本步骤中,认为这个色值可以被列入候选的最佳匹配色,把它组成RGB颜色mostRGB,为了将平均颜色值数组的平均颜色与最多像素点色值计数数组中的最多计数颜色进行对比,将平均颜色值数组中的R颜色分量平均值、G颜色分量平均值和B颜色分量平均值转换到HSV颜色空间,将最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值转换到HSV颜色空间。Step S308 Converting the R color component average value, the G color component average value, and the B color component average value in the average color value array to the HSV color space, and the R color component maximum pixel dot color value in the maximum pixel dot color value count array, G Color component maximum pixel point color value and B color component maximum pixel point color value are converted to HSV color space: if the result of the above step S306 is YES, that is, the number of pixel points is greater than 40% of the total number of sampled pixel points, then this step is performed. . In this step, it is considered that this color value can be included in the candidate best matching color, which is composed into the RGB color mostRGB, in order to compare the average color of the average color value array with the maximum count color in the most pixel color value count array. Converting the R color component average value, the G color component average value, and the B color component average value in the average color value array into the HSV color space, and maximizing the pixel color value of the R color component in the maximum pixel dot color value count array, The G color component maximum pixel point color value and the B color component maximum pixel point color value are converted to the HSV color space.
步骤S309判断平均颜色值数组的H颜色分量与最多像素点色值计数数组的H颜色分量的差值是否小于阈值:本步骤中,判断平均颜色值数组的H颜色分量与最多像素点色值计数数组的H颜色分量的差值是否小于阈值,本实施例中,阈值为5,如果判断的结果为是,则执行步骤S310;否则,返回步骤S307。Step S309 determines whether the difference between the H color component of the average color value array and the H color component of the most pixel color value count array is less than a threshold: in this step, determining the H color component of the average color value array and the maximum pixel color value count The difference between the H color components of the array is less than the threshold. In this embodiment, the threshold is 5. If the result of the determination is yes, step S310 is performed; otherwise, the process returns to step S307.
步骤S310 将R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值的组合作为背板的颜色:如果上述步骤S309的判断结果为是,则执行本步骤。本步骤中,将R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值的组合作为背板的颜色。Step S310 The combination of the R color component maximum pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value is used as the color of the backboard: if the determination result of the above step S309 is YES, this step is performed. In this step, a combination of the R color component maximum pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value is used as the color of the back plate.
本实施例中,在手势滑动的时候,记录下布局整体滑动过的角度:初始角度为0度,顺时针旋转,其布局整体滑动过的角度增加,逆时针旋转,其布局整体滑动过的角度减小。对于图标来说,每转动270度位置应当复原,也即图标的公转周期是270度;而布局整体的手势角度周期为360度。因此,本实施例采用270与360的最小公倍数10800,作为记录角度的周期,具体请见图3。图3是上述步骤S04进一步细化的流程图,图3中,上述步骤S04进一步包括:In this embodiment, when the gesture is slid, the angle at which the overall layout slides is recorded: the initial angle is 0 degrees, and the clockwise rotation increases the angle at which the overall sliding of the layout increases, counterclockwise rotation, and the overall sliding angle of the layout. Reduced. For the icon, the position of each 270 degrees of rotation should be restored, that is, the revolution period of the icon is 270 degrees; and the overall gesture angle of the layout is 360 degrees. Therefore, this embodiment adopts the least common multiple of 10800 of 270 and 360 as the period of the recording angle, as shown in FIG. 3 . FIG. 3 is a flowchart of further refinement of the above step S04. In FIG. 3, the above step S04 further includes:
步骤S401 初始化角度为10800度:本步骤中,当滑出扇形界面时,记初始化角度为10800度。值得一提的是,扇形界面是个应用,扇形界面要从屏幕角落通过手势唤出,在唤出后,在什么都没做的情况下,角度是10800度。Step S401 The initialization angle is 10800 degrees: In this step, when the fan-shaped interface is slid out, the initialization angle is 10800 degrees. It is worth mentioning that the fan-shaped interface is an application. The fan-shaped interface should be called out from the corner of the screen by gesture. After the call is made, the angle is 10800 degrees without doing anything.
步骤S402 开始手势滑动时,记录手势滑过的角度,当手势顺时针滑动时,图标的当前整体角度增加,当手势逆时针滑动时,图标的当前整体角度减小,图标的当前整体角度为:degree = (degree + 10800) % 10800:本步骤中,当开始手势滑动时,记录手势滑过的角度,当当手势顺时针滑动时,图标的当前整体角度增加,当手势逆时针滑动时,图标的当前整体角度减小,然后对图标的当前整体角度利用公式degree = (degree + 10800) % 10800进行修正,以确保图标的当前整体角度0度到10800度之间。上述公式中,degree为图标的当前整体角度。Step S402 When the gesture is started to slide, the angle at which the gesture slides is recorded. When the gesture slides clockwise, the current overall angle of the icon increases. When the gesture slides counterclockwise, the current overall angle of the icon decreases, and the current overall angle of the icon is: = (degree + 10800) % 10800: In this step, when the gesture is started to slide, the angle at which the gesture slides is recorded. When the gesture slides clockwise, the current overall angle of the icon increases. When the gesture slides counterclockwise, the current overall angle of the icon decreases, and then The current overall angle of the icon uses the formula degree = (degree + 10800) % The 10800 is modified to ensure that the current overall angle of the icon is between 0 and 10800 degrees. In the above formula, degree is the current overall angle of the icon.
步骤S403根据图标的当前整体角度,得到图标的整体布局的相位为phase = degree % 270:本步骤中,根据图标的当前整体角度,得到图标的整体布局的相位为phase = degree % 270,以确保图标的整体布局的相位在0度-270度之间,上式中,phase为图标的整体布局的相位,degree为图标的当前整体角度。Step S403: according to the current overall angle of the icon, the phase of the overall layout of the icon is phase = degree % 270: In this step, according to the current overall angle of the icon, the phase of the overall layout of the icon is phase = degree % 270, to ensure that the phase of the overall layout of the icon is between 0 degrees and 270 degrees. In the above formula, phase is the phase of the overall layout of the icon, and degree is the current overall angle of the icon.
步骤S404根据事先设定的关键帧属性,由图标的整体布局的相位得到图标的当前角度:本步骤中,根据事先设定的关键帧属性,由图标的整体布局的相位得到图标的当前角度,具体来讲,每个图标都有一个固有的关键帧属性,该关键帧属性其实是一组mapping映射[key, value],其中,key为图标的整体布局的相位,value为图标在该整体布局的相位下的角度。Step S404 obtains the current angle of the icon from the phase of the overall layout of the icon according to the key frame attribute set in advance: in this step, according to the key frame attribute set in advance, the current angle of the icon is obtained from the phase of the overall layout of the icon, Specifically, each icon has an intrinsic keyframe property, which is actually a set of mapping mappings [key, Value], where key is the phase of the overall layout of the icon, and value is the angle of the icon under the phase of the overall layout.
本发明提供三屏图标,分别表示“最近打开的应用”、“常用应用”与“快捷开关”,每屏图标最多会有13个。由于不同位置图标的大小不一,本实施例按以下原则排布每组图标的相对位置:第一,把大图标留给有效的应用,把小图标留给占位坑;值得一提的是,图标的大小与其坐标位置有关系,第二,尽可能对称排布。根据上述原则,每屏图标的排布顺序如图4所示。图4中,0-12个图标,每个数字代表一个图标。这些图标的大小是错落不一样的。其中比较大的有0号位、1号位、2号位、3号位、4号位和5号位;其它图标相对较小。三屏图标的布局如图5所示。The present invention provides three screen icons, which respectively represent "recently opened applications", "common applications" and "quick switches", and there are at most 13 icons per screen. Since the icons of different locations are different in size, the present embodiment arranges the relative positions of each group of icons according to the following principles: First, leaving the large icons to the effective application, leaving the small icons to the placeholders; it is worth mentioning that The size of the icon has a relationship with its coordinate position. Second, it is arranged as symmetrically as possible. According to the above principle, the arrangement order of each screen icon is as shown in FIG. 4. In Figure 4, there are 0-12 icons, each of which represents an icon. The size of these icons is different. Among them, there are 0, 1, 2, 3, 4, and 5; the other icons are relatively small. The layout of the three-screen icon is shown in Figure 5.
图5中,A6图标的关键帧为:[0, 45], [90, 135], [180, 315], [270, 45],表明在图标的整体布局的相位为0度时,A6在45度位置;图标的整体布局的相位为90度时,A6图标在135度位置;图标的整体布局的相位为180度时,A6图标在315度位置;图标的整体布局的相位在270度时,由于图标的公转周期是270度,所以也就是回到了原点45度。B6图标的关键帧为:[0, 315], [90, 45], [180, 135], [270,315],而转速比较特殊的A11图标,其关键帧为:[0, 72],[45, 90],[90, 135],[172, 0],[180, 5],[244, 30],[245, 60],[270, 72]。这样,就可以根据图标的当前整体布局的相位,即可由关键帧生成差值器,计算该图标的当前角度。In Figure 5, the keyframes for the A6 icon are: [0, 45], [90, 135], [180, 315], [270, 45], indicating that when the phase of the overall layout of the icon is 0 degrees, A6 is at 45 degrees; when the phase of the overall layout of the icon is 90 degrees, the A6 icon is at 135 degrees; when the overall layout of the icon is 180 degrees The A6 icon is at 315 degrees; when the overall layout of the icon is at 270 degrees, since the icon's revolution period is 270 degrees, it is back to the original 45 degrees. The key frame of the B6 icon is: [0, 315], [90, 45], [180, 135], [270, 315], and the special speed of the A11 icon, the key frames are: [0, 72], [45, 90], [90, 135], [172, 0], [180, 5], [244, 30], [245, 60], [270, 72]. In this way, the difference angle of the key frame can be generated according to the phase of the current overall layout of the icon, and the current angle of the icon can be calculated.
对于本实施例而言,上述步骤S05还可进一步细化,其细化后的流程图如图6所示。图6中,上述步骤S05进一步包括:For the embodiment, the above step S05 can be further refined, and the refined flowchart is as shown in FIG. 6. In Figure 6, the above step S05 further includes:
步骤S501 根据图标的当前角度,计算得到图标的坐标位置:本步骤中,根据图标的当前角度,计算得到图标的坐标位置。本实施例中,所有图标会以屏幕左下角为圆心,排布在如图5所示的四个同心圆上。因此图标的坐标位置公式为:x = 所在同心圆半径 * cos(图标的当前角度);y = 所在同心圆半径 * sin(图标的当前角度),其中,x为图标的横坐标,y为图标的纵坐标。Step S501 According to the current angle of the icon, the coordinate position of the icon is calculated: in this step, the coordinate position of the icon is calculated according to the current angle of the icon. In this embodiment, all icons are centered on the lower left corner of the screen and arranged on four concentric circles as shown in FIG. So the coordinate position formula of the icon is: x = Concentric radius * cos (the current angle of the icon); y = the radius of the concentric circle * sin (the current angle of the icon), where x is the abscissa of the icon and y is the ordinate of the icon.
进一步地,为了取得更好的视觉效果,使得每个图标更紧凑、整体看起来更像一个圆,本实施例在基本坐标位置的基础上,对图标的坐标位置加以矫正。具体请见以下步骤。Further, in order to achieve a better visual effect, each icon is made more compact and the whole looks more like a circle. In this embodiment, the coordinate position of the icon is corrected based on the basic coordinate position. Please see the steps below for details.
步骤S502判断图标的当前角度是否大于90度:本步骤中,判断图标的当前角度是否大于90度,如果判断的结果为是,说明已经划出了可见区域(上一屏或下一屏),,则执行步骤S503;否则,执行步骤S504。Step S502: determining whether the current angle of the icon is greater than 90 degrees: in this step, determining whether the current angle of the icon is greater than 90 degrees, and if the result of the determination is yes, indicating that the visible area (upper screen or next screen) has been drawn, Then, step S503 is performed; otherwise, step S504 is performed.
步骤S503 对图标的坐标位置不做矫正:如果上述步骤S502的判断结果为是,则执行本步骤。本步骤中,对图标的坐标位置不做矫正。Step S503 The coordinate position of the icon is not corrected: if the result of the above step S502 is YES, then this step is performed. In this step, the coordinate position of the icon is not corrected.
步骤S504 判断图标的当前角度是否位于0度到90度之间:如果上述步骤S503的判断结果为否,则执行本步骤。本步骤中,判断图标的当前角度是否位于0度到90度之间,如果判断的结果为是,则执行步骤S505;否则,执行步骤S506。Step S504 It is judged whether the current angle of the icon is between 0 degrees and 90 degrees: if the result of the above step S503 is NO, the step is executed. In this step, it is determined whether the current angle of the icon is between 0 degrees and 90 degrees. If the result of the determination is yes, step S505 is performed; otherwise, step S506 is performed.
步骤S505计算图标的当前角度与45度之间的差值,并根据差值计算图标的坐标位置的偏移量,并使图标的坐标位置按照计算出的偏移量进行偏移:如果上述步骤S504的判断结果为是,则执行本步骤。本步骤中,计算图标的当前角度与45度之间的差值,并根据差值计算图标的坐标位置的偏移量,并使图标的坐标位置按照计算出的偏移量进行偏移。这样,当图标的当前角度位于45度时,不发生任何偏移;当图标的当前角度位于0度到45度之间时,x位置往圆心处收,越靠近0度收得越厉害,也就是越靠近0度,x的负偏移量越大;当图标的当前角度位于45度到90度之间时,y位置往圆心处收,越靠近90度收得越厉害,也就是越靠近90度,y的负偏移量越大。Step S505 calculates a difference between the current angle of the icon and 45 degrees, and calculates an offset of the coordinate position of the icon according to the difference, and offsets the coordinate position of the icon according to the calculated offset: if the above steps If the result of the determination in S504 is YES, the present step is executed. In this step, the difference between the current angle of the icon and 45 degrees is calculated, and the offset of the coordinate position of the icon is calculated according to the difference, and the coordinate position of the icon is offset according to the calculated offset. Thus, when the current angle of the icon is at 45 degrees, no offset occurs; when the current angle of the icon is between 0 degrees and 45 degrees, the x position is received at the center of the circle, and the closer to 0 degrees, the more powerful it is. The closer to 0 degrees, the greater the negative offset of x; when the current angle of the icon is between 45 degrees and 90 degrees, the y position is received at the center of the circle, and the closer to 90 degrees, the more severely, that is, the closer it is. At 90 degrees, the negative offset of y is larger.
另外,本实施例针对四圈图标的每一圈,分别定义一个最大偏移量,表示当图标的当前角度位于0度或90度时的偏移量,将位于0度时的偏移量称为第一设定偏移量,将位于90度时的偏移量称为第二设定偏移量。In addition, the present embodiment defines a maximum offset for each circle of the four-circle icon, indicating an offset when the current angle of the icon is at 0 or 90 degrees, and an offset at 0 degrees. For the first set offset, the offset at 90 degrees is referred to as the second set offset.
步骤S506 判断图标的当前角度是否等于0度:如果上述步骤S504的判断结果为否,则执行本步骤。本步骤中,判断图标的当前角度是否等于0度,如果判断的结果为是,则执行步骤S507;否则,执行步骤S508。Step S506 It is judged whether the current angle of the icon is equal to 0 degrees: if the result of the above step S504 is NO, the present step is executed. In this step, it is determined whether the current angle of the icon is equal to 0 degrees. If the result of the determination is yes, step S507 is performed; otherwise, step S508 is performed.
步骤S507 将图标的坐标位置按照第一设定偏移量进行偏移:如果上述步骤S506的判断结果为是,则执行本步骤。本步骤中,将图标的坐标位置按照第一设定偏移量进行偏移。值得一提的是,第一设定偏移量的大小可根据具体情况进行相应调整。Step S507 The coordinate position of the icon is offset according to the first set offset: if the result of the above step S506 is YES, the step is executed. In this step, the coordinate position of the icon is offset according to the first set offset. It is worth mentioning that the size of the first set offset can be adjusted accordingly.
步骤S508 判断图标的当前角度是否等于90度:如果上述步骤S506的判断结果为否,则执行本步骤。本步骤中,判断图标的当前角度是否等于90度,如果判断的结果为是,则执行步骤S509;否则,返回步骤S503。Step S508 It is judged whether the current angle of the icon is equal to 90 degrees: if the result of the above step S506 is NO, the present step is executed. In this step, it is determined whether the current angle of the icon is equal to 90 degrees. If the result of the determination is yes, step S509 is performed; otherwise, the process returns to step S503.
步骤S509将图标的坐标位置按照第二设定偏移量进行偏移:如果上述步骤S508的判断结果为是,则执行本步骤。本步骤中,将图标的坐标位置按照第二设定偏移量进行偏移。值得一提的是,第二设定偏移量的大小可根据具体情况进行相应调整。Step S509 shifts the coordinate position of the icon according to the second set offset: if the result of the above step S508 is YES, the present step is executed. In this step, the coordinate position of the icon is offset according to the second set offset. It is worth mentioning that the size of the second set offset can be adjusted accordingly.
还包括如下步骤:It also includes the following steps:
步骤S502'判断图标的当前角度是否大于90度:本步骤中,判断图标的当前角度是否大于90度,如果判断的结果为是,说明已经划出了可见区域(上一屏或下一屏),则执行步骤S503';否则,执行步骤S504'。Step S502 ′: determining whether the current angle of the icon is greater than 90 degrees: in this step, determining whether the current angle of the icon is greater than 90 degrees, and if the result of the determination is yes, indicating that the visible area has been drawn (upper screen or next screen) Then, step S503' is performed; otherwise, step S504' is performed.
步骤S503'对图标的大小不做矫正:如果上述步骤S502'的判断结果为是,则执行本步骤。本步骤中,对图标的大小不做矫正。Step S503' does not correct the size of the icon: if the result of the above step S502' is YES, then this step is performed. In this step, the size of the icon is not corrected.
步骤S504'判断图标的当前角度是否位于0度到90度之间:如果上述步骤S502'的判断结果为否,则执行本步骤。本步骤中,判断图标的当前角度是否位于0度到90度之间,如果判断的结果为是,则执行步骤S505';否则,返回步骤S503'。Step S504' determines whether the current angle of the icon is between 0 degrees and 90 degrees: if the result of the above step S502' is negative, the step is performed. In this step, it is determined whether the current angle of the icon is between 0 degrees and 90 degrees. If the result of the determination is yes, then step S505' is performed; otherwise, the process returns to step S503'.
步骤S505'将图标所在的屏划分为第一区域、第二区域和第三区域,并分别设定第一区域、第二区域和第三区域的角度阈值,以及第二区域和第三区域的缩放比例,并将位于对于区域的图标进行相应缩放:如果上述步骤S504'的判断结果为是,则执行本步骤。本步骤中,将图标所在的屏划分为第一区域A、第二区域B和第三区域C(参见图7),并分别设定第一区域A、第二区域B和第三区域C的角度阈值,以及第二区域B和第三区域C的缩放比例,然后由此生成分段差值器,并将位于对应区域的图标进行相应缩放。当图标的当前角度在第一区域A时,对图标不做任何缩放,当图标的当前角度在第二区域B时,图标缓慢缩放;当图标的当前角度在第三区域C时,图标急剧缩放。Step S505' divides the screen in which the icon is located into the first area, the second area, and the third area, and sets an angle threshold of the first area, the second area, and the third area, respectively, and the second area and the third area. The scaling is performed, and the icon located for the area is scaled accordingly: if the result of the above step S504' is YES, then this step is performed. In this step, the screen in which the icon is located is divided into a first area A, a second area B, and a third area C (see FIG. 7), and the first area A, the second area B, and the third area C are respectively set. The angle threshold, and the scaling of the second region B and the third region C, and then generate a segmentation difference, and scale the icons located in the corresponding regions accordingly. When the current angle of the icon is in the first area A, the icon is not scaled. When the current angle of the icon is in the second area B, the icon is slowly zoomed; when the current angle of the icon is in the third area C, the icon is sharply zoomed. .
具体的,本实施例中,以图5中第三圈图标为例,其第一区域A可以认为是15度到75度之间;第二区域B为7度到15度、以及75度到83度之间;第三区域C为0度到7度、以及83度到90度之间。在第一区域A,图标大小始终不变;在第二区域B,图标大小的缩小比例从1缩小到图标的0.8,在第三区域C,图标大小的缩小比例从0.8缩小到0。这样,图标的大小就可以根据实际情况进行相应调整,这样不仅有效的提高了屏幕空间的利用率,而且在有限的面积内展示多个图标。Specifically, in this embodiment, taking the third circle icon in FIG. 5 as an example, the first area A can be considered to be between 15 degrees and 75 degrees; the second area B is 7 degrees to 15 degrees, and 75 degrees to Between 83 degrees; the third region C is between 0 degrees and 7 degrees, and between 83 degrees and 90 degrees. In the first area A, the icon size is always the same; in the second area B, the reduction ratio of the icon size is reduced from 1 to 0.8 of the icon, and in the third area C, the reduction ratio of the icon size is reduced from 0.8 to 0. In this way, the size of the icon can be adjusted according to the actual situation, which not only effectively improves the utilization of the screen space, but also displays multiple icons in a limited area.
本实施例还涉及一种实现上述在安卓设备上进行图标排布的方法的装置,其结构示意图如图7所示。图7中,上述装置包括手势动作判断单元1、数据结构加载单元2、背板图标匹配单元3、图标当前角度计算单元4、位置大小透明度计算单元5和面板开启显示单元6;其中,手势动作判断单元1用于判断在安卓设备的应用界面上的指定区域是否有手势;数据结构加载单元2用于加载三屏图标的数据结构;背板图标匹配单元3用于根据三屏图标的数据结构,分别为每个图标增加相应的背板,并使背板的颜色与图标的颜色相匹配;图标当前角度计算单元4用于根据图标所在屏、初始位置以及跟随手势滑动过的角度,分别计算出每个屏中每个图标的当前角度;位置大小透明度计算单元5用于根据每个图标的当前角度,分别获取每个图标的位置、大小和透明度;面板开启显示单元6用于在安卓设备的应用界面上开启一个面板,并在面板上显示每个图标;上述面板包括三个子面板,每个子面板分别填充不同类型的图标。其屏幕的空间利用率较高、能在有限的面积内展示多个图标。The embodiment further relates to an apparatus for implementing the method for performing icon arrangement on an Android device, and a schematic structural diagram thereof is shown in FIG. 7. In FIG. 7, the above apparatus includes a gesture action determining unit 1, a data structure loading unit 2, a backboard icon matching unit 3, an icon current angle calculating unit 4, a position size transparency calculating unit 5, and a panel open display unit 6; The determining unit 1 is configured to determine whether there is a gesture in the designated area on the application interface of the Android device; the data structure loading unit 2 is configured to load the data structure of the three-screen icon; the backboard icon matching unit 3 is configured to use the data structure of the three-screen icon Adding a corresponding backplane to each icon, and matching the color of the backboard with the color of the icon; the icon current angle calculating unit 4 is configured to calculate respectively according to the screen where the icon is located, the initial position, and the angle swept by the following gesture. The current angle of each icon in each screen; the position size transparency calculation unit 5 is configured to respectively acquire the position, size and transparency of each icon according to the current angle of each icon; the panel open display unit 6 is used in the Android device Open a panel on the application interface and display each icon on the panel; the above panel includes three Sub-panels, each of which is populated with different types of icons. The screen has a high space utilization and can display multiple icons in a limited area.
本实施例中,背板图标匹配单元3进一步包括数组创建模块31、加载采样模块32、像素点遍历模块33、分量平均值计算模块34、最大像素点色值计算模块35、色值判断模块36、颜色空间转换模块37和差值判断模块38;其中,数组创建模块31用于创建最多像素点色值计数数组和平均颜色值数组;最多像素点色值计数数组包括R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素点色值计数数组,平均颜色值数组包括R颜色分量值、G颜色分量值和B颜色分量值;加载采样模块32用于加载应用的图标,对图标不同区域的像素点使用不同的采样率进行采样; 像素点遍历模块33用于遍历每个抽样像素点,分别取得每个抽样像素点的R颜色分量、G颜色分量和B颜色分量,使最多像素点色值计数数组中的R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素值计数数组的计数分别加1,并使平均颜色值数组中的R颜色分量数组、G颜色分量数组和B颜色分量数组分别与每个抽样像素点的R颜色分量、G颜色分量和B颜色分量进行叠加;分量平均值计算模块34用于使平均颜色值数组中的叠加后的R颜色分量值、G颜色分量值和B颜色分量值分别除以抽样像素点的个数,分别得到R颜色分量平均值、G颜色分量平均值和B颜色分量平均值;最大像素点色值计算模块35用于分别计算最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值;色值判断模块36用于判断最多像素点色值计数数组是否存在其像素点个数大于设定个数的色值,如是,对平均颜色值数组和最多像素点色值计数数组进行颜色空间的转换;否则,将R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为所述背板的颜色;颜色空间转换模块37用于将平均颜色值数组中的R颜色分量平均值、G颜色分量平均值和B颜色分量平均值转换到HSV颜色空间,将最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值转换到HSV颜色空间;差值判断模块38用于判断平均颜色值数组的H颜色分量与最多像素点色值计数数组的H颜色分量的差值是否小于阈值,如是,将R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值的组合作为背板的颜色;否则,将R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为背板的颜色。上述设定个数为抽样像素点总数的40%,阈值为5。当然,在本实施例的一些情况下,上述设定个数与阈值的大小可根据具体情况进行相应调整。In this embodiment, the backplane icon matching unit 3 further includes an array creation module 31, a load sampling module 32, a pixel traversal module 33, a component average calculation module 34, a maximum pixel color value calculation module 35, and a color value determination module 36. , the color space conversion module 37 and the difference judgment module 38; wherein, the array creation module 31 is configured to create a maximum pixel point color value count array and an average color value array; the maximum pixel point color value count array includes the R color component maximum pixel point color The value count array, the G color component maximum pixel point color value count array, and the B color component maximum pixel point color value count array, the average color value array includes an R color component value, a G color component value, and a B color component value; the loading sampling module 32 An icon for loading an application, using different sampling rates for sampling pixels in different areas of the icon; The pixel traversal module 33 is configured to traverse each sampled pixel point, respectively obtain the R color component, the G color component, and the B color component of each sampled pixel point, so that the maximum pixel point of the R color component in the maximum pixel point color value count array The color value count array, the G color component maximum pixel point color value count array, and the B color component maximum pixel value count array count are respectively incremented by 1, and the R color component array, the G color component array, and the B color in the average color value array are added. The component arrays are respectively superimposed with the R color component, the G color component, and the B color component of each sampled pixel point; the component average value calculation module 34 is configured to make the superimposed R color component value and the G color component in the average color value array. The value and the B color component value are respectively divided by the number of sampled pixel points, and the R color component average value, the G color component average value, and the B color component average value are respectively obtained; the maximum pixel point color value calculation module 35 is configured to calculate the maximum pixel respectively. The maximum color pixel color value of the R color component in the dot color value count array, the maximum pixel dot color value of the G color component, and the maximum pixel dot color value of the B color component; The determining module 36 is configured to determine whether the maximum pixel point color value count array has a color value whose number of pixel points is greater than a set number, and if so, convert the average color value array and the maximum pixel point color value count array into a color space; Otherwise, the combination of the R color component average, the G color component average, and the B color component average is used as the color of the backboard; the color space conversion module 37 is configured to average the R color components in the average color value array, The average value of the G color component and the average of the B color component are converted to the HSV color space, and the R color component maximum pixel dot color value, the G color component maximum pixel dot color value, and the B color component maximum pixel in the maximum pixel dot color value counting array. The point color value is converted to the HSV color space; the difference determining module 38 is configured to determine whether the difference between the H color component of the average color value array and the H color component of the most pixel color value count array is less than a threshold, and if so, the R color component The combination of the maximum pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value as the color of the back plate; otherwise, R Average color component, G component average value of the color and B color components and an average of color as the backsheet. The above set number is 40% of the total number of sampled pixels, and the threshold is 5. Certainly, in some cases in this embodiment, the number of the above settings and the size of the threshold may be adjusted accordingly according to specific conditions.
本实施例中,图标当前角度计算单元4进一步包括初始化模块41、图标当前整体角度计算模块42、整体布局相位计算模块43和图标当前角度获取模块44;其中,初始化模块41用于初始化角度为10800度;图标当前整体角度计算模块42用于开始手势滑动时,记录手势滑过的角度,当手势顺时针滑动时,图标的当前整体角度增加,当手势逆时针滑动时,图标的当前整体角度减小,图标的当前整体角度为:degree = (degree + 10800) % 10800,其中,degree为图标的当前整体角度;整体布局相位计算模块43用于根据图标的当前整体角度,得到图标的整体布局的相位为phase = degree % 270,其中,phase为图标的整体布局的相位,degree为图标的当前整体角度;图标当前角度获取模块44用于根据事先设定的关键帧属性,由图标的整体布局的相位得到图标的当前角度。In this embodiment, the icon current angle calculation unit 4 further includes an initialization module 41, an icon current overall angle calculation module 42, an overall layout phase calculation module 43, and an icon current angle acquisition module 44; wherein the initialization module 41 is used to initialize the angle to 10800. The icon current overall angle calculation module 42 is used to record the angle at which the gesture slides when the gesture is started to slide. When the gesture slides clockwise, the current overall angle of the icon increases. When the gesture slides counterclockwise, the current overall angle of the icon is decreased. Small, the current overall angle of the icon is: = (degree + 10800) % 10800, wherein degree is the current overall angle of the icon; the overall layout phase calculation module 43 is configured to obtain the phase of the overall layout of the icon according to the current overall angle of the icon as phase = degree % 270, wherein phase is the phase of the overall layout of the icon, and degree is the current overall angle of the icon; the icon current angle obtaining module 44 is configured to obtain the current angle of the icon from the phase of the overall layout of the icon according to the key frame property set in advance. .
本实施例中,位置大小透明度计算单元5进一步包括图标坐标位置计算模块51、第一图标当前角度判断模块52、第二图标当前角度判断模块53、第三图标当前角度判断模块54、第四图标当前角度判断模块55、第五图标当前角度判断模块56和第六图标当前角度判断模块57;其中,图标坐标位置计算模块51用于根据图标的当前角度,计算得到图标的坐标位置;第一图标当前角度判断模块52用于判断图标的当前角度是否大于90度,如是,对图标的坐标位置不做矫正;否则,继续判断图标的当前角度的大小;第二图标当前角度判断模块53用于判断图标的当前角度是否位于0度到90度之间,如是,计算图标的当前角度与45度之间的差值,并根据差值计算图标的坐标位置的偏移量,并使图标的坐标位置按照计算出的偏移量进行偏移;否则,继续判断图标的当前角度的大小;第三图标当前角度判断模块54用于判断图标的当前角度是否等于0度,如是,将图标的坐标位置按照第一设定偏移量进行偏移;否则,继续判断图标的当前角度的大小;第四图标当前角度判断模块55用于判断图标的当前角度是否等于90度,如是,将图标的坐标位置按照第二设定偏移量进行偏移;否则,对图标的坐标位置不做矫正;第五图标当前角度判断模块56用于判断图标的当前角度是否大于90度,如是,对图标的大小不做矫正;否则,继续判断图标的当前角度的大小;第六图标当前角度判断模块57用于判断图标的当前角度是否位于0度到90度之间,如是,将图标所在的屏划分为第一区域、第二区域和第三区域,并分别设定第一区域、第二区域和第三区域的角度阈值,以及第二区域和第三区域的缩放比例,并将位于对应区域的图标进行相应缩放;否则,对图标的大小不做矫正。In this embodiment, the location size transparency calculation unit 5 further includes an icon coordinate position calculation module 51, a first icon current angle determination module 52, a second icon current angle determination module 53, a third icon current angle determination module 54, and a fourth icon. The current angle determining module 55, the fifth icon current angle determining module 56, and the sixth icon current angle determining module 57; wherein the icon coordinate position calculating module 51 is configured to calculate the coordinate position of the icon according to the current angle of the icon; the first icon The current angle determining module 52 is configured to determine whether the current angle of the icon is greater than 90 degrees. If yes, the coordinate position of the icon is not corrected; otherwise, the current angle of the icon is determined; the second icon current angle determining module 53 is used for determining Whether the current angle of the icon is between 0 degrees and 90 degrees, and if so, calculating the difference between the current angle of the icon and 45 degrees, and calculating the offset of the coordinate position of the icon according to the difference, and making the coordinate position of the icon Offset according to the calculated offset; otherwise, continue to determine the size of the current angle of the icon; The third icon current angle determining module 54 is configured to determine whether the current angle of the icon is equal to 0 degrees, and if so, to offset the coordinate position of the icon according to the first set offset; otherwise, continue to determine the current angle of the icon; The fourth icon current angle determining module 55 is configured to determine whether the current angle of the icon is equal to 90 degrees. If yes, the coordinate position of the icon is offset according to the second set offset; otherwise, the coordinate position of the icon is not corrected; The fifth icon current angle determining module 56 is configured to determine whether the current angle of the icon is greater than 90 degrees. If yes, the size of the icon is not corrected; otherwise, the size of the current angle of the icon is continuously determined; and the sixth icon is used by the current angle determining module 57. Determining whether the current angle of the icon is between 0 degrees and 90 degrees, and if so, dividing the screen where the icon is located into the first area, the second area, and the third area, and setting the first area, the second area, and the first The angle threshold of the three regions, and the scaling of the second region and the third region, and the icons located in the corresponding regions are scaled accordingly; otherwise, The size of the icon is not corrected.
总之,在本实施例中,实现了在安卓设备上任意应用的右下角可以通过手势开启一个面板,并在面板上显示类似大小错落的图标。通过为应用图标加上彩色背板,使之看上去整齐、且与原图标颜色统一。另外,通过定义图标的排布和运动轨迹,使之有气泡感。在提高屏幕空间利用率的同时,增强了用户的体验。In summary, in this embodiment, it is implemented that a panel can be opened by a gesture in the lower right corner of an arbitrary application on the Android device, and an icon of similar size is displayed on the panel. By adding a color back panel to the app icon, it looks neat and uniform with the original icon color. In addition, by defining the arrangement of the icons and the trajectory of the movement, it has a sense of bubble. Enhance the user experience while increasing screen space utilization.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., which are included in the spirit and scope of the present invention, should be included in the present invention. Within the scope of protection.

Claims (10)

  1. 一种在安卓设备上进行图标排布的方法,其特征在于,包括如下步骤: A method for performing icon arrangement on an Android device, comprising the steps of:
    A)判断在所述安卓设备的应用界面上的指定区域是否有手势,如是,执行步骤B);否则,继续进行本步骤的判断;A) determining whether there is a gesture in the designated area on the application interface of the Android device, and if yes, performing step B); otherwise, proceeding to determine the step;
    B)加载三屏图标的数据结构;B) loading the data structure of the three-screen icon;
    C)根据所述三屏图标的数据结构,分别为每个图标增加相应的背板,并使所述背板的颜色与所述图标的颜色相匹配;C) according to the data structure of the three-screen icon, respectively adding a corresponding backplane for each icon, and matching the color of the backboard with the color of the icon;
    D)根据所述图标所在屏、初始位置以及跟随所述手势滑动过的角度,分别计算出每个屏中每个所述图标的当前角度;D) calculating a current angle of each of the icons in each screen according to a screen on which the icon is located, an initial position, and an angle swept by the gesture;
    E)根据每个所述图标的当前角度,分别获取每个所述图标的位置、大小和透明度;E) obtaining the position, size and transparency of each of the icons according to the current angle of each of the icons;
    F)在所述安卓设备的应用界面上开启一个面板,并在所述面板上显示每个所述图标;所述面板包括三个子面板,每个子面板分别填充不同类型的图标。F) opening a panel on the application interface of the Android device, and displaying each of the icons on the panel; the panel includes three sub-panels, each of which is filled with different types of icons.
  2. 根据权利要求1所述的在安卓设备上进行图标排布的方法,其特征在于, 所述步骤C)进一步包括:The method for performing icon arrangement on an Android device according to claim 1, wherein the step C) further comprises:
    C1)创建最多像素点色值计数数组和平均颜色值数组;所述最多像素点色值计数数组包括R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素点色值计数数组,所述平均颜色值数组包括R颜色分量值、G颜色分量值和B颜色分量值;C1) creating a maximum pixel point color value count array and an average color value array; the maximum pixel point color value count array includes an R color component maximum pixel point color value count array, a G color component maximum pixel point color value count array, and a B color a component maximum pixel point color value count array, the average color value array comprising an R color component value, a G color component value, and a B color component value;
    C2)加载应用的图标,对所述图标不同区域的像素点使用不同的采样率进行采样; C2) loading an icon of the application, and sampling pixels of different areas of the icon using different sampling rates;
    C3)遍历每个抽样像素点,分别取得每个所述抽样像素点的R颜色分量、G颜色分量和B颜色分量,使所述最多像素点色值计数数组中的R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素值计数数组的计数分别加1,并使所述平均颜色值数组中的R颜色分量数组、G颜色分量数组和B颜色分量数组分别与每个抽样像素点的R颜色分量、G颜色分量和B颜色分量进行叠加;C3) traversing each sampled pixel point, respectively obtaining an R color component, a G color component, and a B color component of each of the sampled pixel points, so that the maximum color pixel color of the R color component in the maximum pixel color value count array The count of the value count array, the G color component maximum pixel point color value count array, and the B color component maximum pixel value count array are respectively incremented by 1, and the R color component array, the G color component array, and the B in the average color value array are added. The color component array is superimposed with the R color component, the G color component, and the B color component of each sampled pixel;
    C4)使所述平均颜色值数组中的叠加后的R颜色分量值、G颜色分量值和B颜色分量值分别除以所述抽样像素点的个数,分别得到R颜色分量平均值、G颜色分量平均值和B颜色分量平均值;C4) dividing the superimposed R color component value, G color component value, and B color component value in the average color value array by the number of the sampled pixel points, respectively, and obtaining the R color component average value and the G color respectively. Average value of component and B color component;
    C5)分别计算所述最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值;C5) respectively calculating an R color component maximum pixel point color value, a G color component maximum pixel point color value, and a B color component maximum pixel point color value in the maximum pixel point color value count array;
    C6)判断所述最多像素点色值计数数组是否存在其像素点个数大于设定个数的色值,如是,执行步骤C7);否则,将所述R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为所述背板的颜色;C6) determining whether the maximum pixel point color value count array has a color value whose number of pixel points is greater than a set number, and if so, performing step C7); otherwise, averaging the R color component average value and the G color component a combination of the value and the average of the B color components as the color of the back panel;
    C7)将所述平均颜色值数组中的R颜色分量平均值、G颜色分量平均值和B颜色分量平均值转换到HSV颜色空间,将所述最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值转换到HSV颜色空间;C7) converting the R color component average value, the G color component average value, and the B color component average value in the average color value array to the HSV color space, and maximizing the R color component in the most pixel color value count array The pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value are converted to the HSV color space;
    C8)判断所述平均颜色值数组的H颜色分量与所述最多像素点色值计数数组的H颜色分量的差值是否小于阈值,如是,将所述R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值的组合作为所述背板的颜色;否则,将所述R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为所述背板的颜色。C8) determining whether a difference between the H color component of the average color value array and the H color component of the most pixel color value count array is less than a threshold, and if so, the R color component maximum pixel color value, G color a combination of a component maximum pixel point color value and a B color component maximum pixel point color value as a color of the backboard; otherwise, a combination of the R color component average value, the G color component average value, and the B color component average value is taken as The color of the back panel.
  3. 根据权利要求1或2所述的在安卓设备上进行图标排布的方法,其特征在于,所述步骤D)进一步包括:The method for performing icon arrangement on an Android device according to claim 1 or 2, wherein the step D) further comprises:
    D1)初始化角度为10800度;D1) The initialization angle is 10800 degrees;
    D2)开始手势滑动时,记录所述手势滑过的角度,当所述手势顺时针滑动时,图标的当前整体角度增加,当所述手势逆时针滑动时,所述图标的当前整体角度减小,所述图标的当前整体角度为:degree = (degree + 10800) % 10800,其中,degree为图标的当前整体角度;D2) when starting the gesture sliding, recording the angle at which the gesture slides, when the gesture slides clockwise, the current overall angle of the icon increases, and when the gesture slides counterclockwise, the current overall angle of the icon decreases , the current overall angle of the icon is: = (degree + 10800) % 10800, where degree is the current overall angle of the icon;
    D3)根据所述图标的当前整体角度,得到所述图标的整体布局的相位为phase = degree % 270,其中,phase为图标的整体布局的相位,degree为图标的当前整体角度;D3) according to the current overall angle of the icon, the phase of the overall layout of the icon is obtained as phase = degree % 270, wherein phase is the phase of the overall layout of the icon, and degree is the current overall angle of the icon;
    D4)根据事先设定的关键帧属性,由所述图标的整体布局的相位得到所述图标的当前角度。D4) The current angle of the icon is obtained from the phase of the overall layout of the icon according to a key frame property set in advance.
  4. 根据权利要求3所述的在安卓设备上进行图标排布的方法,其特征在于, 所述步骤E)进一步包括:The method for performing icon arrangement on an Android device according to claim 3, wherein the step E) further comprises:
    E1)根据所述图标的当前角度,计算得到所述图标的坐标位置;E1) calculating a coordinate position of the icon according to a current angle of the icon;
    E2)判断所述图标的当前角度是否大于90度,如是,对所述图标的坐标位置不做矫正;否则,执行步骤E3);E2) determining whether the current angle of the icon is greater than 90 degrees, if not, correcting the coordinate position of the icon; otherwise, performing step E3);
    E3)判断所述图标的当前角度是否位于0度到90度之间,如是,计算所述图标的当前角度与45度之间的差值,并根据所述差值计算所述图标的坐标位置的偏移量,并使所述图标的坐标位置按照计算出的所述偏移量进行偏移;否则,执行步骤E4);E3) determining whether the current angle of the icon is between 0 degrees and 90 degrees, and if so, calculating a difference between the current angle of the icon and 45 degrees, and calculating a coordinate position of the icon according to the difference Offset, and the coordinate position of the icon is offset according to the calculated offset; otherwise, step E4) is performed;
    E4)判断所述图标的当前角度是否等于0度,如是,将所述图标的坐标位置按照第一设定偏移量进行偏移;否则,执行步骤E5);E4) determining whether the current angle of the icon is equal to 0 degrees, and if so, shifting the coordinate position of the icon according to the first set offset; otherwise, performing step E5);
    E5)判断所述图标的当前角度是否等于90度,如是,将所述图标的坐标位置按照第二设定偏移量进行偏移;否则,对所述图标的坐标位置不做矫正;还包括:E5) determining whether the current angle of the icon is equal to 90 degrees, and if so, shifting the coordinate position of the icon according to the second set offset; otherwise, correcting the coordinate position of the icon; :
    E2')判断所述图标的当前角度是否大于90度,如是,对所述图标的大小不做矫正;否则,执行步骤E3');E2') determining whether the current angle of the icon is greater than 90 degrees, if not, correcting the size of the icon; otherwise, performing step E3');
    E3')判断所述图标的当前角度是否位于0度到90度之间,如是,将所述图标所在的屏划分为第一区域、第二区域和第三区域,并分别设定所述第一区域、第二区域和第三区域的角度阈值,以及所述第二区域和第三区域的缩放比例,并将位于对应区域的图标进行相应缩放;否则,对所述图标的大小不做矫正。E3') determining whether the current angle of the icon is between 0 degrees and 90 degrees, and if so, dividing the screen in which the icon is located into the first area, the second area, and the third area, and setting the first An angle threshold of a region, a second region, and a third region, and a scaling ratio of the second region and the third region, and correspondingly scaling an icon located in the corresponding region; otherwise, correcting the size of the icon .
  5. 根据权利要求2所述的在安卓设备上进行图标排布的方法,其特征在于,所述设定个数为抽样像素点总数的40%,所述阈值为5。 The method for performing icon arrangement on an Android device according to claim 2, wherein the set number is 40% of the total number of sampled pixels, and the threshold is 5.
  6. 一种实现如权利要求1所述的在安卓设备上进行图标排布的方法的装置,其特征在于,包括:An apparatus for implementing the method for performing icon arrangement on an Android device according to claim 1, comprising:
    手势动作判断单元:用于判断在所述安卓设备的应用界面上的指定区域是否有手势;a gesture action determining unit: configured to determine whether a specified area on the application interface of the Android device has a gesture;
    数据结构加载单元:用于加载三屏图标的数据结构;Data structure loading unit: a data structure for loading a three-screen icon;
    背板图标匹配单元:用于根据所述三屏图标的数据结构,分别为每个图标增加相应的背板,并使所述背板的颜色与所述图标的颜色相匹配;a backplane icon matching unit: configured to add a corresponding backplane to each icon according to the data structure of the three-screen icon, and match a color of the backboard with a color of the icon;
    图标当前角度计算单元:用于根据所述图标所在屏、初始位置以及跟随所述手势滑动过的角度,分别计算出每个屏中每个所述图标的当前角度;An icon current angle calculation unit: configured to calculate a current angle of each of the icons in each screen according to a screen on which the icon is located, an initial position, and an angle that follows the gesture;
    位置大小透明度计算单元:用于根据每个所述图标的当前角度,分别获取每个所述图标的位置、大小和透明度;a position size transparency calculation unit: configured to respectively acquire a position, a size, and a transparency of each of the icons according to a current angle of each of the icons;
    面板开启显示单元:用于在所述安卓设备的应用界面上开启一个面板,并在所述面板上显示每个所述图标;所述面板包括三个子面板,每个子面板分别填充不同类型的图标。a panel open display unit: configured to open a panel on an application interface of the Android device, and display each of the icons on the panel; the panel includes three sub-panels, each sub-panel respectively filling different types of icons .
  7. 根据权利要求6所述的装置,其特征在于,所述背板图标匹配单元进一步包括:The apparatus according to claim 6, wherein the backplane icon matching unit further comprises:
    数组创建模块:用于创建最多像素点色值计数数组和平均颜色值数组;所述最多像素点色值计数数组包括R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素点色值计数数组,所述平均颜色值数组包括R颜色分量值、G颜色分量值和B颜色分量值;Array creation module: used to create a maximum pixel color value count array and an average color value array; the maximum pixel color value count array includes an R color component maximum pixel point color value count array, a G color component maximum pixel point color value count Array and B color component maximum pixel point color value count array, the average color value array including R color component value, G color component value, and B color component value;
    加载采样模块:用于加载应用的图标,对所述图标不同区域的像素点使用不同的采样率进行采样; Loading sampling module: an icon for loading an application, and sampling pixels of different areas of the icon using different sampling rates;
    像素点遍历模块:用于遍历每个抽样像素点,分别取得每个所述抽样像素点的R颜色分量、G颜色分量和B颜色分量,使所述最多像素点色值计数数组中的R颜色分量最大像素点色值计数数组、G颜色分量最大像素点色值计数数组和B颜色分量最大像素值计数数组的计数分别加1,并使所述平均颜色值数组中的R颜色分量数组、G颜色分量数组和B颜色分量数组分别与每个抽样像素点的R颜色分量、G颜色分量和B颜色分量进行叠加;a pixel traversal module: traversing each sample pixel, respectively obtaining an R color component, a G color component, and a B color component of each of the sampled pixel points, so that the maximum color of the pixel value in the array is counted The component maximum pixel dot color value count array, the G color component maximum pixel dot color value count array, and the B color component maximum pixel value count array are incremented by 1, respectively, and the R color component array in the average color value array, G The color component array and the B color component array are respectively superimposed with the R color component, the G color component, and the B color component of each sample pixel;
    分量平均值计算模块:用于使所述平均颜色值数组中的叠加后的R颜色分量值、G颜色分量值和B颜色分量值分别除以所述抽样像素点的个数,分别得到R颜色分量平均值、G颜色分量平均值和B颜色分量平均值;a component average calculation module: configured to respectively divide the superimposed R color component value, G color component value, and B color component value in the average color value array by the number of the sampled pixel points, respectively, to obtain an R color Component average, G color component average, and B color component average;
    最大像素点色值计算模块:用于分别计算所述最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值;a maximum pixel point color value calculation module: configured to respectively calculate an R color component maximum pixel point color value, a G color component maximum pixel point color value, and a B color component maximum pixel point color value in the maximum pixel point color value count array;
    色值判断模块:用于判断所述最多像素点色值计数数组是否存在其像素点个数大于设定个数的色值,如是,对所述平均颜色值数组和最多像素点色值计数数组进行颜色空间的转换;否则,将所述R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为所述背板的颜色;The color value judging module is configured to determine whether the maximum pixel color value count array has a color value whose number of pixel points is greater than a set number, and if so, the average color value array and the maximum pixel color value count array Performing conversion of color space; otherwise, combining the R color component average, the G color component average, and the B color component average as the color of the backboard;
    颜色空间转换模块:用于将所述平均颜色值数组中的R颜色分量平均值、G颜色分量平均值和B颜色分量平均值转换到HSV颜色空间,将所述最多像素点色值计数数组中的R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值转换到HSV颜色空间;a color space conversion module: configured to convert an R color component average value, a G color component average value, and a B color component average value in the average color value array into an HSV color space, and calculate the maximum pixel color value in an array The R color component maximum pixel point color value, the G color component maximum pixel point color value, and the B color component maximum pixel point color value are converted to the HSV color space;
    差值判断模块:用于判断所述平均颜色值数组的H颜色分量与所述最多像素点色值计数数组的H颜色分量的差值是否小于阈值,如是,将所述R颜色分量最大像素点色值、G颜色分量最大像素点色值和B颜色分量最大像素点色值的组合作为所述背板的颜色;否则,将所述R颜色分量平均值、G颜色分量平均值和B颜色分量平均值的组合作为所述背板的颜色。a difference judging module: configured to determine whether a difference between an H color component of the average color value array and an H color component of the most pixel color value count array is less than a threshold, and if so, the R color component maximum pixel point a combination of a color value, a G color component maximum pixel point color value, and a B color component maximum pixel point color value as a color of the back sheet; otherwise, the R color component average value, the G color component average value, and the B color component The combination of the average values is used as the color of the back sheet.
  8. 根据权利要求6或7所述的装置,其特征在于,所述图标当前角度计算单元进一步包括:The device according to claim 6 or 7, wherein the icon current angle calculation unit further comprises:
    初始化模块:用于初始化角度为10800度;Initialization module: used for initialization angle of 10800 degrees;
    图标当前整体角度计算模块:用于开始手势滑动时,记录所述手势滑过的角度,当所述手势顺时针滑动时,图标的当前整体角度增加,当所述手势逆时针滑动时,所述图标的当前整体角度减小,所述图标的当前整体角度为:degree = (degree + 10800) % 10800,其中,degree为图标的当前整体角度;Icon current overall angle calculation module: for starting a gesture slide, recording an angle at which the gesture slides, when the gesture slides clockwise, the current overall angle of the icon increases, when the gesture slides counterclockwise, The current overall angle of the icon is reduced, and the current overall angle of the icon is: = (degree + 10800) % 10800, where degree is the current overall angle of the icon;
    整体布局相位计算模块:用于根据所述图标的当前整体角度,得到所述图标的整体布局的相位为phase = degree % 270,其中,phase为图标的整体布局的相位,degree为图标的当前整体角度;An overall layout phase calculation module: configured to obtain a phase of the overall layout of the icon according to the current overall angle of the icon as phase = degree % 270, wherein phase is the phase of the overall layout of the icon, and degree is the current overall angle of the icon;
    图标当前角度获取模块:用于根据事先设定的关键帧属性,由所述图标的整体布局的相位得到所述图标的当前角度。Icon current angle acquisition module: used to obtain the current angle of the icon from the phase of the overall layout of the icon according to a key frame property set in advance.
  9. 根据权利要求8所述的装置,其特征在于,所述位置大小透明度计算单元进一步包括:The device according to claim 8, wherein the location size transparency calculation unit further comprises:
    图标坐标位置计算模块:用于根据所述图标的当前角度,计算得到所述图标的坐标位置;An icon coordinate position calculation module: configured to calculate a coordinate position of the icon according to a current angle of the icon;
    第一图标当前角度判断模块:用于判断所述图标的当前角度是否大于90度,如是,对所述图标的坐标位置不做矫正;否则,继续判断所述图标的当前角度的大小;The first icon current angle determining module is configured to determine whether the current angle of the icon is greater than 90 degrees, and if not, correct the coordinate position of the icon; otherwise, continue to determine the current angle of the icon;
    第二图标当前角度判断模块:用于判断所述图标的当前角度是否位于0度到90度之间,如是,计算所述图标的当前角度与45度之间的差值,并根据所述差值计算所述图标的坐标位置的偏移量,并使所述图标的坐标位置按照计算出的所述偏移量进行偏移;否则,继续判断所述图标的当前角度的大小;a second icon current angle determining module: configured to determine whether a current angle of the icon is between 0 degrees and 90 degrees, and if so, calculating a difference between a current angle of the icon and 45 degrees, and according to the difference Calculating an offset of the coordinate position of the icon, and causing the coordinate position of the icon to be offset according to the calculated offset; otherwise, continuing to determine the size of the current angle of the icon;
    第三图标当前角度判断模块:用于判断所述图标的当前角度是否等于0度,如是,将所述图标的坐标位置按照第一设定偏移量进行偏移;否则,继续判断所述图标的当前角度的大小;a third icon current angle determining module: configured to determine whether the current angle of the icon is equal to 0 degrees, and if so, to offset the coordinate position of the icon according to the first set offset; otherwise, continue to determine the icon The size of the current angle;
    第四图标当前角度判断模块:用于判断所述图标的当前角度是否等于90度,如是,将所述图标的坐标位置按照第二设定偏移量进行偏移;否则,对所述图标的坐标位置不做矫正;还包括:a fourth icon current angle determining module: configured to determine whether a current angle of the icon is equal to 90 degrees, and if so, shifting a coordinate position of the icon according to a second set offset; otherwise, the icon is The coordinate position is not corrected; it also includes:
    第五图标当前角度判断模块:用于判断所述图标的当前角度是否大于90度,如是,对所述图标的大小不做矫正;否则,继续判断所述图标的当前角度的大小;The fifth icon current angle determining module is configured to determine whether the current angle of the icon is greater than 90 degrees, and if so, correct the size of the icon; otherwise, continue to determine the current angle of the icon;
    第六图标当前角度判断模块:用于判断所述图标的当前角度是否位于0度到90度之间,如是,将所述图标所在的屏划分为第一区域、第二区域和第三区域,并分别设定所述第一区域、第二区域和第三区域的角度阈值,以及所述第二区域和第三区域的缩放比例,并将位于对应区域的图标进行相应缩放;否则,对所述图标的大小不做矫正。a sixth icon current angle determining module: configured to determine whether the current angle of the icon is between 0 degrees and 90 degrees, and if yes, dividing the screen where the icon is located into the first area, the second area, and the third area, And respectively setting an angle threshold of the first area, the second area, and the third area, and a scaling ratio of the second area and the third area, and respectively scaling an icon located in the corresponding area; otherwise, The size of the icon is not corrected.
  10. 根据权利要求7所述的装置,其特征在于,所述设定个数为抽样像素点总数的40%,所述阈值为5。The apparatus according to claim 7, wherein said set number is 40% of a total number of sampled pixel points, said threshold being 5.
PCT/CN2015/090156 2015-09-21 2015-09-21 Method and device for arranging icons on an android device WO2017049436A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201580006079.1A CN105960631B (en) 2015-09-21 2015-09-21 A kind of method and device carrying out icon arrangement in Android device
PCT/CN2015/090156 WO2017049436A1 (en) 2015-09-21 2015-09-21 Method and device for arranging icons on an android device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/090156 WO2017049436A1 (en) 2015-09-21 2015-09-21 Method and device for arranging icons on an android device

Publications (1)

Publication Number Publication Date
WO2017049436A1 true WO2017049436A1 (en) 2017-03-30

Family

ID=56917964

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/090156 WO2017049436A1 (en) 2015-09-21 2015-09-21 Method and device for arranging icons on an android device

Country Status (2)

Country Link
CN (1) CN105960631B (en)
WO (1) WO2017049436A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637667A (en) * 2020-12-30 2021-04-09 上海铼锶信息技术有限公司 Progress bar display method and intelligent electronic equipment

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109976602A (en) * 2017-12-28 2019-07-05 浙江德景电子科技有限公司 A kind of method that android terminal application returns and switches
CN109683758B (en) * 2018-12-13 2021-05-07 惠州Tcl移动通信有限公司 Application icon display method and device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101114224A (en) * 2006-07-24 2008-01-30 三星电子株式会社 User interface device with rotatable ring type menu
CN103150094A (en) * 2011-12-06 2013-06-12 现代自动车株式会社 Method and apparatus of controlling division screen interlocking display using dynamic touch interaction
CN103324435A (en) * 2013-05-24 2013-09-25 华为技术有限公司 Multi-screen display method and device and electronic device thereof
CN104407782A (en) * 2014-12-11 2015-03-11 张蜀军 Menu display method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8799811B2 (en) * 2008-08-22 2014-08-05 Siemens Aktiengesellschaft Method and apparatus for displaying medical thumbnail objects in a browsing component
US9058186B2 (en) * 2010-04-07 2015-06-16 Apple Inc. Device, method, and graphical user interface for managing concurrently open software applications

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101114224A (en) * 2006-07-24 2008-01-30 三星电子株式会社 User interface device with rotatable ring type menu
CN103150094A (en) * 2011-12-06 2013-06-12 现代自动车株式会社 Method and apparatus of controlling division screen interlocking display using dynamic touch interaction
CN103324435A (en) * 2013-05-24 2013-09-25 华为技术有限公司 Multi-screen display method and device and electronic device thereof
CN104407782A (en) * 2014-12-11 2015-03-11 张蜀军 Menu display method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637667A (en) * 2020-12-30 2021-04-09 上海铼锶信息技术有限公司 Progress bar display method and intelligent electronic equipment

Also Published As

Publication number Publication date
CN105960631A (en) 2016-09-21
CN105960631B (en) 2019-09-13

Similar Documents

Publication Publication Date Title
WO2019199139A1 (en) Display including plurality of wirings bypassing hole area encompassed by display area, and electronic device including same
WO2014104472A1 (en) Method and apparatus for dual display
WO2017049436A1 (en) Method and device for arranging icons on an android device
WO2014116014A1 (en) Transparent display apparatus and method thereof
WO2013083055A1 (en) Image processing method and system
WO2015122566A1 (en) Head mounted display device for displaying augmented reality image capture guide and control method for the same
EP2791760A1 (en) Display apparatus and method of changing screen mode using the same
WO2017096924A1 (en) Method of capturing continuous screenshot of pages on basis of mobile terminal, system and mobile terminal
WO2018155824A1 (en) Display apparatus and control method thereof
WO2013013484A1 (en) An image synthesis method and system using alpha channel
WO2014014242A1 (en) Method and apparatus for moving object in mobile terminal
WO2018176561A1 (en) Liquid crystal panel drive circuit, and liquid crystal display device
WO2015020496A1 (en) Device for providing user interface for video editing, and providing method thereof and recording medium
WO2020009404A1 (en) Electronic apparatus and method for controlling thereof
WO2016099186A1 (en) Display apparatus and controlling method
WO2013149545A1 (en) Demonstration document viewing method and system thereof for mobile device
WO2017088485A1 (en) Optimization processing method for smooth display of circular pattern, system, and smart device
WO2016095362A1 (en) Display terminal and displaying method for screen thereof
WO2012034469A1 (en) Gesture-based human-computer interaction method and system, and computer storage media
WO2014117655A1 (en) Click operation structure of touch screen
WO2018152932A1 (en) Flexible display panel and display method thereof
WO2020138630A1 (en) Display apparatus and image processing method thereof
WO2016065675A1 (en) Curved-surface display panel and curved-surface display apparatus
WO2021118267A1 (en) Electronic device and control method thereof
JP3483469B2 (en) Display device, image display method, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15904324

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15904324

Country of ref document: EP

Kind code of ref document: A1