The present disclosure claims the priority to the CN patent application No. 202111385787.4 entitled “INFORMATION DISPLAY METHOD, DEVICE, AND STORAGE MEDIUM” filed on Nov. 22, 2021, the disclosure of which is incorporated herein by reference in its entity.
The present disclosure generally relates to the field of computer technologies, and more specifically, to an information display method, device, and storage medium.
The improvement in the performance of the terminal device hardware and the continuous development of artificial intelligence technology are accompanied with more applications (shortened as APPs) running on terminal devices.
Nowadays, according to the relevant technologies, after a user operates a certain application on the terminal device, in response to the current user operation, the application will display a message prompt block on the terminal device for the user to view, and such message prompt block automatically disappears after a while, without distracting attention. This type of message prompt block is called bubble message.
Due to the discrepancy of bubble messages in display position and text length, developers have to develop the bubble messages in terms of display position and display manner separately and adaptively, which affects the overall efficiency in developing applications.
Embodiments of the present disclosure provide an information display method and device, electronic device, storage medium, computer program product, and a computer program, to solve the problem that the developers need to separately and adaptively develop the display position and the display manner of the bubble message, affecting the overall development efficiency.
In a first aspect, embodiments of the present disclosure provide an information display method, comprising:
In a second aspect, the embodiments of the present disclosure provide an information display device, comprising:
In a third aspect, the embodiments of the present disclosure provide an electronic device, comprising: a processor and a memory;
In a fourth aspect, the embodiments of the present disclosure provide a computer-readable storage medium having computer execution instructions stored therein, where the computer execution instructions are executed by a processor, to cause the processor to implement the information display method of the first aspect and various possible designs of the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program, where the information display method of the first aspect and various possible designs of the first aspect when executed by a processor the computer program are implemented when the computer program is executed by a processor.
In a sixth aspect, embodiments of the present disclosure provide a computer program, where the information display method of the first aspect and various possible designs of the first aspect when executed by a processor the computer program are implemented when the computer program is executed by a processor.
The embodiments provide an information display method and device, electronic device, storage medium, computer program product, and a computer program. By identifying the anchor object and determining, based on a position of the anchor object relative to the terminal screen, a display position and a text display manner of a bubble message, the solution according to the embodiments can enable automatic computing of the display position and the text display manner of the bubble message, saving the developers' efforts in separate and adaptive development and thus improving the development efficiency.
In order to make clear the technical solution according to embodiments of the present disclosure or the prior art technology, brief introduction will be provided below on the drawings necessary for the embodiments or the prior art technology. Obviously, the drawings described below only illustrate some embodiments of the present disclosure, based on which the ordinary skilled in the art could apparently obtain others, without doing creative work.
In order to make the objective, technical solution, and advantages of the present disclosure more apparent, with reference to the drawings, a clear, complete description will be provided below about the technical solution provided by the embodiments of the present disclosure. Obviously, the embodiments described here are only a part of embodiments of the present disclosure, rather than all of them. Based on the embodiments described here, the ordinary skilled in the art could acquire all of the other embodiments falling into the scope of protection of the present disclosure, without doing creative work.
With the development of terminal technology, various terminal devices have been widely used in daily life. Nowadays, a lot of terminal devices employ the Android system. The Android system provides a message prompt function with bubble messages, i.e., after a user operates a certain application on the terminal device, in response to the current user operation, the application will display a message prompt block on the terminal device for the user to view, and such message prompt block will automatically disappear after a while, without distracting attention. Since the bubble messages are not fixed in relative position and text length, developers typically have to develop separately and adaptively the bubble messages in terms of display position and display manner, which affects the development efficiency.
In order to solve the above-mentioned technical problem, the present disclosure provides the following technical conception of: automatically determining a display position and a text display manner of a bubble message based on a position of an anchor object relative to the terminal screen, saving the developers' efforts in separate, adaptive development and thus improving the development efficiency.
It is worth noting that the terminal device according to the present disclosure may be a wireless or wired terminal. The wireless terminal may be a device that provides voice and/or other service data connectivity to a user, a handheld device with wireless connectivity, or other processing device connected to a wireless modem. The wireless terminal can communicate with one or more core network devices via a Radio Access Network (RAN), which may be a mobile terminal such as a mobile phone (or also referred to as “cellular” phone) or a computer having a mobile terminal, for example, a portable, pocket-sized, handheld, computer in-built or on-vehicle mobile device that can exchange language and/or data with the RAN. For another example, the wireless terminal may be a device such as a Personal Communication Service (PCS) phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), and the like. The wireless terminal may also be called system, Subscriber Unit, Subscriber Station, Mobile Station, Mobile, Remote Station, Remote Terminal, Access Terminal, User Terminal, User Agent, User Device or User Equipment, which is not limited here. Alternatively, the terminal device may be a device such as a smart watch, a tablet, and the like.
S201: identifying an anchor object.
In the embodiments of the present disclosure, the anchor object is a type of hyperlink in an application, through which a link to a specified object, for example, a new file or any other message element, can be attained.
A user can link to other new webpage by clicking on the anchor object, or may open a new message by clicking on the anchor object.
For example, a user clicks on an icon (which is the anchor object) in instant messaging software to open the applet page or game page corresponding to the icon.
S202: based on position information of the anchor object on the terminal screen, determining a display position and a display manner of a bubble message corresponding to the anchor object.
In the embodiments of the present disclosure, a computing model for computing the display position and the display manner of the bubble message can be determined based on a distance of the anchor object on the terminal screen relative to a terminal screen edge, and the display position and the display manner of the bubble message can be determined based on the computing model.
S203: in response to an operation on the anchor object, displaying the bubble message at the displaying position on the terminal screen in the display manner.
In the embodiments of the present disclosure, a user triggers the anchor object by a click on mouse, a touch control or a visual control, and a request is sent to the server based on the trigger of the anchor object so that the server sends a bubble message to the terminal device and displays the bubble message at a corresponding display position on the terminal screen in a corresponding display manner.
From the above description, it can be learned that, by identifying the anchor object and determining, based on a position of the anchor object relative to the terminal screen, a display position and a text display manner of a bubble message, the solution according to the embodiments can enable automatic computing of the display position and the text display manner of the bubble message, saving the developers' efforts in separate and adaptive development and thus improving the development efficiency.
S301: determining an offset amount of the anchor object from a left edge of the terminal screen.
S302: based on the offset amount, determining a computing model for computing the display position and the display manner of the bubble message.
S303: based on the computing model, computing the display position and a text display manner of the bubble message.
In a possible implementation of the present disclosure, in step S302, if the offset amount is less than a first preset threshold, it is determined that the computing model for computing the display position and the display manner of the bubble message is a first computing model, where the first computing model performs the following computing:
Based on a distance from the left edge of the anchor object to the left edge of the terminal screen, a minimum offset amount of a message prompt block of a preset bubble message from the left or right side of the terminal screen, a distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object is computed, specifically with the following equation:
where xoffset is the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object; anchorx is the distance from the left edge of the anchor object to the left edge of the terminal screen; and leftorrightoffset is the minimum offset amount of the message prompt block of the preset bubble message from the left or right side of the terminal screen.
Based on the distance from the left edge of the message prompt block to the left edge of the anchor object, a width of the anchor object, and a width of an arrow of the message prompt block of the bubble message, a distance from the arrow of the message prompt block of the bubble message to the left edge of the message prompt block of the bubble message is computed, specifically with the following equation:
where leftMargin is the distance from the arrow of the message prompt block of the bubble message to the left edge of the message prompt block of the bubble message; anchorviewwidth is the width of the anchor object; arrowviewwidth is the width of the arrow of the message prompt block of the bubble message.
As shown in
Correspondingly, in step S303, computing, based on the computing model, the display position and the text display manner of the bubble message includes: based on the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object computed by the first computing model, determining the display position of the bubble message; and based on the distance from the arrow of the message prompt block of the bubble message to the left edge of the bubble prompt block of the bubble message computed by the first computing model, determining the text display manner of the bubble message.
The distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object is determined as a starting position of a left edge of the display position of the bubble message.
Based on the distance from the arrow of the message prompt block of the bubble message to the left edge of the bubble prompt block of the bubble message, the arrow of the message prompt block is displayed, to serve as the text display manner of the bubble message.
As can be seen from the above description, in the case where the anchor object is located in the left region of the terminal screen, the display position and the display manner of the bubble message are automatically computed by the first computing model. The display position and the display manner obtained are more reasonable and provide better user experience in use.
In a further possible implementation of the present disclosure, in step S302, if the offset amount is greater than a second preset threshold, it is determined that the computing model for determining the display position and the display manner of the bubble message is a second computing model, where the second computing model performs the following computing:
Based on a text width of the bubble message, the width of the terminal screen, the distance from the left edge of the anchor object to the left edge of the terminal screen, and the minimum offset amount from the message prompt block of the preset bubble message to the left or right side of the terminal screen, a distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object is computed, specifically with the following equation:
where xoffset is the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object; textwidth is the text width of the bubble message; screenwidth is the width of the terminal screen; anchorx is the distance from the left edge of the anchor object to the left edge of the screen terminal; leftorrightoffset is the minimum offset amount from the message prompt block of the preset bubble message to the left or right side of the terminal screen.
Based on the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object, the width of the anchor object, and the width of the arrow of the message prompt block of the bubble message, the distance from the arrow of the message prompt block of the bubble message to the left edge of the message prompt block of the bubble message is computed, specifically with the following equation:
where leftMargin is the distance from the arrow of the message prompt block of the bubble message to the left edge of the message prompt block of the bubble message; anchorviewwidth is the width of the anchor object; arrowviewwidth is the width of the arrow of the message prompt block of the bubble message. The second preset threshold is greater than the first preset threshold.
As shown in
Correspondingly, in step S303, computing, based on the computing model, the display position and the text display manner of the bubble message includes:
based on the distance from the left side of the message prompt block of the bubble message to the left edge of the anchor object computed by the second computing model, determining the display position of the bubble message; and based on the distance from the arrow of the message prompt block of the bubble message to the left edge of the message prompt block of the bubble message computed by the second computing model, determining the text display manner of the bubble message.
From the above description, it can be learned that, in the case where the anchor object is located in the right region of the terminal screen, the display position and the display manner of the bubble message are automatically computed by the second computing model. The display position and the display manner obtained are more reasonable and provide better user experience in use.
In a still further possible implementation of the present disclosure, in step S302, if the offset amount is greater than or equal to the first preset threshold, and is less than or equal to the second preset threshold, it is determined that the computing model for computing the display position and the display manner of the bubble message is a third computing model, where the second computing model performs the following computing:
Based on the text width of the bubble message and the width of the anchor object, a distance from the left edge of the message prompt block of the bubble message to the left side of the anchor object is computed, specifically with the following equation:
where xoffset is the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object; textwidth is the text width of the bubble message; anchorviewwidth is the width of the anchor object.
It is computed that the arrow of the message prompt block of the bubble message is located in a center of the text of the bubble message.
As shown in
Correspondingly, in step S303, computing, based on the computing mode, the display manner and the text display manner of the bubble message includes:
Based on the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object obtained by the third computing model, determining the display position of the bubble message; and based on that the arrow of the message prompt block of the bubble message is located in the center of the text of the bubble message, determining the text display manner of the bubble message.
From the above description, it can be learned that, in the case where the anchor object is located in the middle region of the terminal screen, the display position and the display manner of the bubble message automatically computed by the third computing model. The display position and the display manner obtained are more reasonable and provide better user experience in use.
Corresponding to the information display method of the embodiments as described above,
The identifying module 701 is configured to identify an anchor object.
The processing module 702 is configured to determine, based on position information of the anchor object on a terminal screen, a display position and a display manner of a bubble message corresponding to the anchor object.
The displaying module 703 is configured to display the bubble message at the display position on the terminal screen in the display manner in response to an operation on the anchor object.
From the above description, it can be learned that, by identifying the anchor object and determining, based on a position of the anchor object relative to the terminal screen, a display position and a text display manner of a bubble message, the solution according to the embodiments can enable automatic computing of the display position and the text display manner of the bubble message, saving the developers' efforts in separate and adaptive development and thus improving the development efficiency.
The determining unit 7021 is configured to determine an offset amount of the anchor object from a left edge of the terminal screen.
The model processing unit 7022 is configured to determine, based on the offset amount, a computing model for computing the display position and the display manner of the bubble message.
The display processing unit 7023 is configured to compute, based on the computing model, the display manner and a text display manner of the bubble message.
In one or more embodiments of the present disclosure, the model processing unit 7022 is specifically configured to determine that the computing model for computing the display position and the display manner of the bubble message is a first computing model, if the offset amount is less than a first preset threshold.
In one or more embodiments of the present disclosure, the first computing model is configured to perform:
Based on a distance from the left edge of the anchor object to the left edge of the terminal screen, a minimum offset amount of a preset message prompt block of the bubble message from the left or right side of the terminal screen, a distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object is computed, specifically with the following equation:
where xoffset is the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object; anchorx is the distance from the left edge of the anchor object to the left edge of the terminal screen; and leftorrightoffset is the minimum offset amount of the message prompt block of the preset bubble message from the left or right side of the terminal screen.
Based on the distance from the left edge of the message prompt block to the left edge of the anchor object, a width of the anchor object, and a width of an arrow of the message prompt block of the bubble message, a distance from the arrow of the message prompt block of the bubble message to the left edge of the message prompt block of the bubble message is computed, specifically with the following equation:
where leftMargin is the distance from the arrow of the message prompt block of the bubble message to the left edge of the message prompt block of the bubble message; anchorviewwidth is the width of the anchor object; arrowviewwidth is the width of the arrow of the message prompt block of the bubble message.
In one or more embodiments of the present disclosure, the display processing unit 7023 is specifically configured to: based on the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object obtained by the first computing model, determine the display position of the bubble message; and based on the distance from the arrow of the message prompt block of the bubble message to the left edge of the message prompt block of the bubble message obtained by the first computing model, determine the text display manner of the bubble message.
In one or more embodiments of the present disclosure, the model processing unit 7022 is specifically configured to determine that the computing model for computing the display position and the display manner of the bubble message is a second computing model, if the offset amount is greater than a second preset threshold.
In one or more embodiments of the present disclosure, the second computing model is configured to perform:
Based on the text width of the bubble message, the width of the terminal screen, the distance from the left edge of the anchor object to the left edge of the terminal screen, and the minimum offset amount from the message prompt block of the preset bubble message to the left or right side of the terminal screen, a distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object is computed, specifically with the following equation:
where xoffset is the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object; textwidth is the text width of the bubble message; screenwidth is the width of the terminal screen; anchorx is the distance from the left edge of the anchor object to the left edge of the screen terminal; leftorrightoffset is the minimum offset amount from the message prompt block of the preset bubble message to the left or right side of the terminal screen.
Based on the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object, the width of the anchor object, and the width of the arrow of the message prompt block of the bubble message, the distance from the arrow of the message prompt block of the bubble message to the left edge of the message prompt block of the bubble message is computed, specifically with the following equation:
where leftMargin is the distance from the arrow of the message prompt block of the bubble message to the left edge of the message prompt block of the bubble message; anchorviewwidth is the width of the anchor object; arrowviewwidth is the width of the arrow of the message prompt block of the bubble message.
In one or more embodiments of the present disclosure, the model processing unit 7022 is specifically configured to determine that the computing model for computing the display position and the display manner of the bubble message is a third computing model, if the offset amount is greater than or equal to the first preset threshold, and less than or equal to the second preset threshold.
In one or more embodiments of the present disclosure, the third computing module is configured to perform:
Based on the text width of the bubble message and the width of the anchor object, a distance from the left edge of the message prompt block of the bubble message to the left side of the anchor object is computed, specifically with the following equation:
where xoffset is the distance from the left edge of the message prompt block of the bubble message to the left edge of the anchor object; textwidth is the text width of the bubble message; anchorviewwidth is the width of the anchor object.
It is computed that the arrow of the message prompt block of the bubble message is located in a center of the text of the bubble message.
The device provided by those embodiments can be used to implement the technical solution of the method embodiments as described above. The principle and the technical effect thereof are similar, details of which are omitted here for brevity.
In order to implement the aforementioned embodiments, the embodiments of the present disclosure further provide an electronic device.
As shown therein, the electronic device 900 may include processing unit 901 (e.g. a central processor, a graphics processor and the like), which can execute various acts and processing based on programs stored in a Read Only Memory (ROM) 902 or a program loaded from storage unit 908 to a Random Access Memory (RAM) 903. RAM 903 stores therein various programs and data required for operations of the electronic device 900. The processing unit 901, the ROM 902 and the RAM 903 are connected to one another via a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
Typically, the following units may be connected to the I/O interface 905: input unit 906 including, for example, a touchscreen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope and the like; output unit 904 including, for example, a Liquid Crystal Display (LCD), a loudspeaker, a vibrator and the like; storage unit 908 including, for example, a tape, a hard drive and the like; and communication unit 909. The communication unit 909 can allow wireless or wired communication of the electronic device 900 with other devices to exchange data. Although
In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the methods illustrated by the flowcharts. In those embodiments, the computer program may be downloaded and installed from a network via the communication unit 909, or may be installed from the storage unit 908, or may be installed from the ROM 902. The computer program, when executed by the processing unit 901, performs the above-described functions defined in the methods according to the embodiments of the present disclosure.
It should be noted that the computer readable medium according to the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such propagated data signal may take many forms, including, but not limited to, an electro-magnetic signal, an optical signal, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer-readable medium may be the one included in the electronic device, or may be provided separately, rather than assembled in the electronic device.
The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods according to the embodiments as described above.
Computer program code for carrying out operations according to the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C++, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the drawings illustrate the functionality and operation of possible implementations of methods, device and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Wherein, the designation of a module or unit does not in some cases constitute a limitation of the unit itself. For example, the first obtaining unit may also be described as “a unit for obtaining at least two Internet Protocol addresses.”
The functions described above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a computer-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Above described are only relatively optimal embodiments of the present disclosure and the technical principles applied therein. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Number | Date | Country | Kind |
---|---|---|---|
202111385787.4 | Nov 2021 | CN | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2022/123903 | 10/8/2022 | WO |