[go: up one dir, main page]

CN107038037A - Display mode switching method and device - Google Patents

Display mode switching method and device Download PDF

Info

Publication number
CN107038037A
CN107038037A CN201710365350.1A CN201710365350A CN107038037A CN 107038037 A CN107038037 A CN 107038037A CN 201710365350 A CN201710365350 A CN 201710365350A CN 107038037 A CN107038037 A CN 107038037A
Authority
CN
China
Prior art keywords
predetermined
picture
type
screen
user interface
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201710365350.1A
Other languages
Chinese (zh)
Other versions
CN107038037B (en
Inventor
王辰汐
高承星
颜征
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201710365350.1A priority Critical patent/CN107038037B/en
Publication of CN107038037A publication Critical patent/CN107038037A/en
Application granted granted Critical
Publication of CN107038037B publication Critical patent/CN107038037B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Landscapes

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

Abstract

本公开揭示了一种显示模式切换方法及装置,属于移动终端领域。所述方法包括:获取操作系统的第一显示模式;当操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式;其中,预定方式包括:将应用程序的用户界面中的第一类元素转换为预定色调,和/或,在应用程序的用户界面中的第二类元素上添加预定透明度的图层,预定色调是与夜间模式对应的色调。解决了屏幕亮度的手动可调范围有限,即使手动调节到最低亮度,屏幕上显示的白色或浅色区域与黑暗的光线环境仍存在较高对比,从而损害用户视力的问题,达到了降低屏幕光线与黑暗环境之间的对比,减少光线刺激,保护用户视力的效果。

The disclosure discloses a display mode switching method and device, belonging to the field of mobile terminals. The method includes: acquiring the first display mode of the operating system; when the first display mode of the operating system is night mode, switching the second display mode of the application being displayed on the screen to night mode in a predetermined manner; wherein, Predetermined means include converting elements of the first type in the user interface of the application to a predetermined color tone, and/or adding a layer of predetermined transparency on elements of the second type in the user interface of the application, the predetermined color tone being the same as that of night The hue corresponding to the mode. Solve the problem that the manual adjustable range of the screen brightness is limited. Even if the brightness is manually adjusted to the lowest level, there is still a high contrast between the white or light-colored areas displayed on the screen and the dark light environment, which will damage the user's vision, and achieve the goal of reducing the screen light. The contrast with the dark environment reduces light stimulation and protects the user's eyesight.

Description

显示模式切换方法及装置Display mode switching method and device

技术领域technical field

本公开涉及移动终端领域,特别涉及一种显示模式切换方法及装置。The present disclosure relates to the field of mobile terminals, and in particular to a display mode switching method and device.

背景技术Background technique

在夜间使用手机时,由于夜间光线环境较暗,手机屏幕的光线与黑暗的光线环境之间会形成过高对比,从而使得手机屏幕对用户的眼睛造成很大刺激,损害用户视力。When using a mobile phone at night, due to the dark light environment at night, the contrast between the light of the mobile phone screen and the dark light environment will be too high, so that the mobile phone screen will greatly stimulate the user's eyes and damage the user's vision.

为了使用户在夜间使用手机时,能够减少屏幕光线对视力的损害,一些应用程序提供了夜间模式。相对于正常模式,夜间模式是一种适合在弱光环境下使用的显示模式,但某些应用程序不提供夜间模式,对于这些不提供夜间模式的应用程序,终端通常会通过调低屏幕亮度来降低屏幕光线与周围光线环境之间的对比,减少屏幕对眼睛的刺激。In order to enable users to reduce the damage of screen light to eyesight when using mobile phones at night, some applications provide night mode. Compared with normal mode, night mode is a display mode suitable for use in low-light environments, but some applications do not provide night mode. For these applications that do not provide night mode, the terminal usually reduces the screen brightness Reduce the contrast between the screen light and the surrounding light environment, and reduce the screen's irritation to the eyes.

由于屏幕亮度的手动可调范围有限,即使手动调节到最低亮度,屏幕光线与黑暗的光线环境之间仍存在较高对比,另外,对于屏幕上显示的白色或浅色区域,发出的光线依然会对眼睛造成较大刺激,从而损害用户的视力。Due to the limited manual adjustable range of the screen brightness, even if the brightness is manually adjusted to the lowest level, there is still a high contrast between the screen light and the dark light environment. Causes greater irritation to the eyes, thereby impairing the user's vision.

发明内容Contents of the invention

为了解决由于屏幕亮度的手动可调范围有限,即时手动调节到最低亮度,屏幕上显示的白色或浅色区域与黑暗的光线环境之间仍存在较高对比,从而损害用户视力的问题,本公开提供一种显示模式切换方法及装置。所述技术方案如下:In order to solve the problem that due to the limited manual adjustable range of the screen brightness, even if it is manually adjusted to the lowest brightness, there is still a high contrast between the white or light-colored areas displayed on the screen and the dark light environment, thereby damaging the user's vision. Provided are a display mode switching method and device. Described technical scheme is as follows:

根据本公开实施例的第一方面,提供一种显示模式切换方法,所述方法包括:According to a first aspect of an embodiment of the present disclosure, a display mode switching method is provided, the method comprising:

获取所述操作系统的第一显示模式;acquiring a first display mode of the operating system;

当所述操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式;When the first display mode of the operating system is the night mode, switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner;

其中,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调,和/或,在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层,所述预定色调是与所述夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a color with predetermined transparency to the second type of elements in the user interface of the application program layer, the predetermined color tone is the color tone corresponding to the night mode.

可选的,所述第一类元素与所述第二类元素的合集组成所述应用程序的用户界面,所述第一类元素与所述第二类元素之间存在或不存在交集。Optionally, a collection of the first type of elements and the second type of elements constitutes the user interface of the application program, and there is or is not an intersection between the first type of elements and the second type of elements.

可选的,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调;Optionally, the predetermined manner includes: converting the first type of elements in the user interface of the application program to a predetermined tone;

所述通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式,包括:The switching the second display mode of the application being displayed on the screen to the night mode in a predetermined manner includes:

将所述应用程序的用户界面中的图片转换为所述预定色调;converting an image in the user interface of the application program to the predetermined color tone;

和/或,and / or,

将所述应用程序的用户界面中的文字转换为预定颜色,所述预定颜色是属于所述预定色调的颜色。Converting text in the user interface of the application program to a predetermined color, the predetermined color being a color belonging to the predetermined hue.

可选的,所述将所述应用程序的用户界面中的图片转换为所述预定色调,包括:Optionally, converting the picture in the user interface of the application program to the predetermined tone includes:

检测所述应用程序的用户界面中的图片的图片类型,所述图片类型包括:第一图片类型和第二图片类型,所述第一图片类型的高度等于所述屏幕的像素高度或所述第一图片类型的宽度等于所述屏幕的像素宽度,所述第二图片类型的高度小于所述屏幕的像素高度且所述第二图片类型的宽度小于所述屏幕的像素宽度;Detecting the picture type of the picture in the user interface of the application program, the picture type includes: a first picture type and a second picture type, and the height of the first picture type is equal to the pixel height of the screen or the second picture type The width of a picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen, and the width of the second picture type is smaller than the pixel width of the screen;

当所述应用程序的用户界面中的图片属于所述第一图片类型时,将所述图片按照第一颜色矩阵转换为所述预定色调;When the picture in the user interface of the application program belongs to the first picture type, converting the picture into the predetermined tone according to a first color matrix;

当所述应用程序的用户界面中的图片属于所述第二图片类型时,将所述图片按照第二颜色矩阵转换为所述预定色调;When the picture in the user interface of the application program belongs to the second picture type, converting the picture into the predetermined tone according to a second color matrix;

其中,所述第一颜色矩阵和所述第二颜色矩阵不同。Wherein, the first color matrix and the second color matrix are different.

可选的,所述预定方式包括:在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层;Optionally, the predetermined method includes: adding a layer of predetermined transparency on the second type of element in the user interface of the application program;

所述通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式,包括:The switching the second display mode of the application being displayed on the screen to the night mode in a predetermined manner includes:

检测所述应用程序的用户界面中的图片的图片类型,所述图片类型包括:第一图片类型和第二图片类型,所述第一图片类型的高度等于所述屏幕的像素高度或所述第一图片类型的宽度等于所述屏幕的像素宽度,所述第二图片类型的高度小于所述屏幕的像素高度且所述第二图片类型的宽度小于所述屏幕的像素宽度;Detecting the picture type of the picture in the user interface of the application program, the picture type includes: a first picture type and a second picture type, and the height of the first picture type is equal to the pixel height of the screen or the second picture type The width of a picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen, and the width of the second picture type is smaller than the pixel width of the screen;

当所述应用程序的用户界面中的图片属于所述第一图片类型时,在所述图片上增加第一透明度的图层;When the picture in the user interface of the application program belongs to the first picture type, adding a first transparency layer on the picture;

当所述应用程序的用户界面中的图片属于所述第二图片类型时,在所述图片上增加第二透明度的图层;When the picture in the user interface of the application program belongs to the second picture type, adding a second transparency layer on the picture;

其中,所述第一透明度和所述第二透明度不同,且所述第一透明度和所述第二透明度的取值范围为0至1,0表示完全透明,1表示不透明。Wherein, the first transparency and the second transparency are different, and the value range of the first transparency and the second transparency is 0 to 1, 0 means completely transparent, and 1 means opaque.

可选的,所述预定方式还包括:将所述屏幕的背光亮度调节为与所述夜间模式对应的亮度值。Optionally, the predetermined method further includes: adjusting the brightness of the backlight of the screen to a brightness value corresponding to the night mode.

可选的,与所述夜间模式对应的亮度值小于所述屏幕的背光亮度的手动可调范围的最小值。Optionally, the brightness value corresponding to the night mode is smaller than the minimum value of the manually adjustable range of the backlight brightness of the screen.

可选的,所述方法还包括:Optionally, the method also includes:

在检测到光照强度小于第一阈值时,将所述操作系统的第一显示模式切换为所述夜间模式;When it is detected that the light intensity is less than a first threshold, switching the first display mode of the operating system to the night mode;

或者,or,

在检测到光照强度小于所述第一阈值时,在所述屏幕上显示提示消息,所述提示消息用于提示用户开启所述操作系统的所述夜间模式。When it is detected that the light intensity is less than the first threshold, a prompt message is displayed on the screen, and the prompt message is used to prompt the user to turn on the night mode of the operating system.

可选的,所述方法还包括:Optionally, the method also includes:

检测所述应用程序是否支持应用内的夜间模式;Detect whether said application supports an in-app night mode;

当所述应用程序不支持应用内的夜间模式时,执行所述通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式的步骤。When the application does not support the night mode in the application, the step of switching the second display mode of the application being displayed on the screen to the night mode in a predetermined manner is performed.

可选的,所述检测所述应用程序是否支持应用内的夜间模式,包括:Optionally, the detecting whether the application supports the night mode in the application includes:

读取所述应用程序的头文件中的预定标识,所述预定标识的取值用于表示所述应用程序是否支持应用内的夜间模式;Reading the predetermined identifier in the header file of the application, the value of the predetermined identifier is used to indicate whether the application supports the night mode in the application;

当所述预定标识的取值为第一取值时,确定所述应用程序不支持应用内的夜间模式。When the value of the predetermined identifier is the first value, it is determined that the application program does not support the night mode in the application program.

根据本公开实施例的第二方面,提供一种显示模式切换装置,应用于操作系统中,所述装置包括:According to the second aspect of the embodiments of the present disclosure, there is provided a display mode switching device, which is applied in an operating system, and the device includes:

获取模块,被配置为获取所述操作系统的第一显示模式;an acquisition module configured to acquire the first display mode of the operating system;

第一切换模块,被配置为当所述获取模块获取的所述操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式;The first switching module is configured to switch the second display mode of the application being displayed on the screen to the nighttime mode in a predetermined manner when the first display mode of the operating system acquired by the acquiring module is the nighttime mode model;

其中,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调,和/或,在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层,所述预定色调是与所述夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a color with predetermined transparency to the second type of elements in the user interface of the application program layer, the predetermined color tone is the color tone corresponding to the night mode.

可选的,所述第一类元素与所述第二类元素的合集组成所述应用程序的用户界面,所述第一类元素与所述第二类元素之间存在或不存在交集。Optionally, a collection of the first type of elements and the second type of elements constitutes the user interface of the application program, and there is or is not an intersection between the first type of elements and the second type of elements.

可选的,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调;Optionally, the predetermined manner includes: converting the first type of elements in the user interface of the application program to a predetermined tone;

所述第一切换模块,还被配置为:The first switching module is further configured to:

将所述应用程序的用户界面中的图片转换为所述预定色调;converting an image in the user interface of the application program to the predetermined color tone;

和/或,and / or,

将所述应用程序的用户界面中的文字转换为预定颜色,所述预定颜色是属于所述预定色调的颜色。Converting text in the user interface of the application program to a predetermined color, the predetermined color being a color belonging to the predetermined hue.

可选的,所述第一切换模块,包括:Optionally, the first switching module includes:

第一检测子模块,被配置为检测所述应用程序的用户界面中的图片的图片类型,所述图片类型包括:第一图片类型和第二图片类型,所述第一图片类型的高度等于所述屏幕的像素高度或所述第一图片类型的宽度等于所述屏幕的像素宽度,所述第二图片类型的高度小于所述屏幕的像素高度且所述第二图片类型的宽度小于所述屏幕的像素宽度;The first detection submodule is configured to detect the picture type of the picture in the user interface of the application program, the picture type includes: a first picture type and a second picture type, and the height of the first picture type is equal to the The pixel height of the screen or the width of the first picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen, and the width of the second picture type is smaller than the screen the pixel width of

第一转换子模块,被配置为当所述第一检测子模块检测到所述应用程序的用户界面中的图片属于所述第一图片类型时,将所述图片按照第一颜色矩阵转换为所述预定色调;The first conversion submodule is configured to convert the picture into the first picture type according to the first color matrix when the first detection submodule detects that the picture in the user interface of the application program belongs to the first picture type. the predetermined color;

第二转换子模块,被配置为当所述第一检测子模块检测到所述应用程序的用户界面中的图片属于所述第二图片类型时,将所述图片按照第二颜色矩阵转换为所述预定色调;The second conversion submodule is configured to convert the picture into the second picture type according to the second color matrix when the first detection submodule detects that the picture in the user interface of the application program belongs to the second picture type. the predetermined color;

其中,所述第一颜色矩阵和所述第二颜色矩阵不同。Wherein, the first color matrix and the second color matrix are different.

可选的,所述预定方式包括:在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层;Optionally, the predetermined method includes: adding a layer of predetermined transparency on the second type of element in the user interface of the application program;

所述第一切换模块,包括:The first switching module includes:

第二检测子模块,被配置为检测所述应用程序的用户界面中的图片的图片类型,所述图片类型包括:第一图片类型和第二图片类型,所述第一图片类型的高度等于所述屏幕的像素高度或所述第一图片类型的宽度等于所述屏幕的像素宽度,所述第二图片类型的高度小于所述屏幕的像素高度且所述第二图片类型的宽度小于所述屏幕的像素宽度;The second detection submodule is configured to detect the picture type of the picture in the user interface of the application program, the picture type includes: a first picture type and a second picture type, and the height of the first picture type is equal to the The pixel height of the screen or the width of the first picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen, and the width of the second picture type is smaller than the screen the pixel width of

第一增加子模块,被配置为当所述第二检测子模块检测到所述应用程序的用户界面中的图片属于所述第一图片类型时,在所述图片上增加第一透明度的图层;The first adding submodule is configured to add a first transparency layer on the picture when the second detection submodule detects that the picture in the user interface of the application program belongs to the first picture type ;

第二增加子模块,被配置为当所述第二检测子模块检测到所述应用程序的用户界面中的图片属于所述第二图片类型时,在所述图片上增加第二透明度的图层;The second adding submodule is configured to add a second transparency layer on the picture when the second detection submodule detects that the picture in the user interface of the application program belongs to the second picture type ;

其中,所述第一透明度和所述第二透明度不同,且所述第一透明度和所述第二透明度的取值范围为0至1,0表示完全透明,1表示不透明。Wherein, the first transparency and the second transparency are different, and the value range of the first transparency and the second transparency is 0 to 1, 0 means completely transparent, and 1 means opaque.

可选的,所述预定方式还包括:将所述屏幕的背光亮度调节为与所述夜间模式对应的亮度值。Optionally, the predetermined method further includes: adjusting the brightness of the backlight of the screen to a brightness value corresponding to the night mode.

可选的,与所述夜间模式对应的亮度值小于所述屏幕的背光亮度的手动可调范围的最小值。Optionally, the brightness value corresponding to the night mode is smaller than the minimum value of the manually adjustable range of the backlight brightness of the screen.

可选的,所述装置还包括:Optionally, the device also includes:

第二切换模块,被配置为在检测到光照强度小于第一阈值时,将所述操作系统的第一显示模式切换为所述夜间模式;The second switching module is configured to switch the first display mode of the operating system to the night mode when it is detected that the light intensity is less than a first threshold;

或者,or,

显示模块,被配置为在检测到光照强度小于所述第一阈值时,在所述屏幕上显示提示消息,所述提示消息用于提示用户开启所述操作系统的所述夜间模式。The display module is configured to display a prompt message on the screen when it is detected that the light intensity is less than the first threshold, and the prompt message is used to prompt the user to turn on the night mode of the operating system.

可选的,所述装置还包括:Optionally, the device also includes:

检测模块,被配置为检测所述应用程序是否支持应用内的夜间模式;a detection module configured to detect whether the application supports a night mode within the application;

所述第一切换模块,被配置为当所述应用程序不支持应用内的夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式。The first switching module is configured to switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner when the application does not support the night mode in the application.

可选的,所述检测模块,包括:Optionally, the detection module includes:

读取子模块,被配置为读取所述应用程序的头文件中的预定标识,所述预定标识的取值用于表示所述应用程序是否支持应用内的夜间模式;The reading submodule is configured to read a predetermined identifier in the header file of the application, and the value of the predetermined identifier is used to indicate whether the application supports the night mode in the application;

确定子模块,被配置为当所述预定标识的取值为第一取值时,确定所述应用程序不支持应用内的夜间模式。The determination submodule is configured to determine that the application does not support the night mode within the application when the value of the predetermined identifier is the first value.

根据本公开实施例的第三方面,提供一种显示模式切换装置,所述装置包括:According to a third aspect of the embodiments of the present disclosure, there is provided a display mode switching device, the device comprising:

处理器;processor;

用于存储所述处理器可执行指令的存储器;memory for storing said processor-executable instructions;

其中,所述处理器被配置为:Wherein, the processor is configured as:

获取所述操作系统的第一显示模式;acquiring a first display mode of the operating system;

当所述操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式;When the first display mode of the operating system is the night mode, switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner;

其中,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调,和/或,在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层,所述预定色调是与所述夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a color with predetermined transparency to the second type of elements in the user interface of the application program layer, the predetermined color tone is the color tone corresponding to the night mode.

根据本公开实施例的第三方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:According to a third aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

获取所述操作系统的第一显示模式;acquiring a first display mode of the operating system;

当所述操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式;When the first display mode of the operating system is the night mode, switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner;

其中,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调,和/或,在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层,所述预定色调是与所述夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a color with predetermined transparency to the second type of elements in the user interface of the application program layer, the predetermined color tone is the color tone corresponding to the night mode.

本公开的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

在操作系统的第一显示模式为夜间模式时,通过将用户界面中的第一类元素转换为预定色调和/或在用户界面的第二类元素上添加预定透明度的图层,将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式;由于通过转换色调或添加图层的方式改变应用程序的用户界面上的白色或浅色区域,使得屏幕发出的光线与黑暗的光线环境之间的对比降低,解决了屏幕亮度的手动可调范围有限,即使手动调节到最低亮度,屏幕上显示的白色或浅色区域与黑暗的光线环境之间仍存在较高对比,从而损害用户视力的问题;达到了降低屏幕光线与黑暗环境之间的对比,减少光线对眼睛的刺激,保护用户视力的效果。When the first display mode of the operating system is night mode, by converting the first type of elements in the user interface to a predetermined color tone and/or adding a layer of predetermined transparency on the second type of user interface elements, the current display on the screen The displayed app's secondary display mode switches to night mode; the difference between the light emitted by the screen and the dark light environment is due to changing the white or light areas on the app's user interface by shifting the color tone or adding layers The contrast reduction of the screen brightness solves the problem that the manual adjustable range of the screen brightness is limited. Even if the brightness is manually adjusted to the lowest level, there is still a high contrast between the white or light-colored areas displayed on the screen and the dark light environment, thereby damaging the user's vision. ; It achieves the effect of reducing the contrast between the screen light and the dark environment, reducing the stimulation of light to the eyes, and protecting the user's eyesight.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.

图1是根据一示例性实施例示出的一种显示模式切换方法的流程图;Fig. 1 is a flow chart showing a display mode switching method according to an exemplary embodiment;

图2是根据另一示例性实施例示出的一种显示模式切换方法的流程图;Fig. 2 is a flow chart showing a display mode switching method according to another exemplary embodiment;

图3是根据再一示例性实施例示出的一种显示模式切换方法的流程图Fig. 3 is a flow chart of a display mode switching method according to yet another exemplary embodiment

图4是根据一示例性实施例示出的操作系统将应用程序由正常模式切换为夜间模式的示意图;Fig. 4 is a schematic diagram showing an operating system switching an application program from a normal mode to a night mode according to an exemplary embodiment;

图5是根据一示例性实施例示出的一种显示模式切换装置的框图;Fig. 5 is a block diagram of a device for switching display modes according to an exemplary embodiment;

图6是根据另一示例性实施例示出的一种显示模式切换装置的框图;Fig. 6 is a block diagram of a device for switching display modes according to another exemplary embodiment;

图7是根据一示例性实施例示出的一种终端的框图。Fig. 7 is a block diagram of a terminal according to an exemplary embodiment.

具体实施方式detailed description

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present disclosure as recited in the appended claims.

图1是根据一示例性实施例示出的一种显示模式切换方法的流程图,如图1所示,本实施例以该显示模式切换方法应用在终端上的操作系统中来举例说明。该显示模式切换方法可以包括以下步骤。Fig. 1 is a flow chart showing a display mode switching method according to an exemplary embodiment. As shown in Fig. 1 , this embodiment is described by taking the display mode switching method applied to an operating system on a terminal as an example. The display mode switching method may include the following steps.

在步骤101中,获取操作系统的第一显示模式。In step 101, a first display mode of an operating system is obtained.

在步骤102中,当操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式。In step 102, when the first display mode of the operating system is the night mode, the second display mode of the application being displayed on the screen is switched to the night mode in a predetermined manner.

其中,预定方式包括:将应用程序的用户界面中的第一类元素转换为预定色调,和/或,在应用程序的用户界面中的第二类元素上添加预定透明度的图层,预定色调是与夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a layer of predetermined transparency on the second type of elements in the user interface of the application program, and the predetermined color tone is The hue corresponding to night mode.

综上所述,本公开实施例中提供的显示模式切换方法,在操作系统的第一显示模式为夜间模式时,通过将用户界面中的第一类元素转换为预定色调和/或在用户界面的第二类元素上添加预定透明度的图层,将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式;由于通过转换色调或添加图层的方式改变应用程序的用户界面上的白色或浅色区域,使得屏幕发出的光线与黑暗的光线环境之间的对比降低,解决了屏幕亮度的手动可调范围有限,即使手动调节到最低亮度,屏幕上显示的白色或浅色区域与黑暗的光线环境之间仍存在较高对比,从而损害用户视力的问题;达到了降低屏幕光线与黑暗环境之间的对比,减少光线对眼睛的刺激,保护用户视力的效果。To sum up, in the display mode switching method provided in the embodiments of the present disclosure, when the first display mode of the operating system is the night mode, by converting the first type of elements in the user interface to a predetermined tone and/or in the user interface Add a layer of predetermined transparency on the second type of elements of the , and switch the second display mode of the application being displayed on the screen to night mode; due to changing the white color on the user interface of the application by converting the color tone or adding a layer or light-colored areas, which reduces the contrast between the light emitted by the screen and the dark light environment, and solves the problem that the manual adjustment range of the screen brightness is limited. There is still a high contrast between the light environment, which will damage the user's vision; it has achieved the effect of reducing the contrast between the screen light and the dark environment, reducing the stimulation of light to the eyes, and protecting the user's vision.

图2是根据另一示例性实施例示出的一种显示模式切换方法的流程图,如图2所示,本实施例以该显示模式切换方法应用在终端上的操作系统中来举例说明。该显示模式切换方法可以包括以下步骤。Fig. 2 is a flow chart showing a display mode switching method according to another exemplary embodiment. As shown in Fig. 2 , this embodiment is described by taking the display mode switching method applied to an operating system on a terminal as an example. The display mode switching method may include the following steps.

在步骤201中,在检测到光照强度小于第一阈值时,将操作系统的第一显示模式切换为夜间模式。In step 201, when it is detected that the light intensity is less than the first threshold, the first display mode of the operating system is switched to the night mode.

在一种可能的实现方式中,操作系统在检测到周围环境的光照强度小于第一阈值,自动将操作系统的第一显示模式切换为夜间模式,以降低屏幕光线与光照强度较弱的环境之间的对比。In a possible implementation, when the operating system detects that the light intensity of the surrounding environment is lower than the first threshold, it automatically switches the first display mode of the operating system to the night mode, so as to reduce the difference between the screen light and the environment with weak light intensity. contrast between.

第一显示模式是系统级的显示模式。The first display mode is a system-level display mode.

夜间模式是适用于光照强度小于预定阈值的显示模式。The night mode is a display mode suitable for light intensity less than a predetermined threshold.

在另一种可能的实现方式中,操作系统中设置有第一显示模式的切换开关,用户可以手动控制切换开关来决定操作系统的第一显示模式。第一显示模式代表对操作系统以及运行在操作系统之上的各个应用程序均有效。In another possible implementation manner, the operating system is provided with a switch for the first display mode, and the user can manually control the switch to determine the first display mode of the operating system. The first display mode is valid for the operating system and various application programs running on the operating system.

比如:操作系统向用户提供的一个全局的夜间模式的开关,在设置资源对应的程序中添加键为“**ui_night_mode_enabled”,值为0或1的代码,**ui为操作系统的名称,值为1表示开启操作系统的夜间模式,值为0表示关闭操作系统的夜间模式,默认为关闭。当开关切换时,值也会改变,操作系统根据该夜间模式的值,则可以确定操作系统对应的第一显示模式。For example: a global night mode switch provided by the operating system to the user, add a code whose key is "**ui_night_mode_enabled" and the value is 0 or 1 in the program corresponding to the setting resource, **ui is the name of the operating system, and the value is A value of 1 means that the night mode of the operating system is turned on, a value of 0 means that the night mode of the operating system is turned off, and the default is off. When the switch is switched, the value will also change, and the operating system can determine the first display mode corresponding to the operating system according to the value of the night mode.

可选的,操作系统在检测到光照强度小于第一阈值时,在屏幕上显示提示消息,提示消息用于提示用户开启操作系统的夜间模式。Optionally, when the operating system detects that the light intensity is less than the first threshold, a prompt message is displayed on the screen, and the prompt message is used to prompt the user to turn on the night mode of the operating system.

当用户看到屏幕上的提示消息时,用户通过控制第一显示模式的切换开关,可以将操作系统的第一显示模式切换为夜间模式。When the user sees the prompt message on the screen, the user can switch the first display mode of the operating system to the night mode by controlling the switching switch of the first display mode.

在步骤202中,获取操作系统的第一显示模式。In step 202, a first display mode of the operating system is obtained.

操作系统通过读取夜间模式的值,可以确定操作系统当前的第一显示模式。The operating system can determine the current first display mode of the operating system by reading the value of the night mode.

在步骤203中,当操作系统的第一显示模式为夜间模式时,检测屏幕上正在显示的应用程序是否支持应用内的夜间模式。In step 203, when the first display mode of the operating system is the night mode, it is detected whether the application being displayed on the screen supports the night mode in the application.

可选的,操作系统检测应用程序是否支持应用内的夜间模式,可以通过以下方式:Optionally, the operating system detects whether the application supports the night mode in the application through the following methods:

第一步,读取应用程序的头文件中的预定标识。In the first step, the predetermined identification in the header file of the application is read.

预定标识的取值用于表示应用程序是否支持应用内的夜间模式。The value of the predetermined flag is used to indicate whether the application supports the night mode in the application.

第二步,当预定标识的取值为第一取值时,确定应用程序不支持应用内的夜间模式。In the second step, when the value of the predetermined identifier is the first value, it is determined that the application program does not support the night mode in the application program.

比如:预定标识的名称为:name=“support_**ui_night_mode”,取值为:value=“false”,表示应用程序不支持应用内的夜间模式,第一取值为false。For example: the name of the predetermined identifier is: name="support_**ui_night_mode", and the value is: value="false", indicating that the application program does not support the night mode in the application, and the first value is false.

可选的,若预定标识的取值为第二取值,表明应用程序支持应用内的夜间模式,则应用程序中存储有关于夜间模式的模式参数,应用程序根据操作系统的第一显示模式,只需要自行根据自身提供的夜间模式的模式参数切换成对应的第二显示模式即可。对应是指第一显示模式与第二显示模式均为夜间模式或均为正常模式。Optionally, if the value of the predetermined identifier is the second value, it indicates that the application supports the night mode in the application, then the application stores mode parameters about the night mode, and the application, according to the first display mode of the operating system, You only need to switch to the corresponding second display mode according to the mode parameters of the night mode provided by yourself. Correspondence refers to that the first display mode and the second display mode are both night mode or normal mode.

第二显示模式是应用级的显示模式。夜间模式是适用于光照强度小于第一阈值的显示模式,正常模式是适用于光照强度大于第二阈值的显示模式,第一阈值与第二阈值相同或不同。The second display mode is an application-level display mode. The night mode is a display mode suitable for light intensity less than a first threshold, and the normal mode is a display mode suitable for light intensity greater than a second threshold, and the first threshold is the same as or different from the second threshold.

在一种可能的实现中,应用程序的头文件中没有预定标识,则操作系统直接确定该应用程序不支持应用内的夜间模式。In a possible implementation, if there is no predetermined identifier in the header file of the application, the operating system directly determines that the application does not support the night mode in the application.

在步骤204中,当应用程序不支持应用内的夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式。In step 204, when the application does not support the night mode in the application, the second display mode of the application being displayed on the screen is switched to the night mode in a predetermined manner.

第二显示模式是应用级的显示模式。The second display mode is an application-level display mode.

可选的,预定方式包括:将应用程序的用户界面中的第一类元素转换为预定色调,和/或,在应用程序的用户界面中的第二类元素上添加预定透明度的图层。其中,预定色调是与夜间模式对应的色调。Optionally, the predetermined manner includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a layer of predetermined transparency on the second type of elements in the user interface of the application program. Wherein, the predetermined color tone is the color tone corresponding to the night mode.

第一类元素与第二类元素的合集组成应用程序的用户界面,第一类元素与第二类元素之间存在或不存在交集。The collection of the elements of the first type and the elements of the second type constitutes the user interface of the application program, and the intersection between the elements of the first type and the elements of the second type may or may not exist.

当应用程序的用户界面上只有第一类元素,没有第二类元素时,第一类元素组成应用程序的用户界面;当应用程序的用户界面上只有第二类元素,没有第一类元素时,第二类元素组成应用程序的用户界面。When there are only elements of the first type and no elements of the second type on the user interface of the application, the elements of the first type form the user interface of the application; when there are only elements of the second type and no elements of the first type on the user interface of the application , the second class of elements that make up the application's user interface.

用户界面上的元素包括图片、文字、按钮、控件、背景等。Elements on the user interface include pictures, text, buttons, controls, backgrounds, etc.

第一类元素与第二类元素可能有交集,或者,第一类元素与第二类元素相同,或者用户界面上都是第一类元素,或者,用户界面上都是第二类元素。The elements of the first type may overlap with the elements of the second type, or the elements of the first type and the elements of the second type are the same, or the elements of the first type are all on the user interface, or the elements of the second type are all on the user interface.

结合参考图3,若预定方式包括:将应用程序的用户界面中的第一类元素转换为预定色调,则步骤204可以被替换成步骤204a至步骤204b。With reference to FIG. 3 , if the predetermined manner includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, then step 204 may be replaced by steps 204a to 204b.

在步骤204a中,当应用程序不支持应用内的夜间模式时,将应用程序的用户界面中的图片转换为预定色调。In step 204a, when the application program does not support the night mode in the application program, the picture in the user interface of the application program is converted to a predetermined tone.

色调是指应用程序的用户界面中包含的至少一种颜色,比如:用户界面的背景为黑色,用户界面中的按钮控件为深灰色,用户界面中的文字为浅灰色。对于用户界面中的不同元素,应用程序根据夜间模式的模式参数切换为对应的颜色。The color tone refers to at least one color included in the user interface of the application program, for example: the background of the user interface is black, the button control in the user interface is dark gray, and the text in the user interface is light gray. For different elements in the user interface, the application switches to the corresponding color according to the mode parameter of the night mode.

结合参考图4,屏幕10上显示有阅读类应用程序的用户界面,用户界面中包括标题区域11和正文区域12,当阅读类应用程序的第二显示模式为正常模式时,标题区域11的背景颜色为灰白色,正文区域12的背景颜色为白色,文字颜色为黑色,当阅读类应用程序的第二显示模式由正常模式切换为夜间模式时,标题区域21的背景颜色转换为深灰色,正文区域22的背景颜色为浅灰色,文字颜色为灰白色。With reference to FIG. 4 , the user interface of the reading application is displayed on the screen 10. The user interface includes a title area 11 and a text area 12. When the second display mode of the reading application is the normal mode, the background of the title area 11 The color is off-white, the background color of the text area 12 is white, and the text color is black. When the second display mode of the reading application is switched from normal mode to night mode, the background color of the title area 21 is converted to dark gray, and the text area The background color of 22 is light gray, and the text color is off-white.

可选的,将应用程序的用户界面中的图片转换为预定色调,可以通过以下步骤实现:Optionally, converting the picture in the user interface of the application program to a predetermined tone can be achieved through the following steps:

第一步,检测应用程序的用户界面中的图片的图片类型。In the first step, the image type of the image in the user interface of the application is detected.

图片类型包括:第一图片类型和第二图片类型,第一图片类型的高度等于屏幕的像素高度或第一图片类型的宽度等于屏幕的像素宽度,第二图片类型的高度小于屏幕的像素高度且第二图片类型的宽度小于屏幕的像素宽度。The picture type includes: a first picture type and a second picture type, the height of the first picture type is equal to the pixel height of the screen or the width of the first picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen and The width of the second image type is smaller than the pixel width of the screen.

第二步,当应用程序的用户界面中的图片属于第一图片类型时,将图片按照第一颜色矩阵转换为预定色调。In the second step, when the picture in the user interface of the application program belongs to the first picture type, convert the picture into a predetermined tone according to the first color matrix.

第三步,当应用程序的用户界面中的图片属于第二图片类型时,将图片按照第二颜色矩阵转换为预定色调。In the third step, when the picture in the user interface of the application program belongs to the second picture type, convert the picture into a predetermined tone according to the second color matrix.

其中,第二步与第三步是并列的步骤,第二步中的第一颜色矩阵与第三步中的第二颜色矩阵不同。Wherein, the second step and the third step are parallel steps, and the first color matrix in the second step is different from the second color matrix in the third step.

由于在实际实现时,操作系统无法区分用户界面中的每个图片的作用,因此根据图片的大小来识别。比如:图片的高度乘以宽度等于屏幕大小,则确定该图片为背景。Since the operating system cannot distinguish the function of each picture in the user interface during actual implementation, it is identified according to the size of the picture. For example: if the height multiplied by the width of the picture is equal to the screen size, then the picture is determined to be the background.

针对用户界面中不同尺寸的图片,转换的颜色不同,每个图片转换的颜色均属于预定色调。其中,颜色矩阵是一个5*4的矩阵,比如,颜色矩阵M是以一维数组[a,b,c,d,e,f,g,h,I,j,k,l,m,n,o,p,q,r,s,t]的方式进行存储,表示成:For pictures of different sizes in the user interface, the converted colors are different, and the converted color of each picture belongs to a predetermined tone. Among them, the color matrix is a 5*4 matrix. For example, the color matrix M is a one-dimensional array [a,b,c,d,e,f,g,h,I,j,k,l,m,n , o, p, q, r, s, t] to store, expressed as:

在图片中,RGBA(红色、绿色、蓝色、透明度)值决定图片呈现出来的颜色效果,通过将颜色矩阵与图片的RGBA值相乘,就可以使图片根据颜色矩阵改变颜色效果。In the picture, the RGBA (red, green, blue, transparency) value determines the color effect of the picture. By multiplying the color matrix with the RGBA value of the picture, the picture can be changed according to the color matrix.

在颜色矩阵中,第一行参数abcde决定图片的红色成分,第二行参数fghij决定图片的绿色成分,第三行参数klmno决定图片的蓝色成分,第四行参数pqrst决定图片的透明度,另外,第五列参数中的e决定红色的偏移量,j决定绿色的偏移量,o决定蓝色的偏移量,t决定透明度的偏移量。In the color matrix, the parameter abcde in the first line determines the red component of the picture, the parameter fghij in the second line determines the green component of the picture, the parameter klmno in the third line determines the blue component of the picture, and the parameter pqrst in the fourth line determines the transparency of the picture. , e in the fifth column parameter determines the offset of red, j determines the offset of green, o determines the offset of blue, and t determines the offset of transparency.

若不对图片的颜色改变,则颜色矩阵为:If the color of the picture is not changed, the color matrix is:

改变颜色可以直接通过修改第五列的颜色偏移量来实现,比如:令e=100,则可以使图片的红色分量增加100。Changing the color can be realized directly by modifying the color offset of the fifth column, for example: if e=100, the red component of the picture can be increased by 100.

另外,改变颜色还可以直接对某个颜色值乘以某一系数来达到改变颜色分量的目的。比如,若颜色矩阵为:In addition, changing the color can also directly multiply a certain color value by a certain coefficient to achieve the purpose of changing the color component. For example, if the color matrix is:

则将绿色分量放大2倍,图片的效果呈绿色。 Then the green component is enlarged by 2 times, and the effect of the picture is green.

在步骤204b中,当应用程序不支持应用内的夜间模式时,将应用程序的用户界面中的文字转换为预定颜色,预定颜色是属于预定色调的颜色。In step 204b, when the application program does not support the night mode in the application program, the text in the user interface of the application program is converted into a predetermined color, and the predetermined color is a color belonging to a predetermined tone.

对于用户界面中的文字,也采用相同的方法,确定出文字需要转换的颜色的颜色矩阵,将颜色矩阵与文字颜色相乘,得到转换后的文字颜色。For the text in the user interface, the same method is used to determine the color matrix of the color to be converted to the text, and multiply the color matrix by the text color to obtain the converted text color.

可选的,在实际实现时,还可以通过云端控制操作系统改变颜色矩阵的参数,以实现针对不同元素转换为不同颜色的效果。Optionally, in actual implementation, the parameters of the color matrix can also be changed by controlling the operating system through the cloud, so as to achieve the effect of converting different elements into different colors.

其中,步骤204a与步骤204b可以均执行,也可以只执行其中一个步骤。Wherein, both step 204a and step 204b may be executed, or only one of them may be executed.

结合参考图3,若预定方式包括:在应用程序的用户界面中的第二类元素上添加预定透明度的图层,则步骤204可以被替换成步骤204c至步骤204e。With reference to FIG. 3 , if the predetermined method includes: adding a layer of predetermined transparency on the second type of element in the user interface of the application program, then step 204 may be replaced by steps 204c to 204e.

在步骤204c中,当应用程序不支持应用内的夜间模式时,检测应用程序的用户界面中的图片的图片类型。In step 204c, when the application does not support the night mode in the application, the picture type of the picture in the user interface of the application is detected.

图片类型包括:第一图片类型和第二图片类型,第一图片类型的高度等于屏幕的像素高度或第一图片类型的宽度等于屏幕的像素宽度,第二图片类型的高度小于屏幕的像素高度且第二图片类型的宽度小于屏幕的像素宽度。The picture type includes: a first picture type and a second picture type, the height of the first picture type is equal to the pixel height of the screen or the width of the first picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen and The width of the second image type is smaller than the pixel width of the screen.

在步骤204d中,当应用程序的用户界面中的图片属于第一图片类型时,在图片上增加第一透明度的图层。In step 204d, when the picture in the user interface of the application belongs to the first picture type, a first transparency layer is added to the picture.

在步骤204e中,当应用程序的用户界面中的图片属于第二图片类型时,在图片上增加第二透明度的图层。In step 204e, when the picture in the user interface of the application belongs to the second picture type, a second transparency layer is added to the picture.

其中,步骤204d与步骤204e是并列的步骤。Wherein, step 204d and step 204e are parallel steps.

第一透明度与第二透明度不同,且第一透明度与第二透明度的取值范围为0至1,0表示完全透明,1表示不透明。The first transparency is different from the second transparency, and the value range of the first transparency and the second transparency is 0 to 1, 0 means completely transparent, and 1 means opaque.

对于用户界面中的图片,根据不同图片的不同尺寸,添加不同透明度的图层,即对不同尺寸的图片所做的图层的处理程度不同。For the pictures in the user interface, layers with different transparency are added according to different sizes of different pictures, that is, layers with different sizes are processed in different degrees.

可选的,在实现夜间模式时,添加的图层通常为黑色图层。Optionally, when implementing the night mode, the added layer is usually a black layer.

在实际应用中,步骤204a至步骤204b与步骤204c至步骤204e是并列的方案。在实现夜间模式时,可以仅执行步骤204a至步骤204b,也可以仅执行步骤204c至步骤204e。In practical applications, steps 204a to 204b and steps 204c to 204e are parallel solutions. When implementing the night mode, only steps 204a to 204b may be performed, or only steps 204c to 204e may be performed.

可选的,步骤204a至步骤204b与步骤204c至步骤204e中的方案可以混合实现。针对应用程序的用户界面中的不同元素,可以分别采用不同的方式实现夜间模式。比如:在即使通讯应用程序中,用户界面背景图片转换为预定色调,用户之间发送的消息中的图片上增加图层。由于用户之间发送的消息中的图片是用户需要阅读的,若是转换颜色,会导致图片失去可读性,因此通过增加图层的方式降低图片与黑暗的光线环境之间的对比,保持图片的可读性。Optionally, the solutions in steps 204a to 204b and steps 204c to 204e may be implemented in combination. Night mode can be implemented in different ways for different elements of an application's user interface. For example: in an instant messaging application, the user interface background image is converted to a predetermined color tone, and a layer is added to the image in the message sent between users. Since the pictures in the messages sent between users are what users need to read, if the color is changed, the pictures will lose readability. Therefore, the contrast between the pictures and the dark light environment is reduced by adding layers to maintain the clarity of the pictures. readability.

可选的,预定方式还包括:将屏幕的背光亮度调节为与夜间模式对应的亮度值。Optionally, the predetermined manner further includes: adjusting the brightness of the backlight of the screen to a brightness value corresponding to the night mode.

可选的,与夜间模式对应的亮度值小于屏幕的背光亮度的手动可调范围的最小值。Optionally, the brightness value corresponding to the night mode is smaller than the minimum value of the manually adjustable range of the backlight brightness of the screen.

由于屏幕的背光亮度的手动可调范围有限,因此即使将亮度值调整到手动可调范围的最小值,屏幕的光线与黑暗的环境光线之间的对比仍然较大,因此操作系统可以将亮度值调整到手动可调范围的最小值以下,以降低屏幕的背光亮度。比如:将亮度值调整到手动可调范围的最小值以下的10%。Due to the limited manual adjustable range of the backlight brightness of the screen, even if the brightness value is adjusted to the minimum value of the manual adjustable range, the contrast between the light of the screen and the dark ambient light is still large, so the operating system can adjust the brightness value to Adjust below the minimum value of the manually adjustable range to reduce the brightness of the screen's backlight. For example: adjust the brightness value to 10% below the minimum value of the manual adjustable range.

可选的,当操作系统的第一显示模式切换为正常模式,操作系统也将屏幕上正在显示的应用程序的第二显示模式切换为正常模式。Optionally, when the first display mode of the operating system is switched to the normal mode, the operating system also switches the second display mode of the application being displayed on the screen to the normal mode.

将第二显示模式切换为正常模式的过程与将第二显示模式切换为夜间模式的过程对应,是互逆的过程。比如:第二显示模式在切换为夜间模式时,通过颜色转换的方式,则第二显示模式在切换为正常模式时,将颜色转换为原来的颜色;第二显示模式在切换为夜间模式时,通过增加图层的方式,则第二显示模式在切换为正常模式时,将图层去除;第二显示模式在切换为夜间模式时,通过降低亮度值的方式,则第二显示模式在切换为正常模式时,恢复亮度值。The process of switching the second display mode to the normal mode corresponds to the process of switching the second display mode to the night mode, which are reciprocal processes. For example: when the second display mode is switched to night mode, through color conversion, when the second display mode is switched to normal mode, the color will be converted to the original color; when the second display mode is switched to night mode, By adding layers, when the second display mode is switched to normal mode, the layer will be removed; when the second display mode is switched to night mode, by reducing the brightness value, the second display mode will be switched to In normal mode, restore the brightness value.

综上所述,本公开实施例中提供的显示模式切换方法,在操作系统的第一显示模式为夜间模式时,通过将用户界面中的第一类元素转换为预定色调和/或在用户界面的第二类元素上添加预定透明度的图层,将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式;由于通过转换色调或添加图层的方式改变应用程序的用户界面上的白色或浅色区域,使得屏幕发出的光线与黑暗的光线环境之间的对比降低,解决了屏幕亮度的手动可调范围有限,即使手动调节到最低亮度,屏幕上显示的白色或浅色区域与黑暗的光线环境之间仍存在较高对比,从而损害用户视力的问题;达到了降低屏幕光线与黑暗环境之间的对比,减少光线对眼睛的刺激,保护用户视力的效果。To sum up, in the display mode switching method provided in the embodiments of the present disclosure, when the first display mode of the operating system is the night mode, by converting the first type of elements in the user interface to a predetermined tone and/or in the user interface Add a layer of predetermined transparency on the second type of elements of the , and switch the second display mode of the application being displayed on the screen to night mode; due to changing the white color on the user interface of the application by converting the color tone or adding a layer or light-colored areas, which reduces the contrast between the light emitted by the screen and the dark light environment, and solves the problem that the manual adjustment range of the screen brightness is limited. There is still a high contrast between the light environment, which will damage the user's vision; it has achieved the effect of reducing the contrast between the screen light and the dark environment, reducing the stimulation of light to the eyes, and protecting the user's vision.

针对步骤201,操作系统在检测到光照强度小于第一阈值时将第一显示模式切换为夜间模式,使得操作系统在终端处于较暗的光线环境下才进行切换,降低屏幕的光线与黑暗的光线环境之间的对比,减少对用户眼睛的刺激,保护了用户视力。For step 201, the operating system switches the first display mode to the night mode when it detects that the light intensity is less than the first threshold, so that the operating system switches only when the terminal is in a dark light environment, reducing the light and dark light of the screen. The contrast between environments reduces the irritation to the user's eyes and protects the user's eyesight.

针对步骤203至步骤204,通过在检测到应用程序不支持应用内的夜间模式时,采用预定方式对屏幕上正在显示的应用程序进行处理,使得不支持应用内的夜间模式的应用程序也能呈现出夜间模式的效果,从而降低屏幕光线与黑暗的光线环境之间的对比,减少对用户眼睛的刺激,保护用户的视力。For steps 203 to 204, when it is detected that the application does not support the night mode in the application, the application program being displayed on the screen is processed in a predetermined manner, so that the application program that does not support the night mode in the application can also be displayed The effect of night mode can be realized, thereby reducing the contrast between the screen light and the dark light environment, reducing the stimulation to the user's eyes, and protecting the user's eyesight.

针对步骤204a至步骤204b,通过将用户界面转换为预定色调,使得用户界面上原本的白色或浅色区域能够能够转换成与夜间模式对应的色调,从而降低屏幕光线与黑暗的光线环境之间的对比,减少对用户眼睛的刺激,保护用户的视力。For steps 204a to 204b, by converting the user interface to a predetermined color tone, the original white or light-colored area on the user interface can be converted into a color tone corresponding to the night mode, thereby reducing the difference between the screen light and the dark light environment. Contrast, reduce the irritation to the user's eyes and protect the user's eyesight.

针对步骤204c至步骤204e,通过将应用程序的用户界面上的第二类元素上添加预定透明度的图层,使得在降低屏幕光线与黑暗的光线环境之间的对比的同时,不影响用户界面中的图片的可读性。For steps 204c to 204e, by adding a predetermined transparency layer to the second type of elements on the user interface of the application program, while reducing the contrast between the screen light and the dark light environment, it does not affect the elements in the user interface. The readability of the picture.

下述为本公开装置实施例,可以用于执行本公开方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开方法实施例。The following are device embodiments of the present disclosure, which can be used to implement the method embodiments of the present disclosure. For details not disclosed in the disclosed device embodiments, please refer to the disclosed method embodiments.

图5是根据一示例性实施例示出的一种显示模式切换装置的框图,如图5所示,本实施例以该显示模式切换装置应用在终端上的操作系统中来举例说明。该显示模式切换装置包括但不限于:获取模块310和第一切换模块320。Fig. 5 is a block diagram showing a device for switching display modes according to an exemplary embodiment. As shown in Fig. 5 , this embodiment is described by taking the device for switching display modes applied to an operating system on a terminal as an example. The display mode switching device includes but not limited to: an acquisition module 310 and a first switching module 320 .

获取模块310,被配置为获取操作系统的第一显示模式。The acquiring module 310 is configured to acquire the first display mode of the operating system.

第一切换模块320,被配置为当获取模块310获取的操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式。The first switching module 320 is configured to switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner when the first display mode of the operating system acquired by the acquiring module 310 is the night mode.

其中,预定方式包括:将应用程序的用户界面中的第一类元素转换为预定色调,和/或,在应用程序的用户界面中的第二类元素上添加预定透明度的图层,预定色调是与夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a layer of predetermined transparency on the second type of elements in the user interface of the application program, and the predetermined color tone is The hue corresponding to night mode.

综上所述,本公开实施例提供的显示模式切换装置,在操作系统的第一显示模式为夜间模式时,通过将用户界面中的第一类元素转换为预定色调和/或在用户界面的第二类元素上添加预定透明度的图层,将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式;由于通过转换色调或添加图层的方式改变应用程序的用户界面上的白色或浅色区域,使得屏幕发出的光线与黑暗的光线环境之间的对比降低,解决了屏幕亮度的手动可调范围有限,即使手动调节到最低亮度,屏幕上显示的白色或浅色区域与黑暗的光线环境之间仍存在较高对比,从而损害用户视力的问题;达到了降低屏幕光线与黑暗环境之间的对比,减少光线对眼睛的刺激,保护用户视力的效果。To sum up, the display mode switching device provided by the embodiments of the present disclosure, when the first display mode of the operating system is the night mode, converts the first type of elements in the user interface to a predetermined color tone and/or in the user interface Add a layer of predetermined transparency to the second type of element, and switch the second display mode of the application being displayed on the screen to night mode; due to changing the color of the user interface of the application by changing the color tone or adding a layer, or The light-colored area reduces the contrast between the light emitted by the screen and the dark light environment, and solves the problem that the manual adjustment range of the screen brightness is limited. There is still a high contrast between light environments, which damages the user's vision; it achieves the effect of reducing the contrast between the screen light and the dark environment, reducing the stimulation of light to the eyes, and protecting the user's vision.

图6是根据另一示例性实施例示出的一种显示模式切换装置的框图,如图6所示,本实施例以该显示模式切换装置应用在终端上的操作系统中来举例说明。该显示模式切换装置包括但不限于:获取模块410和第一切换模块420。Fig. 6 is a block diagram showing a device for switching display modes according to another exemplary embodiment. As shown in Fig. 6 , this embodiment is described by taking the device for switching display modes applied to an operating system on a terminal as an example. The display mode switching device includes but not limited to: an acquisition module 410 and a first switching module 420 .

获取模块410,被配置为获取操作系统的第一显示模式。The obtaining module 410 is configured to obtain the first display mode of the operating system.

第一切换模块420,被配置为当获取模块410获取的操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式。The first switching module 420 is configured to switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner when the first display mode of the operating system acquired by the acquiring module 410 is the night mode.

其中,预定方式包括:将应用程序的用户界面中的第一类元素转换为预定色调,和/或,在应用程序的用户界面中的第二类元素上添加预定透明度的图层,预定色调是与夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a layer of predetermined transparency on the second type of elements in the user interface of the application program, and the predetermined color tone is The hue corresponding to night mode.

可选的,第一类元素与第二类元素的合集组成应用程序的用户界面,第一类元素与第二类元素之间存在或不存在交集。Optionally, a collection of elements of the first type and elements of the second type constitutes a user interface of the application program, and there is or does not exist an intersection between the elements of the first type and the elements of the second type.

可选的,预定方式包括:将应用程序的用户界面中的第一类元素转换为预定色调,第一切换模块420,还被配置为:将应用程序的用户界面中的图片转换为预定色调;和/或,将应用程序的用户界面中的文字转换为预定颜色,预定颜色是属于预定色调的颜色。Optionally, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and the first switching module 420 is further configured to: convert pictures in the user interface of the application program to a predetermined color tone; And/or, converting the text in the user interface of the application program into a predetermined color, where the predetermined color is a color belonging to a predetermined tone.

可选的,第一切换模块420,包括:第一检测子模块421、第一转换子模块422和第二转换子模块423。Optionally, the first switching module 420 includes: a first detection submodule 421 , a first conversion submodule 422 and a second conversion submodule 423 .

第一检测子模块421,被配置为检测应用程序的用户界面中的图片的图片类型,图片类型包括:第一图片类型和第二图片类型,第一图片类型的高度等于屏幕的像素高度或第一图片类型的宽度等于屏幕的像素宽度,第二图片类型的高度小于屏幕的像素高度且第二图片类型的宽度小于屏幕的像素宽度。The first detection submodule 421 is configured to detect the picture type of the picture in the user interface of the application program, the picture type includes: a first picture type and a second picture type, and the height of the first picture type is equal to the pixel height of the screen or the second picture type The width of one picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen, and the width of the second picture type is smaller than the pixel width of the screen.

第一转换子模块422,被配置为当第一检测子模块421检测到应用程序的用户界面中的图片属于第一图片类型时,将图片按照第一颜色矩阵转换为预定色调。The first conversion sub-module 422 is configured to convert the picture into a predetermined tone according to the first color matrix when the first detection sub-module 421 detects that the picture in the user interface of the application belongs to the first picture type.

第二转换子模块423,被配置为当第一检测子模块421检测到应用程序的用户界面中的图片属于第二图片类型时,将图片按照第二颜色矩阵转换为预定色调。The second conversion sub-module 423 is configured to convert the picture into a predetermined tone according to the second color matrix when the first detection sub-module 421 detects that the picture in the user interface of the application program belongs to the second picture type.

其中,第一颜色矩阵和第二颜色矩阵不同。Wherein, the first color matrix and the second color matrix are different.

可选的,预定方式包括:在应用程序的用户界面中的第二类元素上添加预定透明度的图层,第一切换模块420,包括:第二检测子模块424、第一增加子模块425和第二增加子模块426。Optionally, the predetermined method includes: adding a predetermined transparency layer on the second type of element in the user interface of the application program, the first switching module 420 includes: the second detection sub-module 424, the first adding sub-module 425 and The second sub-module 426 is added.

第二检测子模块424,被配置为检测应用程序的用户界面中的图片的图片类型,图片类型包括:第一图片类型和第二图片类型,第一图片类型的高度等于屏幕的像素高度或第一图片类型的宽度等于屏幕的像素宽度,第二图片类型的高度小于屏幕的像素高度且第二图片类型的宽度小于屏幕的像素宽度。The second detection submodule 424 is configured to detect the picture type of the picture in the user interface of the application program, the picture type includes: a first picture type and a second picture type, and the height of the first picture type is equal to the pixel height of the screen or the second picture type The width of one picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen, and the width of the second picture type is smaller than the pixel width of the screen.

第一增加子模块425,被配置为当第二检测子模块424检测到应用程序的用户界面中的图片属于第一图片类型时,在图片上增加第一透明度的图层。The first adding sub-module 425 is configured to add a first transparency layer on the picture when the second detection sub-module 424 detects that the picture in the user interface of the application belongs to the first picture type.

第二增加子模块426,被配置为当第二检测子模块424检测到应用程序的用户界面中的图片属于第二图片类型时,在图片上增加第二透明度的图层。The second adding submodule 426 is configured to add a second transparency layer on the picture when the second detection submodule 424 detects that the picture in the user interface of the application belongs to the second picture type.

其中,第一透明度和第二透明度不同,且第一透明度和第二透明度的取值范围为0至1,0表示完全透明,1表示不透明。Wherein, the first transparency and the second transparency are different, and the value range of the first transparency and the second transparency is 0 to 1, 0 means completely transparent, and 1 means opaque.

可选的,预定方式还包括:将屏幕的背光亮度调节为与夜间模式对应的亮度值。Optionally, the predetermined manner further includes: adjusting the brightness of the backlight of the screen to a brightness value corresponding to the night mode.

可选的,与夜间模式对应的亮度值小于屏幕的背光亮度的手动可调范围的最小值。Optionally, the brightness value corresponding to the night mode is smaller than the minimum value of the manually adjustable range of the backlight brightness of the screen.

可选的,显示模式切换装置还包括:第二切换模块430和显示模块440。Optionally, the display mode switching device further includes: a second switching module 430 and a display module 440 .

第二切换模块430,被配置为在检测到光照强度小于第一阈值时,将操作系统的第一显示模式切换为夜间模式。The second switching module 430 is configured to switch the first display mode of the operating system to the night mode when it is detected that the light intensity is less than the first threshold.

显示模块440,被配置为在检测到光照强度小于第一阈值时,在屏幕上显示提示消息,提示消息用于提示用户开启操作系统的夜间模式。The display module 440 is configured to display a prompt message on the screen when it is detected that the light intensity is less than the first threshold, and the prompt message is used to prompt the user to turn on the night mode of the operating system.

可选的,显示模块切换装置还包括:检测模块450。Optionally, the display module switching device further includes: a detection module 450 .

检测模块450,被配置为检测应用程序是否支持应用内的夜间模式。The detection module 450 is configured to detect whether the application supports the night mode in the application.

第一切换模块420,被配置为当应用程序不支持应用内的夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式。The first switching module 420 is configured to switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner when the application does not support the night mode in the application.

可选的,检测模块450,包括:读取子模块451和确定子模块452。Optionally, the detecting module 450 includes: a reading submodule 451 and a determining submodule 452 .

读取子模块451,被配置为读取应用程序的头文件中的预定标识,预定标识的取值用于表示应用程序是否支持应用内的夜间模式。The reading sub-module 451 is configured to read a predetermined identifier in the header file of the application program, and the value of the predetermined identifier is used to indicate whether the application program supports the night mode in the application program.

确定子模块452,被配置为当预定标识的取值为第一取值时,确定应用程序不支持应用内的夜间模式。The determination sub-module 452 is configured to determine that the application program does not support the night mode within the application when the value of the predetermined identifier is the first value.

综上所述,本公开实施例提供的显示模式切换装置,在操作系统的第一显示模式为夜间模式时,通过将用户界面中的第一类元素转换为预定色调和/或在用户界面的第二类元素上添加预定透明度的图层,将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式;由于通过转换色调或添加图层的方式改变应用程序的用户界面上的白色或浅色区域,使得屏幕发出的光线与黑暗的光线环境之间的对比降低,解决了屏幕亮度的手动可调范围有限,即使手动调节到最低亮度,屏幕上显示的白色或浅色区域与黑暗的光线环境之间仍存在较高对比,从而损害用户视力的问题;达到了降低屏幕光线与黑暗环境之间的对比,减少光线对眼睛的刺激,保护用户视力的效果。To sum up, the display mode switching device provided by the embodiments of the present disclosure, when the first display mode of the operating system is the night mode, converts the first type of elements in the user interface to a predetermined color tone and/or in the user interface Add a layer of predetermined transparency to the second type of element, and switch the second display mode of the application being displayed on the screen to night mode; due to changing the color of the user interface of the application by changing the color tone or adding a layer, or The light-colored area reduces the contrast between the light emitted by the screen and the dark light environment, and solves the problem that the manual adjustment range of the screen brightness is limited. There is still a high contrast between light environments, which damages the user's vision; it achieves the effect of reducing the contrast between the screen light and the dark environment, reducing the stimulation of light to the eyes, and protecting the user's vision.

操作系统在检测到光照强度小于第一阈值时将第一显示模式切换为夜间模式,使得操作系统在终端处于较暗的光线环境下才进行切换,降低屏幕的光线与黑暗的光线环境之间的对比,减少对用户眼睛的刺激,保护了用户视力。When the operating system detects that the light intensity is less than the first threshold, the first display mode is switched to the night mode, so that the operating system switches only when the terminal is in a dark light environment, reducing the difference between the light of the screen and the dark light environment. Contrast, reduce the stimulation to the user's eyes and protect the user's eyesight.

通过在检测到应用程序不支持应用内的夜间模式时,采用预定方式对屏幕上正在显示的应用程序进行处理,使得不支持应用内的夜间模式的应用程序也能呈现出夜间模式的效果,从而降低屏幕光线与黑暗的光线环境之间的对比,减少对用户眼睛的刺激,保护用户的视力。When it is detected that the application does not support the night mode in the application, the application program being displayed on the screen is processed in a predetermined manner, so that the application program that does not support the night mode in the application can also show the effect of the night mode, thereby Reduce the contrast between the screen light and the dark light environment, reduce the irritation to the user's eyes, and protect the user's vision.

通过将用户界面转换为预定色调,使得用户界面上原本的白色或浅色区域能够能够转换成与夜间模式对应的色调,从而降低屏幕光线与黑暗的光线环境之间的对比,减少对用户眼睛的刺激,保护用户的视力。By converting the user interface to a predetermined color tone, the original white or light-colored area on the user interface can be converted into the color tone corresponding to the night mode, thereby reducing the contrast between the screen light and the dark light environment, and reducing the impact on the user's eyes Stimulate, protect user's eyesight.

通过将应用程序的用户界面上的第二类元素上添加预定透明度的图层,使得在降低屏幕光线与黑暗的光线环境之间的对比的同时,不影响用户界面中的图片的可读性。By adding a layer of predetermined transparency to the second type of elements on the user interface of the application program, the contrast between the screen light and the dark light environment is reduced without affecting the readability of pictures in the user interface.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the foregoing embodiments, the specific manner in which each module executes operations has been described in detail in the embodiments related to the method, and will not be described in detail here.

本公开一示例性实施例提供了一种显示模式切换装置,能够实现本公开提供的显示模式切换方法,该显示模式切换装置包括:处理器、用于存储处理器可执行指令的存储器;An exemplary embodiment of the present disclosure provides a display mode switching device capable of implementing the display mode switching method provided in the present disclosure. The display mode switching device includes: a processor and a memory for storing processor-executable instructions;

其中,处理器被配置为:where the processor is configured as:

获取操作系统的第一显示模式;Obtain the first display mode of the operating system;

当操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为夜间模式;When the first display mode of the operating system is the night mode, switching the second display mode of the application program being displayed on the screen to the night mode in a predetermined manner;

其中,预定方式包括:将应用程序的用户界面中的第一类元素转换为预定色调,和/或,在应用程序的用户界面中的第二类元素上添加预定透明度的图层,预定色调是与夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a layer of predetermined transparency on the second type of elements in the user interface of the application program, and the predetermined color tone is The hue corresponding to night mode.

图7是根据一示例性实施例示出的一种终端的框图。例如,终端500可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。Fig. 7 is a block diagram of a terminal according to an exemplary embodiment. For example, the terminal 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.

参照图7,终端500可以包括以下一个或多个组件:处理组件502,存储器504,电源组件506,多媒体组件508,音频组件510,输入/输出(I/O)接口512,传感器组件514,以及通信组件516。Referring to FIG. 7, a terminal 500 may include one or more of the following components: a processing component 502, a memory 504, a power supply component 506, a multimedia component 508, an audio component 510, an input/output (I/O) interface 512, a sensor component 514, and Communication component 516 .

处理组件502通常控制终端500的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件502可以包括一个或多个处理器518来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件502可以包括一个或多个模块,便于处理组件502和其他组件之间的交互。例如,处理组件502可以包括多媒体模块,以方便多媒体组件508和处理组件502之间的交互。The processing component 502 generally controls the overall operations of the terminal 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 518 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 502 may include one or more modules that facilitate interaction between processing component 502 and other components. For example, processing component 502 may include a multimedia module to facilitate interaction between multimedia component 508 and processing component 502 .

存储器504被配置为存储各种类型的数据以支持在终端500的操作。这些数据的示例包括用于在终端500上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器504可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(英文:Static Random Access Memory,简称:SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(英文:ElectricallyErasable Programmable Read-Only Memory,简称:EPROM),可编程只读存储器(英文:Programmable Read-Only Memory,简称:PROM),只读存储器(英文:Read-Only Memory,简称:ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 504 is configured to store various types of data to support operations at the terminal 500 . Examples of such data include instructions for any application or method operating on the terminal 500, contact data, phonebook data, messages, pictures, videos, etc. The memory 504 can be realized by any type of volatile or non-volatile storage device or their combination, such as static random access memory (English: Static Random Access Memory, referred to as: SRAM), electrically erasable programmable read-only Memory (EEPROM), Erasable Programmable Read-Only Memory (English: ElectricallyErasable Programmable Read-Only Memory, referred to as: EPROM), Programmable Read-Only Memory (English: Programmable Read-Only Memory, referred to as: PROM), read-only memory (English: Read-Only Memory, referred to as: ROM), magnetic memory, flash memory, magnetic disk or optical disk.

电源组件506为终端500的各种组件提供电力。电源组件506可以包括电源管理系统,一个或多个电源,及其他与为终端500生成、管理和分配电力相关联的组件。The power supply component 506 provides power to various components of the terminal 500 . Power components 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for terminal 500 .

多媒体组件508包括在终端500和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(英文:Liquid Crystal Display,简称:LCD)和触摸面板(英文:TouchPanel,简称:TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件508包括一个前置摄像头和/或后置摄像头。当终端500处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 508 includes a screen providing an output interface between the terminal 500 and the user. In some embodiments, the screen may include a liquid crystal display (English: Liquid Crystal Display, LCD for short) and a touch panel (TouchPanel in English, TP for short). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or a swipe action, but also detect duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 508 includes a front camera and/or a rear camera. When the terminal 500 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.

音频组件510被配置为输出和/或输入音频信号。例如,音频组件510包括一个麦克风(英文:microphone,简称:MIC),当终端500处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器504或经由通信组件516发送。在一些实施例中,音频组件510还包括一个扬声器,用于输出音频信号。The audio component 510 is configured to output and/or input audio signals. For example, the audio component 510 includes a microphone (English: microphone, MIC for short), and when the terminal 500 is in an operation mode, such as a call mode, a recording mode and a voice recognition mode, the microphone is configured to receive an external audio signal. Received audio signals may be further stored in memory 504 or sent via communication component 516 . In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.

I/O接口512为处理组件502和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 512 provides an interface between the processing component 502 and a peripheral interface module. The peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.

传感器组件514包括一个或多个传感器,用于为终端500提供各个方面的状态评估。例如,传感器组件514可以检测到终端500的打开/关闭状态,组件的相对定位,例如组件为终端500的显示器和小键盘,传感器组件514还可以检测终端500或终端500一个组件的位置改变,用户与终端500接触的存在或不存在,终端500方位或加速/减速和终端500的温度变化。传感器组件514可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件514还可以包括光传感器,如互补金属氧化物半导体(英文:Complementary Metal Oxide Semiconductor,简称:CMOS)或电荷耦合元件(英文:Charge-coupled Device,简称:CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件514还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。The sensor component 514 includes one or more sensors for providing various aspects of a status assessment of the terminal 500 . For example, the sensor component 514 can detect the open/closed state of the terminal 500, the relative positioning of the components, for example, the components are the display and the keypad of the terminal 500, the sensor component 514 can also detect the position change of the terminal 500 or a component of the terminal 500, and the user The presence or absence of contact with the terminal 500 , the orientation or acceleration/deceleration of the terminal 500 and the temperature change of the terminal 500 . Sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor component 514 may also include an optical sensor, such as a complementary metal oxide semiconductor (English: Complementary Metal Oxide Semiconductor, CMOS for short) or a charge-coupled device (English: Charge-coupled Device, CCD for short) image sensor, for imaging used in the application. In some embodiments, the sensor component 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.

通信组件516被配置为便于终端500和其他设备之间有线或无线方式的通信。终端500可以接入基于通信标准的无线网络,如无线保真(WIreless-Fidelity,简称:Wi-Fi),2G或3G,或它们的组合。在一个示例性实施例中,通信组件516经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件516还包括近场通信(英文:Near Field Communication,简称:NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(英文:Radio Frequency Identification,简称:RFID)技术,红外数据协会(英文:Infrared Data Association,简称:IrDA)技术,超宽带(英文:UltraWideband,简称:UWB)技术,蓝牙(英文:Bluetooth,简称:BT)技术和其他技术来实现。The communication component 516 is configured to facilitate wired or wireless communication between the terminal 500 and other devices. The terminal 500 may access a wireless network based on a communication standard, such as wireless fidelity (WIreless-Fidelity, Wi-Fi for short), 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 516 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 further includes a near field communication (English: Near Field Communication, NFC for short) module to facilitate short-range communication. For example, the NFC module can be based on radio frequency identification (English: Radio Frequency Identification, referred to as: RFID) technology, infrared data association (English: Infrared Data Association, referred to as: IrDA) technology, ultra-wideband (English: UltraWideband, referred to as: UWB) technology , Bluetooth (English: Bluetooth, referred to as: BT) technology and other technologies to achieve.

在示例性实施例中,终端500可以被一个或多个应用专用集成电路(英文:Application Specific Integrated Circuit,简称:ASIC)、数字信号处理器(英文:Digital Signal Processing,简称:DSP)、数字信号处理设备(英文:Digital SignalProcessing Device,简称:DSPD)、可编程逻辑器件(英文:programmable logic device,简称:PLD)、现场可编程门阵列(英文:Field-Programmable Gate Array,简称:FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述显示模式切换方法。In an exemplary embodiment, the terminal 500 may be implemented by one or more application-specific integrated circuits (English: Application Specific Integrated Circuit, ASIC for short), digital signal processors (English: Digital Signal Processing, DSP for short), digital signal processing Processing equipment (English: Digital Signal Processing Device, referred to as: DSPD), programmable logic device (English: programmable logic device, referred to as: PLD), field programmable gate array (English: Field-Programmable Gate Array, referred to as: FPGA), control implemented by a microcontroller, a microcontroller, a microprocessor or other electronic components, and is used to execute the above display mode switching method.

在示例性实施例中,还提供了一种计算机可读存储介质,例如包括指令的存储器504,上述指令可由终端500的处理器518执行以实现图1、图2和图3所示方法实施例中的显示模式切换方法的步骤。例如,非临时性计算机可读存储介质可以是ROM、随机存取存储器(英文:Random-Access Memory,简称:RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a computer-readable storage medium, such as a memory 504 including instructions, which can be executed by the processor 518 of the terminal 500 to implement the method embodiments shown in FIG. 1 , FIG. 2 and FIG. 3 The steps of the display mode switching method in . For example, the non-transitory computer-readable storage medium may be ROM, Random-Access Memory (English: Random-Access Memory, RAM for short), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, and these modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure . The specification and examples are to be considered exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise constructions which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (22)

1.一种显示模式切换方法,其特征在于,应用于操作系统中,所述方法包括:1. A display mode switching method, characterized in that it is applied in an operating system, and the method comprises: 获取所述操作系统的第一显示模式;acquiring a first display mode of the operating system; 当所述操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式;When the first display mode of the operating system is the night mode, switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner; 其中,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调,和/或,在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层,所述预定色调是与所述夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a color with predetermined transparency to the second type of elements in the user interface of the application program layer, the predetermined color tone is the color tone corresponding to the night mode. 2.根据权利要求1所述的方法,其特征在于,所述第一类元素与所述第二类元素的合集组成所述应用程序的用户界面,所述第一类元素与所述第二类元素之间存在或不存在交集。2. The method according to claim 1, wherein the collection of the first type of elements and the second type of elements constitutes the user interface of the application program, and the combination of the first type of elements and the second type There is or is no intersection between class elements. 3.根据权利要求1所述的方法,其特征在于,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调;3. The method according to claim 1, wherein the predetermined manner comprises: converting the first type of elements in the user interface of the application program to a predetermined tone; 所述通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式,包括:The switching the second display mode of the application being displayed on the screen to the night mode in a predetermined manner includes: 将所述应用程序的用户界面中的图片转换为所述预定色调;converting an image in the user interface of the application program to the predetermined color tone; 和/或,and / or, 将所述应用程序的用户界面中的文字转换为预定颜色,所述预定颜色是属于所述预定色调的颜色。Converting text in the user interface of the application program to a predetermined color, the predetermined color being a color belonging to the predetermined hue. 4.根据权利要求3所述的方法,其特征在于,所述将所述应用程序的用户界面中的图片转换为所述预定色调,包括:4. The method according to claim 3, wherein the converting the picture in the user interface of the application program to the predetermined tone comprises: 检测所述应用程序的用户界面中的图片的图片类型,所述图片类型包括:第一图片类型和第二图片类型,所述第一图片类型的高度等于所述屏幕的像素高度或所述第一图片类型的宽度等于所述屏幕的像素宽度,所述第二图片类型的高度小于所述屏幕的像素高度且所述第二图片类型的宽度小于所述屏幕的像素宽度;Detecting the picture type of the picture in the user interface of the application program, the picture type includes: a first picture type and a second picture type, and the height of the first picture type is equal to the pixel height of the screen or the second picture type The width of a picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen, and the width of the second picture type is smaller than the pixel width of the screen; 当所述应用程序的用户界面中的图片属于所述第一图片类型时,将所述图片按照第一颜色矩阵转换为所述预定色调;When the picture in the user interface of the application program belongs to the first picture type, converting the picture into the predetermined tone according to a first color matrix; 当所述应用程序的用户界面中的图片属于所述第二图片类型时,将所述图片按照第二颜色矩阵转换为所述预定色调;When the picture in the user interface of the application program belongs to the second picture type, converting the picture into the predetermined tone according to a second color matrix; 其中,所述第一颜色矩阵和所述第二颜色矩阵不同。Wherein, the first color matrix and the second color matrix are different. 5.根据权利要求1所述的方法,其特征在于,所述预定方式包括:在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层;5. The method according to claim 1, wherein the predetermined method comprises: adding a layer of predetermined transparency on the second type of element in the user interface of the application program; 所述通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式,包括:The switching the second display mode of the application being displayed on the screen to the night mode in a predetermined manner includes: 检测所述应用程序的用户界面中的图片的图片类型,所述图片类型包括:第一图片类型和第二图片类型,所述第一图片类型的高度等于所述屏幕的像素高度或所述第一图片类型的宽度等于所述屏幕的像素宽度,所述第二图片类型的高度小于所述屏幕的像素高度且所述第二图片类型的宽度小于所述屏幕的像素宽度;Detecting the picture type of the picture in the user interface of the application program, the picture type includes: a first picture type and a second picture type, and the height of the first picture type is equal to the pixel height of the screen or the second picture type The width of a picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen, and the width of the second picture type is smaller than the pixel width of the screen; 当所述应用程序的用户界面中的图片属于所述第一图片类型时,在所述图片上增加第一透明度的图层;When the picture in the user interface of the application program belongs to the first picture type, adding a first transparency layer on the picture; 当所述应用程序的用户界面中的图片属于所述第二图片类型时,在所述图片上增加第二透明度的图层;When the picture in the user interface of the application program belongs to the second picture type, adding a second transparency layer on the picture; 其中,所述第一透明度和所述第二透明度不同,且所述第一透明度和所述第二透明度的取值范围为0至1,0表示完全透明,1表示不透明。Wherein, the first transparency and the second transparency are different, and the value range of the first transparency and the second transparency is 0 to 1, 0 means completely transparent, and 1 means opaque. 6.根据权利要求1所述的方法,其特征在于,所述预定方式还包括:将所述屏幕的背光亮度调节为与所述夜间模式对应的亮度值。6. The method according to claim 1, wherein the predetermined manner further comprises: adjusting the brightness of the backlight of the screen to a brightness value corresponding to the night mode. 7.根据权利要求6所述的方法,其特征在于,与所述夜间模式对应的亮度值小于所述屏幕的背光亮度的手动可调范围的最小值。7. The method according to claim 6, wherein the brightness value corresponding to the night mode is smaller than the minimum value of the manually adjustable range of the backlight brightness of the screen. 8.根据权利要求1至7任一所述的方法,其特征在于,所述方法还包括:8. The method according to any one of claims 1 to 7, characterized in that the method further comprises: 在检测到光照强度小于第一阈值时,将所述操作系统的第一显示模式切换为所述夜间模式;When it is detected that the light intensity is less than a first threshold, switching the first display mode of the operating system to the night mode; 或者,or, 在检测到光照强度小于所述第一阈值时,在所述屏幕上显示提示消息,所述提示消息用于提示用户开启所述操作系统的所述夜间模式。When it is detected that the light intensity is less than the first threshold, a prompt message is displayed on the screen, and the prompt message is used to prompt the user to turn on the night mode of the operating system. 9.根据权利要求1至7任一所述的方法,其特征在于,所述方法还包括:9. The method according to any one of claims 1 to 7, characterized in that the method further comprises: 检测所述应用程序是否支持应用内的夜间模式;Detect whether said application supports an in-app night mode; 当所述应用程序不支持应用内的夜间模式时,执行所述通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式的步骤。When the application does not support the night mode in the application, the step of switching the second display mode of the application being displayed on the screen to the night mode in a predetermined manner is performed. 10.根据权利要求9所述的方法,其特征在于,所述检测所述应用程序是否支持应用内的夜间模式,包括:10. The method according to claim 9, wherein the detecting whether the application supports the night mode in the application comprises: 读取所述应用程序的头文件中的预定标识,所述预定标识的取值用于表示所述应用程序是否支持应用内的夜间模式;Reading the predetermined identifier in the header file of the application, the value of the predetermined identifier is used to indicate whether the application supports the night mode in the application; 当所述预定标识的取值为第一取值时,确定所述应用程序不支持应用内的夜间模式。When the value of the predetermined identifier is the first value, it is determined that the application program does not support the night mode in the application program. 11.一种显示模式切换装置,其特征在于,应用于操作系统中,所述装置包括:11. A display mode switching device, characterized in that it is applied in an operating system, and the device comprises: 获取模块,被配置为获取所述操作系统的第一显示模式;an acquisition module configured to acquire the first display mode of the operating system; 第一切换模块,被配置为当所述获取模块获取的所述操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式;The first switching module is configured to switch the second display mode of the application being displayed on the screen to the nighttime mode in a predetermined manner when the first display mode of the operating system acquired by the acquiring module is the nighttime mode model; 其中,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调,和/或,在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层,所述预定色调是与所述夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a color with predetermined transparency to the second type of elements in the user interface of the application program layer, the predetermined color tone is the color tone corresponding to the night mode. 12.根据权利要求11所述的装置,其特征在于,所述第一类元素与所述第二类元素的合集组成所述应用程序的用户界面,所述第一类元素与所述第二类元素之间存在或不存在交集。12. The device according to claim 11, wherein the collection of the first type of elements and the second type of elements constitutes the user interface of the application program, and the combination of the first type of elements and the second type There is or is no intersection between class elements. 13.根据权利要求11所述的装置,其特征在于,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调;13. The device according to claim 11, wherein the predetermined manner comprises: converting the first type of elements in the user interface of the application program to a predetermined tone; 所述第一切换模块,还被配置为:The first switching module is further configured to: 将所述应用程序的用户界面中的图片转换为所述预定色调;converting an image in the user interface of the application program to the predetermined color tone; 和/或,and / or, 将所述应用程序的用户界面中的文字转换为预定颜色,所述预定颜色是属于所述预定色调的颜色。Converting text in the user interface of the application program to a predetermined color, the predetermined color being a color belonging to the predetermined hue. 14.根据权利要求13所述的装置,其特征在于,所述第一切换模块,包括:14. The device according to claim 13, wherein the first switching module comprises: 第一检测子模块,被配置为检测所述应用程序的用户界面中的图片的图片类型,所述图片类型包括:第一图片类型和第二图片类型,所述第一图片类型的高度等于所述屏幕的像素高度或所述第一图片类型的宽度等于所述屏幕的像素宽度,所述第二图片类型的高度小于所述屏幕的像素高度且所述第二图片类型的宽度小于所述屏幕的像素宽度;The first detection submodule is configured to detect the picture type of the picture in the user interface of the application program, the picture type includes: a first picture type and a second picture type, and the height of the first picture type is equal to the The pixel height of the screen or the width of the first picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen, and the width of the second picture type is smaller than the screen the pixel width of 第一转换子模块,被配置为当所述第一检测子模块检测到所述应用程序的用户界面中的图片属于所述第一图片类型时,将所述图片按照第一颜色矩阵转换为所述预定色调;The first conversion submodule is configured to convert the picture into the first picture type according to the first color matrix when the first detection submodule detects that the picture in the user interface of the application program belongs to the first picture type. the predetermined color; 第二转换子模块,被配置为当所述第一检测子模块检测到所述应用程序的用户界面中的图片属于所述第二图片类型时,将所述图片按照第二颜色矩阵转换为所述预定色调;The second conversion submodule is configured to convert the picture into the second picture type according to the second color matrix when the first detection submodule detects that the picture in the user interface of the application program belongs to the second picture type. the predetermined color; 其中,所述第一颜色矩阵和所述第二颜色矩阵不同。Wherein, the first color matrix and the second color matrix are different. 15.根据权利要求11所述的装置,其特征在于,所述预定方式包括:在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层;15. The device according to claim 11, wherein the predetermined method comprises: adding a layer of predetermined transparency on the second type of element in the user interface of the application program; 所述第一切换模块,包括:The first switching module includes: 第二检测子模块,被配置为检测所述应用程序的用户界面中的图片的图片类型,所述图片类型包括:第一图片类型和第二图片类型,所述第一图片类型的高度等于所述屏幕的像素高度或所述第一图片类型的宽度等于所述屏幕的像素宽度,所述第二图片类型的高度小于所述屏幕的像素高度且所述第二图片类型的宽度小于所述屏幕的像素宽度;The second detection submodule is configured to detect the picture type of the picture in the user interface of the application program, the picture type includes: a first picture type and a second picture type, and the height of the first picture type is equal to the The pixel height of the screen or the width of the first picture type is equal to the pixel width of the screen, the height of the second picture type is smaller than the pixel height of the screen, and the width of the second picture type is smaller than the screen the pixel width of 第一增加子模块,被配置为当所述第二检测子模块检测到所述应用程序的用户界面中的图片属于所述第一图片类型时,在所述图片上增加第一透明度的图层;The first adding submodule is configured to add a first transparency layer on the picture when the second detection submodule detects that the picture in the user interface of the application program belongs to the first picture type ; 第二增加子模块,被配置为当所述第二检测子模块检测到所述应用程序的用户界面中的图片属于所述第二图片类型时,在所述图片上增加第二透明度的图层;The second adding submodule is configured to add a second transparency layer on the picture when the second detection submodule detects that the picture in the user interface of the application program belongs to the second picture type ; 其中,所述第一透明度和所述第二透明度不同,且所述第一透明度和所述第二透明度的取值范围为0至1,0表示完全透明,1表示不透明。Wherein, the first transparency and the second transparency are different, and the value range of the first transparency and the second transparency is 0 to 1, 0 means completely transparent, and 1 means opaque. 16.根据权利要求11所述的装置,其特征在于,所述预定方式还包括:将所述屏幕的背光亮度调节为与所述夜间模式对应的亮度值。16. The device according to claim 11, wherein the predetermined manner further comprises: adjusting the brightness of the backlight of the screen to a brightness value corresponding to the night mode. 17.根据权利要求16所述的装置,其特征在于,与所述夜间模式对应的亮度值小于所述屏幕的背光亮度的手动可调范围的最小值。17. The device according to claim 16, wherein the brightness value corresponding to the night mode is smaller than a minimum value of a manually adjustable range of brightness of the backlight of the screen. 18.根据权利要求11至17任一所述的装置,其特征在于,所述装置还包括:18. The device according to any one of claims 11 to 17, further comprising: 第二切换模块,被配置为在检测到光照强度小于第一阈值时,将所述操作系统的第一显示模式切换为所述夜间模式;The second switching module is configured to switch the first display mode of the operating system to the night mode when it is detected that the light intensity is less than a first threshold; 或者,or, 显示模块,被配置为在检测到光照强度小于所述第一阈值时,在所述屏幕上显示提示消息,所述提示消息用于提示用户开启所述操作系统的所述夜间模式。The display module is configured to display a prompt message on the screen when it is detected that the light intensity is less than the first threshold, and the prompt message is used to prompt the user to turn on the night mode of the operating system. 19.根据权利要求11至17任一所述的装置,其特征在于,所述装置还包括:19. The device according to any one of claims 11 to 17, further comprising: 检测模块,被配置为检测所述应用程序是否支持应用内的夜间模式;a detection module configured to detect whether the application supports a night mode within the application; 所述第一切换模块,被配置为当所述应用程序不支持应用内的夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式。The first switching module is configured to switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner when the application does not support the night mode in the application. 20.根据权利要求19所述的装置,其特征在于,所述检测模块,包括:20. The device according to claim 19, wherein the detection module comprises: 读取子模块,被配置为读取所述应用程序的头文件中的预定标识,所述预定标识的取值用于表示所述应用程序是否支持应用内的夜间模式;The reading submodule is configured to read a predetermined identifier in the header file of the application, and the value of the predetermined identifier is used to indicate whether the application supports the night mode in the application; 确定子模块,被配置为当所述预定标识的取值为第一取值时,确定所述应用程序不支持应用内的夜间模式。The determining submodule is configured to determine that the application does not support the night mode in the application when the value of the predetermined identifier is the first value. 21.一种显示模式切换装置,其特征在于,所述装置包括:21. A display mode switching device, characterized in that the device comprises: 处理器;processor; 用于存储所述处理器可执行指令的存储器;memory for storing said processor-executable instructions; 其中,所述处理器被配置为:Wherein, the processor is configured as: 获取所述操作系统的第一显示模式;acquiring a first display mode of the operating system; 当所述操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式;When the first display mode of the operating system is the night mode, switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner; 其中,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调,和/或,在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层,所述预定色调是与所述夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a color with predetermined transparency to the second type of elements in the user interface of the application program layer, the predetermined color tone is the color tone corresponding to the night mode. 22.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现以下步骤:22. A computer-readable storage medium, on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the following steps are implemented: 获取所述操作系统的第一显示模式;acquiring a first display mode of the operating system; 当所述操作系统的第一显示模式为夜间模式时,通过预定方式将屏幕上正在显示的应用程序的第二显示模式切换为所述夜间模式;When the first display mode of the operating system is the night mode, switch the second display mode of the application being displayed on the screen to the night mode in a predetermined manner; 其中,所述预定方式包括:将所述应用程序的用户界面中的第一类元素转换为预定色调,和/或,在所述应用程序的用户界面中的第二类元素上添加预定透明度的图层,所述预定色调是与所述夜间模式对应的色调。Wherein, the predetermined method includes: converting the first type of elements in the user interface of the application program to a predetermined color tone, and/or adding a color with predetermined transparency to the second type of elements in the user interface of the application program layer, the predetermined color tone is the color tone corresponding to the night mode.
CN201710365350.1A 2017-05-22 2017-05-22 Display mode switching method and device Active CN107038037B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710365350.1A CN107038037B (en) 2017-05-22 2017-05-22 Display mode switching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710365350.1A CN107038037B (en) 2017-05-22 2017-05-22 Display mode switching method and device

Publications (2)

Publication Number Publication Date
CN107038037A true CN107038037A (en) 2017-08-11
CN107038037B CN107038037B (en) 2021-03-02

Family

ID=59539247

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710365350.1A Active CN107038037B (en) 2017-05-22 2017-05-22 Display mode switching method and device

Country Status (1)

Country Link
CN (1) CN107038037B (en)

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107861675A (en) * 2017-09-21 2018-03-30 海南智媒云图科技股份有限公司 A kind of method and device of intelligence switching Night
CN108469976A (en) * 2018-03-13 2018-08-31 北京车和家信息技术有限公司 Mode switching method, mode-changeover device, mobile unit and vehicle
CN108924338A (en) * 2018-05-24 2018-11-30 珠海市魅族科技有限公司 Method for controlling mobile terminal, mobile terminal and storage medium
CN109614186A (en) * 2018-11-29 2019-04-12 深圳市酷达通讯有限公司 Application program color switching method, system and terminal device
CN110609722A (en) * 2019-08-09 2019-12-24 华为技术有限公司 A kind of dark mode display interface processing method, electronic device and storage medium
CN110618852A (en) * 2019-09-24 2019-12-27 Oppo广东移动通信有限公司 View processing method, view processing device and terminal equipment
CN110673906A (en) * 2019-08-19 2020-01-10 中至数据集团股份有限公司 Mode switching method and device, readable storage medium and mobile terminal
WO2020042735A1 (en) * 2018-08-29 2020-03-05 中兴通讯股份有限公司 Screen display control method and apparatus, device, and readable storage medium
CN110992869A (en) * 2019-12-24 2020-04-10 Oppo广东移动通信有限公司 Layer display method and related equipment
CN111223432A (en) * 2020-01-10 2020-06-02 北京小米移动软件有限公司 Method and device for controlling screen display
CN111475238A (en) * 2020-03-13 2020-07-31 五八有限公司 Page processing method and device, electronic equipment and storage medium
CN112486603A (en) * 2019-09-12 2021-03-12 北京搜狗科技发展有限公司 Interface adaptation method and device for adapting interface
CN112837661A (en) * 2021-01-29 2021-05-25 北京小米移动软件有限公司 A screen brightness adjustment method, a screen brightness adjustment device and a storage medium
CN113299250A (en) * 2021-05-14 2021-08-24 漳州万利达科技有限公司 Image display method and device and display equipment
CN113553127A (en) * 2020-04-23 2021-10-26 深圳市万普拉斯科技有限公司 Reading content processing method and device, computer equipment and storage medium
CN113556424A (en) * 2021-07-22 2021-10-26 山东浪潮通软信息科技有限公司 Mobile terminal skin switching method, design method and computer storage medium
CN113760419A (en) * 2020-09-23 2021-12-07 北京沃东天骏信息技术有限公司 Method, apparatus, device, and computer-readable medium for displaying images
CN114077463A (en) * 2020-07-30 2022-02-22 北京搜狗科技发展有限公司 An input method interface display method, device and electronic device
CN114095603A (en) * 2021-11-11 2022-02-25 努比亚技术有限公司 Screen display characteristic regulation and control method and device and computer readable storage medium
CN114115657A (en) * 2021-11-23 2022-03-01 北京百度网讯科技有限公司 Display mode switching method, device, equipment and medium of cloud mobile phone
CN114138394A (en) * 2021-12-06 2022-03-04 北京得间科技有限公司 Night display mode processing method, electronic device and computer storage medium
CN114500735A (en) * 2022-04-15 2022-05-13 北京车智赢科技有限公司 Display processing method, computing device and readable storage medium
CN115484345A (en) * 2021-05-31 2022-12-16 华为技术有限公司 Display mode switching method, device, electronic device and medium
CN116737292A (en) * 2022-10-29 2023-09-12 荣耀终端有限公司 A display mode switching method, electronic device and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622214A (en) * 2011-01-27 2012-08-01 腾讯科技(深圳)有限公司 Method and device for realizing multiple-display mode universal icons
CN104252362A (en) * 2014-09-26 2014-12-31 可牛网络技术(北京)有限公司 Web page showing method and web page showing device
CN105528389A (en) * 2015-11-09 2016-04-27 上海二三四五网络科技有限公司 A logic control method and device based on mobile phone browser core
CN106469439A (en) * 2016-08-30 2017-03-01 乐视控股(北京)有限公司 The processing method and processing device of picture in a kind of Night
CN106484396A (en) * 2016-09-18 2017-03-08 北京京东尚科信息技术有限公司 Night changing method, device and terminal unit

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622214A (en) * 2011-01-27 2012-08-01 腾讯科技(深圳)有限公司 Method and device for realizing multiple-display mode universal icons
CN104252362A (en) * 2014-09-26 2014-12-31 可牛网络技术(北京)有限公司 Web page showing method and web page showing device
CN105528389A (en) * 2015-11-09 2016-04-27 上海二三四五网络科技有限公司 A logic control method and device based on mobile phone browser core
CN106469439A (en) * 2016-08-30 2017-03-01 乐视控股(北京)有限公司 The processing method and processing device of picture in a kind of Night
CN106484396A (en) * 2016-09-18 2017-03-08 北京京东尚科信息技术有限公司 Night changing method, device and terminal unit

Cited By (37)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107861675A (en) * 2017-09-21 2018-03-30 海南智媒云图科技股份有限公司 A kind of method and device of intelligence switching Night
CN108469976A (en) * 2018-03-13 2018-08-31 北京车和家信息技术有限公司 Mode switching method, mode-changeover device, mobile unit and vehicle
CN108924338A (en) * 2018-05-24 2018-11-30 珠海市魅族科技有限公司 Method for controlling mobile terminal, mobile terminal and storage medium
WO2020042735A1 (en) * 2018-08-29 2020-03-05 中兴通讯股份有限公司 Screen display control method and apparatus, device, and readable storage medium
CN109614186A (en) * 2018-11-29 2019-04-12 深圳市酷达通讯有限公司 Application program color switching method, system and terminal device
WO2021027649A1 (en) * 2019-08-09 2021-02-18 华为技术有限公司 Dark-mode display interface processing method, electronic device, and storage medium
CN110609722A (en) * 2019-08-09 2019-12-24 华为技术有限公司 A kind of dark mode display interface processing method, electronic device and storage medium
US12014663B2 (en) 2019-08-09 2024-06-18 Huawei Technologies Co., Ltd. Dark mode display interface processing method, electronic device, and storage medium
CN110673906A (en) * 2019-08-19 2020-01-10 中至数据集团股份有限公司 Mode switching method and device, readable storage medium and mobile terminal
CN112486603A (en) * 2019-09-12 2021-03-12 北京搜狗科技发展有限公司 Interface adaptation method and device for adapting interface
CN110618852B (en) * 2019-09-24 2023-12-29 Oppo广东移动通信有限公司 View processing method, view processing device and terminal equipment
CN110618852A (en) * 2019-09-24 2019-12-27 Oppo广东移动通信有限公司 View processing method, view processing device and terminal equipment
CN110992869B (en) * 2019-12-24 2022-11-22 Oppo广东移动通信有限公司 Layer display method and related equipment
CN110992869A (en) * 2019-12-24 2020-04-10 Oppo广东移动通信有限公司 Layer display method and related equipment
CN111223432A (en) * 2020-01-10 2020-06-02 北京小米移动软件有限公司 Method and device for controlling screen display
CN111223432B (en) * 2020-01-10 2024-02-13 北京小米移动软件有限公司 Method and device for controlling screen display
CN111475238A (en) * 2020-03-13 2020-07-31 五八有限公司 Page processing method and device, electronic equipment and storage medium
CN111475238B (en) * 2020-03-13 2023-12-05 五八有限公司 Page processing method and device, electronic equipment and storage medium
WO2021213222A1 (en) * 2020-04-23 2021-10-28 深圳市万普拉斯科技有限公司 Method and apparatus for processing reading content, computer device and storage medium
CN113553127A (en) * 2020-04-23 2021-10-26 深圳市万普拉斯科技有限公司 Reading content processing method and device, computer equipment and storage medium
CN114077463A (en) * 2020-07-30 2022-02-22 北京搜狗科技发展有限公司 An input method interface display method, device and electronic device
CN114077463B (en) * 2020-07-30 2025-02-07 北京搜狗科技发展有限公司 Input method interface display method, device and electronic device
CN113760419A (en) * 2020-09-23 2021-12-07 北京沃东天骏信息技术有限公司 Method, apparatus, device, and computer-readable medium for displaying images
CN113760419B (en) * 2020-09-23 2024-10-18 北京沃东天骏信息技术有限公司 Method, device, apparatus and computer-readable medium for displaying an image
CN112837661A (en) * 2021-01-29 2021-05-25 北京小米移动软件有限公司 A screen brightness adjustment method, a screen brightness adjustment device and a storage medium
CN113299250B (en) * 2021-05-14 2022-05-27 漳州万利达科技有限公司 Image display method and device and display equipment
CN113299250A (en) * 2021-05-14 2021-08-24 漳州万利达科技有限公司 Image display method and device and display equipment
CN115484345A (en) * 2021-05-31 2022-12-16 华为技术有限公司 Display mode switching method, device, electronic device and medium
CN113556424A (en) * 2021-07-22 2021-10-26 山东浪潮通软信息科技有限公司 Mobile terminal skin switching method, design method and computer storage medium
CN114095603A (en) * 2021-11-11 2022-02-25 努比亚技术有限公司 Screen display characteristic regulation and control method and device and computer readable storage medium
CN114095603B (en) * 2021-11-11 2024-04-23 努比亚技术有限公司 Screen display characteristic regulation and control method, equipment and computer readable storage medium
CN114115657B (en) * 2021-11-23 2024-04-02 北京百度网讯科技有限公司 Display mode switching method, device, equipment and medium of cloud mobile phone
CN114115657A (en) * 2021-11-23 2022-03-01 北京百度网讯科技有限公司 Display mode switching method, device, equipment and medium of cloud mobile phone
CN114138394A (en) * 2021-12-06 2022-03-04 北京得间科技有限公司 Night display mode processing method, electronic device and computer storage medium
CN114500735A (en) * 2022-04-15 2022-05-13 北京车智赢科技有限公司 Display processing method, computing device and readable storage medium
CN116737292B (en) * 2022-10-29 2024-05-24 荣耀终端有限公司 A display mode switching method, electronic device and readable storage medium
CN116737292A (en) * 2022-10-29 2023-09-12 荣耀终端有限公司 A display mode switching method, electronic device and readable storage medium

Also Published As

Publication number Publication date
CN107038037B (en) 2021-03-02

Similar Documents

Publication Publication Date Title
CN107038037B (en) Display mode switching method and device
CN104700786B (en) Method and device for adjusting display brightness
JP7166171B2 (en) INTERFACE IMAGE DISPLAY METHOD, APPARATUS AND PROGRAM
CN106454336A (en) Method and device for detecting whether camera of terminal is covered or not, and terminal
CN106128385A (en) Liquid crystal display control method and device
CN106101680A (en) Acquisition parameters method to set up and device
CN106131441A (en) Photographic method and device, electronic equipment
CN105957037B (en) Image enchancing method and device
CN106953991A (en) Display mode switching method and device
CN106484356A (en) Adjust the method and device of brightness of image
CN108200279A (en) backlight adjusting method, device and equipment
US10951816B2 (en) Method and apparatus for processing image, electronic device and storage medium
CN112331158B (en) Terminal display adjustment method, device, equipment and storage medium
CN108122195A (en) Image processing method and device
CN106017668B (en) The reminding method and device of radiation intensity
CN108470552A (en) Display methods, device and storage medium
CN106557294A (en) Color adjustment method and device
CN106775548B (en) page processing method and device
CN116453459A (en) Screen display method and device, readable storage medium and electronic equipment
EP3866155A1 (en) Method and device for adjusting display brightness
CN106128415A (en) Screen luminance adjustment method and device
CN108538261A (en) Method and device for controlling display, and display device
CN110874829B (en) Image processing method and device, electronic device and storage medium
CN113470583B (en) Display screen adjusting method and device and storage medium
CN108206012A (en) Gamma correction method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant