CN111090384B - Soft keyboard display method and device - Google Patents

Soft keyboard display method and device Download PDF

Info

Publication number
CN111090384B
CN111090384B CN201911328400.4A CN201911328400A CN111090384B CN 111090384 B CN111090384 B CN 111090384B CN 201911328400 A CN201911328400 A CN 201911328400A CN 111090384 B CN111090384 B CN 111090384B
Authority
CN
China
Prior art keywords
soft keyboard
color
value
mobile terminal
target style
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.)
Active
Application number
CN201911328400.4A
Other languages
Chinese (zh)
Other versions
CN111090384A (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.)
BOE Technology Group Co Ltd
Original Assignee
BOE Technology Group 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 BOE Technology Group Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN201911328400.4A priority Critical patent/CN111090384B/en
Publication of CN111090384A publication Critical patent/CN111090384A/en
Application granted granted Critical
Publication of CN111090384B publication Critical patent/CN111090384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04886Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures by partitioning the display area of the touch-screen or the surface of the digitising tablet into independently controllable areas, e.g. virtual keyboards or menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

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

Abstract

The invention discloses a display method and a display device of a soft keyboard, relates to the technical field of mobile terminals, and aims to improve the user experience of inputting by using the soft keyboard when a user in a dark environment turns on a mobile terminal system or an application program in a night mode. The main technical scheme of the invention is as follows: when the operation of triggering the soft keyboard pop-up is monitored, judging whether the current environment of the mobile terminal is a dark environment or not and judging whether the current interface of the mobile terminal is in a night mode or not; if the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is in a night mode, adding a light shield for the soft keyboard; or adjusting the background color and the character color of the soft keyboard. The method and the device are applied to the process that the user in the dark environment uses the soft keyboard to input in the mobile terminal system or the application program which starts the night mode.

Description

Soft keyboard display method and device
Technical Field
The invention relates to the technical field of mobile terminals, in particular to a display method and device of a soft keyboard.
Background
With the continuous development of science and technology, mobile terminals such as smart phones and tablet computers are widely used by people, and people spend a great deal of time using the mobile terminals every day, such as browsing web pages, viewing screens, making calls, receiving and sending short messages, so that the mobile terminals become an indispensable part of the daily life of people.
Currently, in order to enable a user to obtain a better visual experience in dark environments, the system and most applications of the mobile terminal provide the option of night mode, however, the mobile terminal system and the application having the night mode cannot turn on the night mode for the soft keyboard, therefore, when the user in the dark environment uses the soft keyboard for inputting in the mobile terminal system or the application program which starts the night mode, the high-brightness soft keyboard is in sharp contrast with the system interface (or application program interface) in the dark environment and in the night mode, and can bring strong stimulation to the eyes of the user, so that the eyes of the user are uncomfortable and the vision is tired, therefore, the user experience of inputting by using the soft keyboard is poor when the user in a dark environment starts the mobile terminal system or the application program in the night mode.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for displaying a soft keyboard, and mainly aims to improve user experience when a user in a dark environment uses the soft keyboard to perform input when the user starts a mobile terminal system or an application program in a night mode.
In order to solve the above problems, the present invention mainly provides the following technical solutions:
in one aspect, the present invention provides a method for displaying a soft keyboard, including:
when the operation of triggering the soft keyboard pop-up is monitored, judging whether the current environment of the mobile terminal is a dark environment or not and judging whether the current interface of the mobile terminal is in a night mode or not;
if the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is in a night mode, adding a light shield for the soft keyboard; or adjusting the background color and the character color of the soft keyboard.
Optionally, the determining whether the current environment of the mobile terminal is a dark environment includes:
acquiring current time and a sunset time period, and judging whether the current time belongs to the sunset time period;
if so, determining that the current environment of the mobile terminal is a dark environment; or
Acquiring a brightness value corresponding to the current environment of the mobile terminal through a brightness sensor, and judging whether the brightness value belongs to a first preset brightness interval or not;
and if so, determining that the current environment of the mobile terminal is a dark environment.
Optionally, the determining whether the current interface of the mobile terminal is in the night mode includes:
acquiring a screenshot corresponding to the current interface;
acquiring RGB (red, green and blue) color values corresponding to each pixel point in the screenshot, substituting the RGB color values corresponding to each pixel point into a preset algorithm, and calculating a brightness value corresponding to each pixel point;
calculating the average brightness value corresponding to a plurality of pixel points according to the brightness value corresponding to each pixel point and the number of the plurality of pixel points;
judging whether the average brightness value belongs to a second preset brightness interval or not;
and if so, determining that the current interface of the mobile terminal is in a night mode.
Optionally, the obtaining an RGB color value corresponding to each pixel point in the screenshot includes:
converting the screenshot into a preset format file;
and extracting the RGB color value corresponding to each pixel point in the screenshot from the preset format file.
Optionally, adding a light shield for the soft keyboard includes:
obtaining a target style main tone color value corresponding to the screenshot through a palette tool;
creating the light shield according to the target style dominant hue color value and a preset transparency value;
and adding the light shield for the soft keyboard.
Optionally, the creating the light hood according to the target style dominant hue color value and a preset transparency value includes:
when the target style dominant hue color value is less than or equal to a first hue value threshold, giving the first hue value threshold and the preset transparency value to a shade template to create the shade;
when the target style dominant hue color value is larger than the first color value threshold value and smaller than a second color value threshold value, giving the target style dominant hue color value and the preset transparency value to the light shield template so as to create the light shield;
and when the target style dominant hue color value is greater than or equal to the second color value threshold, giving the second color value threshold and the preset transparency value to the light shield template so as to create the light shield.
Optionally, the adjusting the background color and the text color of the soft keyboard includes:
acquiring a target style main tone color value and a target style character color value corresponding to the screenshot through a palette tool;
calculating RGB color values corresponding to the target style main color tone color values, substituting the RGB color values into the preset algorithm, and calculating brightness values corresponding to the target style main color tone color values;
judging whether the brightness value belongs to the second preset brightness interval or not;
if so, adjusting the background color of the soft keyboard according to the target style main color tone color value, and adjusting the character color of the soft keyboard according to the target style character color value;
if not, adjusting the value of the target style main tone color value, so that the brightness value corresponding to the adjusted target style main tone color value belongs to the second preset brightness interval;
adjusting the value of the color value of the target style character according to the adjusted main color tone color value of the target style and a preset contrast value;
and adjusting the background color of the soft keyboard according to the adjusted target style dominant hue color value, and adjusting the character color of the soft keyboard according to the adjusted target style character color value.
Optionally, the method further includes:
when the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is not in a night mode, outputting and displaying a preset prompt frame so as to prompt a user whether to add a light shield for the soft keyboard and whether to adjust the background color and the character color of the soft keyboard;
and when the current environment of the mobile terminal is a non-dark environment and the current interface of the mobile terminal is in a night mode, outputting and displaying the preset prompt box so as to prompt a user whether to add a light shield for the soft keyboard and whether to adjust the background color and the character color of the soft keyboard.
Optionally, the method further includes:
setting a global monitoring event for the soft keyboard;
and monitoring the operation of triggering the soft keyboard pop-up in real time through the global monitoring event.
In order to achieve the above object, according to another aspect of the present invention, there is provided an electronic apparatus including: the display method of the soft keyboard comprises a memory, a processor and a program which is stored on the memory and can be run on the processor, wherein when the processor executes the program, the display method of the soft keyboard is realized.
In order to achieve the above object, according to another aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which when executed implements the soft keyboard display method described above.
In another aspect, the present invention further provides a display device of a soft keyboard, including:
the first judging unit is used for judging whether the current environment of the mobile terminal is a dark environment or not when the operation of triggering the soft keyboard pop-up is monitored;
the second judgment unit is used for judging whether the current interface of the mobile terminal is in a night mode or not when the operation of triggering the soft keyboard to pop up is monitored;
the adding unit is used for adding a light shield for the soft keyboard when the first judging unit judges that the current environment of the mobile terminal is a dark environment and the second judging unit judges that the current interface of the mobile terminal is in a night mode;
and the adjusting unit is used for adjusting the background color and the character color of the soft keyboard when the first judging unit judges that the environment where the mobile terminal is located is a dark environment and the second judging unit judges that the current interface of the mobile terminal is in a night mode.
Optionally, the first determining unit includes:
the first acquisition module is used for acquiring the current time and the sunset time period;
the first judging module is used for judging whether the current time belongs to the sunset time period or not;
the first determining module is used for determining that the current environment of the mobile terminal is a dark environment when the first judging module judges that the current time belongs to the sunset time period;
the acquisition module is used for acquiring the brightness value corresponding to the current environment of the mobile terminal through a brightness sensor;
the second judgment module is used for judging whether the brightness value belongs to a first preset brightness interval or not;
and the second determining module is used for determining that the current environment of the mobile terminal is a dark environment when the second judging module judges that the brightness value belongs to the first preset brightness interval.
Optionally, the second judging unit includes:
the second acquisition module is used for acquiring the screenshot corresponding to the current interface;
a third obtaining module, configured to obtain RGB (red, green, blue) color values corresponding to each pixel point in the screenshot;
the first calculation module is used for substituting the RGB color value corresponding to each pixel point into a preset algorithm and calculating the brightness value corresponding to each pixel point;
the second calculation module is used for calculating the average brightness value corresponding to the plurality of pixel points according to the brightness value corresponding to each pixel point and the number of the plurality of pixel points;
the third judging module is used for judging whether the average brightness value belongs to a second preset brightness interval or not;
and the third determining module is configured to determine that the current interface of the mobile terminal is in a night mode when the third determining module determines that the average brightness value belongs to a second preset brightness interval.
Optionally, the third obtaining module includes:
the conversion submodule is used for converting the screenshot into a preset format file;
and the extraction submodule is used for extracting the RGB color value corresponding to each pixel point in the screenshot from the preset format file.
Optionally, the adding unit includes:
a fourth obtaining module, configured to obtain, by using a palette tool, a target style keytone color value corresponding to the screenshot;
the creation module is used for creating the light shield according to the target style dominant hue color value and a preset transparency value;
and the adding module is used for adding the light shield for the soft keyboard.
Optionally, the creating module includes:
a first creating sub-module, configured to assign the first color value threshold and the preset transparency value to a mask template to create the mask when the target style dominant hue value is less than or equal to a first color value threshold;
a second creating sub-module, configured to assign the target style dominant hue color value and the preset transparency value to the mask template to create the mask when the target style dominant hue color value is greater than the first color value threshold and smaller than a second color value threshold;
and the third creating sub-module is used for giving the second color value threshold value and the preset transparency value to the light shield template when the target style dominant hue color value is larger than or equal to the second color value threshold value so as to create the light shield.
Optionally, the adjusting unit includes:
a fifth obtaining module, configured to obtain, by using a palette tool, a target style keytone color value and a target style text color value corresponding to the screenshot;
the third calculation module is used for calculating the RGB color values corresponding to the target style dominant hue color values;
the fourth calculation module is used for substituting the RGB color values into the preset algorithm and calculating the brightness value corresponding to the target style dominant hue color value;
the fourth judging module is used for judging whether the brightness value belongs to the second preset brightness interval or not;
the first adjusting module is used for adjusting the background color of the soft keyboard according to the target style main color tone color value and adjusting the character color of the soft keyboard according to the target style character color value when the fourth judging module judges that the brightness value belongs to the second preset brightness interval;
a second adjusting module, configured to adjust a value of the target style dominant hue color value when the fourth determining module determines that the brightness value does not belong to the second preset brightness interval, so that the brightness value corresponding to the adjusted target style dominant hue color value belongs to the second preset brightness interval;
the third adjusting module is used for adjusting the value of the color value of the target style character according to the adjusted target style dominant hue color value and a preset contrast value;
and the fourth adjusting module is used for adjusting the background color of the soft keyboard according to the adjusted target style dominant hue color value and adjusting the character color of the soft keyboard according to the adjusted target style character color value.
Optionally, the apparatus further comprises:
the output unit is used for outputting and displaying a preset prompt box when the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is not in a night mode so as to prompt a user whether to add a light shield for the soft keyboard and whether to adjust the background color and the character color of the soft keyboard;
and the output unit is further used for outputting and displaying the preset prompt box when the current environment of the mobile terminal is a non-dark environment and the current interface of the mobile terminal is in a night mode, so as to prompt a user whether to add a light shield for the soft keyboard and whether to adjust the background color and the character color of the soft keyboard.
Optionally, the apparatus further comprises:
the setting unit is used for setting a global monitoring event for the soft keyboard;
and the monitoring unit is used for monitoring the operation of triggering the soft keyboard pop-up in real time through the global monitoring event.
By the technical scheme, the technical scheme provided by the invention at least has the following advantages:
the invention provides a soft keyboard display method and device, compared with the prior art, the invention can monitor the operation of triggering the soft keyboard pop-up by a user in real time by a client application program, when the operation of triggering the soft keyboard pop-up by the user is monitored, the client application program judges whether the current environment of a mobile terminal is a dark environment or not and judges whether the current interface of the mobile terminal is in a night mode or not, and when the current environment of the mobile terminal is judged to be the dark environment and the current interface of the mobile terminal is in the night mode (namely the mobile terminal system or the currently opened application program starts the night mode), the soft keyboard is processed according to a preset mode, namely a light shield is added to the soft keyboard or the background color and the character color of the soft keyboard are adjusted to reduce the brightness of the soft keyboard, so that the user in the dark environment is in the mobile terminal system or the application program which starts the night mode, when the processed soft keyboard is used for inputting, strong stimulation can not be brought to the eyes of a user, and the user experience is further improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of a display method of a soft keyboard according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for displaying a soft keyboard according to an embodiment of the present invention;
fig. 3 is a block diagram of a display device of a soft keyboard according to an embodiment of the present invention;
fig. 4 is a block diagram of another display device of a soft keyboard according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
An embodiment of the present invention provides a display method of a soft keyboard, as shown in fig. 1, the method includes:
101. when the operation of triggering the soft keyboard pop-up is monitored, whether the current environment of the mobile terminal is a dark environment or not is judged, and whether the current interface of the mobile terminal is in a night mode or not is judged.
Among them, the system of the mobile terminal may be, but is not limited to: android system, IOS system, other customization systems, etc., the mobile terminal may be, but is not limited to: smart phones, tablet computers, and the like; the soft keyboard may be, but is not limited to: a soft keyboard of a third-party input method, a soft keyboard of a mobile terminal system with an input method, and the like; the current interface of the mobile terminal may be an interface of a mobile terminal system, or may also be an interface of an application program that is currently opened, which is not specifically limited in this embodiment of the present invention.
In the embodiment of the present invention, the execution subject in each step is a client application program running in the mobile terminal. When the operation that the user triggers the soft keyboard pop-up is monitored, the client application program needs to judge whether the current environment of the mobile terminal is a dark environment or not and whether the current interface of the mobile terminal is in a night mode or not, so that the subsequent client application program can process the soft keyboard according to a preset mode after judging that the current environment of the mobile terminal is the dark environment and the current interface of the mobile terminal is in the night mode, and the brightness of the soft keyboard is reduced.
102. If the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is in a night mode, adding a light shield for the soft keyboard; or adjusting the background color and the character color of the soft keyboard.
Wherein, the character color of the soft keyboard refers to: the color of the text in each key on the soft keyboard.
In the embodiment of the invention, when the current environment of the mobile terminal is determined to be a dark environment and the current interface of the mobile terminal is in a night mode (namely the mobile terminal system or the currently opened application program starts the night mode), the client application program can process the soft keyboard according to a preset mode, namely, a light shield is added to the soft keyboard or the background color and the character color of the soft keyboard are adjusted, so that the brightness of the soft keyboard is reduced, and further, a user in the dark environment can not bring strong stimulation to the eyes of the user when the processed soft keyboard is used for inputting in the mobile terminal system or the application program which starts the night mode.
It should be noted that, in the actual application process, the user may pre-select a preset mode for processing the soft keyboard, so that when the client application determines that the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is in the night mode, the client application may process the soft keyboard according to the preset mode selected by the user, that is: when the processing mode selected by the user is as follows: when a light shield is added to the soft keyboard, after the current environment of the mobile terminal is judged to be a dark environment and the current interface of the mobile terminal is in a night mode, the client application program adds the light shield to the soft keyboard, so that the brightness of the soft keyboard is reduced; when the processing mode selected by the user is as follows: when the background color and the character color of the soft keyboard are adjusted, the client application program adjusts the background color and the character color of the soft keyboard after the current environment where the mobile terminal is located is judged to be a dark environment and the current interface of the mobile terminal is in a night mode, so that the brightness of the soft keyboard is reduced.
The embodiment of the invention provides a method for displaying a soft keyboard, which is compared with the prior art, the method can monitor the operation of triggering the soft keyboard pop-up by a user in real time through a client application program, when the operation of triggering the soft keyboard pop-up by the user is monitored, the client application program judges whether the current environment of a mobile terminal is a dark environment or not and judges whether the current interface of the mobile terminal is in a night mode or not, and when the current environment of the mobile terminal is judged to be the dark environment and the current interface of the mobile terminal is in the night mode (namely the mobile terminal system or the currently opened application program starts the night mode), the soft keyboard is processed according to a preset mode, namely a light shield is added to the soft keyboard or the background color and the character color of the soft keyboard are adjusted to reduce the brightness of the soft keyboard, so that the user in the dark environment can start the mobile terminal system or the application program in the night mode, when the processed soft keyboard is used for inputting, strong stimulation can not be brought to the eyes of a user, and the user experience is further improved.
To explain in more detail below, an embodiment of the present invention provides another method for displaying a soft keyboard, specifically as shown in fig. 2, where the method includes:
201. when the operation of triggering the soft keyboard pop-up is monitored, whether the current environment of the mobile terminal is a dark environment or not is judged, and whether the current interface of the mobile terminal is in a night mode or not is judged.
In the embodiment of the invention, when the operation that the user triggers the soft keyboard pop-up is monitored, the client application program needs to judge whether the current environment of the mobile terminal is a dark environment or not and whether the current interface of the mobile terminal is in a night mode or not, so that the soft keyboard is processed according to a preset mode when the subsequent client application program judges that the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is in the night mode, and the brightness of the soft keyboard is reduced. A detailed description will be given below of how the client application determines whether the current environment of the mobile terminal is a dark environment and how the client application determines whether the current interface of the mobile terminal is in the night mode.
(1) And judging whether the current environment of the mobile terminal is a dark environment.
In the embodiment of the present invention, the client application may specifically determine whether the current environment of the mobile terminal is a dark environment through the following two ways:
1. the method comprises the steps of firstly obtaining the current time and the sunset time period, then judging whether the current time belongs to the sunset time period, and when the current time is judged to belong to the sunset time period, determining that the current environment of the mobile terminal is a dark environment. It should be noted that the sunset time period may be a preset fixed sunset time period, such as 17: 00-the next day 5:00, 18: 00-the next day 6:00, or may also be a real-time sunset time period obtained from a mobile terminal system or other application program, which is not specifically limited in this embodiment of the present invention.
2. Acquiring a brightness value corresponding to the current environment of the mobile terminal through a brightness sensor, judging whether the brightness value corresponding to the current environment of the mobile terminal belongs to a first preset brightness interval, and determining that the current environment of the mobile terminal is a dark environment when the brightness value corresponding to the current environment of the mobile terminal is judged to belong to the first preset brightness interval; the first preset brightness interval may be, but is not limited to: [15, 35], [18, 40], [20, 45], and so on.
(2) And judging whether the current interface of the mobile terminal is in a night mode or not.
In the embodiment of the present invention, the client application may specifically determine whether the current interface of the mobile terminal is in the night mode by:
firstly, acquiring a screenshot corresponding to a current interface;
then, converting the screenshot into a preset format file, extracting RGB (red, green, blue) color values corresponding to each pixel point in the screenshot from the preset format file, and substituting the RGB color values corresponding to each pixel point into a preset algorithm to calculate a brightness value corresponding to each pixel point, wherein the preset format file specifically can be: the preset algorithm of the Bitmap file is as follows:
Yi=((66*Ri+129*Gi+25*Bi+128)>>8)+16
wherein, YiFor the luminance value corresponding to the ith pixel point, RiFor the R value (red value), G, corresponding to the ith pixel pointiFor the G value (green value), B corresponding to the ith pixel pointiB value (blue color value) corresponding to the ith pixel point;
secondly, after calculating the brightness value corresponding to each pixel point, calculating the average brightness value corresponding to the plurality of pixel points according to the brightness value corresponding to each pixel point and the number of the plurality of pixel points, namely summing the brightness values corresponding to the plurality of pixel points to obtain the total brightness value corresponding to the plurality of pixel points, and dividing the total brightness value corresponding to the plurality of pixel points by the number corresponding to the plurality of pixel points to obtain the average brightness value corresponding to the plurality of pixel points;
finally, whether the average brightness values corresponding to the multiple pixel points belong to a second preset brightness interval or not is judged, and when the average brightness values corresponding to the multiple pixel points belong to the second preset brightness interval, the current interface of the mobile terminal can be determined to be in a night mode, namely the night mode of the mobile terminal system or the currently opened application program can be determined to be started; the second preset brightness interval may be, but is not limited to: [15, 35], [18, 40], [20, 45], and so on.
Specifically, in this step, the client application may set a global monitoring event for the soft keyboard in advance, and then monitor, in real time, an operation of triggering the soft keyboard pop-up by the user through the global monitoring event, but is not limited thereto.
202. If the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is in a night mode, adding a light shield for the soft keyboard; or adjusting the background color and the character color of the soft keyboard.
In the embodiment of the invention, when the current environment of the mobile terminal is determined to be a dark environment and the current interface of the mobile terminal is in a night mode, the client application program can process the soft keyboard according to a preset mode, namely, a light shield is added to the soft keyboard or the background color and the character color of the soft keyboard are adjusted, so that the brightness of the soft keyboard is reduced. The following description will be made in detail on how the client application adds a light shield to the soft keyboard and how the client application adjusts the background color and text color of the soft keyboard.
(1) A light shield is added to the soft keyboard.
In the embodiment of the present invention, the client application may add a light shield to the soft keyboard specifically by the following means:
firstly, a target style keytone color value corresponding to a screenshot (the screenshot corresponding to a current interface of the mobile terminal) is obtained by a palette tool, wherein the keytone color values of multiple styles corresponding to the screenshot can be obtained by the palette tool, and then the keytone color value of the target style is selected from the keytone color values of the multiple styles, and the multiple styles may include, but are not limited to: dark plus soft, bright plus soft, dark plus bright, bright plus bright, soft, bright and the like, and the target style can be any one of a plurality of styles;
then, creating a light shield according to the target style dominant hue color value corresponding to the screenshot and a preset transparency value: 1. when the target style main color tone value corresponding to the screenshot is smaller than or equal to the first color value threshold value, giving the first color value threshold value and a preset transparency value to the light shield template so as to create the light shield, wherein the color value of the created light shield is the first color value threshold value, and the transparency value is the preset transparency value; 2. when the target style main tone color value corresponding to the screenshot is larger than the first color value threshold value and smaller than the second color value threshold value, giving the target style main tone color value and a preset transparency value to the light shield template so as to create the light shield, wherein the created color value of the light shield is the target style main tone color value, and the created transparency value is the preset transparency value; 3. when the target style main tone color value corresponding to the screenshot is larger than or equal to the second color value threshold value, giving the second color value threshold value and a preset transparency value to the light shield template so as to create the light shield, wherein the color value of the created light shield is the second color value threshold value, and the transparency value is the preset transparency value; the first color value threshold may be, but is not limited to: 191919, the second color value threshold may be, but is not limited to: 333333, the preset transparency values may be, but are not limited to: 40%, 45%, 50%, etc.;
finally, a built light shield can be added to the soft keyboard, and the built light shield is covered on the upper layer of the soft keyboard.
(2) And adjusting the background color and the character color of the soft keyboard.
In the embodiment of the present invention, the client application program may specifically adjust the background color and the text color of the soft keyboard in the following manner:
firstly, a target style main tone color value and a target style character color value corresponding to a screenshot (the screenshot corresponding to a current interface of a mobile terminal) are obtained through a palette tool, wherein the main tone color values of a plurality of styles and the character color values of the plurality of styles corresponding to the screenshot can be obtained through the palette tool, then the main tone color value of the target style is selected from the main tone color values of the plurality of styles, and the character color value of the target style is selected from the character color values of the plurality of styles, and the plurality of styles can be, but are not limited to, including: dark plus soft, bright plus soft, dark plus bright, bright plus bright, soft, bright and the like, and the target style can be any one of a plurality of styles;
then, calculating an RGB color value corresponding to the target style dominant hue color value, and substituting the RGB color value corresponding to the target style dominant hue color value into the aforementioned preset algorithm, thereby calculating a luminance value corresponding to the target style dominant hue color value, that is, substituting the RGB color value corresponding to the target style dominant hue color value as an RGB color value corresponding to a certain pixel into the aforementioned preset algorithm, thereby calculating a luminance value corresponding to the target style dominant hue color value;
finally, whether the brightness value corresponding to the target style main color tone color value belongs to a second preset brightness interval or not is judged, when the brightness value corresponding to the target style main color tone color value belongs to the second preset brightness interval, the background color of the soft keyboard can be adjusted according to the target style main color tone color value, the character color of the soft keyboard can be adjusted according to the target style character color value, namely, the target style main color tone color value is endowed to the background color of the soft keyboard, and the target style character color value is endowed to the character color of the soft keyboard; when it is determined that the luminance value corresponding to the target style keytone color value does not fall within the second preset luminance interval, gradually adjusting the value of the target style dominant hue color value until the brightness value corresponding to the adjusted target style dominant hue color value belongs to a second preset brightness interval, then adjusting the value of the color value of the target style characters (i.e. adjusting the value of the color value of the target style characters to the ratio of the adjusted value of the color value of the target style main color to the preset contrast value) according to the adjusted color value of the target style main color and the preset contrast value, finally adjusting the background color of the soft keyboard according to the adjusted color value of the target style main color, and adjusting the character color of the soft keyboard according to the adjusted color value of the target style characters, the adjusted target style main color tone color value is endowed to the background color of the soft keyboard, and the adjusted target style character color value is endowed to the character color of the soft keyboard; wherein, the preset contrast value may be, but is not limited to: 3.1, 3.7, 4.2, 4.5, etc.
203. And when the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is not in the night mode, outputting and displaying a preset prompt box.
In the embodiment of the present invention, when it is determined in step 201 that the environment where the mobile terminal is currently located is a dark environment but the current interface of the mobile terminal is not in the night mode, the client application program may output and display a preset prompt box so as to prompt the user whether to add a light shield for the soft keyboard and whether to adjust the background color and the text color of the soft keyboard, and when the user selects to add a light shield for the soft keyboard in the preset prompt box, the client application program may execute the corresponding steps recorded in step 202 to add a light shield for the soft keyboard; when the user selects to adjust the background color and the text color of the soft keyboard in the preset prompt box, the client application program can execute the corresponding steps recorded in step 202 to adjust the background color and the text color of the soft keyboard.
204. And when the current environment of the mobile terminal is a non-dark environment and the current interface of the mobile terminal is in a night mode, outputting and displaying a preset prompt box.
In the embodiment of the present invention, when it is determined in step 201 that the environment where the mobile terminal is currently located is a non-dark environment, but the current interface of the mobile terminal is in a night mode, the client application program may output and display a preset prompt box so as to prompt the user whether to add a light shield for the soft keyboard and whether to adjust the background color and the text color of the soft keyboard, and when the user selects to add a light shield for the soft keyboard in the preset prompt box, the client application program may execute the corresponding steps recorded in step 202 to add a light shield for the soft keyboard; when the user selects to adjust the background color and the text color of the soft keyboard in the preset prompt box, the client application program can execute the corresponding steps recorded in step 202 to adjust the background color and the text color of the soft keyboard.
In order to achieve the above object, according to another aspect of the present invention, an embodiment of the present invention further provides an electronic device, including: the display method of the soft keyboard comprises a memory, a processor and a program which is stored on the memory and can be run on the processor, wherein when the processor executes the program, the display method of the soft keyboard is realized.
In order to achieve the above object, according to another aspect of the present invention, an embodiment of the present invention further provides a computer readable storage medium, on which a computer program is stored, where the computer program implements the above-mentioned soft keyboard display method when running.
Further, as an implementation of the method shown in fig. 1 and fig. 2, an embodiment of the present invention provides a display device for a soft keyboard. The embodiment of the apparatus corresponds to the embodiment of the method, and for convenience of reading, details in the embodiment of the apparatus are not repeated one by one, but it should be clear that the apparatus in the embodiment can correspondingly implement all the contents in the embodiment of the method. The device is applied to improve the user experience of a user in a dark environment when the user uses a soft keyboard for inputting in a mobile terminal system or an application program which starts a night mode, and specifically as shown in fig. 3, the device comprises:
the first judging unit 31 is configured to, when an operation of triggering a soft keyboard pop-up is monitored, judge whether the current environment where the mobile terminal is located is a dark environment;
a second judging unit 32, configured to judge whether a current interface of the mobile terminal is in a night mode when an operation of triggering a soft keyboard pop-up is monitored;
an adding unit 33, configured to add a light shield to the soft keyboard when the first determining unit 31 determines that the current environment of the mobile terminal is a dark environment and the second determining unit 32 determines that the current interface of the mobile terminal is in a night mode;
an adjusting unit 34, configured to adjust a background color and a text color of the soft keyboard when the first determining unit 31 determines that the current environment of the mobile terminal is a dark environment and the second determining unit 32 determines that the current interface of the mobile terminal is in a night mode.
Further, as shown in fig. 4, the first judgment unit 31 includes:
a first obtaining module 311, configured to obtain a current time and a sunset time period;
a first judging module 312, configured to judge whether the current time belongs to the sunset time period;
a first determining module 313, configured to determine that the current environment of the mobile terminal is a dark environment when the first determining module 312 determines that the current time belongs to the sunset time period;
the acquisition module 314 is configured to acquire, through a brightness sensor, a brightness value corresponding to an environment where the mobile terminal is currently located;
a second determining module 315, configured to determine whether the brightness value belongs to a first preset brightness interval;
a second determining module 316, configured to determine that the current environment of the mobile terminal is a dark environment when the second determining module 315 determines that the brightness value belongs to the first preset brightness interval.
Further, as shown in fig. 4, the second judgment unit 32 includes:
a second obtaining module 321, configured to obtain a screenshot corresponding to the current interface;
a third obtaining module 322, configured to obtain RGB (red, green, blue) color values corresponding to each pixel point in the screenshot;
the first calculating module 323 is configured to substitute the RGB color value corresponding to each pixel point into a preset algorithm, and calculate a luminance value corresponding to each pixel point;
a second calculating module 324, configured to calculate, according to a luminance value corresponding to each pixel point and the number of the plurality of pixel points, an average luminance value corresponding to the plurality of pixel points;
a third determining module 325, configured to determine whether the average brightness value belongs to a second preset brightness interval;
a third determining module 326, configured to determine that the current interface of the mobile terminal is in a night mode when the third determining module 325 determines that the average brightness value belongs to a second preset brightness interval.
Further, as shown in fig. 4, the third obtaining module 322 includes:
a conversion sub-module 3221, configured to convert the screenshot into a preset format file;
the extracting sub-module 3222 is configured to extract, from the preset format file, an RGB color value corresponding to each pixel point in the screenshot.
Further, as shown in fig. 4, the adding unit 33 includes:
a fourth obtaining module 331, configured to obtain, through a palette tool, a target style keytone color value corresponding to the screenshot;
a creating module 332, configured to create the light shade according to the target style dominant hue color value and a preset transparency value;
an adding module 333, configured to add the light shield to the soft keyboard.
Further, as shown in fig. 4, the creating module 332 includes:
the first creating sub-module 3321, configured to assign the first color value threshold and the preset transparency value to a mask template to create the mask when the target style dominant hue value is less than or equal to a first color value threshold;
a second creating sub-module 3322, configured to assign the target style dominant hue color value and the preset transparency value to the mask template to create the mask when the target style dominant hue color value is greater than the first color value threshold and smaller than a second color value threshold;
a third creating sub-module 3323, configured to assign the second color value threshold and the preset transparency value to the mask template to create the mask when the target style dominant hue color value is greater than or equal to the second color value threshold.
Further, as shown in fig. 4, the adjusting unit 34 includes:
a fifth obtaining module 341, configured to obtain, by using a palette tool, a target style keytone color value and a target style text color value corresponding to the screenshot;
a third calculating module 342, configured to calculate an RGB color value corresponding to the target style dominant hue color value;
a fourth calculating module 343, configured to substitute the RGB color values into the preset algorithm, and calculate a luminance value corresponding to the target style dominant hue color value;
a fourth determining module 344, configured to determine whether the brightness value belongs to the second preset brightness interval;
a first adjusting module 345, configured to adjust a background color of the soft keyboard according to the target style dominant hue color value and adjust a text color of the soft keyboard according to the target style text color value when the fourth determining module 344 determines that the brightness value belongs to the second preset brightness interval;
a second adjusting module 346, configured to, when the fourth determining module 344 determines that the brightness value does not belong to the second preset brightness interval, adjust a value of the target style dominant hue color value, so that the brightness value corresponding to the adjusted target style dominant hue color value belongs to the second preset brightness interval;
a third adjusting module 347, configured to adjust a value of the color value of the target-style text according to the adjusted target-style dominant hue color value and a preset contrast value;
a fourth adjusting module 348, configured to adjust a background color of the soft keyboard according to the adjusted target style dominant hue color value, and adjust a text color of the soft keyboard according to the adjusted target style text color value.
Further, as shown in fig. 4, the apparatus further includes:
the output unit 35 is configured to output and display a preset prompt box when the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is not in a night mode, so as to prompt a user whether to add a light shield to the soft keyboard and whether to adjust a background color and a text color of the soft keyboard;
and the output unit 35 is further configured to output and display the preset prompt box when the current environment of the mobile terminal is a non-dark environment and the current interface of the mobile terminal is in a night mode, so as to prompt a user whether to add a light shield to the soft keyboard and whether to adjust the background color and the text color of the soft keyboard.
Further, as shown in fig. 4, the apparatus further includes:
a setting unit 36, configured to set a global snoop event for the soft keyboard;
and the monitoring unit 37 is configured to monitor, in real time, an operation of triggering the soft keyboard pop-up through the global monitoring event.
To sum up, embodiments of the present invention provide a method and an apparatus for displaying a soft keyboard, where, compared with the prior art, an embodiment of the present invention can monitor an operation of triggering a soft keyboard pop-up by a user in real time through a client application program, and when the operation of triggering the soft keyboard pop-up by the user is monitored, the client application program determines whether a current environment of a mobile terminal is a dark environment or not, and determines whether a current interface of the mobile terminal is in a night mode or not, and when it is determined that the current environment of the mobile terminal is the dark environment and the current interface of the mobile terminal is in the night mode (i.e. the mobile terminal system or the currently opened application program has started the night mode), the soft keyboard is processed according to a preset manner, i.e. adding a light shield to the soft keyboard or adjusting a background color and a text color of the soft keyboard to reduce a brightness of the soft keyboard, so that the user in the environment of the mobile terminal system or the application program in the dark mode is started, when the processed soft keyboard is used for inputting, strong stimulation can not be brought to the eyes of a user, and the user experience is further improved.
The display device of the soft keyboard comprises a processor and a memory, wherein the first judging unit, the second judging unit, the adding unit, the adjusting unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the user experience of inputting by using a soft keyboard in a mobile terminal system or an application program which is in a night mode is promoted by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides an electronic device, including: the display device comprises a memory, a processor and a program which is stored on the memory and can run on the processor, wherein when the processor executes the program, the display method of the soft keyboard is realized.
The embodiment of the invention provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the program realizes the soft keyboard display method when running.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
when the operation of triggering the soft keyboard pop-up is monitored, judging whether the current environment of the mobile terminal is a dark environment or not and judging whether the current interface of the mobile terminal is in a night mode or not;
if the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is in a night mode, adding a light shield for the soft keyboard; or adjusting the background color and the character color of the soft keyboard.
Further, the determining whether the current environment of the mobile terminal is a dark environment includes:
acquiring current time and a sunset time period, and judging whether the current time belongs to the sunset time period;
if so, determining that the current environment of the mobile terminal is a dark environment; or
Acquiring a brightness value corresponding to the current environment of the mobile terminal through a brightness sensor, and judging whether the brightness value belongs to a first preset brightness interval or not;
and if so, determining that the current environment of the mobile terminal is a dark environment.
Further, the determining whether the current interface of the mobile terminal is in a night mode includes:
acquiring a screenshot corresponding to the current interface;
acquiring RGB (red, green and blue) color values corresponding to each pixel point in the screenshot, substituting the RGB color values corresponding to each pixel point into a preset algorithm, and calculating a brightness value corresponding to each pixel point;
calculating the average brightness value corresponding to a plurality of pixel points according to the brightness value corresponding to each pixel point and the number of the plurality of pixel points;
judging whether the average brightness value belongs to a second preset brightness interval or not;
and if so, determining that the current interface of the mobile terminal is in a night mode.
Further, the obtaining of the RGB color value corresponding to each pixel point in the screenshot includes:
converting the screenshot into a preset format file;
and extracting the RGB color value corresponding to each pixel point in the screenshot from the preset format file.
Further, adding a light shield for the soft keyboard comprises:
obtaining a target style main tone color value corresponding to the screenshot through a palette tool;
creating the light shield according to the target style dominant hue color value and a preset transparency value;
and adding the light shield for the soft keyboard.
Further, the creating the shade according to the target style dominant hue color value and a preset transparency value includes:
when the target style dominant hue color value is less than or equal to a first hue value threshold, giving the first hue value threshold and the preset transparency value to a shade template to create the shade;
when the target style dominant hue color value is larger than the first color value threshold value and smaller than a second color value threshold value, giving the target style dominant hue color value and the preset transparency value to the light shield template so as to create the light shield;
and when the target style dominant hue color value is greater than or equal to the second color value threshold, giving the second color value threshold and the preset transparency value to the light shield template so as to create the light shield.
Further, the adjusting the background color and the text color of the soft keyboard includes:
acquiring a target style main tone color value and a target style character color value corresponding to the screenshot through a palette tool;
calculating RGB color values corresponding to the target style main color tone color values, substituting the RGB color values into the preset algorithm, and calculating brightness values corresponding to the target style main color tone color values;
judging whether the brightness value belongs to the second preset brightness interval or not;
if so, adjusting the background color of the soft keyboard according to the target style main color tone color value, and adjusting the character color of the soft keyboard according to the target style character color value;
if not, adjusting the value of the target style main tone color value, so that the brightness value corresponding to the adjusted target style main tone color value belongs to the second preset brightness interval;
adjusting the value of the color value of the target style character according to the adjusted main color tone color value of the target style and a preset contrast value;
and adjusting the background color of the soft keyboard according to the adjusted target style dominant hue color value, and adjusting the character color of the soft keyboard according to the adjusted target style character color value.
Further, the method further comprises:
when the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is not in a night mode, outputting and displaying a preset prompt frame so as to prompt a user whether to add a light shield for the soft keyboard and whether to adjust the background color and the character color of the soft keyboard;
and when the current environment of the mobile terminal is a non-dark environment and the current interface of the mobile terminal is in a night mode, outputting and displaying the preset prompt box so as to prompt a user whether to add a light shield for the soft keyboard and whether to adjust the background color and the character color of the soft keyboard.
Further, the method further comprises:
setting a global monitoring event for the soft keyboard;
and monitoring the operation of triggering the soft keyboard pop-up in real time through the global monitoring event.
The device herein may be a smartphone, a tablet computer, etc.
The present application further provides a computer program product adapted to perform program code for initializing the following method steps when executed on a data processing device: when the operation of triggering the soft keyboard pop-up is monitored, judging whether the current environment of the mobile terminal is a dark environment or not and judging whether the current interface of the mobile terminal is in a night mode or not; if the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is in a night mode, adding a light shield for the soft keyboard; or adjusting the background color and the character color of the soft keyboard.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (trahsity media) such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (12)

1. A method for displaying a soft keyboard, the method comprising:
when the operation of triggering the soft keyboard pop-up is monitored, judging whether the current environment of the mobile terminal is a dark environment or not and judging whether the current interface of the mobile terminal is in a night mode or not;
if the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is in a night mode, adding a light shield for the soft keyboard; or adjusting the background color and the character color of the soft keyboard;
the judging whether the current interface of the mobile terminal is in a night mode includes:
acquiring a screenshot corresponding to the current interface;
acquiring an RGB color value corresponding to each pixel point in the screenshot, substituting the RGB color value corresponding to each pixel point into a preset algorithm, and calculating a brightness value corresponding to each pixel point;
calculating the average brightness value corresponding to a plurality of pixel points according to the brightness value corresponding to each pixel point and the number of the plurality of pixel points;
judging whether the average brightness value belongs to a second preset brightness interval or not;
if so, determining that the current interface of the mobile terminal is in a night mode;
the adjusting of the background color and the character color of the soft keyboard comprises the following steps:
acquiring a target style main tone color value and a target style character color value corresponding to the screenshot through a palette tool;
calculating RGB color values corresponding to the target style main color tone color values, substituting the RGB color values into the preset algorithm, and calculating brightness values corresponding to the target style main color tone color values;
judging whether the brightness value belongs to the second preset brightness interval or not;
if so, adjusting the background color of the soft keyboard according to the target style main color tone color value, and adjusting the character color of the soft keyboard according to the target style character color value;
if not, adjusting the value of the target style main tone color value, so that the brightness value corresponding to the adjusted target style main tone color value belongs to the second preset brightness interval;
adjusting the value of the color value of the target style character according to the adjusted main color tone color value of the target style and a preset contrast value;
adjusting the background color of the soft keyboard according to the adjusted target style dominant hue color value, and adjusting the character color of the soft keyboard according to the adjusted target style character color value;
adding a light shield for the soft keyboard, comprising:
obtaining a target style main tone color value corresponding to the screenshot through a palette tool;
creating the light shield according to the target style dominant hue color value and a preset transparency value;
adding the light shield for the soft keyboard;
creating the light shield according to the target style dominant hue color value and a preset transparency value, comprising:
when the target style dominant hue color value is less than or equal to a first hue value threshold, giving the first hue value threshold and the preset transparency value to a shade template to create the shade;
when the target style dominant hue color value is larger than the first color value threshold value and smaller than a second color value threshold value, giving the target style dominant hue color value and the preset transparency value to the light shield template so as to create the light shield;
and when the target style dominant hue color value is greater than or equal to the second color value threshold, giving the second color value threshold and the preset transparency value to the light shield template so as to create the light shield.
2. The method according to claim 1, wherein the determining whether the current environment of the mobile terminal is a dark environment comprises:
acquiring current time and a sunset time period, and judging whether the current time belongs to the sunset time period;
if so, determining that the current environment of the mobile terminal is a dark environment; or
Acquiring a brightness value corresponding to the current environment of the mobile terminal through a brightness sensor, and judging whether the brightness value belongs to a first preset brightness interval or not;
and if so, determining that the current environment of the mobile terminal is a dark environment.
3. The method of claim 1, wherein the obtaining the RGB color values corresponding to each pixel point in the screenshot comprises:
converting the screenshot into a preset format file;
and extracting the RGB color value corresponding to each pixel point in the screenshot from the preset format file.
4. The method according to any one of claims 1-3, further comprising:
when the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is not in a night mode, outputting and displaying a preset prompt frame so as to prompt a user whether to add a light shield for the soft keyboard and whether to adjust the background color and the character color of the soft keyboard;
and when the current environment of the mobile terminal is a non-dark environment and the current interface of the mobile terminal is in a night mode, outputting and displaying the preset prompt box so as to prompt a user whether to add a light shield for the soft keyboard and whether to adjust the background color and the character color of the soft keyboard.
5. The method according to any one of claims 1-3, further comprising:
setting a global monitoring event for the soft keyboard;
and monitoring the operation of triggering the soft keyboard pop-up in real time through the global monitoring event.
6. A display device for a soft keyboard, the device comprising:
the first judging unit is used for judging whether the current environment of the mobile terminal is a dark environment or not when the operation of triggering the soft keyboard pop-up is monitored;
the second judgment unit is used for judging whether the current interface of the mobile terminal is in a night mode or not when the operation of triggering the soft keyboard to pop up is monitored;
the adding unit is used for adding a light shield for the soft keyboard when the first judging unit judges that the current environment of the mobile terminal is a dark environment and the second judging unit judges that the current interface of the mobile terminal is in a night mode;
the adjusting unit is used for adjusting the background color and the character color of the soft keyboard when the first judging unit judges that the environment where the mobile terminal is located is a dark environment and the second judging unit judges that the current interface of the mobile terminal is in a night mode;
the second determination unit includes:
the second acquisition module is used for acquiring the screenshot corresponding to the current interface;
the third acquisition module is used for acquiring the RGB color value corresponding to each pixel point in the screenshot;
the first calculation module is used for substituting the RGB color value corresponding to each pixel point into a preset algorithm and calculating the brightness value corresponding to each pixel point;
the second calculation module is used for calculating the average brightness value corresponding to the plurality of pixel points according to the brightness value corresponding to each pixel point and the number of the plurality of pixel points;
the third judging module is used for judging whether the average brightness value belongs to a second preset brightness interval or not;
the third determining module is configured to determine that the current interface of the mobile terminal is in a night mode when the third determining module determines that the average brightness value belongs to a second preset brightness interval;
the adjusting unit includes:
a fifth obtaining module, configured to obtain, by using a palette tool, a target style keytone color value and a target style text color value corresponding to the screenshot;
the third calculation module is used for calculating the RGB color values corresponding to the target style dominant hue color values;
the fourth calculation module is used for substituting the RGB color values into the preset algorithm and calculating the brightness value corresponding to the target style dominant hue color value;
the fourth judging module is used for judging whether the brightness value belongs to the second preset brightness interval or not;
the first adjusting module is used for adjusting the background color of the soft keyboard according to the target style main color tone color value and adjusting the character color of the soft keyboard according to the target style character color value when the fourth judging module judges that the brightness value belongs to the second preset brightness interval;
a second adjusting module, configured to adjust a value of the target style dominant hue color value when the fourth determining module determines that the brightness value does not belong to the second preset brightness interval, so that the brightness value corresponding to the adjusted target style dominant hue color value belongs to the second preset brightness interval;
the third adjusting module is used for adjusting the value of the color value of the target style character according to the adjusted target style dominant hue color value and a preset contrast value;
the fourth adjusting module is used for adjusting the background color of the soft keyboard according to the adjusted target style dominant hue color value and adjusting the character color of the soft keyboard according to the adjusted target style character color value;
the adding unit includes:
a fourth obtaining module, configured to obtain, by using a palette tool, a target style keytone color value corresponding to the screenshot;
the creation module is used for creating the light shield according to the target style dominant hue color value and a preset transparency value;
the adding module is used for adding the light shield for the soft keyboard;
the creation module comprises:
a first creating sub-module, configured to assign the first color value threshold and the preset transparency value to a mask template to create the mask when the target style dominant hue value is less than or equal to a first color value threshold;
a second creating sub-module, configured to assign the target style dominant hue color value and the preset transparency value to the mask template to create the mask when the target style dominant hue color value is greater than the first color value threshold and smaller than a second color value threshold;
and the third creating sub-module is used for giving the second color value threshold value and the preset transparency value to the light shield template when the target style dominant hue color value is larger than or equal to the second color value threshold value so as to create the light shield.
7. The apparatus according to claim 6, wherein the first judging unit includes:
the first acquisition module is used for acquiring the current time and the sunset time period;
the first judging module is used for judging whether the current time belongs to the sunset time period or not;
the first determining module is used for determining that the current environment of the mobile terminal is a dark environment when the first judging module judges that the current time belongs to the sunset time period;
the acquisition module is used for acquiring the brightness value corresponding to the current environment of the mobile terminal through a brightness sensor;
the second judgment module is used for judging whether the brightness value belongs to a first preset brightness interval or not;
and the second determining module is used for determining that the current environment of the mobile terminal is a dark environment when the second judging module judges that the brightness value belongs to the first preset brightness interval.
8. The apparatus of claim 6, wherein the third obtaining module comprises:
the conversion submodule is used for converting the screenshot into a preset format file;
and the extraction submodule is used for extracting the RGB color value corresponding to each pixel point in the screenshot from the preset format file.
9. The apparatus according to any one of claims 6-8, further comprising:
the output unit is used for outputting and displaying a preset prompt box when the current environment of the mobile terminal is a dark environment and the current interface of the mobile terminal is not in a night mode so as to prompt a user whether to add a light shield for the soft keyboard and whether to adjust the background color and the character color of the soft keyboard;
and the output unit is further used for outputting and displaying the preset prompt box when the current environment of the mobile terminal is a non-dark environment and the current interface of the mobile terminal is in a night mode, so as to prompt a user whether to add a light shield for the soft keyboard and whether to adjust the background color and the character color of the soft keyboard.
10. The apparatus according to any one of claims 6-8, further comprising:
the setting unit is used for setting a global monitoring event for the soft keyboard;
and the monitoring unit is used for monitoring the operation of triggering the soft keyboard pop-up in real time through the global monitoring event.
11. An electronic device, comprising: a memory, a processor and a program stored on the memory and executable on the processor, the processor implementing the soft keyboard display method of any one of claims 1-5 when executing the program.
12. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when running, implements the soft keyboard display method of any one of claims 1-5.
CN201911328400.4A 2019-12-20 2019-12-20 Soft keyboard display method and device Active CN111090384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911328400.4A CN111090384B (en) 2019-12-20 2019-12-20 Soft keyboard display method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911328400.4A CN111090384B (en) 2019-12-20 2019-12-20 Soft keyboard display method and device

Publications (2)

Publication Number Publication Date
CN111090384A CN111090384A (en) 2020-05-01
CN111090384B true CN111090384B (en) 2021-11-02

Family

ID=70396542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911328400.4A Active CN111090384B (en) 2019-12-20 2019-12-20 Soft keyboard display method and device

Country Status (1)

Country Link
CN (1) CN111090384B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111773683A (en) * 2020-07-03 2020-10-16 珠海金山网络游戏科技有限公司 Character display method and device based on mobile terminal
CN112492106A (en) * 2020-11-27 2021-03-12 北京高途云集教育科技有限公司 Page theme switching method and device, computer equipment and storage medium
CN115328385A (en) * 2022-08-05 2022-11-11 北京百度网讯科技有限公司 Virtual keyboard display method and device, electronic equipment, storage medium and product

Citations (3)

* 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
JP2015203911A (en) * 2014-04-11 2015-11-16 キヤノン株式会社 Interface device, information processing apparatus, and computer program
CN109032739A (en) * 2018-07-20 2018-12-18 掌阅科技股份有限公司 A kind of interface display method, terminal and computer storage medium

Patent Citations (3)

* 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
JP2015203911A (en) * 2014-04-11 2015-11-16 キヤノン株式会社 Interface device, information processing apparatus, and computer program
CN109032739A (en) * 2018-07-20 2018-12-18 掌阅科技股份有限公司 A kind of interface display method, terminal and computer storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"夜间模式为什么虚拟键盘还是那么亮";M1485412334261;《http://www.oneplusbbs.com/thread-3463658-1.html》;20170522;第1页及附图 *

Also Published As

Publication number Publication date
CN111090384A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
US11729514B2 (en) Image processing method and apparatus
CN107179889B (en) Interface color adjusting method, webpage color adjusting method and webpage color adjusting device
CN111090384B (en) Soft keyboard display method and device
CN111610847B (en) Page display method and device of third-party application program and electronic equipment
CN109951627B (en) Image processing method, image processing device, storage medium and electronic equipment
CN107680042B (en) Rendering method, device, engine and storage medium combining texture and convolution network
CN107408401B (en) User slider for simplified adjustment of images
CN109739609B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN114640783B (en) Photographing method and related equipment
CN108446089B (en) Data display method and device and display
CN111399965A (en) User interface compatible display method and device, equipment and storage medium
CN110880164B (en) Image processing method, device, equipment and computer storage medium
CN113064687A (en) Color adaptation processing method, device and equipment for user interface component
CN110473156B (en) Image information processing method and device, storage medium and electronic equipment
CN113724282A (en) Image processing method and related product
CN112149745B (en) Method, device, equipment and storage medium for determining difficult example sample
CN113986175A (en) Color selection method and device, electronic equipment and readable medium
CN113760429A (en) Control method and control device
CN107895563B (en) Display control method and device, terminal and computer readable storage medium
CN110225177B (en) Interface adjusting method, computer storage medium and terminal equipment
CN111930461A (en) Android-based mobile terminal APP full page graying method and device
CN110795096A (en) Slice layer special effect realization method based on openlayers
CN110874816A (en) Image processing method and device, mobile terminal and storage medium
CN112508774B (en) Image processing method and device
CN103544931A (en) Character generating method and device and application terminal

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