CN113867672A - Screen adaptation method and device, computer equipment and storage medium - Google Patents
Screen adaptation method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN113867672A CN113867672A CN202111065982.9A CN202111065982A CN113867672A CN 113867672 A CN113867672 A CN 113867672A CN 202111065982 A CN202111065982 A CN 202111065982A CN 113867672 A CN113867672 A CN 113867672A
- Authority
- CN
- China
- Prior art keywords
- screen
- width
- model information
- equipment
- bang
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 230000006978 adaptation Effects 0.000 title claims abstract description 38
- 238000012545 processing Methods 0.000 claims abstract description 17
- 238000004590 computer program Methods 0.000 claims description 25
- 238000010586 diagram Methods 0.000 description 9
- 230000000007 visual effect Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 206010066054 Dysmorphism Diseases 0.000 description 1
- 244000062793 Sorghum vulgare Species 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 235000019713 millet Nutrition 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/14—Digital output to display device ; Cooperation and interconnection of the display device with other functional units
- G06F3/147—Digital output to display device ; Cooperation and interconnection of the display device with other functional units using display panels
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses a screen adaptation method, a screen adaptation device, computer equipment and a storage medium. The method comprises the following steps: acquiring equipment model information of terminal equipment; acquiring the width of a safety zone corresponding to the equipment model information in a preset configuration table, and acquiring the width of the bang corresponding to the equipment model information in a preset registry; acquiring the screen size of the terminal equipment; according to the width of the safety area, the width of the bang and the size of the screen, carrying out adaptation processing on the screen safety area of the terminal equipment; and filling the special-shaped area of the screen of the terminal equipment. The method and the device can simplify the screen adaptation process and improve the screen adaptation efficiency.
Description
Technical Field
The application relates to the technical field of computers, in particular to a screen adapting method, a screen adapting device, computer equipment and a storage medium.
Background
Mobile terminal devices play an increasingly important role in today's society and go deep into various aspects of people's daily life, bringing information, fun and convenience to people's lives. Nowadays, the screen resolution ratio of the mobile terminal device is different day by day from day to day with the screen width-height ratio, the bang screen appears on the market, and a designer needs to carry out targeted interface adaptation to the bang screen. In the traditional mode, Android and IOS system layer interfaces need to be called, equipment information is acquired, screen adaptation is carried out, and the process is troublesome. Therefore, how to simplify the screen adapting process to improve the screen adapting efficiency becomes a technical problem to be solved at present.
Disclosure of Invention
The present application is directed to a screen adapting method, apparatus, computer device and storage medium, which can simplify a screen adapting process to improve screen adapting efficiency.
In order to achieve the above object, according to one aspect of the present application, there is provided a screen adapting method.
The screen adaptation method comprises the following steps:
acquiring equipment model information of terminal equipment;
acquiring the width of a safety zone corresponding to the equipment model information in a preset configuration table, and acquiring the width of the bang corresponding to the equipment model information in a preset registry;
acquiring the screen size of the terminal equipment;
according to the width of the safety area, the width of the bang and the size of the screen, carrying out adaptation processing on the screen safety area of the terminal equipment;
and filling the special-shaped area of the screen of the terminal equipment.
In one embodiment, the adapting the screen security zone of the terminal device according to the security zone width, the bang width, and the screen size includes:
calculating anchor point information according to the width of the bang and the size of the screen;
and carrying out adaptation processing on the screen safety area of the terminal equipment according to the anchor point information.
In one embodiment, the filling the screen special-shaped area of the terminal device includes:
according to the anchor point information, a black picture with the width of the bang as the width and the height of the screen in the screen size as the height is newly built;
and filling the special-shaped area of the screen of the terminal equipment according to the black picture.
In one embodiment, the method further comprises:
identifying whether a safety zone width corresponding to the equipment model information exists in the preset configuration table or not;
if the device type information exists, the width of a safety zone corresponding to the device type information is obtained;
if not, calling a preset engine interface to acquire the width of the safety zone corresponding to the equipment model information.
In one embodiment, the method further comprises:
identifying whether the bang width corresponding to the equipment model information exists in the preset registry;
if the information exists, acquiring the width of the bang corresponding to the equipment model information;
if not, calling a preset engine interface to acquire the width of the bang corresponding to the equipment model information.
In one embodiment, the obtaining the device model information of the terminal device includes:
when the target application program is detected to be started, acquiring equipment model information of the terminal equipment; or,
and when the target application program is detected to be installed, acquiring the equipment model information of the terminal equipment.
In one embodiment, before the obtaining of the device model information of the terminal device, the method further includes:
determining the width of a corresponding safety zone according to a preset device model;
and storing key values of the preset equipment model and the corresponding safety zone width to generate a preset configuration table.
In order to achieve the above object, according to another aspect of the present application, there is provided a screen adapting device.
The screen adapting device according to the application comprises:
the device model acquisition module is used for acquiring the device model information of the terminal device;
the first parameter acquisition module is used for acquiring the width of a safety area corresponding to the equipment model information in a preset configuration table and acquiring the width of a bang corresponding to the equipment model information in a preset registry;
the second parameter acquisition module is used for acquiring the screen size of the terminal equipment;
the screen adaptation module is used for adapting the screen safety area of the terminal equipment according to the width of the safety area, the width of the bang and the size of the screen;
and the screen filling module is used for filling the screen special-shaped area of the terminal equipment.
A computer device comprising a memory and a processor, the memory storing a computer program operable on the processor, the processor implementing the steps in the various method embodiments described above when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the respective method embodiment described above.
According to the screen adaptation method, the screen adaptation device, the computer equipment and the storage medium, the safety zone width corresponding to the equipment model information is acquired from the preset configuration table, the bang width corresponding to the equipment model information is acquired from the preset registry, and after the screen size of the terminal equipment is acquired, the screen safety zone of the terminal equipment is adapted according to the safety zone width, the bang width and the screen size, so that the screen special-shaped area of the terminal equipment is filled. The operating system layer can be skipped over, the equipment information can be acquired by calling the preset configuration table and the preset registry, subsequent screen adaptation processing is carried out, the screen adaptation flow is simplified, and the screen adaptation efficiency is improved. And the preset configuration table can be updated, so that the later development and maintenance work is facilitated, the operation is more flexible, a large amount of labor and time can be saved, and the cost is saved. In addition, this embodiment can be compatible all mobile devices have the screen of bang screen, and the compatibility is higher. By filling the special-shaped area of the screen of the terminal equipment, the visual effect is better.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, serve to provide a further understanding of the application and to enable other features, objects, and advantages of the application to be more apparent. The drawings and their description illustrate the embodiments of the invention and do not limit it. In the drawings:
FIG. 1 is a flow diagram illustrating a screen adaptation method in one embodiment;
fig. 2 is a schematic diagram of security zone information of a bang screen of a terminal device in one embodiment;
FIG. 3 is a diagram illustrating an effect of the terminal device after screen filling in one embodiment;
FIG. 4 is a schematic diagram of a screen adapting apparatus according to an embodiment;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In one embodiment, as shown in fig. 1, there is provided a screen adapting method, which can be applied to a terminal, including the following steps 102 to 110:
and 102, acquiring equipment model information of the terminal equipment.
The terminal device can be, but is not limited to, various personal computers, notebook computers, smart phones and tablet computers. For example, the terminal device is a terminal device employing a bang screen. The Liuhai screen belongs to one of special-shaped screens, and the special-shaped screen refers to the shape of a screen or the shape of a displayable area of the screen is other than a rectangle. Each manufacturer may also have a difference in designing the bang screens of different models, and therefore, the user interface of the bang screen terminal device needs to be adapted in the display process.
The device model information may be used to identify the terminal device. Taking a smart phone as an example, when each smart phone leaves a factory, there is an equipment model, and configuration information corresponding to the terminal equipment can be acquired according to the equipment model. The configuration information may include security zone parameters, screen parameters, and the like. For example, the device model information collected by the acquisition millet 8 is Xiaomi MI 8. After the model information of a mobile phone is determined, the information such as the security zone parameter, the screen parameter and the like of the mobile phone are determined. When the device model information of the terminal device is determined, the hardware information of the terminal device is determined, that is, the size and the position of the screen display area are determined, and the user interface needs to be adapted to the screen display area of the terminal device.
In one embodiment, the obtaining the device model information of the terminal device includes: when the target application program is detected to be started, acquiring equipment model information of the terminal equipment; or when the target application program is detected to be installed completely, acquiring the device model information of the terminal device.
When the application program is executed on the processor of the terminal device, a corresponding graphical user interface (hereinafter referred to as a user interface) is provided by the terminal device, and the user interface may include an operation area. The target application may be an application that requires screen adaptation. For example, the target application may be a gaming application, a video application, and the like. When the terminal device runs, the target application program may have a right to identify the device model information of the terminal device, and based on the right, the device model information of the terminal device may be acquired. Specifically, when it is detected that the target application is installed on the terminal device or is started for the first time, or when the application is started each time, the device model information of the terminal device is acquired. In this embodiment, the device model information of the terminal device can be quickly acquired by detecting the installation and start of the target application program in real time.
And 104, acquiring the width of the safety zone corresponding to the equipment model information in a preset configuration table, and acquiring the width of the bang corresponding to the equipment model information in a preset registry.
In this embodiment, a preset configuration table (local configuration table) is pre-stored in the terminal, and the preset configuration table records device model information of the terminal device and a security zone parameter corresponding to the device model information. The security zone parameter may include a security zone width. The security zone parameters may be preset by a technician and filled in a preset configuration table. The terminal is further stored with a preset registry (local registry), and the preset registry records the equipment model information of the terminal equipment and the bang width corresponding to the equipment model information.
For example, a schematic diagram of the security zone information of the bang screen of the terminal device may be shown in fig. 2. The safety zone information may be represented as Rect (X, Y, width, height), X representing the width of the bang, Y representing the height of the bang, width representing the width of the safety zone, and height representing the height of the safety zone. The screen safety zone of the terminal equipment is a rectangular zone.
After the device model information of the terminal device is acquired, a pre-stored preset configuration table can be read by calling the engine interface systemlnfo. Meanwhile, a preset registry is accessed by calling a PlayerPrefs interface of an engine interface so as to acquire the width of the Liuhai corresponding to the equipment model information.
In one embodiment, the method further includes: identifying whether a safety zone width corresponding to the equipment model information exists in a preset registry; if the device type information exists, the width of a safety zone corresponding to the device type information is obtained; if not, calling a preset engine interface to acquire the width of the safety zone corresponding to the equipment model information.
The terminal device may call the engine interface systemlnfo. And if the device model information does not exist, acquiring the width of the safe area corresponding to the device model information through an engine interface Screen.
In one embodiment, the method further includes: identifying whether the bang width corresponding to the equipment model information exists in a preset configuration table or not; if the information exists, acquiring the width of the bang corresponding to the equipment model information; if not, calling a preset engine interface to acquire the width of the bang corresponding to the equipment model information.
The method comprises the steps that the terminal equipment accesses a preset registry by calling a PlayerPrefs interface, whether the Liu style width corresponding to the current equipment model exists in the preset registry is identified, if yes, the Liu style width is used for carrying out safety area self-adaption if yes, and if not, the Liu style width corresponding to the equipment model information is obtained through a Screen interface, SafeArea interface.
In one embodiment, before obtaining the device model information of the terminal device, the method further includes a step of generating a preset configuration table, where the step includes: determining the width of a corresponding safety zone according to a preset device model; and storing key values of the preset equipment model and the corresponding safety zone width to generate a preset configuration table.
The terminal equipment can obtain the preset equipment model, and the corresponding safety zone width is determined according to the preset equipment model. Therefore, key value storage is performed on the preset device model and the corresponding safety zone width, specifically, a preset configuration table with key as the preset device model (for example, Xiaomi Mi 8) and value as the safety zone width is created, and subsequent searching and configuration use are facilitated.
And 106, acquiring the screen size of the terminal equipment.
The screen size is used to represent the size of the shape of the screen display area. The screen size includes a screen width and a screen height. Specifically, in this embodiment, the screen width of the bang screen of the terminal device may be obtained by calling a screen.
And 108, carrying out adaptation processing on the screen security area of the terminal equipment according to the width of the security area, the width of the bang and the size of the screen.
The screen security zone refers to a security zone in the bang screen of the terminal device. Because the User Interface (UI for short) of the liu hai screen close to the edge of the screen is not fully displayed, the User Interface needs to be adapted to the screen display area of the terminal device. Specifically, the operation area of the user interface needs to be adapted to the screen security area of the terminal device, and the operation area of the user interface is displayed in the screen security area of the terminal device.
In one embodiment, the adapting the screen security zone of the terminal device according to the security zone width, the bang width, and the screen size includes: calculating anchor point information according to the width of the bang and the size of the screen; and carrying out adaptation processing on the screen security zone of the terminal equipment according to the anchor point information.
And calculating anchor point information according to the acquired width of the bang and the screen size. The anchor point information may be denoted as (AnchorMin x, AnchorMin y, AnchorMax x, AnchorMax y). The mobile terminal is characterized in that x is the bang width, y is 0, w is the screen width-x, h is the screen height-y, AnchorMin x is x/screen width, AnchorMin y is y/screen height, AnchorMax x is (x + w)/screen width, AnchorMax is (y + h)/screen height. Therefore, the width of the bang and the size of the screen can be substituted into the formula, and anchor point information is obtained through calculation. And then, assigning the anchor point information to the UI canvas, namely realizing the self-adaption of the safety area and realizing the adaption processing of the operation area of the user interface and the screen safety area of the terminal equipment. Furthermore, the operation area of the user interface is zoomed according to the anchor point information, so that the operation area of the user interface is adapted to the screen safety area of the terminal device. In this embodiment, anchor point information is calculated according to the width of the bang and the size of the screen, adaptation processing is performed on the screen security zone of the terminal device according to the anchor point information, the operation zone of the user interface can be adapted to the screen security zone of the terminal device, and the problem that the user interface close to the edge of the screen is incompletely displayed is solved.
And step 110, filling the special-shaped area of the screen of the terminal equipment.
After anchor point information assignment is finished, the special-shaped area of the Liuhai screen of the terminal equipment can be filled by newly building a black picture.
In one embodiment, the filling the screen special-shaped area of the terminal equipment comprises the following steps: according to the anchor point information, a black picture with the width of the Liuhai as the width and the height of the screen in the screen size as the height is newly built; and filling the special-shaped area of the screen of the terminal equipment according to the black picture.
And after the anchor point information is assigned to the UI canvas, two black pictures are newly created through the UI canvas, which can also be called as UI images. The shape size of the black picture is that the width is with bang width, uses the screen height in the screen size as the height. The special-shaped area of the screen of the terminal device refers to an area outside the rectangular area, and comprises a bang area of a bang screen and a right area of the screen symmetrical to the bang area. The black picture is filled into the screen special-shaped area of the terminal device, and the effect schematic diagram after the screen of the terminal device is filled can be as shown in fig. 3. Wherein the boxes in the blank area of the screen represent the security zones. The area outside the security area in the blank area is a screen boundary area. Through filling the bang screen and handling, improved visual effect.
In this embodiment, through the safety zone width that acquires the equipment model information correspondence in presetting the configuration table and the bang width that acquires the equipment model information correspondence in presetting the registry to after the screen size who acquires terminal equipment, according to safety zone width, bang width and screen size, carry out adaptation processing to terminal equipment's screen safety zone, and then fill terminal equipment's screen dysmorphism region. The operating system layer can be skipped over, the equipment information can be acquired by calling the preset configuration table and the preset registry, subsequent screen adaptation processing is carried out, the screen adaptation flow is simplified, and the screen adaptation efficiency is improved. And the preset configuration table can be updated, so that the later development and maintenance work is facilitated, the operation is more flexible, a large amount of labor and time can be saved, and the cost is saved. In addition, this embodiment can be compatible all mobile devices have the screen of bang screen, and the compatibility is higher. By filling the special-shaped area of the screen of the terminal equipment, the visual effect is better.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
In one embodiment, as shown in fig. 4, there is provided a screen adapting apparatus including: a device model obtaining module 402, a first parameter obtaining module 404, a second parameter obtaining module 406, a screen adapting module 408, and a screen filling module 410, wherein:
an apparatus model obtaining module 402, configured to obtain apparatus model information of the terminal apparatus.
The first parameter obtaining module 404 is configured to obtain a security zone width corresponding to the device model information in a preset configuration table, and obtain a bang width corresponding to the device model information in a preset registry.
And a second parameter obtaining module 406, configured to obtain a screen size of the terminal device.
And the screen adapting module 408 is configured to adapt the screen security zone of the terminal device according to the security zone width, the bang width, and the screen size.
And a screen filling module 410, configured to fill the screen special-shaped area of the terminal device.
In one embodiment, the screen adaptation module 408 is further configured to calculate anchor point information based on the width of the bang and the screen size; and carrying out adaptation processing on the screen security zone of the terminal equipment according to the anchor point information.
In one embodiment, the screen filling module 410 is further configured to create a black picture with the width of the bang being the width and the height of the screen being the height in the screen size according to the anchor point information; and filling the special-shaped area of the screen of the terminal equipment according to the black picture.
In one embodiment, the above apparatus further comprises:
the first parameter obtaining module 404 is further configured to identify whether a security zone width corresponding to the device model information exists in the preset configuration table; if the device type information exists, the width of a safety zone corresponding to the device type information is obtained;
and the system interface module is used for calling a preset engine interface if the device type information does not exist, and acquiring the width of the safety zone corresponding to the device type information.
In one embodiment, the above apparatus further comprises:
the first parameter obtaining module 404 is further configured to identify whether a bang width corresponding to the device model information exists in the preset registry; if the information exists, acquiring the width of the bang corresponding to the equipment model information;
and the system interface module is used for calling the preset engine interface if the system interface module does not exist, and acquiring the bang width corresponding to the equipment model information.
In one embodiment, the device model obtaining module 402 is further configured to obtain device model information of the terminal device when detecting that the target application is started; or when the target application program is detected to be installed completely, acquiring the device model information of the terminal device.
In one embodiment, the above apparatus further comprises: the configuration table generating module is used for determining the width of the corresponding safety zone according to the preset equipment model; and storing key values of the preset equipment model and the corresponding safety zone width to generate a preset configuration table.
For the specific definition of the screen adapting device, reference may be made to the definition of the screen adapting method above, and details are not described here. The various modules in the screen adapting apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a screen adaptation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
acquiring equipment model information of terminal equipment;
acquiring the width of a safety area corresponding to the equipment model information in a preset configuration table, and acquiring the width of the bang corresponding to the equipment model information in a preset registry;
acquiring the screen size of the terminal equipment;
according to the width of the security zone, the width of the bang and the size of the screen, carrying out adaptation processing on the screen security zone of the terminal equipment;
and filling the special-shaped area of the screen of the terminal equipment.
In one embodiment, the processor, when executing the computer program, further performs the steps of: calculating anchor point information according to the width of the bang and the size of the screen; and carrying out adaptation processing on the screen security zone of the terminal equipment according to the anchor point information.
In one embodiment, the processor, when executing the computer program, further performs the steps of: according to the anchor point information, a black picture with the width of the Liuhai as the width and the height of the screen in the screen size as the height is newly built; and filling the special-shaped area of the screen of the terminal equipment according to the black picture.
In one embodiment, the processor, when executing the computer program, further performs the steps of: identifying whether a safety zone width corresponding to the equipment model information exists in a preset configuration table or not; if the device type information exists, the width of a safety zone corresponding to the device type information is obtained; if not, calling a preset engine interface to acquire the width of the safety zone corresponding to the equipment model information.
In one embodiment, the processor, when executing the computer program, further performs the steps of: identifying whether the bang width corresponding to the equipment model information exists in a preset registry; if the information exists, acquiring the width of the bang corresponding to the equipment model information; if not, calling a preset engine interface to acquire the width of the bang corresponding to the equipment model information.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the target application program is detected to be started, acquiring equipment model information of the terminal equipment; or when the target application program is detected to be installed completely, acquiring the device model information of the terminal device.
In one embodiment, the processor, when executing the computer program, further performs the steps of: determining the width of a corresponding safety zone according to a preset device model; and storing key values of the preset equipment model and the corresponding safety zone width to generate a preset configuration table.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring equipment model information of terminal equipment;
acquiring the width of a safety area corresponding to the equipment model information in a preset configuration table, and acquiring the width of the bang corresponding to the equipment model information in a preset registry;
acquiring the screen size of the terminal equipment;
according to the width of the security zone, the width of the bang and the size of the screen, carrying out adaptation processing on the screen security zone of the terminal equipment;
and filling the special-shaped area of the screen of the terminal equipment.
In one embodiment, the computer program when executed by the processor further performs the steps of: calculating anchor point information according to the width of the bang and the size of the screen; and carrying out adaptation processing on the screen security zone of the terminal equipment according to the anchor point information.
In one embodiment, the computer program when executed by the processor further performs the steps of: according to the anchor point information, a black picture with the width of the Liuhai as the width and the height of the screen in the screen size as the height is newly built; and filling the special-shaped area of the screen of the terminal equipment according to the black picture.
In one embodiment, the computer program when executed by the processor further performs the steps of: identifying whether a safety zone width corresponding to the equipment model information exists in a preset configuration table or not; if the device type information exists, the width of a safety zone corresponding to the device type information is obtained; if not, calling a preset engine interface to acquire the width of the safety zone corresponding to the equipment model information.
In one embodiment, the computer program when executed by the processor further performs the steps of: identifying whether the bang width corresponding to the equipment model information exists in a preset registry; if the information exists, acquiring the width of the bang corresponding to the equipment model information; if not, calling a preset engine interface to acquire the width of the bang corresponding to the equipment model information.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the target application program is detected to be started, acquiring equipment model information of the terminal equipment; or when the target application program is detected to be installed completely, acquiring the device model information of the terminal device.
In one embodiment, the computer program when executed by the processor further performs the steps of: determining the width of a corresponding safety zone according to a preset device model; and storing key values of the preset equipment model and the corresponding safety zone width to generate a preset configuration table.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A screen adaptation method, comprising:
acquiring equipment model information of terminal equipment;
acquiring the width of a safety zone corresponding to the equipment model information in a preset configuration table, and acquiring the width of the bang corresponding to the equipment model information in a preset registry;
acquiring the screen size of the terminal equipment;
according to the width of the safety area, the width of the bang and the size of the screen, carrying out adaptation processing on the screen safety area of the terminal equipment;
and filling the special-shaped area of the screen of the terminal equipment.
2. The method of claim 1, wherein the adapting the screen security zone of the terminal device according to the security zone width, the bang width, and the screen size comprises:
calculating anchor point information according to the width of the bang and the size of the screen;
and carrying out adaptation processing on the screen safety area of the terminal equipment according to the anchor point information.
3. The method according to claim 2, wherein the filling of the screen shaped area of the terminal device comprises:
according to the anchor point information, a black picture with the width of the bang as the width and the height of the screen in the screen size as the height is newly built;
and filling the special-shaped area of the screen of the terminal equipment according to the black picture.
4. The method of claim 1, further comprising:
identifying whether a safety zone width corresponding to the equipment model information exists in the preset configuration table or not;
if the device type information exists, the width of a safety zone corresponding to the device type information is obtained;
if not, calling a preset engine interface to acquire the width of the safety zone corresponding to the equipment model information.
5. The method of claim 1, further comprising:
identifying whether the bang width corresponding to the equipment model information exists in the preset registry;
if the information exists, acquiring the width of the bang corresponding to the equipment model information;
if not, calling a preset engine interface to acquire the width of the bang corresponding to the equipment model information.
6. The method of claim 1, wherein the obtaining of the device model information of the terminal device comprises:
when the target application program is detected to be started, acquiring equipment model information of the terminal equipment; or,
and when the target application program is detected to be installed, acquiring the equipment model information of the terminal equipment.
7. The method according to any one of claims 1 to 6, wherein before the obtaining of the device model information of the terminal device, the method further comprises:
determining the width of a corresponding safety zone according to a preset device model;
and storing key values of the preset equipment model and the corresponding safety zone width to generate a preset configuration table.
8. A screen adapting device, the device comprising:
the device model acquisition module is used for acquiring the device model information of the terminal device;
the first parameter acquisition module is used for acquiring the width of a safety area corresponding to the equipment model information in a preset configuration table and acquiring the width of a bang corresponding to the equipment model information in a preset registry;
the second parameter acquisition module is used for acquiring the screen size of the terminal equipment;
the screen adaptation module is used for adapting the screen safety area of the terminal equipment according to the width of the safety area, the width of the bang and the size of the screen;
and the screen filling module is used for filling the screen special-shaped area of the terminal equipment.
9. A computer device comprising a memory and a processor, the memory storing a computer program operable on the processor, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111065982.9A CN113867672A (en) | 2021-09-10 | 2021-09-10 | Screen adaptation method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111065982.9A CN113867672A (en) | 2021-09-10 | 2021-09-10 | Screen adaptation method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113867672A true CN113867672A (en) | 2021-12-31 |
Family
ID=78995336
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111065982.9A Pending CN113867672A (en) | 2021-09-10 | 2021-09-10 | Screen adaptation method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113867672A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110874177A (en) * | 2018-08-29 | 2020-03-10 | 中兴通讯股份有限公司 | Display method of display screen, electronic equipment and storage medium |
CN111190672A (en) * | 2019-12-20 | 2020-05-22 | 深圳市优必选科技股份有限公司 | UI (user interface) adaptation method of electronic equipment, electronic equipment and storage medium |
CN111198629A (en) * | 2018-11-19 | 2020-05-26 | 青岛海信移动通信技术股份有限公司 | Method for processing touch operation by mobile terminal and mobile terminal |
CN111258704A (en) * | 2020-02-20 | 2020-06-09 | 腾讯科技(深圳)有限公司 | Application screen display method and device, storage medium and electronic device |
CN111552530A (en) * | 2020-04-22 | 2020-08-18 | 北京赤金智娱科技有限公司 | Terminal screen adapting method, device and equipment for user interface |
CN111949360A (en) * | 2020-09-01 | 2020-11-17 | 网易(杭州)网络有限公司 | User interface adaptation method and device, electronic equipment and storage medium |
CN112019891A (en) * | 2020-08-28 | 2020-12-01 | 北京达佳互联信息技术有限公司 | Multimedia content display method and device, terminal and storage medium |
-
2021
- 2021-09-10 CN CN202111065982.9A patent/CN113867672A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110874177A (en) * | 2018-08-29 | 2020-03-10 | 中兴通讯股份有限公司 | Display method of display screen, electronic equipment and storage medium |
CN111198629A (en) * | 2018-11-19 | 2020-05-26 | 青岛海信移动通信技术股份有限公司 | Method for processing touch operation by mobile terminal and mobile terminal |
CN111190672A (en) * | 2019-12-20 | 2020-05-22 | 深圳市优必选科技股份有限公司 | UI (user interface) adaptation method of electronic equipment, electronic equipment and storage medium |
CN111258704A (en) * | 2020-02-20 | 2020-06-09 | 腾讯科技(深圳)有限公司 | Application screen display method and device, storage medium and electronic device |
CN111552530A (en) * | 2020-04-22 | 2020-08-18 | 北京赤金智娱科技有限公司 | Terminal screen adapting method, device and equipment for user interface |
CN112019891A (en) * | 2020-08-28 | 2020-12-01 | 北京达佳互联信息技术有限公司 | Multimedia content display method and device, terminal and storage medium |
CN111949360A (en) * | 2020-09-01 | 2020-11-17 | 网易(杭州)网络有限公司 | User interface adaptation method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110020323B (en) | Page switching method and system for hybrid application, computer equipment and storage medium | |
CN108376094B (en) | Notification message display method and device, computer equipment and storage medium | |
CN111079263A (en) | Building main body structure generation method and device, computer equipment and storage medium | |
CN105573787A (en) | Software upgrade method and device based on vehicular T-Box | |
CN111459541B (en) | Application program packaging method and device, computer equipment and storage medium | |
CN108304243B (en) | Interface generation method and device, computer equipment and storage medium | |
CN109375972B (en) | Method, apparatus, computer device and storage medium for multi-element layout | |
CN111949360A (en) | User interface adaptation method and device, electronic equipment and storage medium | |
CN111767002B (en) | Page display method, device, equipment and storage medium | |
EP3822757A1 (en) | Method and apparatus for setting background of ui control | |
CN112306368A (en) | Method and device for expanding user data partition by EMMC (enhanced multi-media card) | |
CN110908655B (en) | Skin changing method, device, computer equipment and readable storage medium | |
CN113867672A (en) | Screen adaptation method and device, computer equipment and storage medium | |
CN110929249B (en) | Screen recording method, device, equipment and storage medium for automatic test | |
CN110032390B (en) | Method for realizing multi-model co-upgrade package, storage medium and intelligent terminal | |
CN108320315A (en) | View switching method, device, computer equipment and storage medium | |
CN112261639A (en) | SIM card function configuration method, device, terminal equipment and storage medium | |
CN108876713B (en) | Mapping method and device of two-dimensional template image, terminal equipment and storage medium | |
CN111427652B (en) | Display method, device, medium and computer equipment of custom button | |
CN115756222A (en) | Application program skin changing method and device, computer equipment and storage medium | |
CN111563955A (en) | Building model monomer visualization method, terminal and storage medium | |
CN110134475B (en) | Method and device for displaying interface parameter configuration, computer equipment and storage medium | |
CN110148190B (en) | Meteorological image correction method, device, computer equipment and storage medium | |
CN111190574B (en) | Method, device, equipment and storage medium for selecting options of multi-stage linkage assembly | |
CN116071482A (en) | Vehicle effect generation method and device, storage medium and equipment thereof |
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 |