CN108519894A - A kind of method of music box load initialization - Google Patents
A kind of method of music box load initialization Download PDFInfo
- Publication number
- CN108519894A CN108519894A CN201810233080.3A CN201810233080A CN108519894A CN 108519894 A CN108519894 A CN 108519894A CN 201810233080 A CN201810233080 A CN 201810233080A CN 108519894 A CN108519894 A CN 108519894A
- Authority
- CN
- China
- Prior art keywords
- animation
- picture
- load
- music box
- initialization
- 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
Links
Classifications
-
- 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/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Processing Or Creating Images (AREA)
Abstract
The present invention relates to a kind of methods of music box load initialization, include the following steps:Step 1, definition load frame class CommonLoadingView;Step 2, picture variable is defined, including:Background picture mBackgroud, logo picture mCenter;Step 3, word variable mMessageTextView is defined;Step 4, the collection object mAnimatorSet of animation is defined;Step 5, it is loaded into load initialization topology file Loading, obtains picture control and word control;Step 6, animation is opened.The present invention, pass through self-defined general charging assembly, it only needs two small pictures that load animation can be realized, reduces the picture resource and installation kit size of application, while reducing memory, after further optimization, when in layout using load frame, when hiding, it can also be automatically stopped animation, effectively save memory and system resource are easy to the exploitation and maintenance of APP.
Description
Technical field
The present invention relates to music box technical field, specifically a kind of method of music box load initialization.
Background technology
Existing music box App, will present load animation upon actuation, which is presented the state in load, by multiple
The frame animation of picture and Android are realized, are counted the resource for the different colours for changing skin in, have been added up 40 plurality of pictures, ability
Construct the load animation of music box.
It is cumbersome that this causes picture resource to make, and installation kit refers to greatly, and memory and overhead are high, are unfavorable for the exploitation of App
And it safeguards.
Invention content
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of sides of music box load initialization
Method only needs two small pictures that load animation can be realized, reduces the picture resource of application by self-defined general charging assembly
With installation kit size, while memory is reduced, after further optimization, when in layout using load frame, when hiding,
It can be automatically stopped animation, effectively save memory and system resource, be easy to the exploitation and maintenance of APP.
To achieve the above objectives, the technical solution adopted by the present invention is that:
A kind of method of music box load initialization, which is characterized in that include the following steps:
Step 1, definition load frame class CommonLoadingView inherits the FrameLayout frame cloth that Android system provides
Office;
Step 2, picture variable is defined, including:Background picture mBackgroud, logo picture mCenter, is android systems
The Element Variable for the ImageView types provided of uniting;
Step 3, word variable mMessageTextView is defined, the TextView components that Android system provides are inherited;
Step 4, the collection object mAnimatorSet of animation is defined, the AnimatorSet types that Android system provides are inherited
Object;
The playing sequence of animation is specified in the collection object mAnimatorSet of animation:Be performed simultaneously for several objects or
Sequence executes;
Step 5, it is loaded into load initialization topology file Loading, obtains picture control and word control;
Step 6, animation is opened.
Based on the above technical solution, an external interface is provided, the word that user specifies is received, when being used for step 3
Text importing when modification load.
Based on the above technical solution, in step 5, the API of the load layout of Android system offer is called
LayoutInflater.from obtains system resource from the context context of current page,
The topology file R.layout.item_loading finished writing in advance is called, background picture, logo are set in topology file
The display of picture and word,
Resource picture is obtained using the context of Android system offer,
Using the power function setImageDrawable of ImageView controls, resource picture is loaded in topology file.
Based on the above technical solution, in step 6, the class ObjectAnimator for executing attribute animation is called, is referred to
Surely the method ofFloat for needing to execute the control of animation, and being provided using attribute animation, completes the attribute of specified animation,
The attribute of affiliated specified animation is:Rotation, scaling, translation or gradual change.
Based on the above technical solution, in step 6, default background picture mBackgroud specifies rotation rotations
Animation, from 0 ° of rotation to 360 °,
Giving tacit consent to logo pictures mCenter specifies scaleX and scaleY to scale animation, is zoomed in and out in x-axis and y-axis, pantograph ratio
Example is expanded to original size from 0.6 times of original size, zooms to 1.6 times of original size again later,
Above-mentioned rotation animation and scaling animation acquiescence is performed simultaneously.
Based on the above technical solution, in step 6, animation is set using the attribute initAnimation of animation
Execute the interpolation device and/or animation number of repetition of time and/or animation.
Based on the above technical solution, the interpolation device of default animation is linear interpolator LinearInterpolator,
Indicate that animation is linear change.
Based on the above technical solution, load frame class CommonLoadingView is added to window, opens animation
Realization starts to execute animation, is executed in load window onAttachedToWindow readjustments,
Correspondingly, executing stops animation in removing window onDetachedFromWindow readjustments.
Based on the above technical solution, the readjustment dispatchVisibilityChanged changed by visibility
In, it according to display or hides, opening and closing animation is arranged.
The method of music box load initialization of the present invention is only needed two small by self-defined general charging assembly
Load animation can be realized in picture, reduces the picture resource and installation kit size of application, while reducing memory, further excellent
After change, when in layout using load frame, when hiding, it can also be automatically stopped animation, effectively save memory and system money
Source is easy to the exploitation and maintenance of APP.
Description of the drawings
The present invention has following attached drawing:
The flow chart of Fig. 1 present invention.
Specific implementation mode
Below in conjunction with attached drawing, invention is further described in detail.
As shown in Figure 1, the method for music box load initialization of the present invention, includes the following steps:
Step 1, definition load frame class CommonLoadingView inherits the FrameLayout frame cloth that Android system provides
Office;
Step 2, picture variable is defined, including:Background picture mBackgroud, logo picture mCenter, is android systems
The Element Variable for the ImageView types provided of uniting;
Step 3, word variable mMessageTextView is defined, the TextView components that Android system provides are inherited;
Step 4, the collection object mAnimatorSet of animation is defined, the AnimatorSet types that Android system provides are inherited
Object;
The playing sequence of animation is specified in the collection object mAnimatorSet of animation:Be performed simultaneously for several objects or
Sequence executes;
Step 5, it is loaded into load initialization topology file Loading, obtains picture control and word control;
Step 6, animation is opened.
Based on the above technical solution, an external interface is provided, the word that user specifies is received, when being used for step 3
Text importing when modification load.
Based on the above technical solution, in step 5, the API of the load layout of Android system offer is called
LayoutInflater.from obtains system resource from the context context of current page,
The topology file R.layout.item_loading finished writing in advance is called, background picture, logo are set in topology file
The display of picture and word,
Resource picture is obtained using the context of Android system offer,
Using the power function setImageDrawable of ImageView controls, resource picture is loaded in topology file.
It includes on mBackgroud and mCenter thereby to realize picture.
Based on the above technical solution, in step 6, the class ObjectAnimator for executing attribute animation is called, is referred to
Surely the method ofFloat for needing to execute the control of animation, and being provided using attribute animation, completes the attribute of specified animation,
The attribute of affiliated specified animation is:Rotation, scaling, translation or gradual change.
Based on the above technical solution, in step 6, default background picture mBackgroud specifies rotation rotations
Animation, from 0 ° of rotation to 360 °,
Giving tacit consent to logo pictures mCenter specifies scaleX and scaleY to scale animation, is zoomed in and out in x-axis and y-axis, pantograph ratio
Example is expanded to original size from 0.6 times of original size, zooms to 1.6 times of original size again later,
Above-mentioned rotation animation and scaling animation acquiescence is performed simultaneously.
Based on the above technical solution, in step 6, animation is set using the attribute initAnimation of animation
Execute the interpolation device and/or animation number of repetition of time and/or animation.
Based on the above technical solution, the interpolation device of default animation is linear interpolator LinearInterpolator,
Indicate that animation is linear change.
Based on the above technical solution, load frame class CommonLoadingView is added to window, opens animation
Realization starts to execute animation, is executed in load window onAttachedToWindow readjustments,
Correspondingly, executing stops animation in removing window onDetachedFromWindow readjustments.
It can prevent from expending resource, occupy cpu.
Based on the above technical solution, the readjustment dispatchVisibilityChanged changed by visibility
In, it according to display or hides, opening and closing animation is arranged.
The content not being described in detail in this specification belongs to the prior art well known to professional and technical personnel in the field.
Claims (9)
1. a kind of method of music box load initialization, which is characterized in that include the following steps:
Step 1, definition load frame class CommonLoadingView inherits the FrameLayout frame cloth that Android system provides
Office;
Step 2, picture variable is defined, including:Background picture mBackgroud, logo picture mCenter, is android systems
The Element Variable for the ImageView types provided of uniting;
Step 3, word variable mMessageTextView is defined, the TextView components that Android system provides are inherited;
Step 4, the collection object mAnimatorSet of animation is defined, the AnimatorSet types that Android system provides are inherited
Object;
The playing sequence of animation is specified in the collection object mAnimatorSet of animation:Be performed simultaneously for several objects or
Sequence executes;
Step 5, it is loaded into load initialization topology file Loading, obtains picture control and word control;
Step 6, animation is opened.
2. the method for music box load initialization as described in claim 1, it is characterised in that:One external interface is provided, is received
The word that user specifies is used for text importing when modification load when step 3.
3. the method for music box load initialization as described in claim 1, it is characterised in that:In step 5, android is called
The API LayoutInflater.from for the load layout that system provides, obtain system from the context context of current page
System resource,
The topology file R.layout.item_loading finished writing in advance is called, background picture, logo are set in topology file
The display of picture and word,
Resource picture is obtained using the context of Android system offer,
Using the power function setImageDrawable of ImageView controls, resource picture is loaded in topology file.
4. the method for music box load initialization as described in claim 1, it is characterised in that:In step 6, calls and execute attribute
The class ObjectAnimator of animation, method that is specified to need to execute the control of animation, and being provided using attribute animation
OfFloat completes the attribute of specified animation,
The attribute of affiliated specified animation is:Rotation, scaling, translation or gradual change.
5. the method for music box load initialization as claimed in claim 4, it is characterised in that:In step 6, default background picture
MBackgroud specifies rotation to rotate animation, from 0 ° of rotation to 360 °,
Giving tacit consent to logo pictures mCenter specifies scaleX and scaleY to scale animation, is zoomed in and out in x-axis and y-axis, pantograph ratio
Example is expanded to original size from 0.6 times of original size, zooms to 1.6 times of original size again later,
Above-mentioned rotation animation and scaling animation acquiescence is performed simultaneously.
6. the method for music box load initialization as claimed in claim 4, it is characterised in that:In step 6, the category of animation is utilized
Property initAnimation setting animations the interpolation device and/or animation number of repetition for executing time and/or animation.
7. the method for music box load initialization as claimed in claim 6, it is characterised in that:The interpolation device of default animation is line
Property interpolation device LinearInterpolator, indicate animation be linear change.
8. the method for music box load initialization as described in claim 1, it is characterised in that:Load frame class
CommonLoadingView is added to window, opens animation realization and starts to execute animation, is in load window
It is executed in onAttachedToWindow readjustments,
Correspondingly, executing stops animation in removing window onDetachedFromWindow readjustments.
9. the method for music box load initialization as claimed in claim 8, it is characterised in that:The readjustment changed by visibility
In dispatchVisibilityChanged, according to display or hide, opening and closing animation is arranged.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810233080.3A CN108519894B (en) | 2018-03-21 | 2018-03-21 | Music box loading initialization method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810233080.3A CN108519894B (en) | 2018-03-21 | 2018-03-21 | Music box loading initialization method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108519894A true CN108519894A (en) | 2018-09-11 |
CN108519894B CN108519894B (en) | 2021-06-01 |
Family
ID=63433827
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810233080.3A Active CN108519894B (en) | 2018-03-21 | 2018-03-21 | Music box loading initialization method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108519894B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110881139A (en) * | 2019-10-10 | 2020-03-13 | 深圳创维-Rgb电子有限公司 | Display method and display device of boot animation and computer equipment |
CN112596829A (en) * | 2020-12-15 | 2021-04-02 | 平安普惠企业管理有限公司 | Lottie-based prompt box generation method and device, electronic equipment and storage medium |
CN112672198A (en) * | 2020-12-14 | 2021-04-16 | 海看网络科技(山东)股份有限公司 | EPG (electronic program guide) special-shaped graph assembly and display method thereof |
CN113448642A (en) * | 2020-03-11 | 2021-09-28 | 成都鼎桥通信技术有限公司 | System file access method and device and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20010035859A1 (en) * | 2000-05-08 | 2001-11-01 | Kiser Willie C. | Image based touchscreen device |
CN103699398A (en) * | 2012-09-27 | 2014-04-02 | 联想(北京)有限公司 | Terminal equipment and starting control method thereof |
CN104090787A (en) * | 2014-06-25 | 2014-10-08 | 可牛网络技术(北京)有限公司 | Starting method and starting device for home page of application software |
CN105979340A (en) * | 2016-06-07 | 2016-09-28 | Tcl集团股份有限公司 | Boot video playing method and device |
US20170132829A1 (en) * | 2015-11-05 | 2017-05-11 | Adobe Systems Incorporated | Method For Displaying and Animating Sectioned Content That Retains Fidelity Across Desktop and Mobile Devices |
-
2018
- 2018-03-21 CN CN201810233080.3A patent/CN108519894B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20010035859A1 (en) * | 2000-05-08 | 2001-11-01 | Kiser Willie C. | Image based touchscreen device |
CN103699398A (en) * | 2012-09-27 | 2014-04-02 | 联想(北京)有限公司 | Terminal equipment and starting control method thereof |
CN104090787A (en) * | 2014-06-25 | 2014-10-08 | 可牛网络技术(北京)有限公司 | Starting method and starting device for home page of application software |
US20170132829A1 (en) * | 2015-11-05 | 2017-05-11 | Adobe Systems Incorporated | Method For Displaying and Animating Sectioned Content That Retains Fidelity Across Desktop and Mobile Devices |
CN105979340A (en) * | 2016-06-07 | 2016-09-28 | Tcl集团股份有限公司 | Boot video playing method and device |
Non-Patent Citations (1)
Title |
---|
刘威: ""基于Android平台的智能家居客户端应用软件设计与实现"", 《中国优秀硕士学位论文全文数据库》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110881139A (en) * | 2019-10-10 | 2020-03-13 | 深圳创维-Rgb电子有限公司 | Display method and display device of boot animation and computer equipment |
CN113448642A (en) * | 2020-03-11 | 2021-09-28 | 成都鼎桥通信技术有限公司 | System file access method and device and electronic equipment |
CN113448642B (en) * | 2020-03-11 | 2022-11-15 | 成都鼎桥通信技术有限公司 | System file access method and device and electronic equipment |
CN112672198A (en) * | 2020-12-14 | 2021-04-16 | 海看网络科技(山东)股份有限公司 | EPG (electronic program guide) special-shaped graph assembly and display method thereof |
CN112596829A (en) * | 2020-12-15 | 2021-04-02 | 平安普惠企业管理有限公司 | Lottie-based prompt box generation method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108519894B (en) | 2021-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108519894A (en) | A kind of method of music box load initialization | |
US8984428B2 (en) | Overlay images and texts in user interface | |
CN109085965A (en) | Take down notes generation method, electronic equipment and computer storage medium | |
US20180349107A1 (en) | Preview Changes To Mobile Applications At Different Display Resolutions | |
CN103793138A (en) | Mobile terminal and method for displaying background applications | |
CN106055190A (en) | Apparatus and method for providing information via portion of display | |
CN105988860A (en) | Method for executing application program and mobile device | |
CN104462516B (en) | A kind of information cuing method and mobile terminal | |
CN106982249A (en) | Multithreading segmentation method for down loading, equipment, client device and electronic equipment | |
CN104899038A (en) | Interface style transformation method and device | |
CN108235104B (en) | Live video floating window playing method for mobile terminal | |
CN106033412B (en) | A kind of text conversion method and device | |
CN107688382A (en) | The method and apparatus for controlling the display of terminal | |
CN106126111A (en) | A kind of file moving method, device and terminal unit | |
WO2018223593A1 (en) | Method and device for presenting segment view, and user terminal | |
US11232616B2 (en) | Methods and systems for performing editing operations on media | |
AU2019266078B2 (en) | System for displaying electronic mail metadata and related methods | |
US10592087B1 (en) | System and method for creating fluid design keyframes on graphical user interface | |
CN103761047A (en) | Method and device for opening instruction book relevant to application and intelligent terminal | |
CN103984580B (en) | DBP configuration files and supervising device collocation method, supervising device | |
CN106649208A (en) | Text halo method and system for UI in U3D | |
US20160246761A1 (en) | Method for quickly inserting wordart in pdf document | |
CN109960559A (en) | The message window management method and relevant apparatus of end application | |
CN108052369A (en) | A kind of text control in android system | |
CN111814087B (en) | Dynamic layout method and device of Web window, electronic equipment and readable 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |