CN106557326A - A kind of mask layout method to set up and system - Google Patents

A kind of mask layout method to set up and system Download PDF

Info

Publication number
CN106557326A
CN106557326A CN201611068509.5A CN201611068509A CN106557326A CN 106557326 A CN106557326 A CN 106557326A CN 201611068509 A CN201611068509 A CN 201611068509A CN 106557326 A CN106557326 A CN 106557326A
Authority
CN
China
Prior art keywords
control
reminded
layout
effect control
mask layout
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.)
Granted
Application number
CN201611068509.5A
Other languages
Chinese (zh)
Other versions
CN106557326B (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201611068509.5A priority Critical patent/CN106557326B/en
Publication of CN106557326A publication Critical patent/CN106557326A/en
Application granted granted Critical
Publication of CN106557326B publication Critical patent/CN106557326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a kind of mask layout method to set up, is related to computer interface technical field, the object of PhoneWindow in being included in the page, is obtained;The object of adaptation layout layer is obtained in the object of PhoneWindow;Used in the object of adaptation layout layer, addview functions add the object of mask layout.Present invention addview functions used in the object of the adaptation layout layer in the object of PhoneWindow add the object of mask layout, and mask layout is applicable to various types of page layouts.The invention also discloses a kind of mask layout arranges system.

Description

A kind of mask layout method to set up and system
Technical field
The present invention relates to computer interface technical field, and in particular to a kind of mask layout method to set up and system.
Background technology
When certain is initially opened in Android system and applying, apply and mask can be ejected on some interfaces, for guiding Or instruction user some apply central key operation, or some more hiding user mutual logics, such as instruction user one The operation that a little length touch the button, or some complicated gesture operations.
But each there are multiple pages using central, the page for showing mask is needed also to have multiple, but due to each page The layout in face is different, so when mask is arranged, the different mask of each different page customization is both for, and in the page Add corresponding mask layout in the layout of face.Its defect is that autgmentability is very poor, because product need the page is modified When, the mask of the page must be modified together, and corresponding mask layout will also be changed.When one application mask compared with When many, all corresponding mask layout work amounts are quite big for change, expend substantial amounts of manpower and time.
The content of the invention
For defect present in prior art, it is an object of the invention to provide a kind of mask layout method to set up and being System, can easily add the mask layout for being common to various page layouts.
To reach object above, the present invention is adopted the technical scheme that:A kind of mask layout method to set up, its feature exist In:
The object of PhoneWindow is obtained in the page;
The object of adaptation layout layer is obtained in the object of PhoneWindow;
Used in the object of adaptation layout layer, addview functions add the object of mask layout.
On the basis of above-mentioned technical proposal, adaptation layout layer is obtained by the corresponding id of object of the adaptation layout layer Object.
On the basis of above-mentioned technical proposal, after adding the object of mask layout in the page, in the object of mask layout In be a control additive effect control to be reminded.
On the basis of above-mentioned technical proposal, it is a control additive effect control to be reminded in the object of mask layout Process include:
The object of its layout parameter is created in the object of mask layout;
Obtain coordinate of the effect control in screen;
By the object of the coordinate in screen of the effect control incoming layout parameter;
The object of the object and layout parameter of the addview functions additive effect control used in the object of mask layout.
On the basis of above-mentioned technical proposal, coordinate of the effect control in screen includes abscissa and vertical coordinate, The process for obtaining coordinate of the effect control in screen includes:By described to be reminded in the object of PhoneWindow The id of control obtains the object of the control to be reminded;The control to be reminded is obtained in the object of the control to be reminded to exist Abscissa and vertical coordinate in screen, then obtains the width and height of the control to be reminded, calculates the control to be reminded The abscissa and vertical coordinate at part center;Width and height of the effect control in screen are obtained in the object of effect control Degree, the width and altimeter according to the centre coordinate and the effect control of the control to be reminded in screen calculate the effect The abscissa and vertical coordinate of fruit control.
On the basis of above-mentioned technical proposal, the abscissa at the control center to be reminded is equal to the control to be reminded Width of the abscissa plus 1/2nd control described to be reminded;The vertical coordinate at the control center to be reminded is equal to described treating The vertical coordinate of control is reminded plus the height of 1/2nd control described to be reminded.
On the basis of above-mentioned technical proposal, the abscissa of the effect control is equal to the center of the control to be reminded Abscissa deducts the width of 1/2nd effect control;The vertical coordinate of the effect control is equal to the control to be reminded Center vertical coordinate deduct 1/2nd the effect control height.
On the basis of above-mentioned technical proposal, a control to be reminded can add multiple effect controls.
The invention also discloses a kind of mask layout arranges system, including:
Mask layout add module, for the object for obtaining PhoneWindow in the page;In the right of PhoneWindow As the middle object for obtaining adaptation layout layer;Used in the object of adaptation layout layer, addview functions addition mask layout is right As;
Effect control add module, for the object of its layout parameter is created in the object of mask layout;Obtain described Coordinate of the effect control in screen;By the object of the coordinate of the effect control incoming layout parameter;In the right of mask layout The object of the object and layout parameter of the addview functions additive effect control as used in.
On the basis of above-mentioned technical proposal, a control to be reminded can add multiple effect controls.
Compared with prior art, it is an advantage of the current invention that:
(1) present invention obtains the object of adaptation layout layer in the object of PhoneWindow;In the object of adaptation layout layer Used in addview functions add mask layout object, due to android application in each page be to pass through What the object of PhoneWindow was shown, therefore used in the object of the adaptation layout layer in the object of PhoneWindow Addview functions add the object of mask layout, and mask layout is applicable to various types of page layouts.
(2) when a control to be reminded in mask is provided with effect control, its cloth is created in the object of mask layout The object of office's parameter;By the object of the coordinate of effect control incoming layout parameter;The addview used in the object of mask layout The object of the object and layout parameter of function additive effect control.When the position of control to be reminded changes, its effect control The coordinate of part also can change therewith automatically, need not be realized by the location logic of change effect control.Even if changed to wait to carry Awake control, still need not change effect control location logic, it is only necessary to the id of control to be reminded is replaced with and new waits to carry The corresponding ID of awake control.
Description of the drawings
Fig. 1 is the schematic flow sheet of mask layout method to set up in the embodiment of the present invention;
It in the embodiment of the present invention is a control to be reminded in mask layout method to set up in the object of mask layout that Fig. 2 is The schematic flow sheet of part additive effect control;
Fig. 3 is the structural representation of mask layout setting system in the embodiment of the present invention.
Specific embodiment
The present invention is described in further detail below in conjunction with drawings and Examples.
Shown in Figure 1, the embodiment of the present invention provides a kind of mask layout method to set up, comprises the following steps:
S101, the getWindow () function used in the page is obtaining the object of PhoneWindow;
S102, the findViewById functions used in the object of PhoneWindow obtain the object of adaptation layout layer;
S103, used in the object of adaptation layout layer, addview functions add the object of mask layout.
WindowManager is an important service in Android.Entirely the windowing mechanism of android system is exactly Serviced based on WindowManager.The operation of user is translated into instruction by WindowManager services, and transmission is presented on interface On each window.PhoneWindow is that a kind of of WindowManager services is encapsulated, each page in android applications Face is all shown by its PhoneWindow object.That is, the layout of each page is exactly finally to load in fact It is shown in windowmanager services, and windowmanager services needs one Root View of addition to be shown, And the layout of the page needs to be carried in Root View by adaptation layer.If so mask can be added in adaptation layer, only needed The layout is adapted to by adaptation layer just can be so that mask layout be applicable to various types of page layouts.
FindViewById functions obtain the object of adaptation layout layer by the corresponding id of the object for being adapted to layout layer.Id is fixed Justice is a static constant Window.ID_ANDROID_CONTENT.
It is shown in Figure 2, after adding the object of mask layout in the page, wait to carry for one in the object of mask layout Awake control additive effect control.Its process includes:
S201, creates the object of its layout parameter in the object of mask layout;
S202, obtains coordinate of the effect control in screen;
S203, by leftMargin functions and topMargin functions by the coordinate of effect control incoming layout parameter Object;
S204, the object and layout parameter of the addview functions additive effect control used in the object of mask layout Object.
When a control to be reminded in mask is provided with effect control, its layout is created in the object of mask layout and is joined Several objects;By the object of the coordinate of effect control incoming layout parameter;The addview functions used in the object of mask layout The object of the object and layout parameter of additive effect control.When the position of control to be reminded changes, its effect control Coordinate also can change therewith automatically, need not be realized by the location logic of change effect control.Even if having changed to be reminded Control, still need not change effect control location logic, it is only necessary to the id of control to be reminded is replaced with new to be reminded The corresponding ID of control.
Coordinate of the effect control in screen includes abscissa and vertical coordinate, obtains coordinate of the effect control in screen Process includes:
(1) the findViewById functions used in the object of PhoneWindow are obtained by the id of control to be reminded and are treated Remind the object of control;
(2) the getLocationOnScreen functions used in the object of control to be reminded obtain control to be reminded in screen Abscissa and vertical coordinate in curtain, then obtains the width of control to be reminded by getWidth functions and getHeight functions And height, calculate the abscissa and vertical coordinate at control center to be reminded;The abscissa at control center to be reminded is equal to be reminded Width of the abscissa of control plus 1/2nd control to be reminded;The vertical coordinate at control center to be reminded is equal to control to be reminded Height of the vertical coordinate of part plus 1/2nd control to be reminded.
(3) the getWidth functions used in the object of effect control and getHeight functions obtain effect control in screen Width and height in curtain, the width and altimeter according to the centre coordinate and effect control of control to be reminded in screen are calculated The abscissa and vertical coordinate of effect control.
The abscissa of effect control is equal to the effect control that the abscissa at the center of control to be reminded deducts 1/2nd Width;The vertical coordinate of effect control is equal to the height that the vertical coordinate at the center of control to be reminded deducts 1/2nd effect control Degree.One control to be reminded can add multiple effect controls.
It is shown in Figure 3, the invention also discloses a kind of mask layout arranges system, including:
Mask layout add module, obtains the right of PhoneWindow for the getWindow () function used in the page As;The findViewById functions used in the object of PhoneWindow obtain the object of adaptation layout layer;In adaptation layout layer Object used in addview functions add mask layout object.
Effect control add module, for the object of its layout parameter is created in the object of mask layout;Obtain effect Coordinate of the control in screen;By leftMargin functions and topMargin functions by the coordinate of effect control incoming layout The object of parameter;The object and layout parameter of the addview functions additive effect control used in the object of mask layout it is right As.One control to be reminded can add multiple effect controls.
The present invention is not limited to above-mentioned embodiment, for those skilled in the art, without departing from On the premise of the principle of the invention, some improvements and modifications can also be made, these improvements and modifications are also considered as the protection of the present invention Within the scope of.The content not being described in detail in this specification belongs to prior art known to professional and technical personnel in the field.

Claims (10)

1. a kind of mask layout method to set up, it is characterised in that:
The object of PhoneWindow is obtained in the page;
The object of adaptation layout layer is obtained in the object of PhoneWindow;
Used in the object of adaptation layout layer, addview functions add the object of mask layout.
2. a kind of mask layout method to set up as claimed in claim 1, it is characterised in that:By the right of the adaptation layout layer As corresponding id obtains the object of adaptation layout layer.
3. a kind of mask layout method to set up as claimed in claim 1, it is characterised in that:Add mask layout in the page After object, it is a control additive effect control to be reminded in the object of mask layout.
4. a kind of mask layout method to set up as claimed in claim 3, it is characterised in that:It is one in the object of mask layout The process of individual control additive effect control to be reminded includes:
The object of its layout parameter is created in the object of mask layout;
Obtain coordinate of the effect control in screen;
By the object of the coordinate in screen of the effect control incoming layout parameter;
The object of the object and layout parameter of the addview functions additive effect control used in the object of mask layout.
5. a kind of mask layout method to set up as claimed in claim 4, it is characterised in that:The effect control is in screen Coordinate includes abscissa and vertical coordinate, and the process for obtaining coordinate of the effect control in screen includes:
The object of the control to be reminded is obtained in the object of PhoneWindow by the id of the control to be reminded;
Abscissa and vertical coordinate of the control to be reminded in screen are obtained in the object of the control to be reminded, is then obtained The width and height of the control to be reminded are obtained, the abscissa and vertical coordinate at the control center to be reminded is calculated;
Width and height of the effect control in screen are obtained in the object of effect control, according to the control to be reminded Width and altimeter in screen of centre coordinate and the effect control calculate the abscissa and vertical seat of the effect control Mark.
6. a kind of mask layout method to set up as claimed in claim 5, it is characterised in that:The horizontal stroke at the control center to be reminded Coordinate is equal to the width of the abscissa plus 1/2nd control described to be reminded of the control to be reminded;The control to be reminded The vertical coordinate at part center is equal to the height of the vertical coordinate plus 1/2nd control described to be reminded of the control to be reminded.
7. a kind of mask layout method to set up as claimed in claim 5, it is characterised in that:Abscissa of the effect control etc. Abscissa in the center of the control to be reminded deducts the width of 1/2nd effect control;The effect control Vertical coordinate is equal to the height that the vertical coordinate at the center of the control to be reminded deducts 1/2nd effect control.
8. a kind of mask layout method to set up as claimed in claim 3, it is characterised in that:One control to be reminded can add many Individual effect control.
9. a kind of mask layout arranges system, it is characterised in that include:
Mask layout add module, for the object for obtaining PhoneWindow in the page;In the object of PhoneWindow Obtain the object of adaptation layout layer;Used in the object of adaptation layout layer, addview functions add the object of mask layout;
Effect control add module, for the object of its layout parameter is created in the object of mask layout;Obtain the effect Coordinate of the control in screen;By the object of the coordinate of the effect control incoming layout parameter;In the object of mask layout Using the object of the object and layout parameter of addview function additive effect controls.
10. a kind of mask layout as claimed in claim 9 arranges system, it is characterised in that:One control to be reminded can add Multiple effect controls.
CN201611068509.5A 2016-11-25 2016-11-25 Method and system for setting layout of cover layer Active CN106557326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611068509.5A CN106557326B (en) 2016-11-25 2016-11-25 Method and system for setting layout of cover layer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611068509.5A CN106557326B (en) 2016-11-25 2016-11-25 Method and system for setting layout of cover layer

Publications (2)

Publication Number Publication Date
CN106557326A true CN106557326A (en) 2017-04-05
CN106557326B CN106557326B (en) 2020-01-03

Family

ID=58445156

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611068509.5A Active CN106557326B (en) 2016-11-25 2016-11-25 Method and system for setting layout of cover layer

Country Status (1)

Country Link
CN (1) CN106557326B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103970415A (en) * 2014-04-13 2014-08-06 数源科技股份有限公司 Method for achieving fade-in and fade-out effects based on Android
CN106033411A (en) * 2015-03-20 2016-10-19 广州金山移动科技有限公司 Object layout method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103970415A (en) * 2014-04-13 2014-08-06 数源科技股份有限公司 Method for achieving fade-in and fade-out effects based on Android
CN106033411A (en) * 2015-03-20 2016-10-19 广州金山移动科技有限公司 Object layout method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WHEATHUSKS: "Android页面中的引导蒙层的使用", 《HTTPS://BLOG.CSDN.NET/SHIHUIYUN/ARTICLE/DETAILS/52117760》 *
ZEXINGZHONG: "Android用户首次打开APP出现教学蒙层效果的实现", 《HTTPS://BLOG.CSDN.NET/SUNDAYZHONG/ARTICLE/DETAILS/46010739》 *

Also Published As

Publication number Publication date
CN106557326B (en) 2020-01-03

Similar Documents

Publication Publication Date Title
CN105740315B (en) The method of one kind of multiple screen response type page layout adjustment
CN110662710B (en) System and method for generating and configuring content for elevator destination dispatch kiosks
CN104182270A (en) Display method for enabling virtual machine interfaces to adapt to mobile terminal screens with different resolution ratios
CN101763234B (en) Method and device for simulating various screen resolutions
CN103279345B (en) Method and device for locking page element
CN104102679A (en) Method and device for displaying extension information area
CN111881662A (en) Form generation method, device, processing equipment and storage medium
CN104951311B (en) A kind of page animation method and device
CN104503769B (en) A kind of character pattern liquid crystal interface implementation method based on XML configuration file
US20150331584A1 (en) Use of style sets to assist a user in digitizing GIS layers
CN107515748A (en) Report Server Management interface creating method and file sharing method
CN105607800A (en) Method and device for input display of terminal screen
CN104750473A (en) Android system based writing superposition method
CN106779576A (en) A kind of collocation method of service fields
CN108241518A (en) It is visual to pull layout and intelligent template generation method and system
CN104063149A (en) Adjustable progress bar system and method
CN107436766A (en) The Processing Algorithm of self-defined shape progress bar under a kind of Mac
CN104572593A (en) Method, system and electronic device for processing letters
US9158452B2 (en) Early drawing system and method to improve touch screen response
CN106557326A (en) A kind of mask layout method to set up and system
CN101408843A (en) Method and apparatus for generating program menu
CN103795799B (en) A kind of long-distance monitoring method and system
CN103294461A (en) Method and system for realizing microlog background interface
CN103186506A (en) Method and system for adjusting character pair interval
CN108345579B (en) Self-defined report logic engine and method

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
GR01 Patent grant
GR01 Patent grant