WO2023220929A1 - 一种界面显示方法、装置、终端及存储介质 - Google Patents

一种界面显示方法、装置、终端及存储介质 Download PDF

Info

Publication number
WO2023220929A1
WO2023220929A1 PCT/CN2022/093375 CN2022093375W WO2023220929A1 WO 2023220929 A1 WO2023220929 A1 WO 2023220929A1 CN 2022093375 W CN2022093375 W CN 2022093375W WO 2023220929 A1 WO2023220929 A1 WO 2023220929A1
Authority
WO
WIPO (PCT)
Prior art keywords
inversion
target
interface
application
rule
Prior art date
Application number
PCT/CN2022/093375
Other languages
English (en)
French (fr)
Inventor
张勇
刘申享
Original Assignee
北京小米移动软件有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Priority to CN202280004411.0A priority Critical patent/CN116806333A/zh
Priority to PCT/CN2022/093375 priority patent/WO2023220929A1/zh
Publication of WO2023220929A1 publication Critical patent/WO2023220929A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Definitions

  • the present disclosure relates to the field of display technology, and in particular, to an interface display method, device, terminal and storage medium.
  • the dark mode function in mobile phones is used to adjust the background and text color of the application so that the display style of the entire interface is as close to black as possible, also known as dark mode or dark theme.
  • the first is to adapt by the application itself.
  • the application needs to prepare two sets of colors and resources.
  • the system selects the corresponding dark resource when drawing the application's display interface, thereby achieving a better dark effect.
  • the second is for the system to actively invert the content of the application display interface, usually by inverting the text and inverting the background to black, so that most areas of the interface appear black, but the system uses the same inverse color for all applications.
  • Color rules cannot be adapted to various applications. Some applications use inverse color rules, giving users a bad visual experience.
  • the present disclosure provides an interface display method, device, terminal and storage medium.
  • an interface display method which is applied to an application installed on a terminal.
  • the interface display method includes:
  • the color inversion rules are used to represent the mapping relationship between the display content in the display interface changing from the first display state to the second display state after being inverted.
  • Each of the inversion color rules has its own Are not the same;
  • the target application Based on the target application, select at least one inversion rule that is suitable for the target application from the preset plurality of inversion rules as the target inversion rule, wherein the target application is a dark mode enabled app;
  • the to-be-displayed interface of the target application is inverted to obtain a target display interface.
  • selecting at least one inversion rule that is adapted to the target application from the preset plurality of inversion rules as the target inversion rule includes:
  • the target inversion rule is selected from the plurality of preset inversion rules.
  • the interface display method when the system main process of the terminal is started, the interface display method further includes:
  • the first configuration information corresponding to the updated version of the target application is obtained.
  • selecting at least one inversion rule that is adapted to the target application from the preset plurality of inversion rules as the target inversion rule includes:
  • the second configuration information is used to characterize the mapping relationship between the type of content displayed in the display interface and the inversion rule;
  • the target inversion rule is selected from the plurality of preset inversion rules according to the second configuration information and the type of content displayed in the to-be-displayed interface of the target application.
  • selecting at least one inversion rule that is adapted to the target application from the preset plurality of inversion rules as the target inversion rule includes:
  • the target inversion rule is selected from the plurality of preset inversion rules
  • inverting the interface to be displayed of the target application to obtain the target display interface includes:
  • an interface display device which is applied to an application installed on a terminal.
  • the interface display device includes:
  • the first acquisition module is configured to acquire a plurality of preset inversion rules.
  • the inversion rules are used to represent the mapping relationship in which the display content in the display interface changes from the first display state to the second display state after inversion, Each of the said anti-color rules is different;
  • the selection module is configured to select at least one inversion rule that is suitable for the target application from the preset plurality of inversion rules as the target inversion rule based on the target application, wherein the target application is Apps with dark mode turned on;
  • the inversion module is configured to perform inversion processing on the to-be-displayed interface of the target application based on the target inversion rule to obtain a target display interface.
  • the selection module is further configured to:
  • the target inversion rule is selected from the plurality of preset inversion rules.
  • the interface display device when the system main process of the terminal is started, the interface display device further includes:
  • a detection module configured to detect updated version information of the target application
  • the second acquisition module is configured to acquire the first configuration information corresponding to the updated version of the target application based on the updated version information.
  • the selection module is further configured to:
  • the second configuration information is used to characterize the mapping relationship between the type of content displayed in the display interface and the inversion rule;
  • the target inversion rule is selected from the plurality of preset inversion rules according to the second configuration information and the type of content displayed in the to-be-displayed interface of the target application.
  • the selection module is further configured to:
  • the target inversion rule is selected from the plurality of preset inversion rules
  • the color inversion module is further configured to:
  • a terminal including:
  • Memory used to store instructions executable by the processor
  • the processor is configured to perform the method described in the first aspect of the embodiment of the present disclosure.
  • a non-transitory computer-readable storage medium which when the instructions in the storage medium are executed by a processor of the terminal, enables the terminal to execute an interface display method, the The method includes the method described in the first aspect of the embodiments of the present disclosure.
  • the technical solution provided by the embodiments of the present disclosure can include the following beneficial effects: by individually adapting the target inversion rules for each target application, when executing dark mode, all target applications can be adapted, improving the user experience, and at the same time making each target application
  • the target applications are independent of each other. When a problem occurs in the anti-color processing and one of the target applications is repaired, it will not affect other applications, thus saving developers' research and development costs.
  • each target application can select the inversion rule that matches the application from the preset multiple inversion rules, the display effect obtained by each target application after the inversion process is better and the display effect is more beautiful. Diversified and personalized.
  • Figure 1 is a flow chart of an interface display method according to an exemplary embodiment.
  • Figure 2 is a flow chart of an interface display method according to an exemplary embodiment.
  • Figure 3 is a flow chart of an interface display method according to an exemplary embodiment.
  • Figure 4 is a flow chart of an interface display method according to an exemplary embodiment.
  • Figure 5 is a flow chart of an interface display method according to an exemplary embodiment.
  • Figure 6 is a flow chart of an interface display method according to an exemplary embodiment.
  • Figure 7 is a block diagram of an interface display device according to an exemplary embodiment.
  • Figure 8 is a block diagram of a terminal according to an exemplary embodiment.
  • an interface display method is provided, which is applied to an application installed on a terminal.
  • the terminal includes electronic devices with display interface adjustment functions such as smart phones, tablets, and computers.
  • Figure 1 is a flow chart of an interface display method according to an exemplary embodiment. As shown in Figure 1, the interface display method includes the following steps:
  • Step S101 Obtain multiple preset inversion rules.
  • the inversion rules are used to represent the mapping relationship between the display content in the display interface changing from the first display state to the second display state after inversion. Each inversion rule is different. same;
  • Step S102 Based on the target application, select at least one inversion rule that matches the target application from a plurality of preset inversion rules as the target inversion rule, where the target application is an application with dark mode turned on;
  • Step S103 Based on the target inversion rule, invert the interface to be displayed of the target application to obtain the target display interface.
  • step S101 multiple inversion rules are preset in the system of the terminal.
  • the inversion rules are used to represent the mapping relationship in which the display content in the display interface changes from the first display state to the second display state after inversion. For example, when the display content of the display interface is text, the color of the text in the first display state is black, and the color of the text in the second display state is white. Inverting the color of the text through the inversion rule can change the color of the text from black to white. to white, or from white to black. For another example, when the display content of the display interface is a color picture, the color of the color picture does not change in the first display state and the second display state, and only the brightness of the picture is dimmed.
  • the multiple preset inversion rules are all inversion rules with different effects. Only when the inversion rules are selected and used, the display content of the display interface will be inverted. For the same display interface, one or more inversion rules can be executed at the same time. For example, when the display content of the display interface includes text and pictures, the first inversion rule related to the text can be selected for the text, and the second inversion rule related to the picture can be selected for the picture, and when processing the display interface, The first inverse color rule and the second inverse color rule are executed at the same time, thereby executing different inverse color rules for text and pictures at the same time.
  • step S102 when the terminal turns on the dark mode, the display interface of the application program will be inverted through the inversion rules. Since not all applications in the terminal support dark mode, and some applications store their own resource packages suitable for dark mode, when dark mode is turned on on the terminal, dark mode is not supported or the appropriate resource package is stored. Applications equipped with dark mode resource packages do not need to adapt to dark mode through the system. In addition to turning on dark mode for the entire system, dark mode can also be turned on for applications. Whether an application needs to turn on dark mode is up to the user. Users can turn on dark mode for some applications based on their own usage habits and needs. Some applications maintain their original display mode.
  • applications that have dark mode turned on are target applications, that is, applications that require the system to adapt to dark mode.
  • Each application has a different degree of adaptation to dark mode, so the same inversion rule does not apply to all applications.
  • some inversion rules have a good inversion effect for application A, but for For Application B, the color inversion effect is very poor. Therefore, when performing inversion processing on a target application, it is necessary to select at least one inversion rule that is suitable for each target application from a plurality of preset inversion rules as its corresponding target inversion rule.
  • the dark mode refers to a display style of the display interface during the display process. It has no impact on the content displayed in the display interface. It only changes the displayed color, light and shade, etc., and is a kind of display style through adjustment.
  • the background and text color of the application make the display style of the entire interface approach the black display mode to the greatest extent.
  • the target inversion rule adapted to the target application may include one inversion rule or multiple inversion rules.
  • the same inversion rule may exist in targets corresponding to multiple target applications at the same time.
  • the target inversion rules between different target applications can be the same or different.
  • the target application includes Application A, Application B, Application C and Application D. Select the anti-color rule adapted to them from multiple preset anti-color rules as follows: Application A adapts anti-color rules.
  • Color rule 1 application B adapts to inverse color rule 1 and inverse color rule 2
  • application C adapts to inverse color rule 4 and inverse color rule 3
  • application D adapts to inverse color rule 4 and inverse color rule 3
  • the inversion rule 1 can be adapted to application A and application B at the same time, and at the same time, the inversion rules adapted to application C and application D can be the same.
  • the target inversion rule When inverting the color, when the view of the interface to be displayed in the target application starts to be drawn, determine the content in the view, and Use the target inversion rule to invert it to obtain the target display interface, that is, the display interface after executing the dark mode, and then display it on the display interface of the terminal for users to browse.
  • multiple preset color inversion rules in the terminal system are obtained, an application with dark mode turned on is determined as the target application, and the target application is selected from the multiple preset inversion rules.
  • an interface display method is provided, which is applied to an application installed on a terminal.
  • the terminal includes electronic devices with display interface adjustment functions such as smart phones, tablets, and computers.
  • Figure 2 is a flow chart of an interface display method according to an exemplary embodiment. As shown in Figure 2, the interface display method includes the following steps:
  • Step S201 Obtain multiple preset inversion rules.
  • the inversion rules are used to represent the mapping relationship between the display content in the display interface changing from the first display state to the second display state after inversion. Each inversion rule is different. same;
  • Step S202 Detect updated version information of the target application, where the target application is an application with dark mode turned on;
  • Step S203 Based on the updated version information, obtain the first configuration information corresponding to the updated version of the target application.
  • the first configuration information is used to represent the anti-color rule information applied to the application program;
  • Step S204 Based on the first configuration information, select a target inversion rule from a plurality of preset inversion rules;
  • Step S205 Based on the target inversion rule, invert the interface to be displayed of the target application to obtain the target display interface.
  • step S201 The contents of step S201 are the same as step S101, and the contents of step S205 are the same as step S103, which will not be described again here.
  • step S202 since the application program is constantly iteratively updated and the version of the application program is constantly updated, there will be certain differences in the layout of each control in the application display interface in different updated versions, and the corresponding adapted inverse color rules will also be changes, therefore, before obtaining the anti-color rules, it is necessary to detect the updated version information of the target application.
  • step S203 the terminal system will update the first configuration information according to the updated version of the target application. After determining the updated version information of the target application, it will first obtain the first configuration information corresponding to the updated version of the target application from the local cache. If If the first configuration information corresponding to the updated version of the target application does not exist in the local cache, a request is made to the system cloud service to obtain the first configuration information corresponding to the updated version of the target application.
  • the first configuration information is used to represent the anti-color rule information applied to the application program, that is, one or more anti-color rules corresponding to the target application.
  • the first configuration information is stored in the terminal system in the form of a formatted file.
  • Each target application corresponds to one anti-color rule information.
  • the first configuration information is a json configuration file, including the following content:
  • packageName indicates the package name of the terminal application, which is used to distinguish each application; forceDark indicates whether the application requires the terminal system to invert it, and true indicates that the application requires the terminal system to invert it. false means that the terminal system does not need to invert it; rules represents the inversion rule information corresponding to the application, and its value uses binary to represent the selected inversion rule. For example, 18 is converted into binary as 10010, which means that the application corresponds to the second inverse color rule and the fifth inverse color rule among the preset multiple inverse color rules. Using this representation method, a number can be used to represent the combination of inverse color rules, and the representation method is simple.
  • the terminal only maintains the target inversion rules corresponding to the latest version of the target application. That is to say, when inverting the display interface of the target application, even if the version of the target application is not the latest version, it is still used.
  • the target inversion rule corresponding to the latest version inverts it. For example, if the latest version of the target application is version 3.0, the corresponding target inversion rules are 1, 2, and 3.
  • the current version used by the user is version 2.0, and the corresponding target inversion rules are 2 and 3.
  • since only the target inversion rules corresponding to the latest version are stored in the terminal when inverting the target application of version 2.0, use target inversion rules 1, 2, and 3 to process it. .
  • the target inversion rules corresponding to each version of the target application are maintained in the terminal. That is to say, when inverting the display interface of the target application, which version the user is using will be used.
  • the target inverse color rule handles it. For example, if the latest version of the target application is version 3.0, and the target application is still promoting version 2.0, the system will store the target anti-color rules corresponding to version 3.0 and version 2.0 respectively, and the target anti-color rules corresponding to version 3.0 will be stored in the system.
  • the color rules are 1, 2, 3, and the target anti-color rules corresponding to version 2.0 are 2, 3.
  • the user is currently using version 2.0, use target inversion rules 2 and 3 to invert the display interface of the target application. If the user is currently using version 3.0, use target inversion rules 1, 2, and 3 to invert the display interface of the target application.
  • a target inversion rule is selected from a plurality of preset inversion rules. For example, when the inversion rule information of application A is 18 according to the first configuration information, it means that the application Corresponding to the 2nd inversion rule and the 5th inversion rule among the preset multiple inversion rules, the combination of the 2nd inversion rule and the 5th inversion rule is the target inversion rule of application A. .
  • the target inverse color rule by individually adapting the target inverse color rule to each target application, for target applications with dark mode enabled, all target applications can be adapted, improving user experience, and at the same time making each target Applications are independent of each other.
  • a target application has a problem with color inversion processing, only the target application needs to be repaired without affecting other applications, thus saving developers' research and development costs.
  • an interface display method is provided, which is applied to an application installed on a terminal.
  • the terminal includes electronic devices with a display interface adjustment function, such as smartphones, tablets, and computers.
  • Figure 3 is a flow chart of an interface display method according to an exemplary embodiment. As shown in Figure 3, the interface display method includes the following steps:
  • Step S301 Obtain multiple preset inversion rules.
  • the inversion rules are used to represent the mapping relationship between the display content in the display interface changing from the first display state to the second display state after inversion. Each inversion rule is different. same;
  • Step S302 Obtain second configuration information.
  • the second configuration information is used to characterize the mapping relationship between the type of content displayed in the display interface and the inversion rule;
  • Step S303 Select a target inversion rule from a plurality of preset inversion rules according to the second configuration information and the type of content displayed in the to-be-displayed interface of the target application, where the target application is an application with dark mode turned on ;
  • Step S304 Based on the target inversion rule, invert the interface to be displayed of the target application to obtain the target display interface.
  • step S301 are the same as step S101, and the contents of step S304 are the same as step S103, which will not be described again here.
  • the second configuration information is used to characterize the mapping relationship between the type of content displayed in the display interface and the inversion rule.
  • the inversion rule is one of multiple preset inversion rules. For example, the inversion rule displayed in the display interface
  • the corresponding inversion rule 1 is used to adjust the black foreground text to white foreground text
  • the corresponding inversion rule 2 is used to adjust the white background to a black background.
  • the second configuration information is stored in the terminal system in advance, and when the dark mode is turned on, the second configuration information is obtained from the system.
  • step S303 from the obtained mapping relationship between the type of content displayed on the display interface and the inversion rule, the inversion rule corresponding to the type of content displayed in the interface to be displayed in the target application is obtained, which is the target inversion rule.
  • Obtaining the target inversion rule according to the mapping relationship between the type of content displayed in the display interface and the inversion rule can enable the target inversion rule to adapt to the target application in real time.
  • the target application when the target application starts to be used, that is, when the process of the target application starts, within a preset time period, such as 10 milliseconds, 1 second, or 2 seconds, the The type of content to be displayed in the interface to be displayed, such as text, pictures, videos, etc., and then based on the mapping relationship between the type of content displayed on the display interface and the inversion rules, it is determined which inversion rules should be selected as The target inversion rules perform inversion processing on the target application, and these target rules are applied to the process of the target application to perform inversion processing on the target display interface to obtain the target display interface.
  • the above process can also be executed at intervals to continuously adjust the target anti-color rules adapted to the target application. .
  • an interface display method is provided, which is applied to an application installed on a terminal.
  • the terminal includes electronic devices with a display interface adjustment function, such as smartphones, tablets, and computers.
  • Figure 4 is a flow chart of an interface display method according to an exemplary embodiment. As shown in Figure 4, the interface display method includes the following steps:
  • Step S401 Obtain multiple preset inversion rules.
  • the inversion rules are used to represent the mapping relationship between the display content in the display interface changing from the first display state to the second display state after inversion. Each inversion rule is different. same;
  • Step S402 When the application process of the target application is started, select the target inversion rule from a plurality of preset inversion rules, where the target application is an application with dark mode turned on;
  • Step S403 Load the target inversion rule into the application process of the target application
  • Step S404 Based on the target inversion rule, invert the interface to be displayed of the target application to obtain the target display interface.
  • step S401 are the same as step S101, and the contents of step S404 are the same as step S103, which will not be described again here.
  • steps S402 and S403 when the terminal system turns on the dark mode, if the application process of the target application has not been started, there is no need to invert it.
  • the application process of the target application is started, the application process is started from the preset multiple Select the target inversion rule in the inversion rule and load the target inversion rule into the application process of the target application.
  • the target anti-color rules are selected and loaded into the application process of the target application, instead of performing anti-color processing on the target application as long as the terminal system turns on the dark mode. Can save terminal resource consumption.
  • an interface display method is provided, which is applied to an application installed on a terminal.
  • the terminal includes electronic devices with a display interface adjustment function, such as smartphones, tablets, and computers.
  • Figure 5 is a flow chart of an interface display method according to an exemplary embodiment. As shown in Figure 5, the interface display method includes the following steps:
  • Step S501 Obtain multiple preset inversion rules.
  • the inversion rules are used to represent the mapping relationship between the display content in the display interface changing from the first display state to the second display state after inversion. Each inversion rule is different. same;
  • Step S502 Based on the target application, select at least one inversion rule that matches the target application from a plurality of preset inversion rules as the target inversion rule, where the target application is an application with dark mode turned on;
  • Step S503 Based on the target inversion rule, when the display content of the interface to be displayed of the target application changes in each frame, invert the color of the interface to be displayed in the frame to obtain the target display interface corresponding to the frame.
  • steps S501 to S502 are the same as those of steps S101 to S102, and will not be described again here.
  • step S503 after the dark mode is turned on, when the interface to be displayed of the target application is inverted, when the control layout or display content in the interface to be displayed of the target application changes, the display interface view will be redrawn, which is called Refresh for frames.
  • the interface to be displayed in the frame needs to be inverted based on the target inversion rules to obtain the target display interface corresponding to each frame. Inverting the color on a frame-by-frame basis can ensure that the dark mode of the target application will not cause sudden changes in the display interface due to the incompatibility of a certain frame.
  • an interface display method is provided, which is applied to an application installed on a terminal.
  • the terminal includes electronic devices with a display interface adjustment function, such as smartphones, tablets, and computers.
  • Figure 6 is a flow chart of an interface display method according to an exemplary embodiment. As shown in Figure 6, the interface display method includes the following steps:
  • Step S601 Obtain multiple preset inversion rules.
  • the inversion rules are used to represent the mapping relationship between the display content in the display interface changing from the first display state to the second display state after inversion. Each inversion rule is different. same;
  • Step S602 When the application process of the target application is started, select the target inversion rule from a plurality of preset inversion rules;
  • step S603-step S605 There are two ways to select the target inversion rule, namely step S603-step S605 and step S606-step S607.
  • step S603-step S605 There are two ways to select the target inversion rule, namely step S603-step S605 and step S606-step S607.
  • which target inversion rule selection method to choose can be selected based on the processing performance of different models, different processors, and different application scenarios.
  • Step S603 Detect updated version information of the target application, where the target application is an application with dark mode turned on;
  • Step S604 Based on the updated version information, obtain the first configuration information corresponding to the updated version of the target application.
  • the first configuration information is used to represent the anti-color rule information applied to the application program;
  • Step S605 Based on the first configuration information, select a target inversion rule from a plurality of preset inversion rules;
  • Step S606 Obtain second configuration information.
  • the second configuration information is used to characterize the mapping relationship between the type of content displayed in the display interface and the inversion rule;
  • Step S607 Select a target inversion rule from a plurality of preset inversion rules according to the second configuration information and the type of content displayed in the to-be-displayed interface of the target application, where the target application is an application with dark mode turned on. ;
  • Step S608 Load the target inversion rule into the application process of the target application
  • Step S609 Based on the target inversion rule, when the display content of the interface to be displayed of the target application changes in each frame, invert the color of the interface to be displayed in the frame to obtain the target display interface corresponding to the frame.
  • each target application when executing dark mode, all target applications can be adapted to improve the user experience, and at the same time, each target application can interact with each other. Independent, when there is a problem with inverse color processing and one of the target applications is repaired, it will not affect other applications, thus saving developers R&D costs.
  • an interface display device which is applied to an application program installed on a terminal.
  • Figure 7 is a block diagram of an interface display device according to an exemplary embodiment. As shown in Figure 7, the interface display device includes:
  • the first acquisition module 701 is configured to acquire a plurality of preset inversion rules.
  • the inversion rules are used to represent the mapping relationship in which the display content in the display interface changes from the first display state to the second display state after inversion. , each of the inverse color rules is different;
  • the selection module 702 is configured to, based on the target application, select at least one inversion rule that is adapted to the target application from the preset plurality of inversion rules as the target inversion rule, wherein the target application For apps with dark mode turned on;
  • the color inversion module 703 is configured to perform color inversion processing on the interface to be displayed of the target application to obtain a target display interface based on the target inversion rule.
  • the selection module 702 is further configured to:
  • the target inversion rule is selected from the plurality of preset inversion rules.
  • the interface display device when the system main process of the terminal is started, the interface display device further includes:
  • the detection module 704 is configured to detect updated version information of the target application
  • the second acquisition module 705 is configured to acquire the first configuration information corresponding to the updated version of the target application based on the updated version information.
  • the selection module 702 is further configured to:
  • the second configuration information is used to characterize the mapping relationship between the type of content displayed in the display interface and the inversion rule;
  • the target inversion rule is selected from the plurality of preset inversion rules according to the second configuration information and the type of content displayed in the to-be-displayed interface of the target application.
  • the selection module 702 is further configured to:
  • the target inversion rule is selected from the plurality of preset inversion rules
  • the color inversion module 703 is further configured to:
  • FIG. 8 is a block diagram of a terminal 800 according to an exemplary embodiment.
  • the terminal 800 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, or the like.
  • the terminal 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and communications component 816.
  • Processing component 802 generally controls the overall operations of terminal 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method.
  • processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components.
  • processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
  • Memory 804 is configured to store various types of data to support operations at device 800 . Examples of such data include instructions for any application or method operating on the terminal 800, contact data, phonebook data, messages, pictures, videos, etc.
  • Memory 804 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EEPROM erasable programmable read-only memory
  • EPROM Programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory, magnetic or optical disk.
  • Power supply component 806 provides power to various components of terminal 800.
  • Power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal 800.
  • Multimedia component 808 includes a screen that provides an output interface between the terminal 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the 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 the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action.
  • multimedia component 808 includes a front-facing camera and/or a rear-facing camera.
  • the front camera and/or the rear camera may receive external multimedia data.
  • Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
  • Audio component 810 is configured to output and/or input audio signals.
  • audio component 810 includes a microphone (MIC) configured to receive external audio signals when terminal 800 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or sent via communication component 816 .
  • audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
  • Sensor component 814 includes one or more sensors that provide various aspects of status assessment for terminal 800 .
  • the sensor component 814 can detect the open/closed state of the device 800, the relative positioning of components, such as the display and keypad of the terminal 800, and the sensor component 814 can also detect the position change of the terminal 800 or a component of the terminal 800. , the presence or absence of user contact with the terminal 800 , the orientation or acceleration/deceleration of the terminal 800 and the temperature change of the terminal 800 .
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the terminal 800 and other devices.
  • the terminal 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communications component 816 also includes a near field communications (NFC) module to facilitate short-range communications.
  • NFC near field communications
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the terminal 800 may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable Gate array
  • controller microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • a non-transitory computer-readable storage medium including instructions such as a memory 804 including instructions, which can be executed by the processor 820 of the terminal 800 to complete the above method is also provided.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
  • a non-transitory computer-readable storage medium that, when instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to perform an interface display method, the method including any of the above interface display methods. .
  • the application display is more diverse and personalized, improving the user experience; at the same time, due to the target anti-color rules of each target application They are independent of each other.
  • the target applications have a problem with color inversion processing, only the target application needs to be repaired separately without affecting other applications, thus saving developers' R&D costs.

Landscapes

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

Abstract

本公开是关于一种界面显示方法、装置、终端及存储介质,涉及显示技术领域。界面显示方法,应用于安装于终端的应用程序,包括:获取预设的多个反色规则,反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个反色规则各不相同;基于目标应用,从预设的多个反色规则中选择与目标应用相适配的至少一个反色规则作为目标反色规则,其中,目标应用为开启了深色模式的应用程序;基于目标反色规则,对目标应用的待显示界面进行反色处理获得目标显示界面。

Description

一种界面显示方法、装置、终端及存储介质 技术领域
本公开涉及显示技术领域,尤其涉及一种界面显示方法、装置、终端及存储介质。
背景技术
相关技术中,手机中的深色模式功能,作用为调整应用的背景和文字颜色,使得整个界面的显示风格最大限度趋近于黑色,又名暗黑模式或者深色主题。
手机中应用程序的深色模式通常分为两种。第一种是由应用程序自身进行适配,应用程序需要准备两套颜色和资源,系统在绘制该应用程序的显示界面时选择对应的深色资源,从而达到一个较好的深色效果。第二种是由系统主动为应用程序显示界面的内容反色,通常是将文字反亮,并将背景反黑,使得界面大部分区域显示黑色,但系统对于全部的应用程序均使用同一种反色规则,无法适配各种应用程序,有的应用程序使用了反色规则后,带给用户不好的视觉体验。
发明内容
为克服相关技术中存在的问题,本公开提供一种界面显示方法、装置、终端及存储介质。
根据本公开实施例的第一方面,提供一种界面显示方法,应用于安装于终端的应用程序,所述界面显示方法包括:
获取预设的多个反色规则,所述反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个所述反色规则各不相同;
基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,其中,所述目标应用为开启了深色模式的应用程序;
基于所述目标反色规则,对所述目标应用的待显示界面进行反色处理获得目标显示界面。
在一示例性实施例中,所述基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,包括:
获取所述目标应用的第一配置信息,所述第一配置信息用于表征应用在应用程序上的反色规则信息;
基于所述第一配置信息,从预设的所述多个反色规则中选择所述目标反色规则。
在一示例性实施例中,当所述终端的系统主进程启动时,所述界面显示方法还包括:
检测所述目标应用的更新版本信息;
基于所述更新版本信息,获取与更新版本后的所述目标应用对应的所述第一配置信息。
在一示例性实施例中,所述基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,包括:
获取第二配置信息,所述第二配置信息用于表征显示界面中显示内容的类型与反色规则之间的映射关系;
根据所述第二配置信息和所述目标应用的待显示界面中显示内容的类型,从预设的所述多个反色规则中选择所述目标反色规则。
在一示例性实施例中,所述基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,包括:
所述目标应用的应用进程启动时,从预设的所述多个反色规则中选择所述目标反色规则;
加载所述目标反色规则至所述目标应用的应用进程中。
在一示例性实施例中,所述基于所述目标反色规则,对所述目标应用的待显示界面进行反色处理获得目标显示界面,包括:
若每一帧所述待显示界面的显示内容发生变化时,对该帧所述待显示界面进行反色处理获得该帧对应的所述目标显示界面。
根据本公开实施例的第二方面,提供一种界面显示装置,应用于安装于终端的应用程序,所述界面显示装置包括:
第一获取模块,被配置为获取预设的多个反色规则,所述反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个所述反色规则各不相同;
选择模块,被配置为基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,其中,所述目标应用为开启了深色模式的应用程序;
反色模块,被配置为基于所述目标反色规则,对所述目标应用的待显示界面进行反色处理获得目标显示界面。
在一示例性实施例中,所述选择模块还被配置为:
获取所述目标应用的第一配置信息,所述第一配置信息用于表征应用在应用程序上的反色规则信息;
基于所述第一配置信息,从预设的所述多个反色规则中选择所述目标反色规则。
在一示例性实施例中,当所述终端的系统主进程启动时,所述界面显示装置还包括:
检测模块,被配置为检测所述目标应用的更新版本信息;
第二获取模块,被配置为基于所述更新版本信息,获取与更新版本后的所述目标应用对应的所述第一配置信息。
在一示例性实施例中,所述选择模块还被配置为:
获取第二配置信息,所述第二配置信息用于表征显示界面中显示内容的类型与反色规则之间的映射关系;
根据所述第二配置信息和所述目标应用的待显示界面中显示内容的类型,从预设的所述多个反色规则中选择所述目标反色规则。
在一示例性实施例中,所述选择模块还被配置为:
所述目标应用的应用进程启动时,从预设的所述多个反色规则中选择所述目标反色规则;
加载所述目标反色规则至所述目标应用的应用进程中。
在一示例性实施例中,所述反色模块还被配置为:
若每一帧所述待显示界面的显示内容发生变化时,对该帧所述待显示界面进行反色处理获得该帧对应的所述目标显示界面。
根据本公开实施例的第三方面,提供一种终端,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为执行如本公开实施例的第一方面所述的方法。
根据本公开实施例的第四方面,提供一种非临时性计算机可读存储介质,当所述存储介质中的指令由终端的处理器执行时,使得终端能够执行一种界面显示方法,所述方法包括本公开实施例的第一方面所述的方法。
本公开的实施例提供的技术方案可以包括以下有益效果:通过对每个目标应用单独适配目标反色规则,执行深色模式时,能够适配所有目标应用,提升用户体验,同时使得每个目标应用之间相互独立,在反色处理出现问题并对其中一个目标应用进行修复时,不会影响其他应用程序,从而节省了开发人员的研发成本。同时,由于每个目标应用可以从预设的多个反色规则中选择与该应用相适配的反色规则,使得每个目标应用经过反色处理后获得的显示效果更佳,显示效果更加多样化、个性化。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。
图1是根据一示例性实施例示出的一种界面显示方法的流程图。
图2是根据一示例性实施例示出的一种界面显示方法的流程图。
图3是根据一示例性实施例示出的一种界面显示方法的流程图。
图4是根据一示例性实施例示出的一种界面显示方法的流程图。
图5是根据一示例性实施例示出的一种界面显示方法的流程图。
图6是根据一示例性实施例示出的一种界面显示方法的流程图。
图7是根据一示例性实施例示出的一种界面显示装置框图。
图8是根据一示例性实施例示出的一种终端的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。
现有终端中的应用程序,大部分需要终端的系统进行反色来适配深色模式,相关技术中,终端系统中的”SmartDark”功能,可以为没有自身适配深色模式的应用程序提供反色功能,但是反色效果对于不同应用程序差别较大。
在使用相关技术中的反色算法在应用程序显示界面内容绘制时,首先确定显示内容是前景内容还是背景内容,如果是前景内容就提亮,如果是背景内容就降暗。并且,在应用过程中不会区分应用程序,对终端内所有的应用程序均采用一套固定的反色规则。但是各种应用程序开发的标准不同,即使是效果相同的界面,不同的应用程序之间的实现方式也可能不同,对于所有的应用程序均采用相同的反色规则,造成不同应用程序的反色效果差异较大,经常出现有部分控件反色错误的情况,影响用户的视觉体验。
另外,当对一个应用程序的反色问题进行修复时,可能会发现这个修复使得其他的应用程序出现反色错误,因此,对反色问题的修复需要花费人力监控其他所有应用程序的反色情况,以保证反色算法适配所有的应用程序。
本公开示例性的实施例中,提供了一种界面显示方法,应用于安装于终端的应用程序,终端包括智能手机、平板、电脑等具有显示界面调节功能的电子设备。图1是根据一示例性实施例示出的一种界面显示方法的流程图,如图1所示,界面显示方法包括以下步骤:
步骤S101:获取预设的多个反色规则,反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个反色规则各不相同;
步骤S102:基于目标应用,从预设的多个反色规则中选择与目标应用相适配的至少一个反色规则作为目标反色规则,其中,目标应用为开启了深色模式的应用程序;
步骤S103:基于目标反色规则,对目标应用的待显示界面进行反色处理获得目标显示界面。
在步骤S101中,在终端的系统中预先设置多个反色规则,反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系。例如,显示界面的显示内容为文字时,第一显示状态下文字的颜色为黑色,第二显示状态下文字的颜色为白色,通过反色规则对文字进行反色可以将文字的颜色从黑色变为白色,或者从白色变为黑色。再例如,显示界面的显示内容为彩色图片时,第一显示状态下和第二显示状态下彩色图片的颜色均不发生变化,仅将图片的亮度做调暗处理。
其中,预设的多个反色规则均为不同效果的反色规则,反色规则只有被选择使用时,才会对显示界面的显示内容执行反色处理。对于同一个显示界面,可以同时执行一个或者多个反色规则。例如,显示界面的显示内容包括文字和图片时,可以针对文字选择与文字相关的第一反色规则,同时针对图片选择与图片相关的第二反色规则,并在对显示界面进行处理时,同时执行第一反色规则和第二反色规则,从而对文字和图片同时执行不同的反色规则。
在步骤S102中,终端开启深色模式时,会通过反色规则对应用程序的显示界面进行反色处理。由于不是终端中的所有应用程序都支持深色模式,并且有些应用程序会自身存储有适配深色模式的资源包,因此,在终端开启深色模式时,不支持深色模式或者存储有适配深色模式资源包的应用程序,都不需要通过系统适配深色模式。除了系统整体开启深色模式之外,还可以针对应用程序开启深色模式,应用程序是否需要开启深色模式由用户决定,用户针对自身使用习惯和需求,可以将部分应用程序开启深色模式,部分应用程序保持原本的显示模式。
除此之外,开启了深色模式的应用程序为目标应用,即需要系统对其进行深色模式适配的应用程序。每个应用程序对于深色模式的适配程度不同,因此同一种反色规则并不适用于 所有的应用程序,例如有些反色规则对于应用程序A来说具有很好的反色效果,但是对于应用程序B来说反色效果很差。因此,对目标应用进行反色处理时,需要从预设的多个反色规则中选择与每一个目标应用相适配的至少一个反色规则作为其对应的目标反色规则。
另外,在本实施例中,深色模式指的是显示界面在显示过程中的一种显示风格,对显示界面中显示的内容没有影响,只改变显示的颜色、明暗等,是一种通过调整应用的背景和文字颜色,使得整个界面的显示风格最大限度趋近于黑色的显示模式。
在步骤S103中,与目标应用相适配的目标反色规则可以包括一个反色规则,也可以包括多个反色规则,对于同一个反色规则,可以同时存在于多个目标应用对应的目标反色规则中,不同目标应用之间的目标反色规则可以相同,也可以不同。例如,目标应用中包括应用程序A、应用程序B、应用程序C和应用程序D,从预设的多个反色规则中选择出分别与其适配的反色规则为:应用程序A适配反色规则1,应用程序B适配反色规则1和反色规则2,应用程序C适配反色规则4和反色规则3,应用程序D适配反色规则4和反色规则3,其中,反色规则1可以同时被适配到应用程序A和应用程序B,同时,应用程序C和应用程序D适配的反色规则可以是相同的。
使用与目标应用对应的目标反色规则分别对目标应用的待显示界面进行反色处理,进行反色处理时,在目标应用的待显示界面的视图开始绘制的时候,确定视图中的内容,并使用目标反色规则对其进行反色,获得目标显示界面,即执行了深色模式之后的显示界面,进而显示在终端的显示界面上供用户浏览。
在本公开示例性的实施例中,获取终端系统中预设的多个反色规则,将开启了深色模式的应用程序确定为目标应用,从预设的多个反色规则中选择与目标应用相适配的至少一个反色规则作为目标反色规则,基于目标反色规则,对目标应用的待显示界面进行反色处理获得目标显示界面。通过对每个目标应用单独适配目标反色规则,执行深色模式时,能够适配所有目标应用,提升用户体验,同时使得每个目标应用之间相互独立,在反色处理出现问题并对其中一个目标应用进行修复时,不会影响其他应用程序,从而节省了开发人员的研发成本。同时,由于每个目标应用可以从预设的多个反色规则中选择与该应用相适配的反色规则,使得每个目标应用经过反色处理后获得的显示效果更佳,显示效果更加多样化、个性化。
本公开示例性的实施例中,提供了一种界面显示方法,应用于安装于终端的应用程序,终端包括智能手机、平板、电脑等具有显示界面调节功能的电子设备。图2是根据一示例性实施例示出的一种界面显示方法的流程图,如图2所示,界面显示方法包括以下步骤:
步骤S201:获取预设的多个反色规则,反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个反色规则各不相同;
步骤S202:检测目标应用的更新版本信息,其中,目标应用为开启了深色模式的应用程序;
步骤S203:基于更新版本信息,获取与更新版本后的目标应用对应的第一配置信息,第一配置信息用于表征应用在应用程序上的反色规则信息;
步骤S204:基于第一配置信息,从预设的多个反色规则中选择目标反色规则;
步骤S205:基于目标反色规则,对目标应用的待显示界面进行反色处理获得目标显示界面。
步骤S201与步骤S101的内容相同,步骤S205与步骤S103的内容相同,在此不再赘述。
在步骤S202中,由于应用程序在不断迭代更新,应用程序的版本不断更新,不同更新版本中应用显示界面中每个控件的布局会存在一定的区别,其对应的适配的反色规则也会发生变化,因此,在获取反色规则之前,需要检测目标应用的更新版本信息。
在步骤S203中,终端系统会根据目标应用的更新版本更新第一配置信息,确定目标应用的更新版本信息后,优先从本地缓存中获取与更新版本后的目标应用对应的第一配置信息,如果本地缓存中不存在与更新版本后的目标应用对应的第一配置信息,则向系统云服务请求获取与更新版本后的目标应用对应的第一配置信息。
第一配置信息用于表征应用在应用程序上的反色规则信息,即目标应用对应的一个或者多个反色规则。第一配置信息以格式化的文件形式存储在终端系统中,每个目标应用对应一个反色规则信息,当目标应用启动时,获取其对应的反色规则信息。
在一示例中,第一配置信息为json配置文件,包括以下内容:
Figure PCTCN2022093375-appb-000001
其中,packageName表示终端应用程序的包名,用于区分每个应用程序;forceDark表示该应用程序是否需要终端系统对其进行反色处理,true表示该应用程序需要终端系统对其进行反色处理,false表示不需要终端系统对其进行反色处理;rules表示该应用程序对应的反 色规则信息,其取值采用二进制来表示所选择的反色规则。例如18转换为二进制为10010,则表示该应用程序对应预设的多个反色规则中的第2个反色规则和第5个反色规则。使用该表示方法,能够用一个数来表示反色规则的组合,表示方式简单。
在一个示例中,终端中只维护目标应用的最新版本对应的目标反色规则,也就是说,在对目标应用的显示界面进行反色处理时,即使目标应用的版本不是最新版本,也依然使用最新版本对应的目标反色规则对其进行反色处理。比如,目标应用的最新版本是3.0版本,对应的目标反色规则是1、2、3。而用户使用的当前版本是2.0版本,对应的目标反色规则是2、3。那么在该示例中,由于终端中只存储了最新版本对应的目标反色规则,因此,在对2.0版本的目标应用进行反色处理时,使用目标反色规则1、2、3对其进行处理。
在另一个示例中,终端中维护目标应用的各个版本对应的目标反色规则,也就是说,在对目标应用的显示界面进行反色处理时,用户使用的是哪个版本,就使用该版本对应的目标反色规则对其进行处理。比如,目标应用的最新版本是3.0版本,该目标应用目前还在推广使用的还有2.0版本,则系统中会分别存储3.0版本和2.0版本分别对应的目标反色规则,3.0版本对应的目标反色规则是1、2、3,2.0版本对应的目标反色规则是2、3。系统上,如果用户当前使用的是2.0版本,则使用目标反色规则2、3对该目标应用的显示界面进行反色处理。如果用户当前使用的是3.0版本,则使用目标反色规则1、2、3对该目标应用的显示界面进行反色处理。
在步骤S204中,基于第一配置信息,从预设的多个反色规则中选择目标反色规则,例如根据第一配置信息获知应用程序A的反色规则信息为18时,表示该应用程序对应预设的多个反色规则中的第2个反色规则和第5个反色规则,第2个反色规则和第5个反色规则的组合即为应用程序A的目标反色规则。
在本公开示例性的实施例中,通过对每个目标应用单独适配目标反色规则,对于启用了深色模式的目标应用,能够适配所有目标应用,提升用户体验,同时使得每个目标应用之间相互独立,在某个目标应用在反色处理出现问题时,只需要对该目标应用进行修复,不会影响其他应用程序,从而节省了开发人员的研发成本。
本公开示例性的实施例中,提供一种界面显示方法,应用于安装于终端的应用程序,终端包括智能手机、平板、电脑等具有显示界面调节功能的电子设备。图3是根据一示例性实施例示出的一种界面显示方法的流程图,如图3所示,界面显示方法包括以下步骤:
步骤S301:获取预设的多个反色规则,反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个反色规则各不相同;
步骤S302:获取第二配置信息,第二配置信息用于表征显示界面中显示内容的类型与反色规则之间的映射关系;
步骤S303:根据第二配置信息和目标应用的待显示界面中显示内容的类型,从预设的多个反色规则中选择目标反色规则,其中,目标应用为开启了深色模式的应用程序;
步骤S304:基于目标反色规则,对目标应用的待显示界面进行反色处理获得目标显示界面。
步骤S301与步骤S101的内容相同,步骤S304与步骤S103的内容相同,在此不再赘述。
在步骤S302中,第二配置信息用于表征显示界面中显示内容的类型与反色规则之间的映射关系,反色规则为预设的多个反色规则中的一个,例如显示界面中显示内容的类型为前景文字时,对应反色规则1,将黑色前景文字调整为白色前景文字;显示界面中显示内容的类型为背景时,对应反色规则2,将白色背景调整为黑色背景。第二配置信息预先存储在终端系统中,开启深色模式时,从系统中获取第二配置信息。
在步骤S303中,从所获取显示界面显示内容的类型与反色规则之间的映射关系中,获取目标应用的待显示界面中显示内容的类型对应的反色规则,即为目标反色规则。根据显示界面中显示内容的类型与反色规则之间的映射关系,获取目标反色规则,能够使得目标反色规则实时适配目标应用。
在一个示例中,对于开启了深色模式的目标应用,当目标应用开始使用时,即该目标应用的进程启动时,在预设时长内,比如10毫秒、1秒钟、2秒钟,获取其要显示的待显示界面中将要显示的内容的类型,比如文字、图片、视频等,进而根据显示界面显示内容的类型与反色规则之间的映射关系,确定出要选择哪些反色规则作为目标反色规则对该目标应用进行反色处理,将这些目标规则应用到目标应用的进程中,以对待显示界面进行反色处理,获得目标显示界面。当然,可以理解的是,除了在目标应用进程启动时可以执行上述过程,在目标应用持续使用过程中,还可以每间隔一段时间执行一次上述过程,以不断调整目标应用适配的目标反色规则。
本公开示例性的实施例中,提供一种界面显示方法,应用于安装于终端的应用程序,终端包括智能手机、平板、电脑等具有显示界面调节功能的电子设备。图4是根据一示例性实施例示出的一种界面显示方法的流程图,如图4所示,界面显示方法包括以下步骤:
步骤S401:获取预设的多个反色规则,反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个反色规则各不相同;
步骤S402:目标应用的应用进程启动时,从预设的多个反色规则中选择目标反色规则, 其中,目标应用为开启了深色模式的应用程序;
步骤S403:加载目标反色规则至目标应用的应用进程中;
步骤S404:基于目标反色规则,对目标应用的待显示界面进行反色处理获得目标显示界面。
步骤S401与步骤S101的内容相同,步骤S404与步骤S103的内容相同,在此不再赘述。
在步骤S402和步骤S403中,终端系统开启深色模式时,如果目标应用的应用进程没有启动,则不需要对其进行反色处理,当目标应用的应用进程启动时,从预设的多个反色规则中选择目标反色规则,并加载目标反色规则至目标应用的应用进程中。在目标应用的应用进程启动时,才开始选择目标反色规则,并加载目标反色规则至目标应用的应用进程中,而不是只要终端系统开启深色模式,便对目标应用执行反色处理,能够节省终端的资源消耗。
本公开示例性的实施例中,提供一种界面显示方法,应用于安装于终端的应用程序,终端包括智能手机、平板、电脑等具有显示界面调节功能的电子设备。图5是根据一示例性实施例示出的一种界面显示方法的流程图,如图5所示,界面显示方法包括以下步骤:
步骤S501:获取预设的多个反色规则,反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个反色规则各不相同;
步骤S502:基于目标应用,从预设的多个反色规则中选择与目标应用相适配的至少一个反色规则作为目标反色规则,其中,目标应用为开启了深色模式的应用程序;
步骤S503:基于目标反色规则,每一帧目标应用的待显示界面的显示内容发生变化时,对该帧待显示界面进行反色处理获得该帧对应的目标显示界面。
步骤S501-步骤S502和与步骤S101-步骤S102的内容相同,在此不再赘述。
在步骤S503中,深色模式开启之后,在对目标应用的待显示界面进行反色处理时,目标应用的待显示界面中的控件布局或者显示内容发生变化时,都会重新绘制显示界面视图,称为帧刷新。目标应用的每一帧进行刷新时,都需要基于目标反色规则,对该帧待显示界面进行反色处理,分别获得每一帧对应的目标显示界面。以帧为单位进行反色处理,能够保证目标应用的深色模式不会出现因为某一帧不适配而导致的显示界面突变的情况。
本公开示例性的实施例中,提供一种界面显示方法,应用于安装于终端的应用程序,终端包括智能手机、平板、电脑等具有显示界面调节功能的电子设备。图6是根据一示例性实施例示出的一种界面显示方法的流程图,如图6所示,界面显示方法包括以下步骤:
步骤S601:获取预设的多个反色规则,反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个反色规则各不相同;
步骤S602:目标应用的应用进程启动时,从预设的多个反色规则中选择目标反色规则;
目标反色规则的选择方式有两种,分别为步骤S603-步骤S605和步骤S606-步骤S607。在实施过程中,选择哪一种目标反色规则选择方式,可以根据不同机型、不同处理器的处理性能、不同的应用场景进行选择。
步骤S603:检测目标应用的更新版本信息,其中,目标应用为开启了深色模式的应用程序;
步骤S604:基于更新版本信息,获取与更新版本后的目标应用对应的第一配置信息,第一配置信息用于表征应用在应用程序上的反色规则信息;
步骤S605:基于第一配置信息,从预设的多个反色规则中选择目标反色规则;
步骤S606:获取第二配置信息,第二配置信息用于表征显示界面中显示内容的类型与反色规则之间的映射关系;
步骤S607:根据第二配置信息和目标应用的待显示界面中显示内容的类型,从预设的多个反色规则中选择目标反色规则,其中,目标应用为开启了深色模式的应用程序;
步骤S608:加载目标反色规则至目标应用的应用进程中;
步骤S609:基于目标反色规则,每一帧目标应用的待显示界面的显示内容发生变化时,对该帧待显示界面进行反色处理获得该帧对应的目标显示界面。
在本公开示例性的实施例中,通过对每个目标应用单独适配目标反色规则,执行深色模式时,能够适配所有目标应用,提升用户体验,同时使得每个目标应用之间相互独立,在反色处理出现问题并对其中一个目标应用进行修复时,不会影响其他应用程序,从而节省了开发人员的研发成本。
本公开示例性的实施例中,提供一种界面显示装置,应用于安装于终端的应用程序。图7是根据一示例性实施例示出的一种界面显示装置框图,如图7所示,界面显示装置包括:
第一获取模块701,被配置为获取预设的多个反色规则,所述反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个所述反色规则各不相同;
选择模块702,被配置为基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,其中,所述目标应用为开启了深色模式的应用程序;
反色模块703,被配置为基于所述目标反色规则,对所述目标应用的待显示界面进行反色处理获得目标显示界面。
在一示例性实施例中,所述选择模块702还被配置为:
获取所述目标应用的第一配置信息,所述第一配置信息用于表征应用在应用程序上的反色规则信息;
基于所述第一配置信息,从预设的所述多个反色规则中选择所述目标反色规则。
在一示例性实施例中,当所述终端的系统主进程启动时,所述界面显示装置还包括:
检测模块704,被配置为检测所述目标应用的更新版本信息;
第二获取模块705,被配置为基于所述更新版本信息,获取与更新版本后的所述目标应用对应的所述第一配置信息。
在一示例性实施例中,所述选择模块702还被配置为:
获取第二配置信息,所述第二配置信息用于表征显示界面中显示内容的类型与反色规则之间的映射关系;
根据所述第二配置信息和所述目标应用的待显示界面中显示内容的类型,从预设的所述多个反色规则中选择所述目标反色规则。
在一示例性实施例中,所述选择模块702还被配置为:
所述目标应用的应用进程启动时,从预设的所述多个反色规则中选择所述目标反色规则;
加载所述目标反色规则至所述目标应用的应用进程中。
在一示例性实施例中,所述反色模块703还被配置为:
若每一帧所述待显示界面的显示内容发生变化时,对该帧所述待显示界面进行反色处理获得该帧对应的所述目标显示界面。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
图8是根据一示例性实施例示出的一种终端800的框图。例如,终端800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。
参照图8,终端800可以包括以下一个或多个组件:处理组件802,存储器804,电力组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。
处理组件802通常控制终端800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于 处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。
存储器804被配置为存储各种类型的数据以支持在设备800的操作。这些数据的示例包括用于在终端800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件806为终端800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为终端800生成、管理和分配电力相关联的组件。
多媒体组件808包括在所述终端800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当终端800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件814包括一个或多个传感器,用于为终端800提供各个方面的状态评估。例如,传感器组件814可以检测到设备800的打开/关闭状态,组件的相对定位,例如所述组件为终端800的显示器和小键盘,传感器组件814还可以检测终端800或终端800一个组件的位置改变,用户与终端800接触的存在或不存在,终端800方位或加速/减速和终端800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附 近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于终端800和其他设备之间有线或无线方式的通信。终端800可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,终端800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器804,上述指令可由终端800的处理器820执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
一种非临时性计算机可读存储介质,当所述存储介质中的指令由移动终端的处理器执行时,使得移动终端能够执行一种界面显示方法,所述方法包括上述的任一界面显示方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其它实施方案。本申请旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。
应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限制。
工业实用性
本文中通过对启用了深色模式的每个目标应用单独适配目标反色规则,使得应用程序显示更具多样化和个性化,提升用户体验;同时,由于每个目标应用的目标反色规则之间相互独立,当其中一个目标应用在反色处理出现问题时,只需对该目标应用单独进行修复,不会影响其他应用程序,从而节省了开发人员的研发成本。

Claims (14)

  1. 一种界面显示方法,其特征在于,应用于安装于终端的应用程序,所述界面显示方法包括:
    获取预设的多个反色规则,所述反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个所述反色规则各不相同;
    基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,其中,所述目标应用为开启了深色模式的应用程序;
    基于所述目标反色规则,对所述目标应用的待显示界面进行反色处理获得目标显示界面。
  2. 根据权利要求1所述的界面显示方法,其特征在于,所述基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,包括:
    获取所述目标应用的第一配置信息,所述第一配置信息用于表征应用在应用程序上的反色规则信息;
    基于所述第一配置信息,从预设的所述多个反色规则中选择所述目标反色规则。
  3. 根据权利要求2所述的界面显示方法,其特征在于,当所述终端的系统主进程启动时,所述界面显示方法还包括:
    检测所述目标应用的更新版本信息;
    基于所述更新版本信息,获取与更新版本后的所述目标应用对应的所述第一配置信息。
  4. 根据权利要求1所述的界面显示方法,其特征在于,所述基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,包括:
    获取第二配置信息,所述第二配置信息用于表征显示界面中显示内容的类型与反色规则之间的映射关系;
    根据所述第二配置信息和所述目标应用的待显示界面中显示内容的类型,从预设的所述多个反色规则中选择所述目标反色规则。
  5. 根据权利要求1所述的界面显示方法,其特征在于,所述基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,包括:
    所述目标应用的应用进程启动时,从预设的所述多个反色规则中选择所述目标反色规则;
    加载所述目标反色规则至所述目标应用的应用进程中。
  6. 根据权利要求1所述的界面显示方法,其特征在于,所述基于所述目标反色规则,对所述目标应用的待显示界面进行反色处理获得目标显示界面,包括:
    若每一帧所述待显示界面的显示内容发生变化时,对该帧所述待显示界面进行反色处理获得该帧对应的所述目标显示界面。
  7. 一种界面显示装置,其特征在于,应用于安装于终端的应用程序,所述界面显示装置包括:
    第一获取模块,被配置为获取预设的多个反色规则,所述反色规则用于表征显示界面中显示内容由第一显示状态经过反色后变为第二显示状态的映射关系,每个所述反色规则各不相同;
    选择模块,被配置为基于目标应用,从预设的所述多个反色规则中选择与所述目标应用相适配的至少一个反色规则作为目标反色规则,其中,所述目标应用为开启了深色模式的应用程序;
    反色模块,被配置为基于所述目标反色规则,对所述目标应用的待显示界面进行反色处理获得目标显示界面。
  8. 根据权利要求7所述的界面显示装置,其特征在于,所述选择模块还被配置为:
    获取所述目标应用的第一配置信息,所述第一配置信息用于表征应用在应用程序上的反色规则信息;
    基于所述第一配置信息,从预设的所述多个反色规则中选择所述目标反色规则。
  9. 根据权利要求8所述的界面显示装置,其特征在于,当所述终端的系统主进程启动时,所述界面显示装置还包括:
    检测模块,被配置为检测所述目标应用的更新版本信息;
    第二获取模块,被配置为基于所述更新版本信息,获取与更新版本后的所述目标应用对应的所述第一配置信息。
  10. 根据权利要求7所述的界面显示装置,其特征在于,所述选择模块还被配置为:
    获取第二配置信息,所述第二配置信息用于表征显示界面中显示内容的类型与反色规则之间的映射关系;
    根据所述第二配置信息和所述目标应用的待显示界面中显示内容的类型,从预设的所述多个反色规则中选择所述目标反色规则。
  11. 根据权利要求7所述的界面显示装置,其特征在于,所述选择模块还被配置为:
    所述目标应用的应用进程启动时,从预设的所述多个反色规则中选择所述目标反色规则;
    加载所述目标反色规则至所述目标应用的应用进程中。
  12. 根据权利要求7所述的界面显示装置,其特征在于,所述反色模块还被配置为:
    若每一帧所述待显示界面的显示内容发生变化时,对该帧所述待显示界面进行反色处理获得该帧对应的所述目标显示界面。
  13. 一种终端,其特征在于,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为执行如权利要求1-6中任一项所述的方法:
  14. 一种非临时性计算机可读存储介质,当所述存储介质中的指令由终端的处理器执行时,使得终端能够执行一种界面显示方法,所述方法包括权利要求1-6任一项所述的方法。
PCT/CN2022/093375 2022-05-17 2022-05-17 一种界面显示方法、装置、终端及存储介质 WO2023220929A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202280004411.0A CN116806333A (zh) 2022-05-17 2022-05-17 一种界面显示方法、装置、终端及存储介质
PCT/CN2022/093375 WO2023220929A1 (zh) 2022-05-17 2022-05-17 一种界面显示方法、装置、终端及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/093375 WO2023220929A1 (zh) 2022-05-17 2022-05-17 一种界面显示方法、装置、终端及存储介质

Publications (1)

Publication Number Publication Date
WO2023220929A1 true WO2023220929A1 (zh) 2023-11-23

Family

ID=88079802

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/093375 WO2023220929A1 (zh) 2022-05-17 2022-05-17 一种界面显示方法、装置、终端及存储介质

Country Status (2)

Country Link
CN (1) CN116806333A (zh)
WO (1) WO2023220929A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110908765A (zh) * 2019-11-29 2020-03-24 五八有限公司 一种界面显示方法、装置、终端设备及存储介质
CN111552451A (zh) * 2020-04-09 2020-08-18 RealMe重庆移动通信有限公司 显示控制方法及装置、计算机可读介质及终端设备
CN111857912A (zh) * 2020-07-03 2020-10-30 Oppo广东移动通信有限公司 界面处理方法、装置、电子设备和计算机可读存储介质
CN114119778A (zh) * 2020-08-27 2022-03-01 华为技术有限公司 用户界面的深色模式生成方法、电子设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110908765A (zh) * 2019-11-29 2020-03-24 五八有限公司 一种界面显示方法、装置、终端设备及存储介质
CN111552451A (zh) * 2020-04-09 2020-08-18 RealMe重庆移动通信有限公司 显示控制方法及装置、计算机可读介质及终端设备
CN111857912A (zh) * 2020-07-03 2020-10-30 Oppo广东移动通信有限公司 界面处理方法、装置、电子设备和计算机可读存储介质
CN114119778A (zh) * 2020-08-27 2022-03-01 华为技术有限公司 用户界面的深色模式生成方法、电子设备及存储介质

Also Published As

Publication number Publication date
CN116806333A (zh) 2023-09-26

Similar Documents

Publication Publication Date Title
US10832619B2 (en) Method for controlling screen display and device using the same
US9928811B2 (en) Methods, devices, and computer-readable storage medium for image display
US9886259B2 (en) Method and terminal device for complying router management application with router firmware
WO2017113666A1 (zh) 应用界面切换方法及装置
US20170300211A1 (en) Method and apparatus for displaying status information of application
EP3012725A1 (en) Method, device and electronic device for displaying descriptive icon information
US20220342706A1 (en) Method for data processing and apparatus, and electronic device
WO2018000710A1 (zh) WiFi信号图标的展示方法、装置和移动终端
CN111261081B (zh) 屏幕显示方法及装置
US20160286023A1 (en) Method and device for loading user interface theme
US20190012299A1 (en) Displaying page
CN105677352B (zh) 应用图标颜色的设置方法和装置
CN112331158B (zh) 终端显示调节方法、装置、设备及存储介质
CN114067733B (zh) 显示屏校正方法、显示屏校正装置以及显示芯片
CN108877700B (zh) 一种显示图像的方法和装置
US20170220401A1 (en) Method, device, and computer-readable storage medium for calling a process
CN108877697B (zh) 一种显示图像的方法和装置
WO2023220929A1 (zh) 一种界面显示方法、装置、终端及存储介质
WO2023115777A1 (zh) 光标控制方法、装置、电子设备和存储介质
CN113946398A (zh) 终端的显示控制方法、装置及存储介质
CN114442789A (zh) 暗屏控制方法、装置、设备及存储介质
CN108874332B (zh) 一种显示界面的方法和装置
CN114968143A (zh) 显示处理方法及装置、电子设备、存储介质
WO2023245311A1 (zh) 一种窗口调整方法、装置、终端及存储介质
US20220291890A1 (en) Method for interaction between devices and medium

Legal Events

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

Ref document number: 22941971

Country of ref document: EP

Kind code of ref document: A1