CN109725967B - Method and device for adjusting horizontal and vertical screen display errors, mobile terminal and storage medium - Google Patents

Method and device for adjusting horizontal and vertical screen display errors, mobile terminal and storage medium Download PDF

Info

Publication number
CN109725967B
CN109725967B CN201811549937.9A CN201811549937A CN109725967B CN 109725967 B CN109725967 B CN 109725967B CN 201811549937 A CN201811549937 A CN 201811549937A CN 109725967 B CN109725967 B CN 109725967B
Authority
CN
China
Prior art keywords
activity interface
screenshot
interface
application
current activity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811549937.9A
Other languages
Chinese (zh)
Other versions
CN109725967A (en
Inventor
张军伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhanxing Automation Technology Co ltd
Original Assignee
Shenzhen Zhanxing Automation Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhanxing Automation Technology Co ltd filed Critical Shenzhen Zhanxing Automation Technology Co ltd
Priority to CN201811549937.9A priority Critical patent/CN109725967B/en
Publication of CN109725967A publication Critical patent/CN109725967A/en
Application granted granted Critical
Publication of CN109725967B publication Critical patent/CN109725967B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method and a device for adjusting display errors of a horizontal screen and a vertical screen of an application interface, a mobile terminal and a computer readable storage medium, which are applied to applications which do not support horizontal screen and vertical screen switching in the mobile terminal. The method comprises the following steps: when the application Activity interface is moved to the background, screenshot is carried out on the current Activity interface and the current Activity interface is stored; when the current Activity interface is triggered to be switched between a horizontal screen and a vertical screen, covering the saved screenshot on the current Activity interface; removing the screenshot when the application Activity interface is reactivated. According to the embodiment of the invention, the problem of interface display confusion caused by being shielded by a transparent or non-full screen window can be solved, the interaction and visual experience is optimized, and the user experience is improved by covering a normal Activity interface screenshot on the forcibly rotated Activity interface without modifying a window management mechanism of a frame layer.

Description

Method and device for adjusting horizontal and vertical screen display errors, mobile terminal and storage medium
Technical Field
The invention relates to the field of mobile terminals, in particular to a method and a device for adjusting display errors of a horizontal screen and a vertical screen of an application interface, a mobile terminal and a computer readable storage medium.
Background
Currently, the increasing popularity of mobile terminals, users using mobile terminals are increasing, and users use mobile terminals more and more frequently in daily life, so that the mobile terminal has become one of the mobile devices indispensable to the users.
In an Android operating system of a current mobile terminal, android forcibly sets display sides of all visible or invisible windows to be consistent with a topmost window (window) based on a topmost window configuration (config) attribute.
In this way, when the topmost layer is a transparent window (taking a vertical screen as an example) or a non-full-screen window, the next window can be seen through the window, and if the next window is an Activity application supporting only a horizontal screen display, in this case, it is seen that the Activity application is forcibly rotated to a vertical screen, which causes the Activity application not to be normally displayed, thereby causing a series of problems and causing a poor user experience.
Disclosure of Invention
In view of this, the method and apparatus for adjusting the display error of the horizontal and vertical screens of the application interface, the mobile terminal and the computer-readable storage medium provided in the embodiments of the present invention can solve the problem of interface display confusion caused by being blocked by a transparent or non-full-screen window, optimize interaction and visual experience, and improve user experience.
The technical scheme adopted by the invention for solving the technical problems is as follows:
according to an aspect of the embodiments of the present invention, a method for adjusting a horizontal and vertical screen display error of an application interface is provided, which is applied to an application that does not support horizontal and vertical screen switching in a mobile terminal, and the method includes:
when the application Activity interface is moved to the background, screenshot is carried out on the current Activity interface and the current Activity interface is stored;
when the current Activity interface is triggered to be switched between a horizontal screen and a vertical screen, covering the saved screenshot on the current Activity interface;
removing the screenshot when the application Activity interface is reactivated.
In one possible design, before screenshot and saving the current Activity interface of the application when the Activity interface is moved to the background, the method further includes: the Activity interface of the monitoring application is moved to the background action.
In one possible design, when the application Activity interface is moved to the background, screenshot is performed on the current Activity interface of the application and the current Activity interface is saved, where the screenshot includes:
when the application Activity interface is moved to a background, screenshot is carried out on the current Activity interface;
and storing the screenshot in a cache.
In one possible design, before overlaying the saved screenshot on the current Activity interface when the current Activity interface is triggered to switch between horizontal and vertical screens, the method further includes: and copying an onConfigChanged method of a parent class in the application Activity, wherein the onConfigChanged method does not support horizontal and vertical screen switching.
In a possible design, when the current Activity interface is triggered to switch between horizontal and vertical screens, overlaying the saved screenshot on the current Activity interface includes:
triggering an onConfigChanged method;
analyzing the incoming parameters by using an onConfigChanged method to obtain bound attributes;
judging whether the current Activity interface is forcibly set to a vertical screen state which is not supported by the application or not according to the obtained Bounds attribute;
if the current Activity interface is judged to be forcibly rotated, acquiring a DecorView object of the current Activity interface;
and adding a full-screen view on the DecorView object, wherein the view display saves the screenshot and covers the current Activity interface.
In one possible design, removing the screenshot when the application Activity interface is reactivated includes: and when the application Activity interface is reactivated, removing the view, namely removing the screenshot.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for adjusting a display error of a horizontal screen and a vertical screen of an application interface, including: screenshot module, save module, replacement module, removal module, wherein:
the screenshot module is used for screenshot for the current Activity interface when the Activity interface is moved to the background;
the storage module is used for storing the screenshot intercepted by the screenshot module;
the replacing module is used for overlaying the stored screenshot on the current Activity interface when the current Activity interface is triggered to be switched between horizontal and vertical screens;
the removal module is used for removing the screenshot when the application Activity interface is reactivated.
According to another aspect of the embodiments of the present invention, there is provided a mobile terminal, including: the method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the steps of the method for adjusting the display errors of the horizontal and vertical screens of the application interface provided by the embodiment of the invention are realized.
According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, where a program of an adjustment method for an application interface horizontal/vertical screen display error is stored, and when executed by a processor, the program of the method for an application interface horizontal/vertical screen display error implements steps of the adjustment method for an application interface horizontal/vertical screen display error provided in the embodiments of the present invention.
Compared with the related art, the method and the device for adjusting the horizontal and vertical screen display errors of the application interface, the mobile terminal and the computer readable storage medium provided by the embodiment of the invention are applied to the application which does not support horizontal and vertical screen switching in the mobile terminal, and when the application Activity interface is moved to a background, the current Activity interface is subjected to screenshot and stored; when the current Activity interface is triggered to be switched between a horizontal screen and a vertical screen, covering the saved screenshot on the current Activity interface; removing the screenshot when the application Activity interface is reactivated. By the technical means, a window management mechanism of the framework layer does not need to be modified, and the problem of interface display confusion caused by being shielded by a transparent or non-full-screen window can be solved by covering a normal Activity interface screenshot on the forcibly rotated Activity interface, so that the interaction and visual experience are optimized, and the user experience is improved.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention;
fig. 2 is a diagram of a communication network system architecture according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for adjusting a display error of a horizontal screen and a vertical screen of an application interface according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an adjusting apparatus for displaying an error on a horizontal screen and a vertical screen of an application interface according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a method for adjusting a display error of a horizontal screen and a vertical screen of an application interface according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
In the following description, suffixes such as "module", "part", or "unit" used to indicate elements are used only for facilitating the description of the present invention, and have no particular meaning in themselves. Thus, "module", "component" or "unit" may be used mixedly.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, wiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000 ), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division multiplexing-Long Term Evolution), and TDD-LTE (Time Division multiplexing-Long Term Evolution), etc.
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of the phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation on or near the touch panel, the touch panel is transmitted to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module and the like, which will not be described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an e-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an epc (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 with access to the EPC 203.
The EPC203 may include MME (Mobility Management Entity) 2031, hss (Home Subscriber Server) 2032, other MME2033, SGW (Serving gateway) 2034, pgw (PDN gateway) 2035, PCRF (Policy and Charging Rules Function) 2036, and the like. The MME2031 is a control node for processing signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
In an Android (Android) operating system of a mobile terminal, many Android components are included, wherein Activity is one of four most basic and most commonly used components (Activity, service, content Provider, broadcastreereceiver).
Activity is an application component that provides a screen through which a user can interact in order to complete a task. All actions in Activity are closely related to the user, and are a component responsible for interaction with the user, and a specified control can be displayed through setContentView (View).
In an Android application, an Activity is usually a separate screen on which some controls can be displayed and events of a user can be monitored and processed to respond. Activity communicates with each other through Intent.
DecorView is the root View (View) of the Activity Window, which is the topmost View of the entire Window interface.
The configChanges are an attribute of the Activity component, and are used for controlling the horizontal and vertical screen switching of the mobile terminal, and when the mobile terminal performs the horizontal and vertical screen switching, the attribute of the configChanges needs to be called.
The Bounds attribute representation describes the position and size of the current interface element in its own coordinate system.
The invention is a specific application scheme based on Activity components.
Please refer to fig. 3. The embodiment of the invention provides a method for adjusting display errors of a horizontal screen and a vertical screen of an application interface, which is applied to an application which does not support horizontal and vertical screen switching in a mobile terminal, and comprises the following steps:
step S1, when the application Activity interface is moved to a background, screenshot is carried out on the current Activity interface and stored;
s2, when the current Activity interface is triggered to be switched between horizontal and vertical screens, covering the saved screenshot on the current Activity interface;
and S3, removing the screenshot when the application Activity interface is reactivated.
Further, in the step S1, before screenshot and saving the current Activity interface of the application when the Activity interface of the application is moved to the background, the method further includes:
and the Activity interface of the monitoring application is moved to the background action, and whether the Activity interface of the monitoring application is moved to the background is monitored.
Further, in step S1, when the application Activity interface is moved to the background, screenshot and saving the current application Activity interface include:
when the application Activity interface is moved to a background, screenshot is carried out on the current Activity interface;
and storing the screenshot in a cache.
Further, in the step S2, before the step of overlaying the saved screenshot on the current Activity interface when the current Activity interface is triggered to switch between horizontal and vertical screens, the method further includes:
and duplicating the onConfigChanged method of the parent class in the application Activity without supporting the horizontal and vertical screen switching.
Further, in step S2, when the current Activity interface is triggered to perform horizontal and vertical screen switching, overlaying the saved screenshot on the current Activity interface includes:
triggering an onConfigChanged method if the application Activity interface is not reactivated;
analyzing the incoming parameters by using an onConfigChanged method to obtain bound attributes;
judging whether the current Activity interface is forcibly set to a vertical screen state which is not supported by the application or not according to the obtained Bounds attribute;
if the current Activity interface is judged to be forcibly rotated, acquiring a DecorView object of the current Activity interface;
adding a full screen view (view) on the DecorView object, wherein the view display saves the screenshot to cover the current Activity interface.
Further, in step S3, removing the screenshot when the application Activity interface is reactivated includes:
and when the application Activity interface is reactivated, removing the view, namely removing the screenshot.
The method for adjusting the horizontal and vertical screen display errors of the application interface is applied to the application which does not support horizontal and vertical screen switching in the mobile terminal, and when the application Activity interface is moved to a background, the current Activity interface is subjected to screenshot and stored; when the current Activity interface is triggered to switch between horizontal and vertical screens, the saved screenshot is covered on the current Activity interface; removing the screenshot when the application Activity interface is reactivated. By the technical means, a window management mechanism of the framework layer does not need to be modified, and the problem of interface display confusion caused by being shielded by a transparent or non-full-screen window can be solved by covering a normal Activity interface screenshot on the forcibly rotated Activity interface, so that the interaction and visual experience are optimized, and the user experience is improved.
Please refer to fig. 4. The embodiment of the invention provides a device for adjusting display errors of a horizontal screen and a vertical screen of an application interface, which is applied to an application which does not support horizontal screen and vertical screen switching in a mobile terminal, and the device comprises: screenshot module 20, save module 30, replace module 50, remove module 60, wherein:
the screenshot module 20 is configured to capture a current Activity interface when the Activity interface is moved to the background;
the saving module 30 is configured to save the screenshot captured by the screenshot module 20;
the replacing module 50 is configured to overlay the saved screenshot on the current Activity interface when the current Activity interface is triggered to perform horizontal and vertical screen switching;
the removal module 60 is configured to remove the screenshot when the application Activity interface is reactivated.
Further, the apparatus further comprises: and the monitoring module 10 is used for monitoring whether the Activity interface of the application is moved to the background action or not.
Further, the method further comprises: the duplicating module 40 is configured to duplicate the onConfigChanged method of the parent class in the application Activity that does not support horizontal and vertical screen switching.
Further, the replacing module 50 is configured to overlay the saved screenshot on the current Activity interface when the current Activity interface is triggered to switch between the horizontal screen and the vertical screen, and includes:
triggering an onConfigChanged method if the application Activity interface is not reactivated;
analyzing the incoming parameters by using an onConfigChanged method to obtain bound attributes;
judging whether the current Activity interface is forcibly set to a vertical screen state which is not supported by the application or not according to the obtained Bounds attribute;
if the current Activity interface is judged to be forcibly rotated, acquiring a DecorView object of the current Activity interface;
and adding a full-screen view on the DecorView object, wherein the view display saves the screenshot and covers the current Activity interface.
Further, the removing module 60 is configured to remove the screenshot when the application Activity interface is reactivated, and includes:
and when the application Activity interface is reactivated, removing the view, namely removing the screenshot.
The adjusting device for the display error of the horizontal and vertical screens of the application interface is applied to the application which does not support the switching of the horizontal and vertical screens in the mobile terminal, when the application Activity interface is moved to a background through the screenshot module, the screenshot is carried out on the current Activity interface, and the screenshot is stored by the storage module; the replacing module covers the stored screenshot on the current Activity interface when the current Activity interface is triggered to be switched between a horizontal screen and a vertical screen; a removal module removes the screenshot when the application Activity interface is reactivated. By the technical means, a window management mechanism of a framework layer does not need to be modified, and the problem of interface display disorder caused by shielding of transparent or non-full-screen windows can be solved by covering a normal Activity interface screenshot on the forcibly rotated Activity interface, so that the interaction and visual experience is optimized, and the user experience is improved.
It should be noted that the device embodiment and the method embodiment belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiment, and technical features in the method embodiment are correspondingly applicable in the device embodiment, which is not described herein again.
The technical solution of the present invention is further described in detail with reference to the following examples.
Please refer to fig. 5.
In this embodiment, the application is a game application, the Activity interface of the application is a game space page, and the game application only supports landscape display and does not support portrait display.
A method for adjusting display errors of horizontal and vertical screens of an application interface is applied to game applications which do not support horizontal and vertical screen switching in a mobile terminal, and comprises the following steps:
step S501, the game space page of the game application is monitored to move to the background action, and whether the game space page of the game application is moved to the background is monitored.
Step S502, when the game space page of the game application is moved to a background, the current game space page of the application is subjected to screenshot;
and step S503, storing the screenshot in a cache.
Step S504, copying the onconfigugchanged method of the parent class in the game application Activity.
Step S505, in case that the game space page is not reactivated, triggering an onConfigChanged method.
Step S506, analyzing the incoming parameters by using an onConfigChanged method, and acquiring the Bounds attributes.
Step S507, according to the obtained Bounds attribute, determining whether the current game space page is forced to be in a vertical screen state that is not supported by the application.
Step S508, is the current game space page forced to be in the vertical screen state not supported by the application? If so, the process proceeds to step S509, otherwise, the process proceeds to step S505.
Step S509, if the current game space page is judged to be rotated forcibly, acquiring a DecorView object of the current game space page.
And step S510, adding a full-screen view on the DecorView object, wherein the view displays, saves and covers the screenshot on the current game space page.
In step S511, is the game space page reactivated? If so, go to step S512, otherwise go to step S513.
In step S512, when the game space page of the game application is reactivated, the view is removed, that is, the screenshot can be removed.
And step S513, the view displays and saves the screenshot to be covered on the current game space page.
The method for adjusting the display error of the horizontal and vertical screens of the application interface is applied to game applications which do not support horizontal and vertical screen switching in the mobile terminal, and screenshots are taken and stored for the current game space page by moving the game space page of the game applications to a background; when the current game space page is triggered to be switched between a horizontal screen and a vertical screen, covering the saved screenshot on the current game space page; removing the screenshot when a game space page of the game application is reactivated. By the technical means, a window management mechanism of a frame layer does not need to be modified, and the problem of interface display disorder caused by shielding of transparent or non-full-screen window can be solved by covering a normal game space page screenshot on the forcibly rotated game space page, so that interaction and visual experience are optimized, and user experience is improved.
In addition, an embodiment of the present invention further provides a mobile terminal, as shown in fig. 6, where the mobile terminal 900 includes: a memory 902, a processor 901 and one or more computer programs stored in the memory 902 and operable on the processor 901, wherein the memory 902 and the processor 901 are coupled together by a bus system 903, and the one or more computer programs are executed by the processor 901 to implement the following steps of the method for adjusting the display errors of the landscape and portrait screens of the application interface provided by the embodiment of the present invention:
s1, when the application Activity interface is moved to a background, screenshot is carried out on the current Activity interface and stored;
s2, when the current Activity interface is triggered to be switched between horizontal and vertical screens, covering the saved screenshot on the current Activity interface;
and S3, removing the screenshot when the application Activity interface is reactivated.
Further, in step S1, when the application Activity interface is moved to the background, before screenshot and saving the current application Activity interface, the method further includes:
and the monitoring application Activity interface is moved to the background action, and whether the Activity interface of the monitoring application is moved to the background is monitored.
Further, in step S1, when the application Activity interface is moved to the background, screenshot the current application Activity interface and saving the current application Activity interface, including:
when the application Activity interface is moved to a background, screenshot is carried out on the current Activity interface;
and storing the screenshot in a cache.
Further, in the step S2, before the step of overlaying the saved screenshot on the current Activity interface when the current Activity interface is triggered to switch between horizontal and vertical screens, the method further includes:
and duplicating the onConfigChanged method of the parent class in the application Activity without supporting the horizontal and vertical screen switching.
Further, in step S2, when the current Activity interface is triggered to perform horizontal and vertical screen switching, overlaying the saved screenshot on the current Activity interface includes:
triggering an onConfigChanged method if the application Activity interface is not reactivated;
analyzing the incoming parameters by using an onConfigChanged method to obtain bound attributes;
judging whether the current Activity interface is forcibly set to a vertical screen state which is not supported by the application or not according to the obtained Bounds attribute;
if the current Activity interface is judged to be forcibly rotated, acquiring a DecorView object of the current Activity interface;
and adding a full-screen view (view) on the DecorView object, wherein the view display saves the screenshot and covers the current Activity interface.
Further, in step S3, removing the screenshot when the application Activity interface is reactivated includes:
and when the application Activity interface is reactivated, removing the view, namely removing the screenshot.
The method disclosed in the above embodiments of the present invention may be applied to the processor 901, or implemented by the processor 901. The processor 901 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be implemented by instructions in the form of hardware integrated logic circuits or software in the processor 901. The processor 901 may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 901 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 902, and the processor 901 reads the information in the memory 902 and performs the steps of the foregoing method in combination with the hardware thereof.
It is to be understood that the memory 902 of embodiments of the present invention may be either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic Random Access Memory (FRAM), a Flash Memory (Flash Memory) or other Memory technologies, a Compact disc Read-Only Memory (CD-ROM), a Digital Versatile Disc (DVD), or other optical disc storage, a magnetic cartridge, a magnetic tape, a magnetic Disk storage, or other magnetic storage devices; the volatile Memory may be a Random Access Memory (RAM), and by way of example and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), static Random Access Memory (SSRAM), dynamic Random Access Memory (DRAM), synchronous Dynamic Random Access Memory (SDRAM), synchronous Dynamic Random Access Memory (ddr RAM), enhanced Synchronous Dynamic Random Access Memory (ESDRAM), synchronous Dynamic Random Access Memory (ddr RAM), synchronous Random Access Memory (ddr RAM), random Access Memory (DRAM), direct Random Access Memory (RAM), and Direct Random Access Memory (RAM). The described memory for embodiments of the present invention is intended to comprise, without being limited to, these and any other suitable types of memory.
It should be noted that the above-mentioned embodiment of the mobile terminal and the embodiment of the method belong to the same concept, and the specific implementation process is described in detail in the embodiment of the method, and the technical features in the embodiment of the method are correspondingly applicable in the embodiment of the mobile terminal, which is not described herein again.
In addition, in an exemplary embodiment, an embodiment of the present invention further provides a computer storage medium, specifically a computer-readable storage medium, for example, a memory 902 storing a computer program, where one or more programs of an adjustment method for an application interface horizontal/vertical screen display error are stored on the computer storage medium, and when executed by a processor 901, the following steps of the adjustment method for an application interface horizontal/vertical screen display error provided by the embodiment of the present invention are implemented:
s1, when the application Activity interface is moved to a background, screenshot is carried out on the current Activity interface and stored;
s2, when the current Activity interface is triggered to be switched between a horizontal screen and a vertical screen, covering the stored screenshot on the current Activity interface;
and S3, removing the screenshot when the application Activity interface is reactivated.
Further, in the step S1, before screenshot and saving the current Activity interface of the application when the Activity interface of the application is moved to the background, the method further includes:
and the Activity interface of the monitoring application is moved to the background action, and whether the Activity interface of the monitoring application is moved to the background is monitored.
Further, in step S1, when the application Activity interface is moved to the background, screenshot and saving the current application Activity interface include:
when the application Activity interface is moved to a background, screenshot is carried out on the current Activity interface;
and storing the screenshot in a cache.
Further, in the step S2, before the step of overlaying the saved screenshot on the current Activity interface when the current Activity interface is triggered to perform horizontal and vertical screen switching, the method further includes:
and copying an onConfigChanged method of a parent class in the application Activity, wherein the onConfigChanged method does not support horizontal and vertical screen switching.
Further, in step S2, when the current Activity interface is triggered to perform horizontal and vertical screen switching, overlaying the saved screenshot on the current Activity interface includes:
triggering an onConfigChanged method if the application Activity interface is not reactivated;
analyzing the incoming parameters by using an onConfigChanged method to obtain bound attributes;
judging whether the current Activity interface is forcibly set to a vertical screen state which is not supported by an application or not according to the obtained Bounds attribute;
if the current Activity interface is judged to be forcibly rotated, acquiring a DecorView object of the current Activity interface;
adding a full screen view (view) on the DecorView object, wherein the view display saves the screenshot to cover the current Activity interface.
Further, in step S3, removing the screenshot when the application Activity interface is reactivated includes:
and when the application Activity interface is reactivated, removing the view, namely removing the screenshot.
It should be noted that, the program embodiment of the adjustment method for the display error of the horizontal and vertical screens of the application interface on the computer-readable storage medium and the method embodiment belong to the same concept, and the specific implementation process thereof is described in detail in the method embodiment, and the technical features in the method embodiment are correspondingly applicable to the embodiments of the computer-readable storage medium, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of another like element in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (8)

1. A method for adjusting display errors of a horizontal screen and a vertical screen of an application interface is applied to an application which does not support horizontal and vertical screen switching in a mobile terminal, and is characterized by comprising the following steps:
when the application Activity interface is moved to the background, screenshot is carried out on the current Activity interface and the current Activity interface is stored;
when the current Activity interface is triggered to switch between horizontal and vertical screens, the saved screenshot is covered on the current Activity interface;
removing the screenshot when the apply Activity interface is reactivated;
when the current Activity interface is triggered to be switched between horizontal and vertical screens, the step of overlaying the saved screenshot on the current Activity interface comprises the following steps:
trigger the onConfigChanged method;
analyzing the incoming parameters by using an onConfigChanged method to obtain bound attributes;
judging whether the current Activity interface is forcibly set to a vertical screen state which is not supported by the application or not according to the obtained Bounds attribute;
if the current Activity interface is judged to be forcibly rotated, acquiring a DecorView object of the current Activity interface;
and adding a full-screen view on the DecorView object, wherein the view display saves the screenshot and covers the current Activity interface.
2. The method of claim 1, wherein before screenshot and saving an application current Activity interface when the application Activity interface is moved to the background, the method further comprises: the Activity interface of the monitoring application is moved to a background action.
3. The method of claim 1, wherein screenshot the current Activity interface and saving it when the application Activity interface is moved to the background comprises:
when the application Activity interface is moved to a background, screenshot is carried out on the current Activity interface;
and storing the screenshot in a cache.
4. The method according to claim 1, wherein before overlaying the saved screenshot on the current Activity interface when the current Activity interface is triggered to switch between horizontal and vertical screens, the method further comprises: and duplicating the onConfigChanged method of the parent class in the application Activity without supporting the horizontal and vertical screen switching.
5. The method of claim 1, wherein removing the screenshot when the apply Activity interface is reactivated comprises: and when the application Activity interface is reactivated, removing the View, namely removing the screenshot.
6. An apparatus for adjusting display errors of a horizontal screen and a vertical screen of an application interface, which is applied to the method for adjusting display errors of a horizontal screen and a vertical screen of an application interface as claimed in any one of claims 1 to 5, is characterized by comprising: screenshot module, save module, replacement module, remove the module, wherein:
the screenshot module is used for screenshot for the current Activity interface when the Activity interface is moved to the background;
the storage module is used for storing the screenshot intercepted by the screenshot module;
the replacing module is used for overlaying the stored screenshot on the current Activity interface when the current Activity interface is triggered to be switched between horizontal and vertical screens;
the removal module is used for removing the screenshot when the application Activity interface is reactivated;
wherein the replacement module is further to:
trigger the onConfigChanged method;
analyzing the input parameters by using an onConfigChanged method to obtain bound attributes;
judging whether the current Activity interface is forcibly set to a vertical screen state which is not supported by the application or not according to the obtained Bounds attribute;
if the current Activity interface is judged to be forcibly rotated, acquiring a DecorView object of the current Activity interface;
and adding a full-screen view on the DecorView object, wherein the view display saves the screenshot and covers the current Activity interface.
7. A mobile terminal, comprising: memory, processor and computer program stored on the memory and executable on the processor, the computer program when executed by the processor implementing the steps of a method for adjusting an application interface display error according to any one of claims 1 to 5.
8. A computer-readable storage medium, on which a program of an adjustment method for an application interface landscape display error is stored, and when the program of the adjustment method for an application interface landscape display error is executed by a processor, the steps of the adjustment method for an application interface landscape display error according to any one of claims 1 to 5 are implemented.
CN201811549937.9A 2018-12-18 2018-12-18 Method and device for adjusting horizontal and vertical screen display errors, mobile terminal and storage medium Active CN109725967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811549937.9A CN109725967B (en) 2018-12-18 2018-12-18 Method and device for adjusting horizontal and vertical screen display errors, mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811549937.9A CN109725967B (en) 2018-12-18 2018-12-18 Method and device for adjusting horizontal and vertical screen display errors, mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109725967A CN109725967A (en) 2019-05-07
CN109725967B true CN109725967B (en) 2022-11-22

Family

ID=66296810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811549937.9A Active CN109725967B (en) 2018-12-18 2018-12-18 Method and device for adjusting horizontal and vertical screen display errors, mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109725967B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111813302B (en) * 2020-06-08 2022-02-08 广州视源电子科技股份有限公司 Screen projection display method and device, terminal equipment and storage medium
CN112752136B (en) * 2020-12-09 2023-06-27 广东各有所爱信息科技有限公司 Crowd funding and opening method
CN117850928A (en) * 2022-09-30 2024-04-09 华为技术有限公司 Application display method and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662659A (en) * 2012-03-21 2012-09-12 奇智软件(北京)有限公司 Method and system for processing image display
CN103970397A (en) * 2013-01-30 2014-08-06 腾讯科技(深圳)有限公司 Rotary screen interface display method and rotary screen interface display device
CN106095551A (en) * 2016-06-07 2016-11-09 腾讯科技(深圳)有限公司 The method and apparatus showing media file
CN106527880A (en) * 2016-09-22 2017-03-22 福建天泉教育科技有限公司 iOS-based page rotation control method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102841722A (en) * 2011-06-20 2012-12-26 联想(北京)有限公司 Electronic equipment and screen displaying rotating method
CN102521020B (en) * 2011-10-26 2014-05-21 华为终端有限公司 Application screen capture method and application screen capture device for mobile terminals
US9165207B2 (en) * 2013-02-25 2015-10-20 Google Inc. Screenshot orientation detection
US20160291846A1 (en) * 2015-03-31 2016-10-06 Airwatch Llc Generating carousel user interface with graphics processing unit
CN107066268B (en) * 2017-03-28 2022-03-04 腾讯科技(深圳)有限公司 Display position switching method and device for widget application

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662659A (en) * 2012-03-21 2012-09-12 奇智软件(北京)有限公司 Method and system for processing image display
CN103970397A (en) * 2013-01-30 2014-08-06 腾讯科技(深圳)有限公司 Rotary screen interface display method and rotary screen interface display device
CN106095551A (en) * 2016-06-07 2016-11-09 腾讯科技(深圳)有限公司 The method and apparatus showing media file
CN106527880A (en) * 2016-09-22 2017-03-22 福建天泉教育科技有限公司 iOS-based page rotation control method and system

Also Published As

Publication number Publication date
CN109725967A (en) 2019-05-07

Similar Documents

Publication Publication Date Title
CN108553896B (en) State information display control method, terminal and computer readable storage medium
CN107635070B (en) Message reminding method, terminal and storage medium
CN109040808B (en) Video interaction regulation and control method, device and computer readable storage medium
CN112667181A (en) Screen projection method, screen projection equipment, screen projection control system and storage medium
CN107979667B (en) Dual-screen display method, mobile terminal and computer-readable storage medium
CN107861663B (en) Method and device for displaying dockbar under comprehensive screen
CN109725967B (en) Method and device for adjusting horizontal and vertical screen display errors, mobile terminal and storage medium
CN112631535A (en) Screen projection reverse control method and device, mobile terminal and storage medium
CN108984063B (en) Desktop interaction regulation and control method and device and computer readable storage medium
CN108322602B (en) Method, terminal and computer readable storage medium for processing application no response
CN110278481B (en) Picture-in-picture implementation method, terminal and computer readable storage medium
CN112637410A (en) Method, terminal and storage medium for displaying message notification
CN109117069B (en) Interface operation method, terminal and computer readable storage medium
CN109711830B (en) Quick display method and device for two-dimension code payment, mobile terminal and storage medium
CN107748680B (en) Kernel configuration method, terminal and computer readable storage medium
CN111381762A (en) Double-screen switching method and device and computer readable storage medium
CN107239208B (en) Method, apparatus, and computer-readable storage medium for processing screenshot
CN110187934B (en) Application control method, terminal and computer readable storage medium
CN109753483B (en) File management application page display method and device, mobile terminal and storage medium
CN110083294B (en) Screen capturing method, terminal and computer readable storage medium
CN112423211A (en) Multi-audio transmission control method, equipment and computer readable storage medium
CN109683796B (en) Interaction control method, equipment and computer readable storage medium
CN109710168B (en) Screen touch method and device and computer readable storage medium
CN110955397A (en) Method for setting frame rate of game terminal, game terminal and storage medium
CN107678622B (en) Application icon display method, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20221103

Address after: 518000 floor 5, office building 1, star center, No. 16, Baodan Road, danzhutou community, Nanwan street, Longgang District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Zhanxing Automation Technology Co.,Ltd.

Address before: 518057 Dazu Innovation Building, 9018 Beihuan Avenue, Nanshan District, Shenzhen City, Guangdong Province, 6-8, 10-11, 6 and 6-10 floors in Area A, B and C

Applicant before: NUBIA TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant