Method for displaying two-dimensional code and related electronic equipment
By using the second screen as the back screen in an electronic device with an outer folding and folding screen, the QR code is quickly displayed, and the problem of many operation steps and poor user experience in displaying the QR code in the prior art is solved, and more efficient is achieved The QR code display and user experience are improved.
Patent Information
- Application Number
- CN202311052022.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-02-21
AI Technical Summary
When existing electronic devices need to display QR codes, they need to interrupt the current task, open the corresponding application and display the QR code, resulting in many operation steps and affecting the user experience.
In an electronic device with an outer folding screen, the second screen is used as the back screen to quickly display the QR code without interrupting the first screen task. The specific steps include displaying the user interface on the first screen, receiving the user's operations and displaying the QR code on the second screen, and closing the second screen after the QR code is scanned.
Reduced the operation steps for displaying QR codes, improve user experience, and protect user information security when the display is in an expanded state or locked state.
Smart Images

Figure CN119493500A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a method for displaying a two-dimensional code and related electronic equipment. Background Art
[0002] When using an electronic device, if you encounter a scenario where you need to present a QR code such as a payment code or a boarding code, you need to interrupt the current task. Then open the corresponding application, and then open the QR code in the application. For example, the electronic device is displaying the content of an e-book in the display interface. If you need to present a QR code such as a payment code or a boarding code at this time, the electronic device will pause the display of the content of the e-book. Then, in response to the user's startup operation, the corresponding application (such as WeChat or Alipay) is started, and then the corresponding QR code is further displayed on the display interface in response to the user's related operations. This way of displaying QR codes, on the one hand, has many operating steps; on the other hand, it interrupts the current task, affecting the user experience. Summary of the invention
[0003] The present application provides a method for displaying a QR code and related electronic devices, which are applied to electronic devices with an outward-folding screen and can improve user experience.
[0004] In a first aspect, the present application provides a method for displaying a two-dimensional code, the method being applied to an electronic device, the electronic device comprising a display screen, the display screen comprising a first screen and a second screen, when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen;
[0005] The display screen is in a folded state, and a first user interface is displayed on the first screen, wherein the first user interface includes an interface of a first application;
[0006] receiving a first operation of a user at a first time point, and displaying a first QR code of a second application on the second screen in response to the first operation; and displaying the first user interface on the first screen during the process of displaying the first QR code on the second screen;
[0007] After the first QR code is scanned, closing the second screen;
[0008] The display screen is in an expanded state, and a second user interface of the first application is displayed on the display screen, wherein the second user interface is an interface of the first user interface adapted to the expanded state;
[0009] At a second time point, a first operation of the user is received, and the first QR code of the second application is not displayed on the second screen.
[0010] Optionally, the first operation includes tapping twice on the back of the first screen. For example, if the display screen is in a folded state, the back of the first screen refers to the front of the second screen. If the display screen is in an unfolded state, the back of the first screen refers to the back cover of the electronic device.
[0011] In the above scheme, when the display screen of the electronic device is in a folded state, in order not to affect the execution of tasks on the main screen (i.e., the above-mentioned first screen), if the user needs to present a certain QR code (such as a boarding code, a payment code, or a collection code, etc.), then the electronic device can display the QR code on the back screen (i.e., the above-mentioned second screen) in response to the user's operation (such as the above-mentioned first operation). That is, this scheme can quickly pull up the QR code to be used on the back screen for display without interrupting the task currently being performed on the first screen of the electronic device, thereby reducing the operation steps for displaying the corresponding QR code and improving the user experience. In addition, if the display screen is in an unfolded state, in order not to affect the user's current use of the display screen, the aforementioned QR code will not be displayed on the second screen even if the above-mentioned first operation is received.
[0012] In a possible implementation, the display screen is in a folded state, and the first screen is in a locked state or a screen-off state;
[0013] At a third time point, a first operation of the user is received, and based on the fact that the first screen is in a locked state or an off-screen state, the first QR code of the second application is not displayed.
[0014] In the above solution, when the display screen is in the folded state and the first screen is in the locked screen state or the off screen state, the QR code will not be displayed on the second screen even if the first operation is received. On the one hand, it can prevent accidental touches, and on the other hand, it can protect the user's information security and avoid leaking the user's information without the user's awareness.
[0015] In a possible implementation, before the first screen displays the first user interface, the method further includes:
[0016] The electronic device is in an unfolded state, and the electronic device displays the second user interface, and the second user interface does not include the first floating window;
[0017] The first screen displays the first user interface, including:
[0018] After the electronic device changes from the unfolded state to the folded state, the electronic device displays the first user interface on the first screen, the first user interface includes the first floating window, and the first floating window includes the first interface element of the first QR code.
[0019] For example, in one implementation, the electronic device displays the first user interface on the first screen in response to the operation of changing the unfolded state to the folded state. At this time, the first user interface includes a floating ball (for example, see Figure 4A Then, the electronic device displays the first floating window in response to the operation on the floating ball. Alternatively, in another possible implementation, the electronic device displays the first user interface on the first screen in response to the operation from the expanded state to the folded state, and the first user interface includes the first floating window. Optionally, if no user operation on the first floating window is received within a preset time (for example, 3 seconds or 5 seconds, etc.) after the first floating window is displayed, then the first floating window becomes hidden by the floating ball.
[0020] Optionally, the method further includes: when the display screen is in a folded state, the first user interface receiving a second operation of the user on the first interface element; and displaying the first QR code on the second screen in response to the second operation.
[0021] Optionally, the first interface element includes at least one of an icon or a name of the second application and a type of the first QR code.
[0022] In the above solution, when the display screen is in the folded state, the first screen can also display the above first floating window, providing the user with another operable interface for pulling up the corresponding QR code display on the second screen. This enriches the operation of pulling up the QR code on the second screen, takes into account the needs of different users, and improves the user experience.
[0023] In a possible implementation, the aforementioned method further includes:
[0024] In response to an operation on a pull-down control of the first floating window, the first floating window is expanded and a second interface element of a second QR code of a third application is displayed;
[0025] A third operation of the user on the second interface element is received, and the second QR code is displayed on the second screen in response to the third operation.
[0026] In the above scheme, the above first floating window can also be expanded to display more QR code options, from which the user can select the QR code to be displayed on the back screen, which is convenient to operate.
[0027] In a possible implementation, after the first QR code is scanned, the method further includes:
[0028] A second floating window is displayed on the first screen, and the second floating window includes indication information that the first QR code has been scanned.
[0029] In the above solution, after the QR code displayed on the back screen is scanned, a window prompting the completion of the scan can also be displayed on the main screen to inform the user in time, thereby improving the user experience.
[0030] In a possible implementation, the receiving of the first operation of the user, before displaying the first QR code of the second application on the second screen in response to the first operation, further includes:
[0031] Acquire first status information of the display screen;
[0032] When the first state information indicates that the display screen is in a folded state, is not locked, and is on, an input event of the first operation is monitored.
[0033] In the above scheme, the electronic device monitors the input event of the above first operation only when the display screen meets the states of folding, unlocking and bright screen, so as to capture the corresponding event in time and respond quickly.
[0034] In a possible implementation, the receiving of the first operation by the user, before the display screen displays the first QR code, further includes:
[0035] Acquire second state information of the display screen;
[0036] When the second state information indicates that the display screen is in a target state, the monitoring of the input event of the first operation is canceled; the target state includes the display screen being in an expanded state, a locked state or an off state.
[0037] In the above scheme, when the display screen is in the expanded state, the locked screen state or the off-screen state, the electronic device cancels the monitoring of the first operation. Specifically, if the monitoring of the first operation is canceled, the QR code will not be pulled up on the second screen. This can not affect the task being performed on the display screen when the display screen is in the expanded state. When the display screen is in the locked screen state or the off-screen state, user information can be protected and user information leakage can be avoided.
[0038] In a possible implementation, the displaying the first QR code of the second application on the second screen in response to the first operation includes:
[0039] In response to the aforementioned first operation, the target window and the third user interface are displayed on the aforementioned second screen; the aforementioned third user interface is the user interface of the aforementioned second application that includes the aforementioned first QR code, the aforementioned target window includes a first area and a second area, the aforementioned first area is a transparent area, the aforementioned second area is a black area, the aforementioned target window covers the aforementioned third user interface, and the aforementioned first QR code corresponds to the aforementioned first area. That is, the first QR code is displayed through the first area.
[0040] In the above solution, the target window plays a role of a mask, so that the content other than the QR code in the third user interface can be covered to reduce unnecessary interference.
[0041] In a possible implementation, closing the second screen includes:
[0042] Setting the aforementioned first area to black;
[0043] removing the task window displayed on the second screen, wherein the task window includes the third user interface;
[0044] Close the aforementioned target window.
[0045] In the above scheme, in order to quickly show the user that the second screen has been closed and not to display additional content to disturb the user, the transparent first area can be set to black, so that the entire target window covering the upper layer is black, and the back screen is full black. Then, the back screen task window is removed and the target window is closed, so that the back screen is closed.
[0046] In a second aspect, the present application provides a method for displaying a QR code, the method being applied to an electronic device, the electronic device comprising a display screen, the display screen comprising a first screen and a second screen, when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen;
[0047] The display screen is in a folded state, and a user interface and a first floating window of a first application are displayed on the first screen, wherein the first floating window includes a first interface element of a first QR code of a second application;
[0048] Receiving a selection operation of the first interface element by a user at a first time point, and displaying the first QR code on the second screen in response to the selection operation; displaying a user interface of the first application on the first screen during the process of displaying the first QR code on the second screen; and closing the second screen after the first QR code is scanned;
[0049] When the aforementioned display screen is in a target state, the aforementioned display screen does not display the aforementioned first floating window, and the aforementioned target state includes the aforementioned display screen being in an expanded state, a locked state, or an off-screen state.
[0050] In the above scheme, when the display screen of the electronic device is in a folded state, in order not to affect the task execution of the main screen (i.e., the above-mentioned first screen), if the user needs to present a certain QR code (such as a boarding code, a payment code, or a collection code, etc.), then the electronic device can display the QR code on the back screen (i.e., the above-mentioned second screen) in response to the user's operation (such as the above-mentioned selection operation). That is, this scheme can quickly pull up the QR code to be used on the back screen for display without interrupting the task currently being performed on the first screen of the electronic device, thereby reducing the operation steps for displaying the corresponding QR code and improving the user experience. In addition, if the display screen is in an unfolded state, in order not to affect the user's current use of the display screen, the aforementioned QR code will not be displayed on the second screen even if the above-mentioned first operation is received. If the display screen is in a locked screen state or a screen-off state, in order to protect the user's information security, the aforementioned QR code will not be displayed on the second screen even if the above-mentioned first operation is received.
[0051] In a third aspect, the present application provides an electronic device, the electronic device comprising a display screen, the display screen comprising a first screen and a second screen, when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen;
[0052] The electronic device also includes a processing unit, configured to perform the following operations:
[0053] The display screen is in a folded state, and a first user interface is displayed on the first screen, wherein the first user interface includes an interface of a first application;
[0054] receiving a first operation of a user at a first time point, and displaying a first QR code of a second application on the second screen in response to the first operation; and displaying the first user interface on the first screen during the process of displaying the first QR code on the second screen;
[0055] After the first QR code is scanned, closing the second screen;
[0056] The display screen is in an expanded state, and a second user interface of the first application is displayed on the display screen, wherein the second user interface is an interface of the first user interface adapted to the expanded state;
[0057] At a second time point, a first operation of the user is received, and the first QR code of the second application is not displayed on the second screen.
[0058] Optionally, the first operation includes tapping twice on the back of the first screen. For example, if the display screen is in a folded state, the back of the first screen refers to the front of the second screen. If the display screen is in an unfolded state, the back of the first screen refers to the back cover of the electronic device.
[0059] In a possible implementation, the display screen is in a folded state, the first screen is in a locked state or a screen-off state; and the processing unit is further configured to perform the following operations:
[0060] At a third time point, a first operation of the user is received, and based on the fact that the first screen is in a locked state or an off-screen state, the first QR code of the second application is not displayed.
[0061] In a possible implementation, before the first screen displays the first user interface, the processing unit is further configured to perform the following operations:
[0062] The electronic device is in an unfolded state, and the electronic device displays the second user interface, and the second user interface does not include the first floating window;
[0063] The aforementioned processing unit is specifically used to perform the following operations:
[0064] After the electronic device changes from the unfolded state to the folded state, the electronic device displays the first user interface on the first screen, the first user interface includes the first floating window, and the first floating window includes the first interface element of the first QR code.
[0065] For example, in one implementation, the electronic device displays the first user interface on the first screen in response to the operation of changing the unfolded state to the folded state. At this time, the first user interface includes a floating ball (for example, see Figure 4A Then, the electronic device displays the first floating window in response to the operation on the floating ball. Alternatively, in another possible implementation, the electronic device displays the first user interface on the first screen in response to the operation from the expanded state to the folded state, and the first user interface includes the first floating window. Optionally, if no user operation on the first floating window is received within a preset time (for example, 3 seconds or 5 seconds, etc.) after the first floating window is displayed, then the first floating window becomes hidden by the floating ball.
[0066] Optionally, the processing unit is further used to perform the following operations: when the display screen is in a folded state, the first user interface receives a second operation of the user on the first interface element; and in response to the second operation, displays the first QR code on the second screen.
[0067] Optionally, the first interface element includes at least one of an icon or a name of the second application and a type of the first QR code.
[0068] In a possible implementation, the processing unit is further configured to perform the following operations:
[0069] In response to an operation on a pull-down control of the first floating window, the first floating window is expanded and a second interface element of a second QR code of a third application is displayed;
[0070] A third operation of the user on the second interface element is received, and the second QR code is displayed on the second screen in response to the third operation.
[0071] In a possible implementation, after the first two-dimensional code is scanned, the processing unit is further configured to perform the following operations:
[0072] A second floating window is displayed on the first screen, and the second floating window includes indication information that the first QR code has been scanned.
[0073] In a possible implementation, in the receiving of the first operation of the user, before displaying the first QR code of the second application on the second screen in response to the first operation, the processing unit is further configured to perform the following operations:
[0074] Acquire first status information of the display screen;
[0075] When the first state information indicates that the display screen is in a folded state, is not locked, and is on, an input event of the first operation is monitored.
[0076] In a possible implementation, after receiving the first operation of the user and before the display screen displays the first QR code, the processing unit is further configured to perform the following operations:
[0077] Acquire second state information of the display screen;
[0078] When the second state information indicates that the display screen is in a target state, the monitoring of the input event of the first operation is canceled; the target state includes the display screen being in an expanded state, a locked state or an off state.
[0079] In a possible implementation, the aforementioned processing unit is specifically used to perform the following operations:
[0080] In response to the aforementioned first operation, a target window and a third user interface are displayed on the aforementioned second screen; the aforementioned third user interface is a user interface in the aforementioned second application that includes the aforementioned first QR code, the aforementioned target window includes a first area and a second area, the aforementioned first area is a transparent area, the aforementioned second area is a black area, the aforementioned target window covers the aforementioned third user interface, and the aforementioned first QR code and the aforementioned first area have corresponding positions.
[0081] In a possible implementation, the aforementioned processing unit is specifically used to perform the following operations:
[0082] Setting the aforementioned first area to black;
[0083] removing the task window displayed on the second screen, wherein the task window includes the third user interface;
[0084] Close the aforementioned target window.
[0085] In a fourth aspect, the present application provides an electronic device, the electronic device comprising a display screen, the display screen comprising a first screen and a second screen, when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen; the electronic device further comprises a processing unit, which is used to perform the following operations:
[0086] The display screen is in a folded state, and a user interface and a first floating window of a first application are displayed on the first screen, wherein the first floating window includes a first interface element of a first QR code of a second application;
[0087] Receiving a selection operation of the first interface element by a user at a first time point, and displaying the first QR code on the second screen in response to the selection operation; displaying a user interface of the first application on the first screen during the process of displaying the first QR code on the second screen; and closing the second screen after the first QR code is scanned;
[0088] When the aforementioned display screen is in a target state, the aforementioned display screen does not display the aforementioned first floating window, and the aforementioned target state includes the aforementioned display screen being in an expanded state, a locked state, or an off-screen state.
[0089] In a fifth aspect, the present application provides an electronic device, comprising: a display screen, one or more processors, and one or more memories; the one or more processors are coupled to the one or more display screens and the one or more memories; the one or more memories are used to store computer program codes, and the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any one of its possible implementation methods.
[0090] In a sixth aspect, the present application provides an electronic device comprising: a display screen, one or more processors, and one or more memories; the one or more processors are coupled to the display screen and the one or more memories; the one or more memories are used to store computer program codes, and the computer program codes include computer instructions, so that when the one or more processors execute the computer instructions, the electronic device executes the method described in the second aspect.
[0091] In a seventh aspect, the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any one of its possible implementation methods.
[0092] In an eighth aspect, the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method described in the second aspect.
[0093] In a ninth aspect, the present application provides a computer program product comprising instructions, which, when the computer program product is run on an electronic device, enables the electronic device to execute the method described in the first aspect and any one of its possible implementation methods.
[0094] In a tenth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the second aspect.
[0095] The third to tenth aspects are used to cooperate with the implementation of any one of the methods in the first aspect, the second aspect and their possible implementation methods, and therefore have the corresponding beneficial effects in the first aspect, the second aspect and their possible implementation methods, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] Figures 1A to 1D A schematic diagram of the electronic device provided in an embodiment of the present application;
[0097] Figure 2A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0098] Figure 3 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0099] Figure 4 A schematic diagram of a user holding an electronic device provided in an embodiment of the present application;
[0100] Figures 4A to 4K A schematic diagram of a user interface displayed by an electronic device provided in an embodiment of the present application;
[0101] Figures 5 to 10 A schematic diagram of the internal interaction process of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0102] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiments may be included in at least one embodiment of the present embodiment application. The appearance of this phrase in various positions in the specification is not necessarily the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It can be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0103] The terms "first", "second", "third", etc. in the specification and claims of the present application and the drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a series of steps or units are included, or optionally, steps or units not listed are included, or optionally, other steps or units inherent to these processes, methods, products or devices are included.
[0104] Only the part relevant to the present application but not all content is shown in the accompanying drawings.Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processing or methods described as flow charts.Although flow charts describe various operations (or steps) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously.In addition, the order of various operations can be rearranged.Described processing can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings.Described processing can correspond to method, function, procedure, subroutine, subprogram etc.
[0105] As used in this specification, the terms "component", "module", "system", "unit", etc. are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or distributed between two or more computers. In addition, these units can be executed from various computer-readable media having various data structures stored thereon. Units can communicate through local and / or remote processes, for example, based on signals having one or more data packets (e.g., data from a second unit interacting with another unit in a local system, a distributed system, and / or a network. For example, the Internet interacts with other systems via signals).
[0106] With the development of users' diversified demands for electronic devices, folding screen electronic devices with large screens and convenience are widely welcomed by users. The folding screen of an electronic device can be folded to form at least two screens. For example, the folding screen can be folded along a folding edge or a folding axis to form a first screen and a second screen. The folding methods of folding screens on electronic devices can be divided into two categories. One is a folding screen that folds outward (referred to as an outward folding screen), and the other is a folding screen that folds inward (referred to as an inward folding screen). Among them, the folding screen can be folded to form a first screen and a second screen as an example. After the outward folding screen is folded, the display direction of the first screen and the display direction of the second screen are opposite, and the display direction is the direction of the front of the screen, or it can be said that the front of the screen is facing the direction. When the screen is displayed, the display direction is the direction of the screen display. Exemplarily, the display screen of the electronic device is a flexible screen. The first screen and the second screen are two different display areas in the same display screen.
[0107] The electronic device involved in the embodiments of the present application mainly takes an electronic device with an outward folding screen as an example. For example, the outward folding screen can include two ways of vertical folding and horizontal folding. Vertical folding refers to folding the screen of the electronic device outward longitudinally. Horizontal folding refers to folding the screen of the electronic device outward laterally. The embodiments of the present application are introduced by taking the screen of the electronic device folding outward laterally as an example. For example, you can refer to Figures 1A to 1D, shows a schematic diagram of the appearance of an electronic device with a horizontally foldable screen provided by an embodiment of the present application. Figure 1A FIG. 1 is a schematic diagram of the electronic device when the display screen is in an unfolded state (hereinafter referred to as an unfolded state). As can be seen, the electronic device includes a first screen and a second screen. In the unfolded state, the first screen and the second screen can form a large display screen to display a user interface. The first screen and the second screen can be folded along a folding axis or a folding edge ( Figures 1A to 1D Folding is shown in the figure using a folding axis as an example).
[0108] For example, in Figure 1A In the embodiment, the second screen can be folded along the direction shown in 1a, and / or the first screen can be folded along the direction shown in 1b to obtain the following Figure 1B For example, in Figure 1B In the embodiment, the second screen can be folded further along the direction shown in 1c to obtain Figure 1C The folded state shown (may be simply referred to as the folded state). Figure 1C The second screen in the folded state is shown in FIG. The first screen in the folded state can be exemplarily referred to as Figure 1D .
[0109] Exemplarily, the first screen is the main screen of the electronic device, and the second screen is the secondary screen of the electronic device. If the electronic device is in a folded state, the first screen generally faces the user, so the second screen can also be called a back screen.
[0110] It is understandable that the above Figures 1A to 1D The above is only an example and does not constitute a limitation on the embodiments of the present application. For example, in a specific implementation, in addition to the first screen and the second screen, the electronic device may also include other display screens, which are not limited in the embodiments of the present application.
[0111] In the process of using an electronic device with an outward folding screen, if you encounter a scenario where you need to present a QR code such as a payment code or a boarding code, you need to interrupt the current task. Then open the corresponding application, and then open the QR code in the application. For example, the electronic device is displaying the content of an e-book in the display interface. If you need to present a QR code such as a payment code or a boarding code at this time, the electronic device will pause displaying the content of the e-book. Then, in response to the user's startup operation, the corresponding application (such as WeChat or Alipay) is started, and then further in response to the user's related operations, the corresponding QR code is displayed on the display interface. This way of displaying QR codes, on the one hand, has many operating steps, resulting in low efficiency in displaying QR codes; on the other hand, it interrupts the current task in progress, affecting the user experience. In order to optimize the efficiency of displaying QR codes and improve the user experience, an embodiment of the present application provides a method for displaying QR codes and an electronic device that uses the method for displaying QR codes.
[0112] First, the electronic device provided by the embodiment of the present application is introduced as an example. The electronic device may include a handheld device (e.g., a mobile phone, a tablet computer, a PDA, etc.), a vehicle-mounted device (e.g., a car, an electric car, an airplane, a ship, etc.), a wearable device (e.g., a smart watch (e.g., iWatch, etc.), a smart bracelet, a pedometer, etc.), a smart home device (e.g., a refrigerator, a television, an air conditioner, an electric meter, etc.), an intelligent robot, a workshop device, and various forms of user equipment (UE), a mobile station (MS), a terminal device (Terminal Equipment), and the like. It can be understood that the introduction here is only an example, and the embodiment of the present application does not limit the specific form and implementation of the electronic device.
[0113] See also Figure 2 , Figure 2 It is a schematic diagram of the hardware structure of the electronic device 100 provided in an embodiment of the present application.
[0114] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0115] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0116] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0117] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0118] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0119] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0120] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0121] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0122] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194 .
[0123] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0124] The magnetic sensor 180D includes a Hall sensor, and the electronic device 100 can detect the opening and closing of the flip leather case by using the magnetic sensor 180D.
[0125] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0126] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0127] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0128] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of a human vocal part.
[0129] based on Figure 2 The hardware structure diagram of the electronic device 100 of the embodiment of the present application is shown in FIG. 1 , and the software structure block diagram of the electronic device 100 of the embodiment of the present application is introduced below. Figure 3 shown.
[0130] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0131] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime and system library, hardware abstraction layer (HAL), and kernel layer.
[0132] The application layer can include a series of application packages.
[0133] like Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, short message and back screen service (TapTapService).
[0134] For example, the back screen service can be used to pull up the target QR code display on the back screen of the electronic device. For specific implementation, please refer to the following Figure 7 For example, the target QR code may be a payment code, a boarding code, or any identity identification code, etc., which is not limited in the present embodiment of the present application.
[0135] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0136] like Figure 3 As shown, the application framework layer may include a window manager, a content provider, a phone manager, a resource manager, a notification manager, a view system, and a double-click control service (TapTapControlService), etc.
[0137] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0138] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0139] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0140] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0141] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0142] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0143] For example, the above double-click control service can be used to monitor the screen folding state and screen on / off state, as well as query the screen unlocking state. For specific implementation, please refer to the following Figure 5 The introduction of the possible implementation is not described in detail here.
[0144] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0145] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0146] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0147] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL) and motion services module.
[0148] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0149] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0150] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc.
[0151] A 2D graphics engine is a drawing engine for 2D drawings.
[0152] For example, the gesture service module can be used to monitor target events through the device management service (hwExtDeviceManage). For specific implementation, please refer to the following Figure 6 The introduction of the possible implementation is not described in detail here.
[0153] The hardware abstraction layer is an abstract structure between the kernel layer and the upper layer. It is a package of the kernel layer driver to provide a unified interface to the upper layer. It makes it unnecessary for the upper layer application to know how the lower layer hardware works, thus shielding the implementation details of the lower layer.
[0154] The hardware abstraction layer can provide a standard interface to display the device hardware capabilities to the higher-level application framework layer. The hardware abstraction layer contains multiple library modules, each of which implements an interface for a specific type of hardware component. The library modules can include audio modules, bluetooth modules, camera modules, and sensors. The sensors can include, for example, accelerometers, magnetic field sensors, orientation sensors, gyroscopes, ambient light sensors, pressure sensors, temperature sensors, and proximity sensors. When the application framework layer requires access to the device hardware, the system will load the corresponding library module for the hardware component. Manufacturers can define interfaces in the hardware abstraction layer.
[0155] Among them, illustratively, the above-mentioned acceleration sensor can be used to sense operations acting on the electronic device (such as a double-click operation on the back screen, etc.).
[0156] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0157] Based on the electronic device described above, an embodiment of the present application provides a method for displaying a QR code. The method can be applied to a scenario where an electronic device with an outward folding screen is in a folded state. For example, it can be applied to Figure 4 In the scenario shown. Figure 4 In the embodiment, the electronic device is in a folded state and the user holds the electronic device. The first screen of the electronic device faces the user, and the second screen of the electronic device faces away from the user. The second screen is referred to as the back screen below. For example, the first screen of the electronic device can display a user interface or desktop of a certain application (that is, the electronic device is in an unlocked and bright screen state).
[0158] Alternatively, in another possible implementation, if security factors such as leakage of user information are not considered, the electronic device can implement the method for displaying a QR code provided in the embodiment of the present application as long as it is in a folded state. For example, as long as the electronic device is in a folded state, the electronic device can be in a screen-off state but not locked, or the electronic device can be in a screen-locked state, etc. to implement the method for displaying a QR code. However, the following introduction mainly describes the method for displaying a QR code when the electronic device is in a folded state, the screen is not locked, and the screen is on as an example. The screen on refers to the first screen of the electronic device being on, and the same applies to the following description, so it will not be repeated.
[0159] The above-mentioned screen off refers to the display screen of the electronic device being off. Screen off is opposite to screen on, and screen on refers to the state where the display screen of the electronic device is lit. Lock screen refers to a protection state set to protect the data security in the electronic device. Lock screen can also prevent accidental touches or presses. After the electronic device is locked, it needs to enter a password or other unlocking method set by the user to unlock it.
[0160] The following is an exemplary introduction to the method for displaying a QR code provided in an embodiment of the present application.
[0161] First, combine the following Figures 4A to 4K The user interface displayed on the display screen of an electronic device during the process of implementing the method for displaying a QR code is exemplarily introduced.
[0162] For example, in the above Figure 4In the scenario shown, that is, when the electronic device is in a folded state, the screen is unlocked and the screen is on, the electronic device can detect the target operation. The target operation can be, for example, two consecutive taps by the user on the back screen of the electronic device, or a single tap by the user on the back screen of the electronic device, or a sliding operation after a tap on the back screen of the electronic device, etc. Alternatively, the target operation can be a tap, slide or drag operation on the first screen of the electronic device and any combination thereof, etc. It is understandable that the target operation can be pre-set, specifically any pre-set operation, and the embodiment of the present application does not limit this. Exemplarily, the electronic device can detect the target operation by an acceleration sensor. Exemplarily, the aforementioned two consecutive tap operations can be, for example, two tap operations within a preset duration. The preset duration can be 0.5 seconds, 1 second or 2 seconds, etc., and the embodiment of the present application does not limit this.
[0163] For example, when the electronic device is in a folded state, unlocked, and the screen is on, the user interfaces of the first screen and the back screen can refer to Figure 4A (a) and (b) in . Figure 4A As can be seen in (a), the user interface of the first screen can display an operable control 402A on the interface 401 originally displayed on the first screen. The operable control 402A is a hidden state of the floating window 402B. The operable control 402A can call out the floating window 402B in response to the user's operation. For details, please refer to the following introduction, which will not be described in detail here. Figure 4A As can be seen in (b), the back screen is black, that is, no user interface of any application is displayed.
[0164] In a possible implementation, the target operation is taken as the first operation. The first operation may be an operation of tapping the back screen of the electronic device twice in a row. Figure 4A In the case shown in FIG. 1 , the electronic device may display a floating window 402B in the first screen in response to the first operation (for example, see Figure 4B (a)), and displaying the target QR code on the back screen (for example, see Figure 4B (b)). Figure 4B (a) and Figure 4B (b) is illustrated by taking the target QR code as the first QR code of the first application as an example. The first application can be any application that can present a QR code such as a payment code, a boarding code, etc., and this embodiment of the application does not limit this.
[0165] Figure 4B (a) is a user interface diagram showing the first screen of the floating window 402B. Figure 4BAs can be seen in (a), after the electronic device responds to the above-mentioned first operation, a floating window 402B may be displayed on the interface 401 originally displayed on the first screen. The floating window 402B may indicate that the first QR code of the first application is displayed on the back screen. The floating window 402B may include an icon 4021 of the first application, text 4022 indicating that the QR code is displayed on the back screen, the name 4023 of the first application, the type 4024 of the displayed QR code, and a drop-down control 4025.
[0166] The icon 4021 of the first application is only an example and does not constitute a limitation on the embodiments of the present application. The icons shown in the drawings of the embodiments of the present application are all examples and will not be described in detail below.
[0167] The above-mentioned text 4022 is, for example, "back screen bright code", etc., which is not limited in the embodiment of the present application. In a specific implementation, the text 4022 can also be other text indicating that the back screen displays a QR code, which is not limited in the embodiment of the present application.
[0168] The above-mentioned QR code type 4024 may include payment code, collection code, boarding code, identity identification code and various QR codes that may appear in the future, etc., and the embodiments of the present application do not limit this.
[0169] The above drop-down control 4025 can display more selectable QR code types in the floating window 402B, and the selected QR code can be displayed on the back screen. Figure 4D and Figure 4E The relevant introduction will not be described in detail here.
[0170] Figure 4B (b) is a schematic diagram of a user interface for displaying the first QR code of the first application on the back screen. Figure 4BAs can be seen in (b), the background of the back screen is black, and the area 403 displaying the first QR code of the first application is white. The area 403 may include a payment barcode 4031, a payment QR code 4032, and text 4033 indicating the display of the first QR code number. The text 4033 may be, for example, "click to view the first QR code number", etc., and the specific content of the text is not limited in the embodiment of the present application. Exemplarily, the user interface of the first QR code of the first application may also include a description 404 about the first QR code. The description 404 may, for example, include an icon 4041 of the first application and a name 4042 of the displayed QR code. The name 4042 of the QR code may, for example, be "first QR code of the first application", etc., and the embodiment of the present application does not limit the text description of the name of the QR code. For example, assuming that the first QR code is a boarding code, then the name 4042 of the QR code may be "first application boarding code". For another example, assuming that the first QR code is a payment code, then the name 4042 of the QR code may be "first application payment code". The names of the QR codes introduced later are the same and will not be repeated here.
[0171] For a possible implementation, see Figure 4B (a), the electronic device can expand the floating window 402B in response to the user's click operation on the drop-down control 4025 to display more selectable QR code types. For example, the expanded floating window 402B can be exemplified as shown in FIG. Figure 4D .exist Figure 4D In the example, the floating window 402B also includes an option for the second QR code of the second application and an option for the boarding code of the third application. Exemplarily, the floating window 402B may include an icon 4027 of the second application and text 4028 indicating the selection of the second QR code of the second application. The text 4028 may be, for example, “Use “Second Application Second QR Code””, etc., which is not limited in the embodiment of the present application. The floating window 402B also includes an icon 4029 of the third application and text 40210 indicating the selection of the boarding code of the third application. The text 40210 may be, for example, “Use “Third Application Boarding Code””, etc., which is not limited in the embodiment of the present application.
[0172] In one possible implementation, Figure 4D In the expanded floating window 402B shown, the electronic device can display the second QR code of the second application on the back screen in response to the user's click operation on the icon 4027 and / or text 4028 display area. Figure 4E , Figure 4E Shown is a schematic diagram of a user interface for displaying a second QR code of a second application on the back screen.
[0173] exist Figure 4EIt can be seen that the background of the back screen is black, and the background of the area 407 displaying the second QR code of the second application is white. The area 407 may include a payment barcode 4071, a payment QR code 4072, and text 4073 indicating the display of the second QR code number. The text 4073 may be, for example, "touch to view the second QR code number", etc., and the specific content of the text is not limited in the embodiment of the present application. Exemplarily, the user interface displaying the second QR code of the second application may also include a description 408 about the second two-dimensional. The description 408 may include, for example, an icon 4081 of the second application and a name 4082 of the displayed QR code. The name 4082 of the QR code may be, for example, "second QR code of the second application", etc., and the text description of the name of the QR code is not limited in the embodiment of the present application.
[0174] Regarding the implementation of selecting the boarding code of the third application in the expanded floating window 402B and displaying it on the back screen, please refer to the relevant introduction of the second QR code of the second application mentioned above, which will not be repeated here.
[0175] In addition, in the above Figure 4D It can also be seen that the expanded floating window 402B also includes a pull-up control 4026. The pull-up control 4026 can collapse the expanded floating window 402B. For example, the electronic device can collapse the expanded floating window 402B in response to the user's click operation on the pull-up control 4026. The collapsed floating window 402B can be exemplarily shown in FIG. Figure 4B As shown in (a).
[0176] In another possible implementation, Figure 4D In the user interface shown, the electronic device can collapse the expanded floating window 402B in response to a user clicking operation at any position outside the expanded floating window 402B. The collapsed floating window 402B can be exemplarily shown in FIG. Figure 4B As shown in (a).
[0177] Understandably, Figure 4D The expanded floating window 402B shown is only an example and does not constitute a limitation on the embodiments of the present application. In a specific implementation, the selectable QR code type included in the expanded floating window 402B can be a QR code of other applications or other QR code types, and the embodiments of the present application do not limit this.
[0178] In one possible implementation, the above Figure 4B (b) (or Figure 4E ) is successfully scanned, the electronic device can Figure 4B The area 403 (or Figure 4EThe area 407 shown in the figure displays information such as "Scan code completed" or "Payment successful". This indicates that the QR code has been successfully scanned. Optionally, the successful scanning of the QR code can also indicate that the corresponding operation (such as payment operation, etc., which is not limited in this embodiment of the application) has been completed. For example, you can refer to Figure 4F and Figure 4G The QR code is scanned successfully or the scanning is completed, which means that the QR code is successfully scanned by other devices.
[0179] Figure 4F Shown Figure 4B After the QR code shown in (b) is scanned successfully, the interface jumps to the user interface displayed on the back screen. It can be seen that the user interface after the jump may include the icon 4034 of the first application, the words "Payment successful" 4035, the payment amount (100 yuan is shown as an example) 4036, the payment method 4037 and the payee 4038 and other information.
[0180] Figure 4G Shown Figure 4E After the QR code is successfully scanned, the interface jumps to the user interface displayed on the back screen. It can be seen that the user interface after the jump can display the message "Scanning completed".
[0181] Understandably, Figure 4F and Figure 4G The above is only an example and does not constitute a limitation on the embodiments of the present application. In a specific implementation, the interface that jumps to after the QR code is successfully scanned may be other user interfaces, which is not limited in the embodiments of the present application. Alternatively, the user interface after the jump may display other interface elements, which is not limited in the embodiments of the present application.
[0182] Above Figure 4B (b) (or Figure 4E ) is successfully scanned and the interface is redirected (for example, the above Figure 4F and Figure 4G After the user interface is displayed, the electronic device can turn off the back screen. Turning off the back screen can mean that the back screen is in a black screen state or the back screen displays a black background, for example, Figure 4A Alternatively, the back screen may be turned off so that the back screen is not displayed.
[0183] In another possible implementation, the above Figure 4B (b) (or Figure 4E ) is successfully scanned, the first screen of the electronic device may display a floating window indicating that the payment is completed or the code scanning is completed. For example, see Figure 4H and Fig. 4I .
[0184] Figure 4H Shown Figure 4B Schematic diagram of the user interface of the first screen after the QR code shown in (b) is successfully scanned. It can be seen that a floating window 402C is displayed in the user interface. The floating window 402C may include the icon 402C1 of the first application, text 402C2 indicating that the payment has been completed, the name of the first application 402C3, and the type of QR code displayed (such as payment code, ride code, etc.) 402C4. For example, the text 402C2 indicating that the payment has been completed may also indicate that the payment amount is "x yuan", such as Figure 4H shown.
[0185] Fig. 4I Shown Figure 4E The user interface diagram of the first screen after the QR code is successfully scanned is shown. It can be seen that a floating window 402D is displayed in the user interface. The floating window 402D may include an icon 402D1 of the second application, text 402D2 indicating that the code scanning is completed, the name 402D3 of the second application, and the type of the displayed QR code (e.g., payment code, ride code, etc.) 402D4.
[0186] In a possible implementation, the floating window 402C or the floating window 402D disappears after being displayed for a preset time period, which may be, for example, 3 seconds, 5 seconds, or 8 seconds, etc., and the present embodiment does not limit this.
[0187] It is understandable that the above Figure 4H and Fig. 4I The floating window shown is only an example and does not constitute a limitation on the embodiments of the present application. In a specific implementation, the floating window can display other interface elements or content, which is not limited in the embodiments of the present application.
[0188] In another possible implementation, the above Figure 4B (b) (or Figure 4E ) is successfully scanned, the jump interface after successful scanning will not be displayed on the back screen (for example, the above Figure 4F and Figure 4G Instead, the screen goes black, for example, Figure 4A as shown in (b).
[0189] In another possible implementation, the electronic device is Figure 4A In the case shown in FIG. 1 , in response to the second operation of the user in the first screen, a floating window 402B (for example, see Figure 4B (a)), and displaying the target QR code on the back screen (for example, see Figure 4B (b)). That is, the target operation is the second operation. The second operation may include Figure 4AIn (a), the click operation (or the operation of pressing and sliding) of the operable control 402A and the selection operation of the target QR code are described below as an example.
[0190] For example, see Figure 4J The electronic device may display a floating window 402B in the first screen in response to the user's click operation on the operable control 402A, such as Figure 4C At this time, the back screen is black and does not display the QR code. Figure 4C as shown in (b).
[0191] For example, see Figure 4K The electronic device may display a floating window 402B in the first screen in response to the user pressing and sliding the operable control 402A, such as Figure 4C At this time, the back screen is black and does not display the QR code. Figure 4C The sliding direction can be, for example, Figure 4K The direction shown in 406.
[0192] In the above Figure 4C In the user interface shown in (a), the electronic device can display the first QR code of the first application on the back screen in response to the user's selection operation on the first QR code of the first application. The user interface for displaying the first QR code of the first application on the back screen can be exemplified by referring to Figure 4B As shown in (b) of FIG. 4 , the selection operation may be, for example, a click operation by the user at the location of the icon 4021 , the name 4023 of the first application, or the type 4024 of the displayed QR code.
[0193] In another possible implementation, if the user wants to select other QR codes to be displayed on the back screen, then, refer to the above Figure 4D and Figure 4E The relevant introduction is not repeated here.
[0194] In another possible implementation, after the QR code displayed on the back screen is successfully scanned, the electronic device can turn off the back screen. FIG. 4F to FIG. 4I The relevant introduction is not repeated here.
[0195] In one possible implementation, in the above Figure 4B (a) Figure 4C (a) or Figure 4DIn the user interface shown, if the electronic device does not receive the user's operation through the floating window 402B after a preset time, for example, the user does not click or touch any position of the floating window 402B within the preset time. Then, the electronic device can hide the floating window 402B. The user interface after hiding can be exemplified in FIG. Figure 4A As shown in (a). Exemplarily, the preset duration may be, for example, 3 seconds, 5 seconds, or 8 seconds, etc., and this embodiment of the present application does not limit this.
[0196] In one possible implementation, if the electronic device is in an expanded state, or in a locked screen state, or in a screen-off state, the first screen will not display the operable control 402A, nor will it display the floating window 402B. Moreover, even if the electronic device receives the first operation from the user, it will not respond. That is, the target QR code will not be displayed on the second screen. In addition, since the first screen will not display the operable control 402A, nor will it display the floating window 402B, the electronic device cannot receive the second operation. That is, when the electronic device is in an expanded state, or in a locked screen state, or in a screen-off state, the display of the target QR code will not be triggered.
[0197] The following further describes the implementation process of the method for displaying a two-dimensional code provided in the embodiment of the present application. The following implementation process is mainly described by taking the above target operation as the above first operation as an example.
[0198] In a possible implementation, based on the previous introduction, it can be known that the electronic device will display the user interface introduced above only when it is in a folded state, unlocked and the screen is on. Therefore, the electronic device can register a listener in the system server to listen to the screen folding state, register a broadcast receiver to receive the screen on / off state, and can query the screen unlock state. After the electronic device obtains the above-mentioned specific screen folding state, specific screen on / off state and specific screen unlock state, it can determine whether to register a target event listener based on these states. The target event is the input event of the above-mentioned target operation. The target event listener can monitor the occurrence of the target event. Only after the target event occurs will the electronic device be triggered to execute the process of displaying the above-mentioned floating window and / or target QR code. The following is combined with Figure 5 and Figure 6 The specific implementation process is introduced as an example. Figure 6 The process shown, Figure 6 The process shown may include, but is not limited to, the following steps.
[0199] 601. When the screen is in a folded state, unlocked, and on state, the double-click control service registers a target event listener with the gesture service.
[0200] Exemplarily, the above-mentioned gesture service (Motion services) is also a sub-service thread in the above-mentioned system service process. The gesture service can identify gesture operations acting on the electronic device.
[0201] In a specific implementation, the double-click control service can obtain the specific screen folding state, the specific screen on / off state, and the specific screen unlocking state of the electronic device. Figure 5 The process shown is obtained, see the following for details Figure 5 The relevant introduction will not be described in detail here.
[0202] After the above-mentioned double-click control service obtains the above-mentioned specific screen folding state, it can judge whether the specific screen folding state is the folding state by comparison. After the above-mentioned double-click control service obtains the above-mentioned specific screen on / off state, it can judge whether the specific screen on / off state is the screen on state by comparison. After the above-mentioned double-click control service obtains the above-mentioned specific screen unlocking state, it can judge whether the specific screen unlocking state is the unlocking state, that is, whether it is the unlocked screen state by comparison.
[0203] In one possible implementation, when the screen is in the expanded state, locked state, or off state, the double-click control service will not register the target event listener with the gesture service. Alternatively, when the screen is in the expanded state, locked state, or off state, if the target event listener has been registered, the double-click control service can request the gesture service to unregister the registered target event listener. Exemplarily, the double-click control service can unregister the registered target event listener by calling the unregister device listener function unregisterDeviceListner().
[0204] In one possible implementation, when the screen is in a folded state, unlocked, and on, the double-click control service can register a target event listener with the gesture service. Exemplarily, the above-mentioned registration of the target event listener can be implemented by registering the device listener function registerDeviceListner(). Exemplarily, if the target event listener has been registered when the screen is in a folded state, unlocked, and on, it will not be registered repeatedly. Exemplarily, it can be judged by querying whether the listener list in the gesture service includes the information of the target event listener. If included, it indicates that the target event listener has been registered. If not included, it indicates that the target event listener has not been registered.
[0205] For example, in a specific implementation, the target event listener may be registered or unregistered in a device management service (hwExtDeviceManage) in the gesture service. The device management service may obtain input events of gesture operations detected by the sensor.
[0206] For example, if any one of the above-mentioned screen folding state, screen on / off state and screen unlocking state changes, the above-mentioned double-click control service will be triggered to determine whether the screen meets the conditions of folding state, unlocked screen and on screen, and then determine whether to register or unregister the above-mentioned target event listener.
[0207] 602. The acceleration sensor driver sends a target event to the gesture service.
[0208] After the double-click control service registers the target event listener with the gesture service, if the above target operation occurs, the accelerometer of the electronic device can detect the input event of the target operation. Exemplarily, in a specific implementation, the system calls the sensor driver so that the hardware accelerometer first receives the input event of the target operation, and then the system calls the accelerometer interface of the hardware abstraction layer to identify the input event as a target event through a preset algorithm. The preset algorithm can be, for example, a back screen tap (TapTap) algorithm, etc., and the embodiments of the present application do not limit this.
[0209] The accelerometer interface of the hardware abstraction layer recognizes the target event and can send the target event to the gesture service. Exemplarily, in a specific implementation, the accelerometer interface of the hardware abstraction layer sends the target event to the device management service in the gesture service.
[0210] 603. The gesture service calls the target event listener to return the target event to the double-click control service.
[0211] After receiving the target event, the gesture service can call the target event listener through the device management service, so that the target event is returned to the double-click control service after the method in the called target event listener is executed.
[0212] 604. The double-click control service starts the back screen service based on the target event.
[0213] After receiving the target event, the double-click control service can start the back screen service. The back screen service is an application provided by an embodiment of the present application to display the target QR code on the back screen.
[0214] 605. After the back screen service is started, launch the target application.
[0215] After launching the target application, the corresponding QR code can be displayed on the back screen. The implementation process can be seen in the following example. Figure 7 or Figure 8 The relevant introduction will not be described in detail here.
[0216] For example, the target application may be a preset application corresponding to the QR code displayed on the back screen by default. Alternatively, in another possible implementation, the target application may be an application corresponding to the QR code selected by the user in the floating window to be displayed on the back screen.
[0217] For example, the following is combined with Figure 5 This article describes the process of obtaining the specific screen folding state, screen on / off state, and screen unlocking state of the electronic device through the double-click control service. Figure 5 The process diagram is shown. Figure 5 The process shown may include, but is not limited to, the following steps.
[0218] 501. The double-click control service registers a screen folding state listener with the folding screen management service.
[0219] Exemplarily, the double-click control service is a sub-service thread newly added to the system service process in the embodiment of the present application. The double-click control service can register a screen folding state listener and a screen on / off state listener to obtain the state data monitored by the listener, and / or can query the unlock state of the screen. Among them, the screen folding state listener can monitor whether the screen is in a folded state or an unfolded state. The screen on / off state listener can monitor whether the screen is in a screen on state or a screen off state.
[0220] Registration is to register the listener information with the event source object, so that when the monitored event occurs, the event source object can find the listener in the list of registered listeners and call its method accordingly to handle it.
[0221] The folding screen manager service is also a sub-service thread in the system service process. The folding screen manager service can manage the folding state or unfolding state of the display screen of the electronic device.
[0222] In a specific implementation, when the electronic device is powered on, the system service process will execute the startOtherServices thread to start various other system sub-services. In an embodiment of the present application, the startOtherServices thread can pull up and start the above-mentioned double-click control service. After the double-click control service is started, the screen folding state listener can be registered with the folding screen management service. So that when the screen of the electronic device is switched from a folded state to an expanded state, and / or when the screen of the electronic device is switched from an expanded state to a folded state, specific status information can be returned to the double-click control service.
[0223] Exemplarily, the double-click control service may register a screen folding state listener with the folding screen management service by registering a folding state function registerfoldablestate().
[0224] 502. The double-click control service registers a broadcast receiver of the screen on / off status with the application activity management service.
[0225] For example, the application activity management service (AMS) is mainly responsible for managing the activity tasks and life cycles of all applications. When an application is opened, AMS starts the process of the application and allocates processor resources and memory to the application.
[0226] In the embodiment of the present application, after the double-click control service is started, the broadcast receiver of the screen on / off status can be registered with the AMS. So that when the screen of the electronic device switches from the screen on state to the screen off state, and / or when the screen of the electronic device switches from the screen off state to the screen on state, the specific screen on / off status information can be returned to the double-click control service.
[0227] Exemplarily, the broadcast receiver of the screen-off state may be implemented as a screen change receiver (Screenchangereceiver) or the like.
[0228] 503. The double-click control service registers a broadcast receiver of the unlock state with the application activity management service.
[0229] In a specific implementation, the unlock state of the screen can be broadcast by the system user interface service (systemUI). Exemplarily, the system user interface service (systemUI) is also a sub-service thread in the above system service process. The system user interface service can implement notification message prompt sound and system status bar presentation, navigation bar presentation, display system or application notification content, lock screen, control and manage split screen dividing lines, and provide management for picture-in-picture mode, etc.
[0230] The application activity management service can receive the broadcast of the unlocked state. Therefore, after the double-click control service is started, the broadcast receiver of the unlocked state can be registered with the application activity management service. Exemplarily, the broadcast receiver can be called after the application activity management service receives the broadcast information from the system user interface service, so as to return the unlocked state of the screen to the double-click control service.
[0231] 504. The folding screen management service calls the folding status listener to return the screen folding status to the double-click control service.
[0232] In the specific implementation, after the double-click control service registers the screen folding state listener with the folding screen management service, if the screen of the electronic device switches from a folded state to an unfolded state, and / or the screen of the electronic device switches from an unfolded state to a folded state, the folding screen management service calls the folding state listener to return the specific screen folding state to the double-click control service.
[0233] 505. The power management service broadcasts the screen on / off status.
[0234] For example, the power management service (PMS) is also a sub-service thread in the system service process. The power management service is responsible for the power management of the system, for example, for lighting up the screen, turning off the screen, or entering the screen saver.
[0235] In a specific implementation, a service that has registered a broadcast receiver for receiving the screen on / off status broadcast by the power management service can receive the screen on / off status broadcast. The above application activity management service has registered a broadcast receiver for the screen on / off status, so the application activity management service can receive the screen on / off status broadcast.
[0236] 506. The application activity management service returns the screen on / off status to the double-click control service.
[0237] In a specific implementation, since the broadcast receiver of the screen on / off status is registered by the double-click control service to the application activity management service, after receiving the screen on / off status broadcast from the power management service, the application activity management service can transmit the screen on / off status to the broadcast receiver. The broadcast receiver then transmits the specific screen on / off status to the double-click control service.
[0238] 507. The system user interface service broadcasts the screen unlock status.
[0239] 508. The application activity management service returns the screen unlock status to the double-click control service.
[0240] In a specific implementation, the system user interface service may broadcast a specific screen unlock status. After receiving the broadcasted screen unlock status, the AMS may transmit the unlock status to the broadcast receiver of the unlock status. The broadcast receiver may send the specific screen unlock status to the above-mentioned double-click control service.
[0241] It is understandable that the execution order of the above steps 501 to 503 is not limited, and the execution order of the above steps 504 to 508 is not limited. In addition, the introduction of the above double-click control service to obtain the screen folding state, screen on and off state, and screen unlocking state is only an example. In a specific implementation, the double-click control service can also obtain these status information through a callback function or other methods, and the embodiment of the present application does not limit this.
[0242] For example, the following is combined with Figure 7 and Figure 8 The above-mentioned process of pulling up the target application to display the corresponding QR code on the back screen is introduced as an example.
[0243] In one possible implementation, Figure 7 The process shown pulls up the target application to display the corresponding QR code on the back screen. Figure 7 The process shown includes but is not limited to the following steps.
[0244] 701. The back screen service sends a message to pull up the target QR code to the application activity management service by calling the startActivity function.
[0245] Exemplarily, the target QR code is the QR code displayed on the back screen by default or the QR code selected by the user to be displayed on the back screen. The user interface of the target QR code can be displayed by starting an application activity.
[0246] The message sent to AMS can be carried by the Intent parameter. The Intent parameter specifies the Activity to be started (referred to as the target Activity), that is, the Intent parameter includes the data description of the target Activity. AMS can create the corresponding application activity record (ActivityRecord) by parsing the Intent parameter, and then continue the subsequent process of starting the Activity.
[0247] In addition, exemplarily, in an embodiment of the present application, the target QR code is required to be displayed on the back screen of the electronic device. The message sent by the back screen service to the AMS also carries the identification information of the sender, that is, the back screen service (such as the application name or a preset unique number, etc.). Therefore, after receiving the message, the AMS can determine whether it is a message sent by the back screen service based on the identification information of the sender in the message. If so, adjust the display area associated with the target Activity and set the display area of the target Activity to the back screen. Thereby, when a window is subsequently created based on the target Activity to display the target QR code, the display area of the window is the back screen.
[0248] 702. The application activity management service sends a notification to the target application to start the target Activity based on the message. The target Activity can display the target QR code.
[0249] After the AMS creates an ActivityRecord based on the received message, it can first determine whether the application process indicated by the ActivityRecord (i.e., the target application process) exists. If not, the target application process can be started first, and then a notification to start the target Activity can be sent to the target application. If the target application process exists, a notification to start the target Activity can be directly sent to the target application.
[0250] 703. The target application starts the target Activity based on the notification.
[0251] After receiving the notification from the AMS, the target application creates a corresponding application activity thread (ActivityThread), thereby starting the target Activity.
[0252] Exemplarily, the application activity thread can start the target Activity by calling functions such as onCreate() and onResume().
[0253] 704. The target application creates a view tree of the first window through the target Activity and adds it to the window management service.
[0254] Exemplarily, the window manager service (WMS) is also a sub-service thread in the above system service process. The window manager service can at least implement functions such as window management, window animation, or assist the input system in receiving input events.
[0255] After the target Activity is started, the view tree of the first window can be created through the target Activity and the view tree can be added to the WMS. The first window can display the target QR code. By way of example, the first window displays the user interface of the target application, which includes the target QR code. For example, if the target QR code is a payment code of an application, then the first window displays the payment code interface of the application. For another example, if the target QR code is a boarding code of an application, then the first window displays the boarding code interface of the application. It can be understood that this is only an example and does not constitute a limitation to the embodiments of the present application.
[0256] Exemplarily, the above-mentioned adding the view tree of the first window to the window management service can be implemented by calling the setview() function. Exemplarily, the setview() function can call the Addwindow() function to add the view tree of the first window to the window management service. In addition, the setview() function can also call the requestlayout() function to layout the first window.
[0257] 705. The window management service applies for a vertical synchronization Vsync signal from the interface mapping service.
[0258] For example, the above-mentioned surface mapping service (Surfaceflinger) is also a system service, which can assist and cooperate with WMS to implement window management.
[0259] After adding the view tree to WMS, WMS can request the vertical synchronization (Vsync) signal of screen refresh from the interface mapping service. The VSync signal can synchronize the frames per second (FPS) and the screen refresh rate to avoid the phenomenon of screen "tearing". If there is no VSync signal, when the rendering frame data is fast, the screen refresh cannot keep up, and it may appear that a certain frame is currently being displayed, and another frame is triggered to be displayed on the screen, which will cause the phenomenon of screen "tearing".
[0260] 706. The interface mapping service returns a notification of a Vsync signal to the target application.
[0261] When the next VSync signal arrives, the interface mapping service returns a notification of the Vsync signal to the target application.
[0262] 707 . The target application calls a rendering module to draw a first window in response to the Vsync signal.
[0263] After receiving the notification, the target application may call the rendering module, for example, call the ViewRootlmpl#performTraversals() function to draw the first window. Exemplarily, the performTraversals() function may call functions such as performdraw() to draw the first window.
[0264] 708. The target application sends the drawn first window to the interface mapping service.
[0265] After the target application obtains the drawn first window, the target application may send the first window to the interface mapping service.
[0266] 709. The interface mapping service synthesizes the content of the first window into a graphic.
[0267] After receiving the drawn first window, the interface mapping service may synthesize the first window into a graphic, wherein the synthesized graphic includes the target two-dimensional code.
[0268] 7010. The interface mapping service sends the synthesized graphics to the display management service.
[0269] Exemplarily, the above-mentioned display manager (DisplayManager) service is also a system service that can manage the life cycle of window display.
[0270] 7011. The display management service displays the synthesized graphics on the back screen.
[0271] In step 701, the display area of the target Activity is set as the back screen. The first window is the window of the target Activity, so the display management service displays the graphic synthesized based on the first window on the back screen. Thus, the target QR code can be displayed on the back screen.
[0272] In another possible implementation, Figure 8 The process shown pulls up the target application to display the corresponding QR code on the back screen. Figure 8 The process shown includes but is not limited to the following steps.
[0273] 801. The back screen service sends a message to pull up a target QR code to the target application by calling the SDK of the target application.
[0274] Exemplarily, a software development kit (SDK) is a collection of development tools for creating application software for software packages, software frameworks, hardware platforms or operating systems. SDK can be used by an application program. SDK facilitates the creation of applications through compilers, debuggers or software frameworks. Alternatively, SDK can provide some files of application program interfaces for a certain programming language, or may also include complex hardware that can communicate with a certain embedded system. In an embodiment of the present application, the above-mentioned target QR code can be pulled up by calling the SDK of the above-mentioned target application.
[0275] Exemplarily, the back screen service may call the SDK of the target application, and then send a message to pull up the target QR code to the target application through the interface of the SDK.
[0276] 802. The target application sends a message to pull up the target QR code to the AMS by calling the startActivity function.
[0277] After the target application receives the message from the back screen service, it can call the startActivity function in response to the message to send a message to AMS to pull up the target QR code. Figure 7 The introduction of step 701 in the above process will not be repeated here.
[0278] 803. The AMS sends a notification to start the target activity to the target application based on the message.
[0279] The target activity can display the target QR code.
[0280] The implementation of this step can refer to the above Figure 7 The introduction of step 702 is not repeated here.
[0281] 804. Display the first window based on the notification by interacting with related threads and modules.
[0282] The implementation of this step can refer to the above Figure 7 The description of steps 703 to 7011 in the above description will not be repeated here.
[0283] It is understandable that the above Figure 7 and Figure 8 The implementation process of pulling up the target application to display the corresponding QR code on the back screen is only an example and does not constitute a limitation to the embodiments of the present application.
[0284] In another possible implementation, if the electronic device changes the QR code displayed on the back screen in response to the user's selection operation, for example, see the above Figure 4D and Figure 4E Then, you can also refer to the above Figure 7 or Figure 8 The process of pulling up the application of the selected QR code to display the QR code is not described here.
[0285] In another possible implementation, the electronic device does not need to monitor the target event. As long as it is determined that the electronic device is in a folded state, unlocked, and the screen is on, the floating window is displayed on the first screen and the target QR code is displayed on the back screen. Figure 5 After following the process shown, the double-click control service can obtain the specific screen folding state, the specific screen on and off state, and the specific screen unlocking state. Then, if it is determined based on these states that the electronic device is in a folded state, the screen is not locked, and the screen is on, then the floating window can be displayed on the first screen. In addition, the double-click control service will start the back screen service, so that the back screen service pulls up the target application to display the corresponding QR code on the back screen. For details, please refer to the aforementioned Figure 6 Step 605, and referring to the above Figure 7 or Figure 8 The relevant introduction is not repeated here.
[0286] In a possible implementation, when the electronic device displays the target QR code on the back screen, the background of the back screen is black. The implementation process of displaying the background of the back screen as black can be referred to Fig. 9 . Fig. 9 The process shown may include, but is not limited to, the following steps.
[0287] 901. The back screen service creates a view tree for the second window and adds it to the WMS.
[0288] In a specific implementation, the view tree of the second window can be created through the back screen service and the view tree can be added to the WMS. The second window is displayed on the back screen, and the second window has a black background.
[0289] Exemplarily, the second window may be a pop-up window (Dialog). When the back screen service creates the second window, the default display area is the back screen. Then, the background of the second window may be set to black through the background setting function. When the second window with a black background is displayed on the back screen, the background of the back screen is also black. Exemplarily, the background setting function may be, for example, a setBackgroundDrawable() function or a setBackground(Drawablebackground) function, etc., which is not limited in the embodiments of the present application.
[0290] 902. The back screen service applies for a vertical synchronous Vsync signal from the interface mapping service.
[0291] After the view tree of the second window is added to the WMS, the WMS may apply to the interface mapping service for a Vsync signal for screen refresh.
[0292] 903. The interface mapping service returns a notification of a Vsync signal to the back screen service.
[0293] When the next VSync signal arrives, the interface mapping service returns a notification of the Vsync signal to the back screen service.
[0294] 904. The back screen service calls a rendering module to draw a second window in response to the Vsync signal.
[0295] After receiving the notification, the back screen service can call the rendering module, for example, call the ViewRootlmpl#performTraversals() method to draw the second window.
[0296] 905. The back screen service sends the drawn second window to the interface mapping service.
[0297] After the back screen service obtains the drawn second window, it can send the second window to the interface mapping service.
[0298] 906. The interface mapping service synthesizes the content of the second window into a graphic.
[0299] After receiving the drawn second window, the interface mapping service may perform graphic synthesis on it.
[0300] 907. The interface mapping service sends the synthesized graphics to the display management service.
[0301] The interface mapping service synthesizes the graphics of the second window and sends the synthesized graphics to the display management service for display.
[0302] 908. The display management service displays the synthesized graphics on the back screen.
[0303] The display management service displays the graphics synthesized based on the second window on the back screen, so that the background of the back screen appears black.
[0304] In a possible implementation, if the back screen is to display the above Figure 4B (b) or Figure 4E The user interface shown in the figure can set the preset area of the second window as a transparent area (for example Figure 4B The area 403 shown in (b) or Figure 4EThe target QR code is displayed in the transparent area. In addition, a corresponding application icon (eg, Figure 4B The icon 4041 of the first application shown in (b) or Figure 4E The icon of the second application shown in 4081) and the name of the target QR code (eg Figure 4B The name of the QR code shown in (b) is 4042 or Figure 4E The name of the QR code shown in 4082).
[0305] Exemplarily, the position and size of the preset area of the second window, as well as the specified position and size of the name of the application icon and the QR code displayed in the second window are all pre-set. Exemplarily, it can be set by means of an extensible markup language (XML) layout file or the like, which is not limited in the embodiments of the present application. Alternatively, in another possible implementation, the position and size of the preset area of the second window may not be pre-set. The display area of the QR code can be dynamically determined based on the position and size of the target QR code to be displayed, and the position and size of the transparent preset area can be determined based on the display area.
[0306] Exemplarily, in a specific implementation, the electronic device may first normally draw the second window with the black background, and then set the preset area as a transparent area by calling a function for setting a transparent area (e.g., srcPaint.setXfermode(newPorterDuffXfermode(PorterDuff.Mode.SRC_OUT) function, etc.). In addition, the layout file describes the application icon and the QR code name displayed at the specified location. Therefore, the application icon and the QR code name may be displayed at the specified location based on the layout file.
[0307] For example, in a specific implementation, the above Figure 7 , Figure 8 Or other possible implementation methods, the first window displayed on the back screen is covered by the second window. Since the preset area of the second window is a transparent area and the background is opaque black, and the transparent area is exactly the display area of the target QR code in the first window. In addition, the application icon and the name of the QR code are laid out at the specified position in the second window. Then the user interface seen on the back screen is, for example, the above Figure 4B (b) or Figure 4E For example, the layer of the first window can be set below the layer of the second window through the layer setting, thereby presenting a display effect that the first window is covered by the second window.
[0308] In another possible implementation, if the back screen is to display the above Figure 4B (b) or Figure 4E The user interface shown can also take a screenshot of the target QR code in the first window, and display the screenshot target QR code in the preset area of the second window. In this implementation, the preset area may not be set as a transparent area.
[0309] It is understandable that the above-mentioned back screen presents, for example, Figure 4B (b) or Figure 4E The implementation method of the user interface shown is only an example and does not constitute a limitation to the embodiments of the present application.
[0310] In a possible implementation, if the target QR code displayed on the back screen has been successfully scanned to complete the corresponding payment operation, the electronic device can close the back screen. For example, the electronic device can exit the user interface displaying the target QR code on the back screen and turn the screen black, or the back screen does not display any interface. Fig.10 The following is an example of the interactive process of closing the back screen. Fig.10 The process shown may include, but is not limited to, the following steps.
[0311] 1001. After the code scanning is completed, the back-screen service displays a floating window on the first screen to prompt the user.
[0312] In a possible implementation, after the target QR code displayed on the back screen is scanned and the corresponding operation is completed, the interface displayed in the first window will jump. After the jump, the preset area of the second window in the back screen no longer displays the target QR code (for example, see the above Figure 4F and Figure 4G The back screen service can detect this change, and thus know that the code has been scanned and the corresponding payment has been completed, thereby triggering the closing of the back screen.
[0313] Exemplarily, the back screen service can capture a picture of the user interface displayed on the back screen and then identify the picture. If the QR code is not recognized in the picture, it is determined that the code scanning is completed. Or, exemplarily, the back screen service can detect the text and other elements displayed in the preset area of the back screen. If the text such as "Payment Successful" or "Scan Code Completed" is detected, it can be determined that the code scanning is completed. Or, exemplarily, the back screen service can call the existing intelligent capabilities in the system (such as the Android Accessibility Framework function, etc.) to identify the user interface where the code scanning is completed, and then determine that the code scanning is completed.
[0314] In another possible implementation, the back screen service can preset the time length for displaying the target QR code on the back screen. If the time for displaying a target QR code on the back screen reaches the preset time length, it can be determined that the code has been scanned and the corresponding payment operation has been completed, thereby triggering the closing of the back screen. Exemplarily, the preset time length can be, for example, 10 seconds or 20 seconds, etc., and the embodiment of the present application does not limit this.
[0315] In another possible implementation, the interactive communication between the back screen service and the target application can be realized through a bundle service. After the target QR code displayed on the back screen is scanned and the corresponding operation is completed, the target application can perceive it. Then, the target application can notify the back screen service of the completion of the code scanning, so as to trigger the back screen service to turn off the back screen.
[0316] After the back screen service learns that the code scanning is completed, a floating window can be displayed on the main screen to indicate that the code scanning is completed. Figure 4H The floating window 402C or Fig. 4I The floating window 402D shown. Exemplarily, the back screen service can call the window management service WMS to realize the display of the floating window. The implementation process of the back screen service displaying the floating window on the first screen can be exemplarily referred to the implementation process of the target application displaying the first window on the back screen. The difference is the setting of attributes such as the display area, display position and interface elements in the window, which will not be described in detail in the embodiments of the present application.
[0317] 1002. The back screen service sets a preset area of the second window displayed on the back screen to black.
[0318] Based on the previous introduction, it can be known that the second window is a Dialog on the upper layer of the first window displaying the target QR code. In order to display the target QR code on the lower layer, the preset area of the second window is set to a transparent area. After the back screen service learns that the code scanning is completed, it indicates that there is no need to continue to display the first window on the lower layer. Therefore, the background of the second window on the upper layer can be set to black. That is, the background of the preset area is also set to black. In this way, the first window is completely covered, and the back screen seen by the user is black, such as the above Figure 4A as shown in (b).
[0319] 1003. The back screen service calls the window management service to remove the task displayed on the back screen.
[0320] Exemplarily, the back screen service sets the background of the second window to black. Optionally, after the floating window indicating the completion of the code scanning displayed on the main screen disappears (based on the previous introduction, it will automatically disappear after a preset time). The back screen service can call the window management service to remove the task displayed on the back screen. That is, remove the window displayed on the back screen.
[0321] For example, the back screen service can call the removeAllTaskForDisplay() function, which in turn calls the window management service to remove the tasks displayed on the back screen. The input parameter of the removeAllTaskForDisplay() function is the identifier of the back screen (displayID). That is, the displayID indicates that the tasks to be removed are those displayed on the back screen.
[0322] 1004. The window management service removes the task displayed on the background screen.
[0323] In the specific implementation, the window management service responds to the above call and finds the object instance displayContent of the back screen according to the above displayID. Then, it traverses all the tasks in the displayContent. And in the process of traversal, it calls the removeImmediately() function to remove the traversed tasks. After the traversal is completed, the tasks displayed on the back screen are also removed.
[0324] 1005. The window management service returns a successful removal result to the back screen service.
[0325] After completing the removal of the task displayed on the back screen, the window management service may return a result of successful removal to the back screen service.
[0326] 1006. The back screen service closes the second window.
[0327] In a specific implementation, since all the tasks, that is, windows, displayed on the back screen are removed, the second window covering the upper layer can be closed. Exemplarily, the presentation.dismiss() function can be called to close the second window.
[0328] Since all the tasks displayed on the back screen have been removed, after closing the second window, there is no window displayed on the back screen and it is in a black screen state.
[0329] 1007. The back screen service sends a message to the double-click control service to close the back screen.
[0330] After the back screen service closes the second window, it can send a message to the double-click control service to close the back screen, so as to inform the double-click control service that it does not need to continue to display the back screen.
[0331] 1008. Double-click the control service to unbind it from the back screen service.
[0332] The double-click control service can respond to the above message of closing the back screen and release the binding relationship with the back screen service. Exemplarily, the double-click control service can release the binding relationship with the back screen service through the ubindservice() function.
[0333] It is understandable that the above Fig.10 The process shown is only an example and does not constitute a limitation to the embodiments of the present application.
[0334] To sum up, compared with the prior art, the method for displaying a QR code provided in the embodiment of the present application can quickly pull up the required QR code on the back screen for display without interrupting the task currently being performed on the first screen of the electronic device, thereby reducing the operation steps for displaying the corresponding QR code and improving the efficiency of displaying the QR code and user experience.
[0335] An embodiment of the present application also provides an electronic device, which includes one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the above embodiment.
[0336] An embodiment of the present application also provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the method described in the above embodiment.
[0337] The embodiments of the present application also provide a computer program product including instructions. When the computer program product is executed on an electronic device, the electronic device executes the method described in the above embodiments.
[0338] An embodiment of the present application also provides a computer-readable storage medium, including instructions, which, when executed on an electronic device, enable the electronic device to execute the method described in the above embodiment.
[0339] It can be understood that the various embodiments of the present application can be combined arbitrarily to achieve different technical effects.
[0340] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk), etc.
[0341] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by computer programs to instruct related hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0342] In short, the above is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for displaying a two-dimensional code, characterized in that: Applied to an electronic device, the electronic device comprises a display screen, the display screen comprises a first screen and a second screen, when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen; The display screen is in a folded state, and a first user interface is displayed on the first screen, wherein the first user interface includes an interface of a first application; receiving a first operation of a user at a first time point, and displaying a first QR code of a second application on the second screen in response to the first operation; During the process of displaying the first two-dimensional code on the second screen, displaying the first user interface on the first screen; After the first QR code is scanned, closing the second screen; The display screen is in an expanded state, and a second user interface of the first application is displayed on the display screen, where the second user interface is an interface of the first user interface adapted to the expanded state; At a second time point, a first operation of the user is received, and the first QR code of the second application is not displayed on the second screen.
2. The method according to claim 1, characterized in that The display screen is in a folded state, and the first screen is in a locked state or an off state; At a third time point, a first operation of the user is received, and based on the fact that the first screen is in a locked state or an off-screen state, the first QR code of the second application is not displayed.
3. The method according to claim 1 or 2, characterized in that: The first operation includes an operation of tapping twice on the back side of the first screen.
4. The method according to any one of claims 1 to 3, characterized in that: Before the first screen displays the first user interface, the method further includes: The electronic device is in an unfolded state, and the electronic device displays the second user interface, which does not include the first floating window; The first screen displays a first user interface, including: After the electronic device changes from the unfolded state to the folded state, the electronic device displays the first user interface on a first screen, where the first user interface includes the first floating window, and the first floating window includes a first interface element of the first QR code.
5. The method according to claim 4, characterized in that The method further comprises: When the display screen is in a folded state, the first user interface receives a second operation of the user on the first interface element; In response to the second operation, the first two-dimensional code is displayed on the second screen.
6. The method according to claim 4 or 5, characterized in that: The first interface element includes at least one of an icon and a name of the second application and a type of the first QR code.
7. The method according to claim 3 or 4, characterized in that: The method further comprises: In response to an operation on a pull-down control of the first floating window, the first floating window is expanded and a second interface element of a second QR code of a third application is displayed; A third operation of the user on the second interface element is received, and the second QR code is displayed on the second screen in response to the third operation.
8. The method according to any one of claims 1 to 7, characterized in that: After the first two-dimensional code is scanned, the method further includes: A second floating window is displayed on the first screen, and the second floating window includes indication information that the first two-dimensional code has been scanned.
9. The method according to any one of claims 1 to 8, characterized in that: The receiving a first operation of the user, before displaying a first QR code of the second application on the second screen in response to the first operation, further includes: Acquire first status information of the display screen; When the first state information indicates that the display screen is in a folded state, is not locked, and is on, an input event of the first operation is monitored.
10. The method according to any one of claims 1 to 8, characterized in that: The receiving of the first operation of the user, before the display screen displays the first QR code, further includes: Acquire second state information of the display screen; When the second state information indicates that the display screen is in a target state, canceling the monitoring of the input event of the first operation; the target state includes that the display screen is in an expanded state, a locked state, or an off state.
11. The method according to any one of claims 1 to 10, characterized in that: The displaying a first QR code of a second application on the second screen in response to the first operation includes: In response to the first operation, a target window and a third user interface are displayed on the second screen; the third user interface is a user interface in the second application that includes the first QR code, the target window includes a first area and a second area, the first area is a transparent area, and the second area is a black area, the target window covers the third user interface, and the first QR code and the first area correspond in position.
12. The method according to claim 11, characterized in that The closing of the second screen includes: Setting the first area to black; removing a task window displayed on the second screen, wherein the task window includes the third user interface; Closes the target window.
13. A method for displaying a QR code, characterized in that: Applied to an electronic device, the electronic device comprises a display screen, the display screen comprises a first screen and a second screen, when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen; The display screen is in a folded state, and a user interface and a first floating window of a first application are displayed on the first screen, wherein the first floating window includes a first interface element of a first QR code of a second application; receiving a selection operation of the first interface element by a user at a first time point, and displaying the first QR code on the second screen in response to the selection operation; During the process of displaying the first two-dimensional code on the second screen, displaying the user interface of the first application on the first screen; after the first two-dimensional code is scanned, closing the second screen; When the display screen is in a target state, the display screen does not display the first floating window, and the target state includes the display screen being in an expanded state, a locked state, or an off state.
14. An electronic device, characterized in that: include: A display screen, one or more processors, and one or more memories; the one or more processors are coupled to the display screen and the one or more memories; the one or more memories are used to store computer program code, the computer program code includes computer instructions, when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 1-12; or, the electronic device executes the method as described in claim 13.
15. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 12; or, when the instruction is executed on an electronic device, the electronic device executes the method as claimed in claim 13.
16. A computer program product comprising instructions, characterized in that When the computer program product runs on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 12; or, when the computer program product runs on an electronic device, the electronic device executes the method as claimed in claim 13.
Citation Information
Cited By
Method for displaying qr code and related electronic device
EP4675410A1
Information processing device, control method for information processing device, and program
JP7826555B1
Information processing device, method for controlling the information processing device, and program
JP7858953B1
Method for displaying QR code and related electronic device
WO2025039501A1