CN108519894A - A kind of method of music box load initialization - Google Patents

A kind of method of music box load initialization Download PDF

Info

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
Application number
CN201810233080.3A
Other languages
Chinese (zh)
Other versions
CN108519894B (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.)
Beijing Kuwo Technology Co Ltd
Original Assignee
Beijing Kuwo 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 Beijing Kuwo Technology Co Ltd filed Critical Beijing Kuwo Technology Co Ltd
Priority to CN201810233080.3A priority Critical patent/CN108519894B/en
Publication of CN108519894A publication Critical patent/CN108519894A/en
Application granted granted Critical
Publication of CN108519894B publication Critical patent/CN108519894B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

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

A kind of method of music box load initialization
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.
CN201810233080.3A 2018-03-21 2018-03-21 Music box loading initialization method Active CN108519894B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
刘威: ""基于Android平台的智能家居客户端应用软件设计与实现"", 《中国优秀硕士学位论文全文数据库》 *

Cited By (5)

* Cited by examiner, † Cited by third party
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
US10671357B2 (en) Preview changes to mobile applications at different display resolutions
CN109085965A (en) Take down notes generation method, electronic equipment and computer storage medium
CN103793138A (en) Mobile terminal and method for displaying background applications
CN108986016A (en) Image beautification method, device and electronic equipment
CN105988860A (en) Method for executing application program and mobile device
US20110167388A1 (en) Electronic device and method of browsing images thereon
CN103064516A (en) Page turning method and device
CN103238131B (en) Display device, display packing and program
CN106982249A (en) Multithreading segmentation method for down loading, equipment, client device and electronic equipment
CN110119515A (en) A kind of interpretation method, device, terminal and readable storage medium storing program for executing
CN106371700A (en) Determining method for interface display contents and mobile terminal
CN104899038A (en) Interface style transformation 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
CN103927078B (en) A kind of information processing method and electronic equipment
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
US20160246761A1 (en) Method for quickly inserting wordart in pdf document
CN111190523A (en) Interface processing method, terminal and computer readable storage medium
CN111927242B (en) Window pushing device and window opening and closing method
CN108052369A (en) A kind of text control in android system

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