WO2018145536A1 - Method and device for adapting application notification color in android system and computing equipment - Google Patents

Method and device for adapting application notification color in android system and computing equipment Download PDF

Info

Publication number
WO2018145536A1
WO2018145536A1 PCT/CN2017/120192 CN2017120192W WO2018145536A1 WO 2018145536 A1 WO2018145536 A1 WO 2018145536A1 CN 2017120192 W CN2017120192 W CN 2017120192W WO 2018145536 A1 WO2018145536 A1 WO 2018145536A1
Authority
WO
WIPO (PCT)
Prior art keywords
color
font
notification
style
default
Prior art date
Application number
PCT/CN2017/120192
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 广州优视网络科技有限公司
Publication of WO2018145536A1 publication Critical patent/WO2018145536A1/en

Links

Images

Classifications

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

Definitions

  • notifications from devices with Android (Andriod) systems mainly include system default notifications and application notifications.
  • the default notification of the system is customized by the manufacturer.
  • the layout, color background, and font color of the notification are well defined by the system, so the Android device can display the system default notification normally.
  • the application notification is a custom notification issued by an application (APP) installed in the system, and the background color and font color of the notification are set by the application.
  • APP application
  • the manufacturer may prohibit the application installed on the Android system from modifying the notification color when popping up the notification, for example, the background color is prohibited from being modified. Therefore, if the font color of the application notification is close to the background color of the system default notification, the user may not be able to view it. Clear the content of the application notification, affecting the user experience.
  • the default notification color of the Android phone A system is black on white, and restricts other APP pop-up application notifications to modify its background color. If the color of the notification sent by the application B installed on the Android phone A is white on a black background, since the system prohibits the application from notifying the custom background color, the application notification displayed to the user is white on a white background, and the user cannot see the notification of the application. content.
  • the main objective of the present invention is to provide a method, an apparatus, and a computing device for an application notification adaptation color in an Android system, which can obtain a system default font or a background color by constructing a system default notification, thereby notifying the configuration phase of the application. Adapt to the color scheme so that the content of the app notification can be recognized by the user.
  • the system default notification to obtain the default font or background color of the system, it is possible to configure an appropriate color matching style for the application notification to avoid the problem of notification background and font mismatch caused by the system prohibiting the application from modifying the notification color.
  • the method further comprises the steps of:
  • the color matching style that matches the color of the font is selected as the default color matching style for the application notification.
  • obtaining the default font color of the system may include: obtaining a default title text color of the system as a system default font color.
  • obtaining a default title text color of the system as a system default font color.
  • the specific system is selected to notify the color matching style as the default color matching style of the application notification.
  • the most suitable color matching can be selected as the default color matching style of the application notification when the system has multiple color matching styles.
  • the similarity described above can be determined by the distance within the color space.
  • selecting a color matching style that matches the font or background color comprises:
  • a color matching style that is the same as or similar to the color matching sample is selected; otherwise, a color matching style different from the color matching sample is selected.
  • the color matching style selected to match the font or background color includes:
  • diff is the color difference between the font or background color and pure black
  • diff_max is the color difference between pure black and pure white
  • the font color is determined to be similar to pure black when s is greater than 0.5.
  • an apparatus for adapting an application notification color under an Android system includes: a system color acquisition unit configured to construct a system default notification to obtain a system default font or background color; and an application color selection The unit is used to select the color matching style that matches the font or background color as the default color matching style for the app notification.
  • the application color matching unit is used to:
  • the color matching style that matches the color of the font is selected as the default color matching style for the application notification.
  • the system color acquisition unit obtains the default title text color of the system as the default font color of the system.
  • the application color selection unit is used for:
  • the specific system is selected to notify the color matching style as the default color matching style of the application notification.
  • the same or similar is determined by the font or background color being notified by a particular system of the font of the color matching style or the distance of the background color within the color space.
  • the application color matching unit is used to:
  • a color matching style that is the same as or similar to the color matching sample is selected; otherwise, a color matching style different from the color matching sample is selected.
  • the application color matching unit is used to:
  • diff is the color difference between the font or background color and pure black
  • diff_max is the color difference between pure black and pure white
  • a computing device comprising: a memory for storing information; a processor coupled to the memory for constructing a system default notification to obtain a system default font or background color from the memory; Select the color style that matches the font or background color from the memory as the default color style for the app notification.
  • the processor is further configured to:
  • the color matching style that matches the color of the font is selected as the default color matching style for the application notification.
  • the processor is further configured to:
  • the processor is further configured to:
  • the specific system is selected to notify the color matching style as the default color matching style of the application notification.
  • the processor is further configured to determine the same or similar by the font or background color and the distance of the font or background color of the color matching style in the color space by the particular system.
  • the processor is further configured to:
  • a color matching style that is the same as or similar to the color matching sample is selected; otherwise, a color matching style different from the color matching sample is selected.
  • the processor is also configured to:
  • the processor is also configured to:
  • diff is the color difference between the font or background color and pure black
  • diff_max is the color difference between pure black and pure white
  • an embodiment of the present invention further provides a computer readable storage medium carrying one or more computer instruction programs, where the computer instruction program is executed by one or more processors, the one or The plurality of processors perform the method of adapting the application notification color under the Android system described above.
  • the method, device and computing device for adapting the application notification color in the Android system of the present invention can obtain the default color matching style as the default color matching style of the application by constructing a default notification to obtain the default font or background color of the system, thereby avoiding The system prohibits the notification background and font mismatch caused by modifying the notification color, ensuring the user experience and ensuring that the related services corresponding to the application notification can run normally.
  • FIG. 1 shows a functional block diagram of a computing device in accordance with an embodiment of the present invention.
  • FIG. 2 is a flow chart showing a method of adapting an application notification color in an Android system according to the present invention.
  • FIG. 3 is a functional block diagram of an apparatus for adapting an application notification color under an Android system in accordance with the present invention.
  • the manufacturer may prohibit the application installed on the Android system from modifying the notification color when popping the notification, for example, prohibiting the application from modifying the notification background color, the background color and application of the system default notification are replaced instead of the display.
  • the font color of the notification is close, the user cannot see the content of the application notification, thereby affecting the user experience.
  • the memory 110 is used to store information, which may include color combinations of system default notifications, such as fonts and corresponding background colors.
  • the default font color of the system can be, for example, black, and the background color is white.
  • a plurality of colors of any color space or color gamut can also be stored in the memory 110.
  • the processor 120 can construct a system default notification to retrieve the system default font or background color from the memory 110.
  • the processor may include a notification construction unit that may generate a system default notification to obtain a layout file ID of the default notification, and the processor may further include a layout generation unit that may generate a layout corresponding to the obtained layout The view container of the file ID, and then traverse the child controls of the view container to get the font color or background color of the system default notification.
  • the processor 120 can also select a color matching style corresponding to the font or the background color from the memory 110 as the default color matching style of the application notification. For example, when the font color of the acquired system default notification is black, black is selected from the memory 110 as the font color of the application notification. Or when the default background color of the obtained system is white, a color such as black which is significantly different from white is selected from the memory as the font color of the application notification, so that the font color of the application notification does not conflict with the default background color of the system. For user identification.
  • the font color of the application notification can be adapted to the system default background color, and the font color of the pop-up application notification is significantly different from the background color of the system default notification, so that the user can easily recognize, thereby ensuring the user's notification reading experience.
  • the processor may also select other color matching styles from the memory as the default color matching style for application notification.
  • the font or background color of the system default notification acquired by the processor is other colors (for example, white on black background, white on transparent background, etc.)
  • a plurality of matching color matching styles may also be selected as the color matching style of the application notification.
  • FIG. 2 shows a flow chart of an adaptation method in accordance with an embodiment of the present invention.
  • Android app message reminders can display notification content in a pop-up box. That is, the system can display the notification content to the user by a Toast that pops up automatically after a few seconds.
  • the application notification needs to be properly matched. For example, the font color of the notification needs to be adapted to the background color in order to provide the user with an easily recognizable and aesthetically pleasing notification.
  • the solution of the present invention knows the default notification color of the system by constructing a system default notification without actually issuing the notification of the above configuration.
  • the font color or background color of the system default notification can be obtained by traversing the child controls of the view container by knowing the layout ID of the system default notification and the corresponding view container.
  • the system default notification A may be generated by a module provided by the system, such as a notification constructor, by the system default notification A's content view and calling its native API to obtain a corresponding layout ID, which is generated using, for example, a layout generator provided by the system.
  • the view container B corresponding to the layout ID of the system default notification traverses all the child controls of the view container B, finds all the text control list C whose control type is TextView type, and traverses the text control list C to obtain the font color of the system default notification.
  • all child controls of view container B can also be traversed in a similar manner to obtain the background color of the system default notification.
  • the color matching style corresponding to the system default font or background color may be selected as the default color matching style of the application notification. For example, when the color of the system default font is black, you can select the color style with black font as the default color for application notification, and so on.
  • step S210 it is also preferable to obtain the default text color of the system as the default font color of the system.
  • these color matching styles may be read in advance to facilitate selection of a matching color matching style according to the font or background color acquired in step S210. Therefore, for step S220, all system notification color matching styles can be acquired, and the specific system notification color matching is selected if it is determined that the font or background color of the system notification is the same or similar to the font or background color of the specific system notification color matching style.
  • Style is the default color style for app notifications.
  • the color matching style in which the title color is the same as black can be selected. If there is more than one color matching style with the title color being black, the text content color and/or the background color can be further compared to select the color matching style with the largest similarity.
  • the similarity of colors can be judged by introducing the concept of color null.
  • the similarity may be determined by the font or background color being notified to the particular system by the font of the color-matching style or the distance of the background color within the color space.
  • the color space here can be a color space actually used by systems such as RGB space and CMYK space.
  • the similarity of colors can be judged by the following method.
  • Color1 and Color2 which can be converted into two three-dimensional coordinates in the RGB color space, such as Color1 converted to (R1, G1, B1) and Color2 converted to (R2, G2, B2).
  • the above distance may represent a color difference between the two colors.
  • the system notification color matching style whose background or font is the smallest with the background or font color difference obtained in step S210 can be selected from the acquired system notification color matching style as the color matching style of the application notification.
  • the system usually has two color schemes of white on black and black on white, so that it can be simply stepped in without having to obtain the color scheme of the system notification in advance.
  • the color obtained by the S210 is closer to pure black or pure white and is directly selected from the white color on black and the black color on white.
  • the similarity formula can be used to determine whether the font or background color of the acquired system default notification is similar to pure black.
  • the color difference diff_max calculated by pure white and pure black can be used as the denominator, and Color1 and Color2 are calculated.
  • the similarity value can be between 0 and 1.
  • FIG. 3 is a functional block diagram of an apparatus (referred to as an adaptation apparatus) for adapting an application notification color in an Android system according to an embodiment of the present invention.
  • the functional modules of the adaptation device 300 may be implemented by hardware, software or a combination of hardware and software that implements the principles of the present invention.
  • the functional modules described in FIG. 3 can be combined or divided into sub-modules to implement the principles of the above invention. Accordingly, the description herein may support any possible combination, or division, or further limitation of the functional modules described herein.
  • the adapting device 300 shown in FIG. 3 can be used to implement the method shown in FIG. 2, and only the functional modules that the adapting device 300 can have and the operations that can be performed by the functional modules are briefly described, for the details involved. Reference may be made to the description above in conjunction with FIG. 2, and details are not described herein again.
  • the adaptation apparatus 300 can include a system color acquisition unit 310 and an application color selection unit 320, wherein the system color acquisition unit 310 can be configured to construct a system default notification to obtain a system default font or background color;
  • the color matching unit 320 can be used to select a color matching style that matches the font or background color as a default color matching style for the application notification. Therefore, the sent application notification can load different color notification layouts according to the system default font or background color, and solve the compatibility problem of different manufacturers and different system versions.
  • the system color acquisition unit 310 can preferably acquire the system default title text color as the system default font color.
  • the application color selection unit 320 can acquire all the system notification color matching styles, and if the font or the background color is determined to be the same and similar to the font or background color of the specific system notification color matching style, the specific system notification color matching style is selected as the default of the application notification. Color style.
  • the application color selection unit 320 can also directly compare the acquired color with pure black or pure white, and directly according to the similarity between the acquired color and the pure black or pure white, directly from the black and white on the white background. select.
  • the terminal device includes a processor 310, a memory 320, an internal memory 330, a network interface 340, and a display screen 350 connected through a system bus.
  • the processor 310 is configured to implement a computing function and a function of controlling the operation of the terminal device, and the processor 310 is configured to execute the method for adapting the application notification color under the Android system provided by the above embodiment.
  • the processor 310 is configured to construct a system default notification to obtain a system default font or background color; and select a color matching style that matches the font or background color as a default color matching style for the application notification.
  • the memory 320 is a non-volatile storage medium, and stores an operating system 321, a database 322, and a computer program for implementing the read-and-write separation mode-based download speed-up method provided by the above embodiments, and a candidate intermediate generated by executing the computer program. Data and result data.
  • Network interface 340 is used to communicate with the server, and network interface 340 includes a radio frequency transceiver.
  • the application further provides a computer readable storage medium having one or more computer program programs thereon, the one or more computer program programs being executed by one or more processors, the one or more The processor executes the method of adapting the application notification color under the Android system described above.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing storage medium includes: a mobile storage device, a random access memory (RAM), a read-only memory (ROM), a magnetic disk, or an optical disk.
  • RAM random access memory
  • ROM read-only memory
  • magnetic disk or an optical disk.
  • optical disk A medium that can store program code.
  • the above-described integrated unit of the present application may be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a stand-alone product.
  • the technical solution of the embodiments of the present application may be embodied in the form of a software product in essence or in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for making
  • a computer device which may be a personal computer, server, or network device, etc.
  • the foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a RAM, a ROM, a magnetic disk, or an optical disk.
  • This scheme constructs an instance of the system default notification, which simply uses the title text color of the system default notification as the default font color of the system, and selects black text on white or black on white according to the similarity between font color and pure black.
  • the system color scheme is used as an application notification color.
  • the specific implementation process is as follows:
  • the role is to generate a view container according to the layout file) to generate a view container B corresponding to the layout file ID of the notification A;
  • the color adaptation is perfectly implemented, so that the user can clearly see the content of the notification display, thereby improving the user experience and ensuring the normal operation of the related business corresponding to the notification.
  • the Android system provided by the company has a number of default shielding application modification notification color matching, especially the background color phenomenon.
  • the adaptation scheme of the present invention it is possible to avoid the problem of prohibiting the application from modifying the font and the background color confusion caused by the background color, and realizing the perfect adaptation of the application notification color matching style and the system default notification.
  • the solution is universal and can also solve compatibility problems between different vendors and different system versions.
  • the method according to the invention can also be implemented as a computer program comprising computer program code instructions for performing the various steps defined above in the above method of the invention.
  • the method according to the invention may also be embodied as a computer program product comprising a computer readable medium on which is stored a computer for performing the above-described functions defined in the above method of the invention program.
  • the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both.
  • each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions.
  • the functions noted in the blocks may also occur in a different order than the ones in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

A method and device for adapting an application notification color in an android system and computing equipment, the method comprising: constructing a system default notification to obtain a system default font or background color (S210); and selecting a color matching style corresponding to the font or background color as the default color matching style of the application notification (S220). Thus, the color matching style of an application notification may adapt to the system default color matching style, so that a user may identify the content of the application notification.

Description

安卓系统下适配应用通知颜色的方法、装置及计算设备Method, device and computing device for adapting application notification color under Android system 技术领域Technical field
本发明涉及安卓技术领域,特别是涉及安卓系统下适配应用通知颜色的方法、装置及计算设备。The present invention relates to the field of Android technology, and in particular, to a method, an apparatus, and a computing device for adapting an application notification color in an Android system.
背景技术Background technique
目前,安装有安卓(Andriod)系统的设备发出的通知主要包括系统默认通知和应用通知。其中,系统默认通知是厂商自行定制的,该通知的布局、颜色背景、字体颜色是系统定义好的,因此安卓设备能够正常显示系统默认通知。应用通知则是安装在系统中的应用(APP)发出的自定义通知,该通知的背景颜色、字体颜色由应用方自行设定。Currently, notifications from devices with Android (Andriod) systems mainly include system default notifications and application notifications. The default notification of the system is customized by the manufacturer. The layout, color background, and font color of the notification are well defined by the system, so the Android device can display the system default notification normally. The application notification is a custom notification issued by an application (APP) installed in the system, and the background color and font color of the notification are set by the application.
由于厂商在定制安卓系统时,可能会禁止其上安装的应用在弹出通知时修改通知配色,例如禁止修改背景颜色,因此如果应用通知的字体颜色与系统默认通知的背景颜色接近,用户可以无法看清应用通知的内容,影响用户使用体验。例如,安卓手机A的系统默认的通知配色是白底黑字,并限制了其他APP弹出应用通知修改其背景色。如果安装在安卓手机A上的应用B发出的通知的配色是黑底白字,由于系统禁止应用通知自定义背景颜色,使得展示给用户的应用通知为白底白字,用户无法看清该应用通知的内容。Since the manufacturer may prohibit the application installed on the Android system from modifying the notification color when popping up the notification, for example, the background color is prohibited from being modified. Therefore, if the font color of the application notification is close to the background color of the system default notification, the user may not be able to view it. Clear the content of the application notification, affecting the user experience. For example, the default notification color of the Android phone A system is black on white, and restricts other APP pop-up application notifications to modify its background color. If the color of the notification sent by the application B installed on the Android phone A is white on a black background, since the system prohibits the application from notifying the custom background color, the application notification displayed to the user is white on a white background, and the user cannot see the notification of the application. content.
因此,需要一种用于解决安卓系统下上述问题的应用通知颜色适配方案。Therefore, there is a need for an application notification color adaptation scheme for solving the above problems under the Android system.
发明内容Summary of the invention
本发明主要解决的目的在于提供一种安卓系统下的应用通知适配颜色的方法、装置及计算设备,其能够通过构造系统默认通知来获取系统默认的字体或背景颜色,从而为应用通知配置相适应的配色风格,以便于应用通知的内容能够被用户识别。The main objective of the present invention is to provide a method, an apparatus, and a computing device for an application notification adaptation color in an Android system, which can obtain a system default font or a background color by constructing a system default notification, thereby notifying the configuration phase of the application. Adapt to the color scheme so that the content of the app notification can be recognized by the user.
根据本发明的一个方面,提供了一种安卓系统下适配应用通知颜色的 方法,该方法可以包括:构造系统默认通知以获取系统默认的字体或背景颜色;以及选择与字体或背景颜色相适应的配色风格作为应用通知的默认配色风格。According to an aspect of the present invention, a method for adapting an application notification color under an Android system is provided. The method may include: constructing a system default notification to obtain a system default font or background color; and selecting to match a font or a background color. The color style is the default color style for app notifications.
由此,通过构造系统默认通知获取系统默认的字体或背景颜色,可以为应用通知配置相适应的配色风格,以避免由于系统禁止应用修改通知配色而导致的通知背景和字体不匹配问题。Thus, by constructing the system default notification to obtain the default font or background color of the system, it is possible to configure an appropriate color matching style for the application notification to avoid the problem of notification background and font mismatch caused by the system prohibiting the application from modifying the notification color.
优选地,所述方法还包括下述步骤:Preferably, the method further comprises the steps of:
构造系统默认通知以获取系统默认的字体颜色;以及Construct a system default notification to get the system default font color;
选择与所述字体颜色相适应的配色风格作为应用通知的默认配色风格。The color matching style that matches the color of the font is selected as the default color matching style for the application notification.
优选地,获取系统默认的字体颜色可以包括:获取系统默认的标题文本颜色作为系统默认的字体颜色。于是可以通过简单获取有代表性的标题文本颜色来作为系统默认的字体颜色,从而简化本发明的配色方案。Preferably, obtaining the default font color of the system may include: obtaining a default title text color of the system as a system default font color. Thus, the color scheme of the present invention can be simplified by simply obtaining a representative title text color as the system default font color.
优选地,Preferably,
获取系统通知配色风格;Get the system notification color style;
在判定所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色相同或相似的情况下,选择该特定系统通知配色风格作为应用通知的默认配色风格。由此,可以在系统存在多个配色风格的情况下选择最为合适的配色作为应用通知的默认配色风格。优选地,上述相似性可以通过色彩空间内的距离来判定。In the case where it is determined that the font or background color is the same or similar to the font or background color of the specific system notification color matching style, the specific system is selected to notify the color matching style as the default color matching style of the application notification. Thereby, the most suitable color matching can be selected as the default color matching style of the application notification when the system has multiple color matching styles. Preferably, the similarity described above can be determined by the distance within the color space.
优选地,选择与所述字体或背景颜色相适应的配色风格包括:Preferably, selecting a color matching style that matches the font or background color comprises:
计算所述字体颜色与预设配色样本之间的色差值;Calculating a color difference value between the font color and a preset color matching sample;
当所述色差值小于第一预设阈值时,选择与所述配色样本相同或相似的配色风格;否则选择与所述配色样本相异的配色风格。When the color difference value is smaller than the first preset threshold, a color matching style that is the same as or similar to the color matching sample is selected; otherwise, a color matching style different from the color matching sample is selected.
优选地,选择与字体或背景颜色相适应的配色风格包括:Preferably, the color matching style selected to match the font or background color includes:
计算所述字体颜色与纯黑色之间的色差值;Calculating a color difference between the font color and pure black;
在判定所述字体或背景颜色与纯黑色相似的情况下,选择黑色文字或黑色背景配色风格,以及In the case where it is determined that the font or background color is similar to pure black, select a black text or a black background color matching style, and
否则,选择白色文字或白色配色风格。由此,通过简单地在黑白配色中选择能够进一步简化本发明的配色方案。Otherwise, choose white text or white color style. Thus, the color scheme of the present invention can be further simplified by simply selecting between black and white color matching.
优选地,可以根据如下公式判定字体或背景颜色与纯黑色是否相似:Preferably, whether the font or background color is similar to pure black can be determined according to the following formula:
s=(1-diff)/(diff_max),s=(1-diff)/(diff_max),
其中,s是相似度,diff是字体或背景颜色与纯黑色的色差,diff_max是纯黑色与纯白色的色差,并且在s大于0.5时判定字体颜色与纯黑色相似。Where s is the similarity, diff is the color difference between the font or background color and pure black, diff_max is the color difference between pure black and pure white, and the font color is determined to be similar to pure black when s is greater than 0.5.
根据本发明的另一方面,提供了一种安卓系统下适配应用通知颜色的装置,包括:系统颜色获取单元,用于构造系统默认通知以获取系统默认的字体或背景颜色;以及应用配色选择单元,用于选择与字体或背景颜色相适应的配色风格作为应用通知的默认配色风格。According to another aspect of the present invention, an apparatus for adapting an application notification color under an Android system includes: a system color acquisition unit configured to construct a system default notification to obtain a system default font or background color; and an application color selection The unit is used to select the color matching style that matches the font or background color as the default color matching style for the app notification.
优选地,所述应用配色选择单元用于:Preferably, the application color matching unit is used to:
构造系统默认通知以获取系统默认的字体颜色;以及Construct a system default notification to get the system default font color;
选择与所述字体颜色相适应的配色风格作为应用通知的默认配色风格。The color matching style that matches the color of the font is selected as the default color matching style for the application notification.
优选地,系统颜色获取单元获取系统默认的标题文本颜色作为系统默认的字体颜色。Preferably, the system color acquisition unit obtains the default title text color of the system as the default font color of the system.
优选地,应用配色选择单元用于:Preferably, the application color selection unit is used for:
获取系统通知配色风格;Get the system notification color style;
在判定所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色相同或相似的情况下,选择该特定系统通知配色风格作为应用通知的默认配色风格。In the case where it is determined that the font or background color is the same or similar to the font or background color of the specific system notification color matching style, the specific system is selected to notify the color matching style as the default color matching style of the application notification.
优选地,通过所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色在色彩空间内的距离来判定所述相同或相似。Preferably, the same or similar is determined by the font or background color being notified by a particular system of the font of the color matching style or the distance of the background color within the color space.
优选地,所述应用配色选择单元用于:Preferably, the application color matching unit is used to:
计算所述字体颜色与预设配色样本之间的色差值;Calculating a color difference value between the font color and a preset color matching sample;
当所述色差值小于第一预设阈值时,选择与所述配色样本相同或相似的配色风格;否则选择与所述配色样本相异的配色风格。When the color difference value is smaller than the first preset threshold, a color matching style that is the same as or similar to the color matching sample is selected; otherwise, a color matching style different from the color matching sample is selected.
优选地,所述应用配色选择单元用于:Preferably, the application color matching unit is used to:
计算所述字体颜色与纯黑色之间的色差值;Calculating a color difference between the font color and pure black;
在判定所述字体或背景颜色与纯黑色相似的情况下,选择黑色文字或黑色背景配色风格,以及In the case where it is determined that the font or background color is similar to pure black, select a black text or a black background color matching style, and
否则,选择白色文字或白色配色风格。Otherwise, choose white text or white color style.
优选地,所述应用配色选择单元用于:Preferably, the application color matching unit is used to:
判定所述字体或背景颜色与纯黑色是否相似的特征描述为:A feature that determines whether the font or background color is similar to pure black is:
s=(1-diff)/(diff_max),s=(1-diff)/(diff_max),
其中,s是相似度,diff是字体或背景颜色与纯黑色的色差,diff_max是纯黑色与纯白色的色差,并且在s大于0.5时判定所述字体颜色与纯黑色相似。Where s is the similarity, diff is the color difference between the font or background color and pure black, diff_max is the color difference between pure black and pure white, and it is determined that the font color is similar to pure black when s is greater than 0.5.
根据本发明的又一方面,提供了一种计算设备,包括:存储器,用于存储信息;连接至存储器的处理器,用于构造系统默认通知以从存储器中获取系统默认的字体或背景颜色;从存储器中选择与字体或背景颜色相适应的配色风格作为应用通知的默认配色风格。According to still another aspect of the present invention, a computing device is provided, comprising: a memory for storing information; a processor coupled to the memory for constructing a system default notification to obtain a system default font or background color from the memory; Select the color style that matches the font or background color from the memory as the default color style for the app notification.
优选地,所述处理器还被配制用于:Preferably, the processor is further configured to:
构造系统默认通知以获取系统默认的字体颜色;以及Construct a system default notification to get the system default font color;
选择与所述字体颜色相适应的配色风格作为应用通知的默认配色风格。The color matching style that matches the color of the font is selected as the default color matching style for the application notification.
优选地,所述处理器还被配制用于:Preferably, the processor is further configured to:
获取系统默认的标题文本颜色作为所述系统默认的字体颜色。Get the system default title text color as the system default font color.
优选地,所述处理器还被配制用于:Preferably, the processor is further configured to:
获取系统通知配色风格;Get the system notification color style;
在判定所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色相同或相似的情况下,选择该特定系统通知配色风格作为应用通知的默认配色风格。In the case where it is determined that the font or background color is the same or similar to the font or background color of the specific system notification color matching style, the specific system is selected to notify the color matching style as the default color matching style of the application notification.
优选地,所述处理器还被配制用于:通过所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色在色彩空间内的距离来判定所述相同或相似。Preferably, the processor is further configured to determine the same or similar by the font or background color and the distance of the font or background color of the color matching style in the color space by the particular system.
优选地,所述处理器还被配制用于:Preferably, the processor is further configured to:
计算所述字体颜色与预设配色样本之间的色差值;Calculating a color difference value between the font color and a preset color matching sample;
当所述色差值小于第一预设阈值时,选择与所述配色样本相同或相似的配色风格;否则选择与所述配色样本相异的配色风格。When the color difference value is smaller than the first preset threshold, a color matching style that is the same as or similar to the color matching sample is selected; otherwise, a color matching style different from the color matching sample is selected.
所述处理器还被配制用于:The processor is also configured to:
计算所述字体颜色与纯黑色之间的色差值;Calculating a color difference between the font color and pure black;
在判定所述字体或背景颜色与纯黑色相似的情况下,选择黑色文字或黑色背景配色风格,以及In the case where it is determined that the font or background color is similar to pure black, select a black text or a black background color matching style, and
否则,选择白色文字或白色配色风格。Otherwise, choose white text or white color style.
所述处理器还被配制用于:The processor is also configured to:
判定所述字体或背景颜色与纯黑色是否相似的特征描述为:A feature that determines whether the font or background color is similar to pure black is:
s=(1-diff)/(diff_max),s=(1-diff)/(diff_max),
其中,s是相似度,diff是字体或背景颜色与纯黑色的色差,diff_max是纯黑色与纯白色的色差,并且在s大于0.5时判定所述字体颜色与纯黑色相似。Where s is the similarity, diff is the color difference between the font or background color and pure black, diff_max is the color difference between pure black and pure white, and it is determined that the font color is similar to pure black when s is greater than 0.5.
为解决上述技术问题,本发明实施例还提供一种计算机可读存储介质,其上承载一个或多个计算机指令程序,所述计算机指令程序被一个或多个处理器执行时,所述一个或多个处理器执行上述所述的安卓系统下适配应用通知颜色的方法。In order to solve the above technical problem, an embodiment of the present invention further provides a computer readable storage medium carrying one or more computer instruction programs, where the computer instruction program is executed by one or more processors, the one or The plurality of processors perform the method of adapting the application notification color under the Android system described above.
本发明的安卓系统下适配应用通知颜色的方法、装置及计算设备,通过构造默认通知获取系统默认的字体或背景颜色,可以选取相适应的配色风格作为应用的默认配色风格,从而可以避免由于系统禁止应用修改通知配色而导致的通知背景和字体不匹配问题,保证用户体验并确保应用通知对应的相关业务能够正常运行。The method, device and computing device for adapting the application notification color in the Android system of the present invention can obtain the default color matching style as the default color matching style of the application by constructing a default notification to obtain the default font or background color of the system, thereby avoiding The system prohibits the notification background and font mismatch caused by modifying the notification color, ensuring the user experience and ensuring that the related services corresponding to the application notification can run normally.
附图说明DRAWINGS
通过结合附图对本公开示例性实施方式进行更详细的描述,本公开的上述以及其它目的、特征和优势将变得更加明显,其中,在本公开示例性实施方式中,相同的参考标号通常代表相同部件。The above and other objects, features, and advantages of the present invention will become more apparent from the aspects of the embodiments of the invention. The same parts.
图1示出了根据本发明一实施例的计算设备的功能框图。FIG. 1 shows a functional block diagram of a computing device in accordance with an embodiment of the present invention.
图2示出了根据本发明的安卓系统下适配应用通知颜色的方法的流程示意图。2 is a flow chart showing a method of adapting an application notification color in an Android system according to the present invention.
图3示出了根据本发明的安卓系统下适配应用通知颜色的装置的功能框图。3 is a functional block diagram of an apparatus for adapting an application notification color under an Android system in accordance with the present invention.
图4为本实施例计算机可读存储介质的基本结构框图。4 is a block diagram showing the basic structure of a computer readable storage medium of the embodiment.
具体实施方式detailed description
下面将参照附图更详细地描述本公开的优选实施方式。虽然附图中显示了本公开的优选实施方式,然而应该理解,可以以各种形式实现本公开而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了使本公开更加透彻和完整,并且能够将本公开的范围完整地传达给本领域的技术人员。Preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the preferred embodiment of the present invention has been shown in the drawings, it is understood that Rather, these embodiments are provided so that this disclosure will be thorough and complete.
如前所述,由于厂商在定制安卓系统时,可能会禁止其上安装的应用 在弹出通知时修改通知配色,例如禁止应用修改通知背景颜色,因此在代替显示的系统默认通知的背景颜色与应用通知的字体颜色接近的情况下,用户无法看清应用通知的内容,从而影响用户体验。As mentioned above, since the manufacturer may prohibit the application installed on the Android system from modifying the notification color when popping the notification, for example, prohibiting the application from modifying the notification background color, the background color and application of the system default notification are replaced instead of the display. When the font color of the notification is close, the user cannot see the content of the application notification, thereby affecting the user experience.
针对这种情况,本发明提出一种解决方案,即构造一个系统默认通知,并获取系统默认通知的字体或背景颜色,选择与系统默认的字体或背景颜色相适应的配色风格作为应用通知的默认配色风格,以使得字体的颜色与背景颜色不相冲突,便于用户可以清楚的辨认应用通知的内容。In response to this situation, the present invention proposes a solution to construct a system default notification and obtain the font or background color of the system default notification, and select a color matching style that matches the system default font or background color as the default for the application notification. The color matching style is such that the color of the font does not conflict with the background color, so that the user can clearly recognize the content of the application notification.
下面将参照图1至图3来具体描述本发明的实施例。图1示出了根据本发明一个实施例的计算设备100的功能框图。计算设备100可以是安装了安卓系统的任何类型的计算设备,优选为移动设备,包括移动计算机或移动计算设备(例如,平板计算机、个人数字助理、膝上型计算机、笔记本计算机、上网本等)、移动电话(例如,智能手机)、可佩戴的计算设备(例如,智能手表、智能眼镜等)或其他类型的移动设备。Embodiments of the present invention will be specifically described below with reference to FIGS. 1 through 3. FIG. 1 shows a functional block diagram of a computing device 100 in accordance with one embodiment of the present invention. The computing device 100 can be any type of computing device on which an Android system is installed, preferably a mobile device, including a mobile computer or mobile computing device (eg, a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), A mobile phone (eg, a smart phone), a wearable computing device (eg, a smart watch, smart glasses, etc.) or other type of mobile device.
如图1所示,计算设备100可以包括存储器110和处理器120,处理器120连接至存储器110。在本发明的一个实施例中,计算设备100可以包括图1中未示出的诸如显示屏、输入输出装置等的其他部件。上述及其他部件可以例如通过总线彼此相连。应当理解,图1所示的计算设备的功能框图仅仅是出于示例的目的,而不是对本发明范围的限制。本领域技术人员可以根据需要,增添或替换其他部件。As shown in FIG. 1, computing device 100 can include a memory 110 and a processor 120 that is coupled to memory 110. In one embodiment of the invention, computing device 100 may include other components such as a display screen, input and output devices, etc., not shown in FIG. The above and other components may be connected to each other, for example, via a bus. It should be understood that the functional block diagram of the computing device shown in FIG. 1 is for illustrative purposes only and is not intended to limit the scope of the invention. Those skilled in the art can add or replace other components as needed.
存储器110用于存储信息,所述信息可以包括系统默认通知的配色,例如,字体和相应背景颜色。系统默认的字体颜色例如可以是黑色,背景颜色相应为白色等。存储器110中还可以存储任意颜色空间或色域的多种颜色。The memory 110 is used to store information, which may include color combinations of system default notifications, such as fonts and corresponding background colors. The default font color of the system can be, for example, black, and the background color is white. A plurality of colors of any color space or color gamut can also be stored in the memory 110.
处理器120可以构造系统默认通知以从存储器110中获取系统默认的字体或背景颜色。例如,处理器可以包括通知构造单元,该通知构造单元可以生成一个系统默认通知,获得默认通知的布局文件ID,处理器还可以包括布局生成单元,该布局生成单元可以生成对应于已获得的布局文件ID的视图容器,再遍历视图容器的子控件以获取系统默认通知的字体颜色或背景颜色。The processor 120 can construct a system default notification to retrieve the system default font or background color from the memory 110. For example, the processor may include a notification construction unit that may generate a system default notification to obtain a layout file ID of the default notification, and the processor may further include a layout generation unit that may generate a layout corresponding to the obtained layout The view container of the file ID, and then traverse the child controls of the view container to get the font color or background color of the system default notification.
处理器120还可以从存储器110中选择与字体或背景颜色相适应的配色风格作为应用通知的默认配色风格。例如,在获取的系统默认通知的字 体颜色为黑色时,从存储器110中选择黑色作为应用通知的字体颜色。或者在获取的系统默认的背景颜色为白色时,从存储器中选择与白色有明显差异的例如黑色等颜色作为应用通知的字体颜色,以便于应用通知的字体颜色和系统默认的背景颜色不相冲突,便于用户识别。The processor 120 can also select a color matching style corresponding to the font or the background color from the memory 110 as the default color matching style of the application notification. For example, when the font color of the acquired system default notification is black, black is selected from the memory 110 as the font color of the application notification. Or when the default background color of the obtained system is white, a color such as black which is significantly different from white is selected from the memory as the font color of the application notification, so that the font color of the application notification does not conflict with the default background color of the system. For user identification.
由此,应用通知的字体颜色能够与系统默认背景颜色相适应,弹出的应用通知的字体颜色与系统默认通知的背景颜色存在显著差异,使得用户易于辨认,由此确保用户的通知阅读体验。Thus, the font color of the application notification can be adapted to the system default background color, and the font color of the pop-up application notification is significantly different from the background color of the system default notification, so that the user can easily recognize, thereby ensuring the user's notification reading experience.
本领域的技术人员应当理解,上述举例是示意性的而非对本发明的限制,处理器还可以从存储器中选择其它的配色风格作为应用通知的默认配色风格。并且,在处理器获取的系统默认通知的字体或背景颜色为其它颜色时(例如,黑底白字、透明底白字等),也可以选择多种相适应的配色风格作为应用通知的配色风格。It should be understood by those skilled in the art that the above examples are illustrative and not limiting, and the processor may also select other color matching styles from the memory as the default color matching style for application notification. Moreover, when the font or background color of the system default notification acquired by the processor is other colors (for example, white on black background, white on transparent background, etc.), a plurality of matching color matching styles may also be selected as the color matching style of the application notification.
处理器120适配安卓系统下的应用通知颜色的处理可以参见图2。图2示出根据本发明一实施例的适配方法的流程图。The process of adapting the processor 120 to the application notification color under the Android system can be seen in FIG. 2. 2 shows a flow chart of an adaptation method in accordance with an embodiment of the present invention.
如图2所示,在步骤S210中,构造系统默认通知以获取系统默认的字体或背景颜色。As shown in FIG. 2, in step S210, the system default notification is constructed to obtain the default font or background color of the system.
在安卓系统下,安卓应用消息提醒可以在弹出框中展示通知内容。即,系统可以通过弹出几秒后自动消失的吐司(Toast)方式向用户展示通知内容。为保证用户能够辨认应用通知的内容,应用通知需要适当配色,例如,通知的字体颜色需要与背景颜色相适应,以便为用户提供易于辨认且富有美感的通知。In Android, Android app message reminders can display notification content in a pop-up box. That is, the system can display the notification content to the user by a Toast that pops up automatically after a few seconds. In order to ensure that the user can recognize the content of the application notification, the application notification needs to be properly matched. For example, the font color of the notification needs to be adapted to the background color in order to provide the user with an easily recognizable and aesthetically pleasing notification.
然而,有些系统会禁止应用自由更改其通知的配色。例如,有些系统会禁止应用修改通知的背景色,这就会导致应用通知实际使用的是应用自行选择的字体颜色和系统默认的背景色。这时,如果字体和背景的颜色相同或相近,会导致通知内容难以辨认。如果字体和背景的颜色虽不相近但不协调,也会使得用户体验下降。为此,需要获知系统默认的通知配色。而所述整体配色可以简单地从其字体或背景颜色来进行推断。However, some systems prohibit the app from being free to change the color of its notifications. For example, some systems prohibit the application from modifying the background color of the notification, which causes the app to actually notify you of the font color selected by the app and the default background color of the system. At this time, if the font and the background are the same or similar in color, the notification content will be illegible. If the font and background colors are not similar but not coordinated, the user experience will also be degraded. To do this, you need to know the system's default notification color. The overall color scheme can be inferred simply from its font or background color.
为了实现上述目的,本发明的方案通过构造一个系统默认通知来获知系统的默认通知配色,而不用真的发布上述构造的通知。在一个实施例中,可以通过获知系统默认通知的布局ID以及相应的视图容器,遍历视图容器的子控件来获取系统默认通知的字体颜色或背景颜色。In order to achieve the above object, the solution of the present invention knows the default notification color of the system by constructing a system default notification without actually issuing the notification of the above configuration. In one embodiment, the font color or background color of the system default notification can be obtained by traversing the child controls of the view container by knowing the layout ID of the system default notification and the corresponding view container.
例如,系统默认通知A可以是由系统提供的例如通知构造器的模块生成的,通过系统默认通知A的内容视图并调用其原生API获得对应的布局ID,使用系统提供的例如布局生成器生成该系统默认通知的布局ID对应的视图容器B,遍历视图容器B的所有子控件,找出所有控件类型为TextView类型的文本控件列表C,遍历文本控件列表C,以获得系统默认通知的字体颜色。For example, the system default notification A may be generated by a module provided by the system, such as a notification constructor, by the system default notification A's content view and calling its native API to obtain a corresponding layout ID, which is generated using, for example, a layout generator provided by the system. The view container B corresponding to the layout ID of the system default notification, traverses all the child controls of the view container B, finds all the text control list C whose control type is TextView type, and traverses the text control list C to obtain the font color of the system default notification.
类似地,也可以以类似的方式遍历视图容器B的所有子控件,以获得系统默认通知的背景颜色。Similarly, all child controls of view container B can also be traversed in a similar manner to obtain the background color of the system default notification.
在获知系统默认通知的字体或背景颜色后,可以在步骤S220,选择与系统默认的字体或背景颜色相适应的配色风格作为应用通知的默认配色风格。例如,在获取系统默认的字体的颜色为黑色时,可以选择具有黑色字体的配色风格作为应用通知的默认配色,等等。After knowing the font or background color of the system default notification, in step S220, the color matching style corresponding to the system default font or background color may be selected as the default color matching style of the application notification. For example, when the color of the system default font is black, you can select the color style with black font as the default color for application notification, and so on.
在一些实施方式中,针对于不同色值的字体颜色,均设计有一个与该色值匹配的配色风格的背景,并形成配色样本文件存储在计算机的存储器内,识别出字体背景后在配色样本文件选择并调用相应的背景,完成背景颜色的搭配,以使该字体颜色搭配该背景后,能够醒目的凸显该字体。In some embodiments, for a font color of different color values, a background of a color matching style matching the color value is designed, and a color matching sample file is formed and stored in a memory of the computer, and the color matching sample is recognized after the font background is recognized. The file selects and calls the corresponding background to complete the matching of the background color, so that the font color matches the background, and the font can be highlighted.
本领域的技术人员应当理解,上述举例是示意性的,不应当用以限制本发明,本发明的应用通知的配色方案还可以以其它方式实现。It should be understood by those skilled in the art that the above examples are illustrative and should not be used to limit the present invention. The color scheme of the application notification of the present invention may also be implemented in other manners.
由于系统默认通知的布局文件里一般存在4个文本控件,分别对应于标题、内容、时间、信息,因此在遍历文本控件列表C的过程中,优选直接根据一个文本控件进行字体颜色判断。这是因为通常难以从多个文本控件中直接获取字体配色信息,而标题作为其中最为显著的文本控件(例如,标题的字体最大,颜色最显眼),可以看做是文本颜色的代表,并认为相应地获取了系统默认字体的颜色。因此,对于步骤S210,还可以优选地获取系统默认的标题文本颜色作为系统默认的字体颜色。Since there are generally four text controls in the layout file notified by the system default, corresponding to the title, content, time, and information, in the process of traversing the text control list C, it is preferable to directly judge the font color according to a text control. This is because it is often difficult to get the font color information directly from multiple text controls, and the title is the most prominent text control (for example, the title has the largest font and the most prominent color), which can be regarded as the representative of the text color, and thinks The color of the system default font is obtained accordingly. Therefore, for step S210, it is also preferable to obtain the default text color of the system as the default font color of the system.
这样,在遍历文本控件列表C时,需要找到系统默认通知标的题所属的文本控件(例如,可以是字体最大的文本控件)D,调用标题文本控件D的原生API,从而获取到标题的文本颜色。Thus, when traversing the text control list C, it is necessary to find the text control to which the system default notification target belongs (for example, the text control with the largest font) D, and call the native API of the title text control D to obtain the text color of the title. .
在一个实施例中,在系统存在多种默认配色风格的情况下,可以预先读取这些配色风格,以方便根据在步骤S210中获取的字体或背景颜色来选择与之相适应的配色风格。因此,对于步骤S220,可以获取所有的系统通 知配色风格,在判定构造的系统通知的字体或背景颜色与特定系统通知配色风格的字体或背景颜色相同或相似的情况下,选择该特定系统通知配色风格作为应用通知的默认配色风格。In one embodiment, in the case where the system has a plurality of default color matching styles, these color matching styles may be read in advance to facilitate selection of a matching color matching style according to the font or background color acquired in step S210. Therefore, for step S220, all system notification color matching styles can be acquired, and the specific system notification color matching is selected if it is determined that the font or background color of the system notification is the same or similar to the font or background color of the specific system notification color matching style. Style is the default color style for app notifications.
具体实施方式如下:计算所述字体颜色与预设配色样本之间的色差值;当所述色差值小于第一预设阈值时,选择与所述配色样本相同或相似的配色风格;否则选择与所述配色样本相异的配色风格。The specific implementation manner is as follows: calculating a color difference value between the font color and a preset color matching sample; when the color difference value is smaller than a first preset threshold, selecting a color matching style that is the same as or similar to the color matching sample; otherwise Choose a color style that is different from the color sample.
配色样本值为纯黑色(0,0,0)或纯白色(255,255,255)。第一预设阈值为0.5。配色样本的色值取值范围不局限与此,根据具体应用场景的不同,配色样本的取值能够为任何色值,例如(150,150,150)、(175、250、45)或(15、58、241)等。同时,第一预设阈值的选值范围也不局限与此,根据具体应用场景的不同,第一预设阈值的取值能够为0-1之间的任意数值。The color sample values are pure black (0,0,0) or pure white (255,255,255). The first preset threshold is 0.5. The color value range of the color matching sample is not limited to this. Depending on the specific application scenario, the value of the color matching sample can be any color value, such as (150, 150, 150), (175, 250, 45) or (15, 58, 241 )Wait. At the same time, the selection range of the first preset threshold is not limited thereto. The value of the first preset threshold can be any value between 0-1, depending on the specific application scenario.
举例说明,在获知构造的系统通知的标题颜色为黑色的情况下,可以选择标题色同为黑色的配色风格。倘若存在一个以上的标题色为黑色的配色风格,则可以进一步比较文本内容色和/或背景色,以选择相似度最大的配色风格。For example, in the case where the title color of the system notification of the learned structure is black, the color matching style in which the title color is the same as black can be selected. If there is more than one color matching style with the title color being black, the text content color and/or the background color can be further compared to select the color matching style with the largest similarity.
在这里可以通过引入色彩空的概念来判断颜色的相似性。在一个实施例中,可以通过字体或背景颜色与特定系统通知配色风格的字体或背景颜色在色彩空间内的距离来判定相似。这里的色彩空间可以是RGB空间、CMYK空间等系统实际使用的色彩空间。Here, the similarity of colors can be judged by introducing the concept of color null. In one embodiment, the similarity may be determined by the font or background color being notified to the particular system by the font of the color-matching style or the distance of the background color within the color space. The color space here can be a color space actually used by systems such as RGB space and CMYK space.
具体地,可以通过如下方法判断颜色的相似性。Specifically, the similarity of colors can be judged by the following method.
假定有2种RGB颜色Color1和Color2,可分别将其转换为RGB色彩空间中的2个三维坐标,如Color1转换为(R1,G1,B1),Color2转换为(R2,G2,B2),从而分别得到x,y,z轴的坐标差,即Rx=R1-R2,Gy=G1-G2,Bz=B1-B2。Color1和Color2在色彩空间内的距离可以根据公式diff=sqrt(Rx*Rx+Gy*Gy+Bz*Bz)来算出,其中,sqrt表示二次开方。上述距离可以表示两颜色之间的色差。Suppose there are two RGB colors, Color1 and Color2, which can be converted into two three-dimensional coordinates in the RGB color space, such as Color1 converted to (R1, G1, B1) and Color2 converted to (R2, G2, B2). The coordinate differences of the x, y, and z axes are respectively obtained, that is, Rx=R1-R2, Gy=G1-G2, and Bz=B1-B2. The distance between Color1 and Color2 in the color space can be calculated according to the formula diff=sqrt(Rx*Rx+Gy*Gy+Bz*Bz), where sqrt represents the second square root. The above distance may represent a color difference between the two colors.
由此,可以从获取的系统通知配色风格中选择其背景或字体与步骤S210中获取的背景或字体色差最小的系统通知配色风格作为应用通知的配色风格。Thereby, the system notification color matching style whose background or font is the smallest with the background or font color difference obtained in step S210 can be selected from the acquired system notification color matching style as the color matching style of the application notification.
在一个更为简单的方案实施例中,考虑到系统通常默认具备黑底白字和白底黑字这两种配色风格,于是可以在无需预先获取系统通知的配色风 格的情况下,简单根据在步骤S210获取的颜色更接近纯黑还是纯白而直接从黑底白字和白底黑字配色风格中进行选择。In a simpler embodiment, it is considered that the system usually has two color schemes of white on black and black on white, so that it can be simply stepped in without having to obtain the color scheme of the system notification in advance. The color obtained by the S210 is closer to pure black or pure white and is directly selected from the white color on black and the black color on white.
例如,可以直接将系统默认通知的字体或背景颜色与纯黑色做比较,将获取的字体或背景颜色作为Color1,纯黑色作为Color2,并根据上述公式算出色差diff。随后,可以利用相似度公式判定获取的系统默认通知的字体或背景颜色与纯黑色是否相似。在这里,由于纯白色(255,255,255)和纯黑色(0,0,0)间的色差最大,因此可以利用纯白色和纯黑色计算出的色差diff_max作为分母,而Color1和Color2计算出的色差为diff,那么相似度s的计算公式为s=(1-diff)/diff_max。相似度取值可以在0~1之间,越接近0表示越不相似,越接近1表示越相似,这里可以取0.5作为临界值,即相似度若大于0.5则认为2个颜色相似,否则认为不相似。于是,在系统默认通知的字体或背景颜色与纯黑色相似的情况下,选择黑色文字或背景的配色风格,否则,选择白色文字或背景的配色风格。For example, you can directly compare the font or background color of the system default notification with pure black, take the obtained font or background color as Color1, and pure black as Color2, and calculate the color difference diff according to the above formula. Subsequently, the similarity formula can be used to determine whether the font or background color of the acquired system default notification is similar to pure black. Here, since the color difference between pure white (255, 255, 255) and pure black (0, 0, 0) is the largest, the color difference diff_max calculated by pure white and pure black can be used as the denominator, and Color1 and Color2 are calculated. The color difference is diff, then the similarity s is calculated as s=(1-diff)/diff_max. The similarity value can be between 0 and 1. The closer to 0, the more dissimilar. The closer to 1, the more similar, the 0.5 can be taken as the critical value. If the similarity is greater than 0.5, the two colors are considered similar. not similar. Therefore, in the case that the font or background color of the system default notification is similar to pure black, the color style of the black text or the background is selected, otherwise, the color style of the white text or the background is selected.
至此,对安卓系统下适配应用通知颜色的方法进行了详细说明。另外,本发明的适配方法也可以由一种适配装置实现。图3示出了根据本发明一实施例的安卓系统下适配应用通知颜色的装置(简称适配装置)的功能框图。其中,适配装置300的功能模块可以由实现本发明原理的硬件、软件或硬件和软件的结合来实现。本领域技术人员可以理解的是,图3所描述的功能模块可以组合起来或者划分成子模块,从而实现上述发明的原理。因此,本文的描述可以支持对本文描述的功能模块的任何可能的组合、或者划分、或者更进一步的限定。So far, the method of adapting the application notification color under the Android system has been described in detail. In addition, the adaptation method of the invention can also be implemented by an adaptation device. FIG. 3 is a functional block diagram of an apparatus (referred to as an adaptation apparatus) for adapting an application notification color in an Android system according to an embodiment of the present invention. The functional modules of the adaptation device 300 may be implemented by hardware, software or a combination of hardware and software that implements the principles of the present invention. Those skilled in the art can understand that the functional modules described in FIG. 3 can be combined or divided into sub-modules to implement the principles of the above invention. Accordingly, the description herein may support any possible combination, or division, or further limitation of the functional modules described herein.
图3所示的适配装置300可以用来实现图2所示的方法,下面仅就适配装置300可以具有的功能模块以及各功能模块可以执行的操作做简要说明,对于其中涉及的细节部分可以参见上文结合图2的描述,这里不再赘述。The adapting device 300 shown in FIG. 3 can be used to implement the method shown in FIG. 2, and only the functional modules that the adapting device 300 can have and the operations that can be performed by the functional modules are briefly described, for the details involved. Reference may be made to the description above in conjunction with FIG. 2, and details are not described herein again.
如图3所示,该适配装置300可以包括系统颜色获取单元310和应用配色选择单元320,其中,系统颜色获取单元310可以用于构造系统默认通知以获取系统默认的字体或背景颜色;应用配色选择单元320可以用于选择与字体或背景颜色相适应的配色风格作为应用通知的默认配色风格。由此,发送的应用通知就可以根据系统默认的字体或背景颜色来加载不同颜色的通知布局,解决了不同厂商、不同系统版本的兼容问题。As shown in FIG. 3, the adaptation apparatus 300 can include a system color acquisition unit 310 and an application color selection unit 320, wherein the system color acquisition unit 310 can be configured to construct a system default notification to obtain a system default font or background color; The color matching unit 320 can be used to select a color matching style that matches the font or background color as a default color matching style for the application notification. Therefore, the sent application notification can load different color notification layouts according to the system default font or background color, and solve the compatibility problem of different manufacturers and different system versions.
系统颜色获取单元310可以优选地获取系统默认的标题文本颜色作为系统默认的字体颜色。The system color acquisition unit 310 can preferably acquire the system default title text color as the system default font color.
应用配色选择单元320可以获取所有的系统通知配色风格,在判定字体或背景颜色与特定系统通知配色风格的字体或背景颜色相同和相似的情况下,选择该特定系统通知配色风格作为应用通知的默认配色风格。应用配色选择单元320也可以直接将获取的颜色与纯黑色或是纯白色相比较,根据获取颜色与纯黑或纯白的相似度,直接从白底黑字和黑底白字的风格中做出选择。The application color selection unit 320 can acquire all the system notification color matching styles, and if the font or the background color is determined to be the same and similar to the font or background color of the specific system notification color matching style, the specific system notification color matching style is selected as the default of the application notification. Color style. The application color selection unit 320 can also directly compare the acquired color with pure black or pure white, and directly according to the similarity between the acquired color and the pure black or pure white, directly from the black and white on the white background. select.
请参阅图4,图4为本实施例终端设备的基本结构框图。Please refer to FIG. 4. FIG. 4 is a block diagram showing the basic structure of the terminal device according to the embodiment.
如图4所示,终端设备包括通过系统总线连接的处理器310、存储器320、内存储器330、网络接口340和显示屏350。处理器310用于实现计算功能和控制终端装置工作的功能,处理器310被配置为执行上述实施例提供的安卓系统下适配应用通知颜色的方法。处理器310用于构造系统默认通知以获取系统默认的字体或背景颜色;以及选择与所述字体或背景颜色相适应的配色风格作为应用通知的默认配色风格。存储器320是一种非易失性存储介质,存储有操作系统321、数据库322和用于实现上述实施例提供的基于读写分离模式的下载提速方法的计算机程序,以及执行计算机程序产生的候选中间数据以及结果数据。网络接口340用于与服务器通信,网络接口340包括射频收发器。As shown in FIG. 4, the terminal device includes a processor 310, a memory 320, an internal memory 330, a network interface 340, and a display screen 350 connected through a system bus. The processor 310 is configured to implement a computing function and a function of controlling the operation of the terminal device, and the processor 310 is configured to execute the method for adapting the application notification color under the Android system provided by the above embodiment. The processor 310 is configured to construct a system default notification to obtain a system default font or background color; and select a color matching style that matches the font or background color as a default color matching style for the application notification. The memory 320 is a non-volatile storage medium, and stores an operating system 321, a database 322, and a computer program for implementing the read-and-write separation mode-based download speed-up method provided by the above embodiments, and a candidate intermediate generated by executing the computer program. Data and result data. Network interface 340 is used to communicate with the server, and network interface 340 includes a radio frequency transceiver.
本申请还提供一种计算机可读存储介质,计算机可读存储介质,其上承载一个或多个计算机指令程序,所述计算机指令程序被一个或多个处理器执行时,所述一个或多个处理器执行权上述所述的安卓系统下适配应用通知颜色的方法。The application further provides a computer readable storage medium having one or more computer program programs thereon, the one or more computer program programs being executed by one or more processors, the one or more The processor executes the method of adapting the application notification color under the Android system described above.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述任意方法实施例的步骤;而前述的存储介质包括:移动存储设备、随机存取存储器(RAM,Random Access Memory)、只读存储器(ROM,Read-Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to the program instructions. The foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing storage medium includes: a mobile storage device, a random access memory (RAM), a read-only memory (ROM), a magnetic disk, or an optical disk. A medium that can store program code.
或者,本申请上述集成的单元如果以软件功能模块的形式实现并作为 独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行申请各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、RAM、ROM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, the above-described integrated unit of the present application may be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiments of the present application may be embodied in the form of a software product in essence or in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for making A computer device (which may be a personal computer, server, or network device, etc.) performs all or part of the methods described in the various embodiments. The foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a RAM, a ROM, a magnetic disk, or an optical disk.
需要指出的是本实施例中的内存存储器中存储有用于执行安卓系统下适配应用通知颜色的方法的所有程序,处理器能够调用该内存储器中的程序实现上述安卓系统下适配应用通知颜色的方法的所有功能,由于安卓系统下适配应用通知颜色的方法在上述文件中已经进行详述,在此不再赘述。It should be noted that all the programs for executing the method for adapting the application notification color under the Android system are stored in the memory in this embodiment, and the processor can call the program in the internal memory to implement the adaptation application notification color under the Android system. All the functions of the method, as the method of adapting the application notification color under the Android system has been detailed in the above documents, and will not be described herein.
上文中已经参考附图详细描述了根据本发明的安卓系统下适配应用通知颜色的方法、装置及计算设备。如下将以一应用例说明其具体适配过程。The method, apparatus, and computing device for adapting an application notification color under the Android system according to the present invention have been described in detail above with reference to the accompanying drawings. The specific adaptation process will be described in an application example as follows.
【应用例】[Application example]
本方案构造了一个系统默认通知的实例,其通过简单获取系统默认通知的标题文本颜色来作为系统默认的字体颜色,并根据字体颜色与纯黑色的相似程度选择白底黑字或是黑底白字的系统配色作为应用通知配色。具体实现过程如下:This scheme constructs an instance of the system default notification, which simply uses the title text color of the system default notification as the default font color of the system, and selects black text on white or black on white according to the similarity between font color and pure black. The system color scheme is used as an application notification color. The specific implementation process is as follows:
1.通过系统提供的通知构造器生成一个系统默认的通知A;1. Generate a system default notification A through the notification constructor provided by the system;
2.通过通知A的内容视图成员(content View)并调用其原生API(getLayoutId)获得对应的系统默认通知布局文件ID;2. Obtain the corresponding system default notification layout file ID by notifying A's content view member (content view) and calling its native API (getLayoutId);
3.使用系统提供的布局生成器(LayoutInflater,作用是根据布局文件生成视图容器)生成通知A的布局文件ID对应的视图容器B;3. Using the layout generator provided by the system (LayoutInflater, the role is to generate a view container according to the layout file) to generate a view container B corresponding to the layout file ID of the notification A;
4.遍历视图容器B的所有子控件,找出所有控件类型为Text View类型的文本控件列表C;4. Traverse all the child controls of view container B, find out all the text control list C of the control type is Text View;
5.遍历文本控件列表C,找出字体大小最大的文本控件D,该控件就是系统默认通知的标题文本控件;5. Traverse the text control list C, find the text control D with the largest font size, the control is the title text control of the system default notification;
6.调用标题的文本控件D的原生API(getCurrentTextColor)获取其文本颜色F;6. Call the title of the text control D's native API (getCurrentTextColor) to get its text color F;
7.通过RGB颜色的色差公式计算纯黑色(0,0,0)与文本颜色F的相似度如果文本颜色F与纯黑色的相似,则加载黑色文字风格的应用通知 布局,否则加载白色文字风格的应用通知布局。7. Calculate the similarity between pure black (0,0,0) and text color F by the color difference formula of RGB color. If the text color F is similar to pure black, load the black text style application notification layout, otherwise load the white text style. Application notification layout.
本领域的技术人员应当理解,本方案构造了一个系统默认通知的实例,只是构造而不需要真的发送该通知,并且,只构造和获取一次即可。这样之后我们发送应用通知都可以根据系统的标题文本颜色来加载不同的颜色的应用通知布局。Those skilled in the art will appreciate that the present scheme constructs an instance of a system default notification, but is constructed without actually sending the notification, and is constructed and retrieved only once. After that, we can send application notifications to load application notification layouts of different colors according to the system's title text color.
至此,非常完美的实现了颜色的适配,使用户能清晰看到通知展示的内容,进而提高用户体验,确保通知对应的相关业务的正常运行。At this point, the color adaptation is perfectly implemented, so that the user can clearly see the content of the notification display, thereby improving the user experience and ensuring the normal operation of the related business corresponding to the notification.
对于现有的众多手机生产厂商,其提供的安卓系统存在诸多默认屏蔽应用修改通知配色,尤其是背景颜色的现象。利用本发明的适配方案,能够避免禁止应用修改背景颜色引起的字体和背景颜色混淆的问题,实现应用通知配色风格与系统默认通知的完美适配。另外,该方案是通用的,也能够解决不同厂商、不同系统版本的兼容问题。For many existing mobile phone manufacturers, the Android system provided by the company has a number of default shielding application modification notification color matching, especially the background color phenomenon. With the adaptation scheme of the present invention, it is possible to avoid the problem of prohibiting the application from modifying the font and the background color confusion caused by the background color, and realizing the perfect adaptation of the application notification color matching style and the system default notification. In addition, the solution is universal and can also solve compatibility problems between different vendors and different system versions.
此外,根据本发明的方法还可以实现为一种计算机程序,该计算机程序包括用于执行本发明的上述方法中限定的上述各步骤的计算机程序代码指令。或者,根据本发明的方法还可以实现为一种计算机程序产品,该计算机程序产品包括计算机可读介质,在该计算机可读介质上存储有用于执行本发明的上述方法中限定的上述功能的计算机程序。本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。Furthermore, the method according to the invention can also be implemented as a computer program comprising computer program code instructions for performing the various steps defined above in the above method of the invention. Alternatively, the method according to the invention may also be embodied as a computer program product comprising a computer readable medium on which is stored a computer for performing the above-described functions defined in the above method of the invention program. The various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both.
附图中的流程图和框图显示了根据本发明的多个实施例的系统和方法的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标记的功能也可以以不同于附图中所标记的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality and operation of possible implementations of systems and methods in accordance with various embodiments of the present invention. In this regard, each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions. It should also be noted that in some alternative implementations, the functions noted in the blocks may also occur in a different order than the ones in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts, can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.
以上已经描述了本发明的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范 围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。The embodiments of the present invention have been described above, and the foregoing description is illustrative, not limiting, and not limited to the disclosed embodiments. Numerous modifications and changes will be apparent to those skilled in the art without departing from the scope of the invention. The choice of terms used herein is intended to best explain the principles, practical applications, or improvements of the techniques in the various embodiments of the embodiments, or to enable those of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (25)

  1. 一种安卓系统下适配应用通知颜色的方法,包括:A method for adapting an application notification color under an Android system, comprising:
    构造系统默认通知以获取系统默认的字体或背景颜色;以及Construct a system default notification to get the system default font or background color;
    选择与所述字体或背景颜色相适应的配色风格作为应用通知的默认配色风格。Choose a color style that matches the font or background color as the default color style for app notifications.
  2. 如权利要求1所述的安卓系统下适配应用通知颜色的方法,所述方法还包括下述步骤:The method for adapting an application notification color in an Android system according to claim 1, further comprising the steps of:
    构造系统默认通知以获取系统默认的字体颜色;以及Construct a system default notification to get the system default font color;
    选择与所述字体颜色相适应的配色风格作为应用通知的默认配色风格。The color matching style that matches the color of the font is selected as the default color matching style for the application notification.
  3. 如权利要求2所述的方法,其中,获取系统默认的字体颜色包括:The method of claim 2 wherein obtaining a system default font color comprises:
    获取系统默认的标题文本颜色作为所述系统默认的字体颜色。Get the system default title text color as the system default font color.
  4. 如权利要求1所述的方法,其中,选择与所述字体或背景颜色相适应的配色风格包括:The method of claim 1 wherein selecting a color matching style that matches the font or background color comprises:
    获取系统通知配色风格;Get the system notification color style;
    在判定所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色相同或相似的情况下,选择该特定系统通知配色风格作为应用通知的默认配色风格。In the case where it is determined that the font or background color is the same or similar to the font or background color of the specific system notification color matching style, the specific system is selected to notify the color matching style as the default color matching style of the application notification.
  5. 如权利要求4所述的方法,其中,通过所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色在色彩空间内的距离来判定所述相同或相似。The method of claim 4, wherein the same or similar is determined by the font or background color being notified by a particular system of the font of the color matching style or the distance of the background color within the color space.
  6. 如权利要求2所述的方法,其中,选择与所述字体或背景颜色相适应的配色风格包括:The method of claim 2 wherein selecting a color matching style that matches the font or background color comprises:
    计算所述字体颜色与预设配色样本之间的色差值;Calculating a color difference value between the font color and a preset color matching sample;
    当所述色差值小于第一预设阈值时,选择与所述配色样本相同或相似的配色风格;否则选择与所述配色样本相异的配色风格。When the color difference value is smaller than the first preset threshold, a color matching style that is the same as or similar to the color matching sample is selected; otherwise, a color matching style different from the color matching sample is selected.
  7. 如权利要求6所述的方法,其中,选择与所述字体或背景颜色相适应的配色风格还包括:The method of claim 6 wherein selecting a color matching style that matches the font or background color further comprises:
    计算所述字体颜色与纯黑色之间的色差值;Calculating a color difference between the font color and pure black;
    在判定所述字体或背景颜色与纯黑色相似的情况下,选择黑色文字或黑色背景配色风格,以及In the case where it is determined that the font or background color is similar to pure black, select a black text or a black background color matching style, and
    否则,选择白色文字或白色配色风格。Otherwise, choose white text or white color style.
  8. 如权利要求7所述的方法,其中,判定所述字体或背景颜色与纯黑色是否相似的特征描述为:The method of claim 7, wherein the feature determining whether the font or background color is similar to pure black is:
    s=(1-diff)/(diff_max),s=(1-diff)/(diff_max),
    其中,s是相似度,diff是字体或背景颜色与纯黑色的色差,diff_max是纯黑色与纯白色的色差,并且在s大于0.5时判定所述字体颜色与纯黑色相似。Where s is the similarity, diff is the color difference between the font or background color and pure black, diff_max is the color difference between pure black and pure white, and it is determined that the font color is similar to pure black when s is greater than 0.5.
  9. 一种安卓系统下适配应用通知颜色的装置,包括:A device for adapting an application notification color under an Android system, comprising:
    系统颜色获取单元,用于构造系统默认通知以获取系统默认的字体或背景颜色;以及a system color acquisition unit for constructing a system default notification to obtain a system default font or background color;
    应用配色选择单元,用于选择与所述字体或背景颜色相适应的配色风格作为应用通知的默认配色风格。The color matching unit is applied to select a color matching style suitable for the font or background color as a default color matching style of the application notification.
  10. 如权利要求9所述的装置,所述应用配色选择单元用于:The apparatus according to claim 9, wherein said application color selection unit is configured to:
    构造系统默认通知以获取系统默认的字体颜色;以及Construct a system default notification to get the system default font color;
    选择与所述字体颜色相适应的配色风格作为应用通知的默认配色风格。The color matching style that matches the color of the font is selected as the default color matching style for the application notification.
  11. 如权利要求10所述的装置,其中,所述系统颜色获取单元获取系统默认的标题文本颜色作为所述系统默认的字体颜色。The apparatus of claim 10, wherein the system color acquisition unit acquires a system default title text color as a default font color of the system.
  12. 如权利要求9所述的装置,其中,所述应用配色选择单元用于:The apparatus of claim 9, wherein the application color selection unit is configured to:
    获取系统通知配色风格;Get the system notification color style;
    在判定所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色相同或相似的情况下,选择该特定系统通知配色风格作为应用通知的默认配色风格。In the case where it is determined that the font or background color is the same or similar to the font or background color of the specific system notification color matching style, the specific system is selected to notify the color matching style as the default color matching style of the application notification.
  13. 如权利要求12所述的装置,其中,通过所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色在色彩空间内的距离来判定所述相同或相似。The apparatus of claim 12, wherein the same or similar is determined by the font or background color being notified to a particular system by a distance of a font or background color of the color matching style within the color space.
  14. 如权利要求10所述的装置,所述应用配色选择单元用于:The apparatus according to claim 10, wherein said application color selection unit is configured to:
    计算所述字体颜色与预设配色样本之间的色差值;Calculating a color difference value between the font color and a preset color matching sample;
    当所述色差值小于第一预设阈值时,选择与所述配色样本相同或相似的配色风格;否则选择与所述配色样本相异的配色风格。When the color difference value is smaller than the first preset threshold, a color matching style that is the same as or similar to the color matching sample is selected; otherwise, a color matching style different from the color matching sample is selected.
  15. 如权利要求14所述的装置,所述应用配色选择单元用于:The apparatus according to claim 14, wherein said application color selection unit is configured to:
    计算所述字体颜色与纯黑色之间的色差值;Calculating a color difference between the font color and pure black;
    在判定所述字体或背景颜色与纯黑色相似的情况下,选择黑色文字或 黑色背景配色风格,以及In the case where it is determined that the font or background color is similar to pure black, select a black text or a black background color matching style, and
    否则,选择白色文字或白色配色风格。Otherwise, choose white text or white color style.
  16. 如权利要求15所述的装置,所述应用配色选择单元用于:The apparatus according to claim 15, wherein said application color selection unit is configured to:
    判定所述字体或背景颜色与纯黑色是否相似的特征描述为:A feature that determines whether the font or background color is similar to pure black is:
    s=(1-diff)/(diff_max),s=(1-diff)/(diff_max),
    其中,s是相似度,diff是字体或背景颜色与纯黑色的色差,diff_max是纯黑色与纯白色的色差,并且在s大于0.5时判定所述字体颜色与纯黑色相似。Where s is the similarity, diff is the color difference between the font or background color and pure black, diff_max is the color difference between pure black and pure white, and it is determined that the font color is similar to pure black when s is greater than 0.5.
  17. 一种计算设备,包括:A computing device comprising:
    存储器,用于存储信息;以及a memory for storing information;
    连接至所述存储器的处理器,用于:A processor coupled to the memory for:
    构造系统默认通知以从所述存储器中获取系统默认的字体或背景颜色;以及Constructing a system default notification to get the system default font or background color from the memory;
    从所述存储器中选择与所述字体或背景颜色相适应的配色风格作为应用通知的默认配色风格。A color matching style suitable for the font or background color is selected from the memory as a default color matching style for application notification.
  18. 如权利要求17所述的计算设备,所述处理器还被配制用于:The computing device of claim 17 further configured to:
    构造系统默认通知以获取系统默认的字体颜色;以及Construct a system default notification to get the system default font color;
    选择与所述字体颜色相适应的配色风格作为应用通知的默认配色风格。The color matching style that matches the color of the font is selected as the default color matching style for the application notification.
  19. 如权利要求18所述的计算设备,所述处理器还被配制用于:The computing device of claim 18, said processor further configured to:
    获取系统默认的标题文本颜色作为所述系统默认的字体颜色。Get the system default title text color as the system default font color.
  20. 如权利要求17所述的计算设备,所述处理器还被配制用于:The computing device of claim 17 further configured to:
    获取系统通知配色风格;Get the system notification color style;
    在判定所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色相同或相似的情况下,选择该特定系统通知配色风格作为应用通知的默认配色风格。In the case where it is determined that the font or background color is the same or similar to the font or background color of the specific system notification color matching style, the specific system is selected to notify the color matching style as the default color matching style of the application notification.
  21. 如权利要求20所述的计算设备,所述处理器还被配制用于:通过所述字体或背景颜色与特定系统通知配色风格的字体或背景颜色在色彩空间内的距离来判定所述相同或相似。30. The computing device of claim 20, the processor further configured to: determine, by the font or background color, a particular system to notify a color matching style of a font or background color within a color space to determine the same or similar.
  22. 如权利要求18所述的计算设备,所述处理器还被配制用于:The computing device of claim 18, said processor further configured to:
    计算所述字体颜色与预设配色样本之间的色差值;Calculating a color difference value between the font color and a preset color matching sample;
    当所述色差值小于第一预设阈值时,选择与所述配色样本相同或相似 的配色风格;否则选择与所述配色样本相异的配色风格。When the color difference value is smaller than the first preset threshold, a color matching style that is the same as or similar to the color matching sample is selected; otherwise, a color matching style different from the color matching sample is selected.
  23. 如权利要求22所述的计算设备,所述处理器还被配制用于:The computing device of claim 22, said processor further configured to:
    计算所述字体颜色与纯黑色之间的色差值;Calculating a color difference between the font color and pure black;
    在判定所述字体或背景颜色与纯黑色相似的情况下,选择黑色文字或黑色背景配色风格,以及In the case where it is determined that the font or background color is similar to pure black, select a black text or a black background color matching style, and
    否则,选择白色文字或白色配色风格。Otherwise, choose white text or white color style.
  24. 如权利要求23所述的计算设备,所述处理器还被配制用于:The computing device of claim 23, said processor further configured to:
    判定所述字体或背景颜色与纯黑色是否相似的特征描述为:A feature that determines whether the font or background color is similar to pure black is:
    s=(1-diff)/(diff_max),s=(1-diff)/(diff_max),
    其中,s是相似度,diff是字体或背景颜色与纯黑色的色差,diff_max是纯黑色与纯白色的色差,并且在s大于0.5时判定所述字体颜色与纯黑色相似。Where s is the similarity, diff is the color difference between the font or background color and pure black, diff_max is the color difference between pure black and pure white, and it is determined that the font color is similar to pure black when s is greater than 0.5.
  25. 一种计算机可读存储介质,其上承载一个或多个计算机指令程序,所述计算机指令程序被一个或多个处理器执行时,所述一个或多个处理器执行权利要求1-8任一项所述的安卓系统下适配应用通知颜色的方法。A computer readable storage medium carrying one or more computer program programs, executed by one or more processors, the one or more processors executing any one of claims 1-8 The method of adapting the application notification color under the Android system described in the item.
PCT/CN2017/120192 2017-02-13 2017-12-29 Method and device for adapting application notification color in android system and computing equipment WO2018145536A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710075908.2 2017-02-13
CN201710075908.2A CN106873996A (en) 2017-02-13 2017-02-13 Adaptation application notifies method, device and the computing device of color under Android system

Publications (1)

Publication Number Publication Date
WO2018145536A1 true WO2018145536A1 (en) 2018-08-16

Family

ID=59165965

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/120192 WO2018145536A1 (en) 2017-02-13 2017-12-29 Method and device for adapting application notification color in android system and computing equipment

Country Status (2)

Country Link
CN (1) CN106873996A (en)
WO (1) WO2018145536A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106873996A (en) * 2017-02-13 2017-06-20 广州优视网络科技有限公司 Adaptation application notifies method, device and the computing device of color under Android system
EP4118639A4 (en) * 2020-03-11 2023-11-15 Hewlett-Packard Development Company, L.P. Color change of information elements

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120075330A1 (en) * 2006-05-03 2012-03-29 Gerhard Dietrich Klassen Dynamic theme color palette generation
CN105094549A (en) * 2015-07-20 2015-11-25 小米科技有限责任公司 Method and device for displaying messages
CN105094821A (en) * 2015-07-17 2015-11-25 百度在线网络技术(北京)有限公司 Method and device used for determining background information of invoked applications
CN105677266A (en) * 2014-11-18 2016-06-15 青岛海信移动通信技术股份有限公司 Electronic equipment and icon display method thereof
CN105700770A (en) * 2016-01-05 2016-06-22 努比亚技术有限公司 Desktop icon corner mark notification display method and terminal device
CN106873996A (en) * 2017-02-13 2017-06-20 广州优视网络科技有限公司 Adaptation application notifies method, device and the computing device of color under Android system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508666B (en) * 2011-11-11 2014-11-19 宇龙计算机通信科技(深圳)有限公司 Method and device for adjusting application prompt message in application program
CN103218115B (en) * 2013-03-06 2016-09-28 广东欧珀移动通信有限公司 The optimization display packing of a kind of informing and mobile terminal
US8929679B1 (en) * 2013-06-12 2015-01-06 Google Inc. Systems and methods for changing contrast based on brightness of an output for presentation on a display
CN107544796B (en) * 2016-06-28 2021-03-09 阿里巴巴(中国)有限公司 Notification bar message display method and device and user terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120075330A1 (en) * 2006-05-03 2012-03-29 Gerhard Dietrich Klassen Dynamic theme color palette generation
CN105677266A (en) * 2014-11-18 2016-06-15 青岛海信移动通信技术股份有限公司 Electronic equipment and icon display method thereof
CN105094821A (en) * 2015-07-17 2015-11-25 百度在线网络技术(北京)有限公司 Method and device used for determining background information of invoked applications
CN105094549A (en) * 2015-07-20 2015-11-25 小米科技有限责任公司 Method and device for displaying messages
CN105700770A (en) * 2016-01-05 2016-06-22 努比亚技术有限公司 Desktop icon corner mark notification display method and terminal device
CN106873996A (en) * 2017-02-13 2017-06-20 广州优视网络科技有限公司 Adaptation application notifies method, device and the computing device of color under Android system

Also Published As

Publication number Publication date
CN106873996A (en) 2017-06-20

Similar Documents

Publication Publication Date Title
US10062362B2 (en) Electronic device including hidden display and method for displaying information thereof
US20150317837A1 (en) Command displaying method and command displaying device
US10009534B2 (en) Device and method for detecting focus of electronic device
US9888061B2 (en) Method for organizing home screen and electronic device implementing the same
US10146412B2 (en) Method and electronic device for providing information
US10416843B2 (en) Electronic device and method of controlling object in electronic device
US9529491B2 (en) Screen display method and electronic device supporting same
US10002255B2 (en) Method and device for controlling security screen in electronic device
US10089332B2 (en) Method and electronic device for classifying contents
US20160063124A1 (en) Content search method and electronic device implementing same
US10691402B2 (en) Multimedia data processing method of electronic device and electronic device thereof
US20180181275A1 (en) Electronic device and photographing method
US20150205567A1 (en) Method and apparatus for controlling user interface
CN110462617B (en) Electronic device and method for authenticating biometric data with multiple cameras
US9959803B2 (en) Electronic device and method of content display
KR20160011388A (en) Method for display window in electronic device and the electronic device thereof
WO2018145536A1 (en) Method and device for adapting application notification color in android system and computing equipment
US20160086138A1 (en) Method and apparatus for providing function by using schedule information in electronic device
US20150363093A1 (en) Method and device for displaying application execution screen in electronic device
US9959598B2 (en) Method of processing image and electronic device thereof
US10334173B2 (en) Electronic device and method for editing image in electronic device
US20180157377A1 (en) Electronic device and method for providing graphic user interface therefor
CN112988810B (en) Information searching method, device and equipment
US11176207B2 (en) Method and electronic device for classifying content
US20160034165A1 (en) Activity processing method and electronic device supporting the same

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: 17895866

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: 17895866

Country of ref document: EP

Kind code of ref document: A1