The content of the invention
In view of the above problems, it is proposed that the present invention, overcome the problems referred to above or solve at least in part to provide one kind
The method and apparatus of the webpage zoom on electronic equipment of the problems referred to above.
According to one aspect of the present invention, there is provided the method for webpage scaling in a kind of electronic equipment, comprise the following steps:
Web displaying control is inherited, to build customization touch event method;Judge whether the operation to electronic equipment is to unclamp n touch
N-1 touch point in point and trigger touch event method, wherein n is the integer more than or equal to 2;In judged result for yes
In the case of, webpage word scaling is set to into the display scaling of web displaying control;From scaling manager object
Reflection arranges and enables scaling method to be called;And perform the touch event side of heritable web displaying control
Method.
Alternatively, it is in the method for webpage zoom on electronic equipment according to an embodiment of the invention, described by webpage text
The step of word scaling is set to the display scaling of web displaying control includes:In the operating system of electronic equipment it is
In the case of Android2.3.x or more older version, word scaling object is reflected from the web displaying control, and
The word scaling object is given by the value of the display scaling of web displaying control;Or in the operation of electronic equipment
In the case that system is Android4.0 or more redaction, word scaling pair is reflected from the scaling manager object
As, and the word scaling object is given by the value of the display scaling of web displaying control.
Alternatively, in the method for webpage zoom on electronic equipment according to an embodiment of the invention, judge right described
During whether the operation of electronic equipment is the step of touch event method is triggered in the n-1 touch point unclamped in n touch point, profit
Determine whether to unclamp in n touch point with ACTION_POINTER_UP objects or ACTION_POINTER_n_UP objects
N-1 touch point and trigger touch event method.
Alternatively, the method for webpage zoom on electronic equipment also includes step according to an embodiment of the invention:Described
Before the step of webpage word scaling is set to the display scaling of web displaying control, the behaviour of electronic equipment is judged
Make whether system is supported to scale handler object, in the case where not supporting, perform described by the setting of webpage word scaling
For web displaying control display scaling the step of and it is described from scaling manager object in reflection arrange and enable contracting
The step of ratio method is put to be called and perform the touch event method of heritable web displaying control;What is supported
In the case of, the step of perform the touch event method of the heritable web displaying control.
Alternatively, the method for webpage zoom on electronic equipment also includes step according to an embodiment of the invention:Described
Before the step of webpage word scaling is set to the display scaling of web displaying control, whether widescreen will be enabled clear
The value of object of looking at is set to false;And the reflection in the manager object from scaling is arranged and enables scaling method
After the step of to be called, whether enabled widescreen and browsed the value of object and be set to true.
Alternatively, in the method for webpage zoom on electronic equipment according to an embodiment of the invention, described from scaling
In the step of reflection is arranged and enables scaling method to be called in manager object, the parameter transmitted when calling includes
It is arranged to the webpage word scaling of the display scaling of web displaying control, allows text composition and allow strong
Text composition processed.
Alternatively, in the method for webpage zoom on electronic equipment according to an embodiment of the invention, the web displaying
Control is the WebView controls of android system, and the scaling manager object is mZoomManager objects, the scaling
Handler object is mListener objects, and the word scaling is to liking mTextWrapScale objects, the touch thing
Part method includes onTouchEvent methods and dispatchTouchEvent methods, and the setting simultaneously enables scaling side
Method is setZoomScale methods or setNewZoomScale methods, it is described whether enable widescreen browse to as if
SetUseWideViewPort objects.
According to another aspect of the present invention, there is provided the device of webpage scaling in a kind of electronic equipment, including:Customization is touched
Event methods build module, are suitable to inherit web displaying control, to build customization touch event method;Touch point judge module,
It is suitable to judge whether the operation to electronic equipment is to unclamp n-1 touch point in n touch point to trigger touch event method,
Wherein n is the integer more than or equal to 2;Webpage word scaling setup module, is suitable in judged result as in the case of being,
Webpage word scaling is set to into the display scaling of web displaying control;Scaling calling module, is suitable to from contracting
Reflection in putting manager object arranges and enables scaling method to be called;And touch event method performing module,
It is adapted for carrying out the touch event method of heritable web displaying control.
Alternatively, in the device of webpage zoom on electronic equipment according to an embodiment of the invention, in electronic equipment
In the case that operating system is Android2.3.x or more older version, the webpage word scaling setup module is suitable to from institute
Word scaling object is reflected in stating web displaying control, and the value of the display scaling of web displaying control is given
The word scaling object;Or in the case where the operating system of electronic equipment is Android4.0 or more redaction,
The webpage word scaling setup module is suitable to reflect word scaling object from the scaling manager object, and
And the word scaling object is given by the value of the display scaling of web displaying control.
Alternatively, in the device of webpage zoom on electronic equipment according to an embodiment of the invention, the touch point is sentenced
Disconnected module is suitable to determine whether to unclamp n using ACTION_POINTER_UP objects or ACTION_POINTER_n_UP objects
N-1 touch point in individual touch point and trigger touch event method.
Alternatively, the device of webpage zoom on electronic equipment also includes according to an embodiment of the invention:Scaling processor
Judge module is supported, is suitable to webpage word scaling is set to webpage in the webpage word scaling setup module show
Before showing the display scaling of control, judge whether the operating system of electronic equipment is supported to scale handler object, do not propping up
In the case of holding, webpage word scaling is set to web displaying control by the webpage word scaling setup module
Scaling is shown, scaling calling module is arranged and enables scaling method to enter from reflection in scaling manager object
Row is called, and touch event method performing module performs the touch event method of heritable web displaying control;Supporting
In the case of, touch event method performing module performs the touch event method of the heritable web displaying control.
Alternatively, the device of webpage zoom on electronic equipment also includes according to an embodiment of the invention:Enable widescreen clear
Look at object setup module, be suitable to webpage word scaling is set to webpage in the webpage word scaling setup module
Before showing the display scaling of control, whether enabled widescreen and browsed the value of object and be set to false, and be suitable in institute
Scaling calling module is stated from after reflection is arranged and scaling method enabled to be called in scaling manager object,
Whether enabled widescreen and browsed the value of object and be set to true.
Alternatively, in the device of webpage zoom on electronic equipment according to an embodiment of the invention, in the pantograph ratio
Example calling module is reflected when arranging and enabling scaling method to be called from scaling manager object, is transmitted when calling
Parameter include being arranged to web displaying control display scaling webpage word scaling, allow text composition,
And allow to force text composition.
Alternatively, in the device of webpage zoom on electronic equipment according to an embodiment of the invention, the web displaying
Control is the WebView controls of android system, and the scaling manager object is mZoomManager objects, the scaling
Handler object is mListener objects, and the word scaling is to liking mTextWrapScale objects, the touch thing
Part method includes onTouchEvent methods and dispatchTouchEvent methods, and the setting simultaneously enables scaling side
Method is setZoomScale methods or setNewZoomScale methods, it is described whether enable widescreen browse to as if
SetUseWideViewPort objects.
The invention provides the method and apparatus that webpage is scaled in a kind of electronic equipment.Embodiments in accordance with the present invention, after
Web displaying control is held, to build customization touch event method, is judging that touch operation is to unclamp n-1 in n touch point
Touch point and in the case of triggering touch event method, webpage word scaling is set to into the display contracting of web displaying control
Ratio is put, and is arranged and scaling method is enabled to be called from reflection in scaling manager object, so as to not repair
Change browser or other pages show the kernel component of program(Such as the WebKit components of android system)On the premise of, realize
After page zoom-in and zoom-out again typesetting, make content tile to the function of whole screen, solving cannot display portion content because of amplification
Problem.And, embodiments of the invention are not supported to scale the electronic equipment of handler object for operating system, equally can
The function of typesetting again is realized after above-mentioned scaling, is so achieved that for the support of nearly all electronic equipment.Meanwhile, according to
Embodiments of the invention, the new features that the operating system of redaction can be made full use of to bring, such as using Android4.0 and
The function of hardware acceleration of more redaction, can significantly improve scaling speed, can also utilize Android4.0 and more redaction
The new features such as senior web page browsing feature.Further, since the core group of browser or other pages display programs need not be changed
Part, saves the memory space of electronic equipment, while it also avoid changing the risk that browser kernel component brings.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And can be practiced according to the content of description, and in order to allow the above and other objects of the present invention, feature and advantage can
Become apparent, below especially exemplified by the specific embodiment of the present invention.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure and should not be by embodiments set forth here
Limited.On the contrary, there is provided these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
Fig. 3 schematically illustrates the stream of the method 300 of webpage zoom on electronic equipment according to an embodiment of the invention
Cheng Tu.
The principle of the present invention is applied to any electronic equipment comprising display unit, including but not limited to:It is based on
The computer of the desktop operating systems such as Windows, Linux, Mac OS, Unix;Based on iOS, Android, Windows
The mobile phone of the Mobile operating systems such as Phone, Symbian, panel computer, video player, electronic reader, DPF
Etc..Hereinafter, by by taking the electronic equipment based on android system as an example, the principle of the present invention is exemplarily retouched
State.However, this is intended merely to the specific example description present invention, it is to help reader to understand the principle of the present invention, of the invention
Scope not limited to this, but go for any comprising display unit, the electronic equipment based on any operating system.
In the following description, " scale " and refer both to " zooming in or out ".
Embodiments in accordance with the present invention, web page contents not only can include word content, it is also possible to including picture, video etc.
Other contents.
As shown in figure 3, the method 300 of webpage zoom on electronic equipment starts from step according to an embodiment of the invention
S301, in step S301, inherits web displaying control, to build customization touch event method.
Embodiments in accordance with the present invention, the web displaying control can for example be the WebView controls of android system
Part, the scope of the present invention not limited to this, web displaying control can be any controls that can realize web displaying function, for example
UIWebView controls of iOS system etc..
Embodiments in accordance with the present invention, touch event method can for example be the onTouchEvent sides of android system
Method and/or dispatchTouchEvent methods, any touch operation of the user to a certain control, android system can all be touched
Touch place director's part of the control, onTouchEvent methods and dispatchTouchEvent methods one parameter of band are sent out, is used
To describe the situation of user's current touch, it is MotionEvent objects in android system, which is used for describing such as user
The quantity of current touch point, corresponding coordinate and the state for touching, such as " when mobile ", " when pressing ", " during release " etc..
Embodiments in accordance with the present invention, in above-mentioned steps S301, can generate an object, allow which to inherit web displaying
Control, to build the customization touch event method of their own, such as onTouchEvent methods and dispatchTouchEvent
Method.
After step S301, execution step S303, wherein, judge whether the operation to electronic equipment is to unclamp n to touch
N-1 touch point in touching a little and trigger touch event method, wherein n is the integer more than or equal to 2.
In case of n=2, i.e. assume Touch screen of the user with two fingers touch electronic equipments, wherein one
When root finger unclamps, touch place reason event methods will be triggered.
Embodiments in accordance with the present invention, in step S303, for android system, it is possible to use ACTION_
POINTER_UP objects or ACTION_POINTER_n_UP objects determine whether to unclamp n-1 touch in n touch point
Put and trigger touch event method.
Next, execution step S305, wherein, in the case of being to be in the judged result in step S303, by webpage text
Word scaling is set to the display scaling of web displaying control.
Embodiments in accordance with the present invention, in step S305, electronic equipment operating system be Android2.3.x or
In the case of more older version, word scaling object is reflected from the web displaying control, and by web displaying control
The value of display scaling give the word scaling object.
Embodiments in accordance with the present invention, for reflective operation, can adopt the reflection of the offers such as Java language .Net language
Method or object are temporarily become publicly-owned attribute from privately owned attribute, for directly using and changing being operated by mechanism.Ability
Field technique personnel it is understood that can equally adopt other programming languages, in a similar manner by method or object from
Privately owned attribute temporarily becomes publicly-owned attribute, to reach the purpose of reflective operation.
In addition, for android system, can be obtained by obtaining Build.VERSION.SDK_INT objects
The version number of android system.
Embodiments in accordance with the present invention, in android system, the word scaling is to liking
MTextWrapScale objects.The word scaling object is given by the value of the display scaling of web displaying control,
That is, make word scaling object word scaling value be equal to web displaying control display scaling value.Its
In, word scaling refers to " web width "/" textwidth ", shows that scaling refers to " web width "/" screen width
Degree ".When the value of word scaling is equal to shows the value of scaling, textwidth is equal to web width, and the text is just
Can be displayed in full screen.For example, if word scaling is 2, and the display scaling of WebView controls is 1, is represented
The ratio of screen shared by word is 1/2;And if the displaying ratio of WebView controls and word scaling are 1, then it represents that
Screen proportion shared by word is 1/1, namely full screen display.Even if in addition, user is slided by touch operation in use
Word segment is removed screen by screen(The rightmost side is slided into for example, until word all removes screen), due to word pantograph ratio
Example is not changed in, therefore when word is slided by user by touch operation, once the left frame of word and electronic equipment screen
When the left frame of curtain aligns, then word must be paved with full frame.
In step S305, in the case where the operating system of electronic equipment is Android4.0 or more redaction, from institute
Word scaling object is reflected in stating scaling manager object, and the value of the display scaling of web displaying control is assigned
Give the word scaling object.Wherein, for android system, the scaling manager object can be
MZoomManager objects, the object directly or indirectly can be called by WebView controls, thus can be by zoom operations
From script just very complicated WebView controls detach out, become more independent module, and by WebView controls(Even
Other controls)It is used.Wherein, in Android2.3.x or more older version, this java class is exactly WebView control classes,
That is WebView classes;And in Android3.0 and later version, directly use for WebView controls one of the object
The object of java class, the i.e. object of ZoomManager classes.
After step S305, can with execution step S307, wherein, from scaling manager object in reflection arrange and enable
Scaling method is to be called, and execution step S309, wherein performing the touch thing of heritable web displaying control
Part method.In addition, in the case that the judged result in step S303 is no, can directly perform above-mentioned steps S309, that is, hold
The touch event method of the heritable web displaying control of row.
Embodiments in accordance with the present invention, for android system, the setting simultaneously enables scaling method and can be
SetZoomScale methods or setNewZoomScale methods, and the parameter transmitted when calling in step S307 can include:
It is arranged to the webpage word scaling of the display scaling of web displaying control, allows text composition(It is set to
true), and allow force text composition(It is set to true).
Have invoked in step S307 after arranging and enabling scaling method, it is possible to execution step S109, i.e. hold
The touch event method of the heritable web displaying control of row, i.e., original touch event method, for android system,
The onTouchEvent methods and dispatchTouchEvent methods of its parent are called exactly.This way it is possible to realize page
Reduction of area put after again typesetting, make content tile to the function of whole screen.
Fig. 4 schematically illustrates webpage contracting on the electronic equipment comprising each optional step according to an embodiment of the invention
The flow chart of the method put.Each optional step in method 100 is described below in conjunction with Fig. 4.
As shown in figure 4, alternatively, embodiments in accordance with the present invention, the method 300 of the webpage zoom on electronic equipment is also
Step S304 can be included:Before step S305, judge whether the operating system of electronic equipment is supported to scale handler object.
For android system, the scaling handler object can be mListener objects, this pair as if be directed to
A certain control zooms in and out the module called during operation, the mListener of android system to as if scaling processor class-
The object of OnScaleGestureListener classes, which includes scaling start method, scaling process approach and the scaling side of completing
Method, for mListener objects, they are respectively onScaleBegin methods, onScale methods and onScaleEnd side
Method.By taking the scene that user is zoomed in and out using two fingers in the Touch screen of electronic equipment as an example, when user prepares double finger
During scaling, namely when user puts down double fingers and starts to drag, call the scaling start method of scaling handler object;In user
During scaling, the scaling process approach of scaling handler object is called;Double fingers are unclamped in user, when indication scaling is completed,
Call the scaling Method Of Accomplishment of scaling handler object.Each supports that the control of scaling can be realized at one's own scaling
Reason device object, WebView controls are one.
As shown in figure 4, in step s 304, in the case where being judged as not supporting, above-mentioned steps S305, step can be performed
Rapid S307 and step S309, will webpage word scaling be set to the display scaling of web displaying control, and
Arrange and scaling method is enabled to be called from reflection in scaling manager object, and perform heritable webpage show
Show the touch event method of control.
And in the case where being judged as supporting, as shown in figure 4, can be directly in execution step S309 execution it is described by after
The step of touch event method of the web displaying control for holding.
As shown in figure 4, alternatively, embodiments in accordance with the present invention, the method 300 of the webpage zoom on electronic equipment is also
Step S304 can be included ':Before step S305, whether enabled widescreen and browsed the value of object and be set to false.For
Android system, the widescreen that whether enables are browsed to liking setUseWideViewPort objects, and its value is present in
WebView control setup modules(WebSettings objects in android system)In, by step S304 ' in operation,
The user after displaying ratio is amplified can be avoided to move webpage by the screen of touch electronic equipment.
As shown in figure 4, alternatively, embodiments in accordance with the present invention, the method 300 of the webpage zoom on electronic equipment is also
Step S308 can be included:In step S307 from scaling manager object in reflection arranging and enable scaling method with
After the step of being called, whether enabled widescreen and browsed the value of object and be set to true.By the operation of step S308, can
To recover the function of webpage is moved by touch operation after word again typesetting.
As shown in figure 4, further optionally, the method 300 of the webpage zoom on electronic equipment above-mentioned steps S303 it
Before, the step of whether quantity for judging current touch point is more than 1 S302-1 can also be included and judge whether webpage supports contracting
The step of playing function S302-2, in the two steps, if the judged result of any of which step is no, just do not do further
Process, the step of the touch event method of the execution heritable web displaying control in direct execution step S309.
Alternatively, judge that the step of whether webpage supports zoom function S302-2 can be realized in the following way:Can be with
Obtain WebView control setup modules(WebSettings objects in android system)In " whether support scaling " become
Amount, the variable are Boolean, if true, then it represents that support, if false, then it represents that do not support zoom function, terminate this and sentence
Disconnected step;" the minimum zoom ratio of current web page " object and " the maximum contracting of current web page are reflected from scaling manager object
Put ratio " object with complete obtain operation, they in android system be respectively mMinZoomScale objects and
MMaxZoomScale objects.Under normal circumstances, in the source code of webpage(It is invisible to user)In, some is understood for accusing
Know the scaling scope of the webpage, the value is underground under normal circumstances, therefore need to obtain by reflecting;It is then possible to compare
It is whether equal with the value of " the maximum zoom ratio of current web page " object compared with the value of " the minimum zoom ratio of current web page " object,
If equal, false is directly returned, represent that the webpage does not support zoom function, if unequal, return true, represent " whether
The value of support zoom function " variable is true, webpage support zoom function.
The invention provides the method that webpage is scaled in a kind of electronic equipment.Embodiments in accordance with the present invention, inherit webpage
Control is shown, to build customization touch event method, is judging that touch operation is to unclamp n-1 touch point in n touch point
And in the case of triggering touch event method, webpage word scaling is set to into the display pantograph ratio of web displaying control
Example, and arrange and enable scaling method to be called from reflection in scaling manager object, so as to not change clear
Look at device or other pages show the kernel component of programs(Such as the WebKit components of android system)On the premise of, realize the page
After scaling again typesetting, make the content tile to the function of whole screen, solve because amplification cannot display portion content ask
Topic.And, embodiments of the invention are not supported to scale the electronic equipment of handler object for operating system, can equally realize
Again the function of typesetting after above-mentioned scaling, is so achieved that for the support of nearly all electronic equipment.Meanwhile, according to this
Bright embodiment, the new features that the operating system of redaction can be made full use of to bring, such as using Android4.0 and renewal
The function of hardware acceleration of version, can significantly improve scaling speed, can also utilize the senior of Android4.0 and more redaction
The new features such as web page browsing feature.Further, since the kernel component of browser or other pages display programs, section need not be changed
The memory space of the sub- equipment of power saving, while it also avoid changing the risk that browser kernel component brings.
It is corresponding with above-mentioned method 300, present invention also offers the device 500 that webpage is scaled in a kind of electronic equipment.
Fig. 5 schematically illustrates the block diagram of the device 500 of webpage zoom on electronic equipment according to an embodiment of the invention.
Referring to Fig. 5, the device 500 of the webpage zoom on electronic equipment is main to include that customization touch event method builds mould
Block 501, touch point judge module 503, webpage word scaling setup module 505, scaling calling module 507, and
Touch event method performing module 509.
Embodiments in accordance with the present invention, customization touch event method build module 501 and are suitable to inherit web displaying control, with
Build customization touch event method;Touch point judge module 503 is suitable to judge whether the operation to electronic equipment is to unclamp n to touch
N-1 touch point in touching a little and trigger touch event method, wherein n is the integer more than or equal to 2;Webpage word pantograph ratio
Example setup module 505 is suitable in judged result, in the case of being, webpage word scaling to be set to web displaying control
Display scaling;Scaling calling module 507 is suitable to from reflection in scaling manager object arrange and enable pantograph ratio
Example method is being called;Touch event method performing module 509 is adapted for carrying out the touch thing of heritable web displaying control
Part method.
Embodiments in accordance with the present invention, first, customization touch event method builds module 501 and inherits web displaying control,
To build customization touch event method.
Embodiments in accordance with the present invention, the web displaying control can for example be the WebView controls of android system
Part, the scope of the present invention not limited to this, web displaying control can be any controls that can realize web displaying function, for example
UIWebView controls of iOS system etc..
Embodiments in accordance with the present invention, touch event method can for example be the onTouchEvent sides of android system
Method and/or dispatchTouchEvent methods, any touch operation of the user to a certain control, android system can all be touched
Touch place director's part of the control, onTouchEvent methods and dispatchTouchEvent methods one parameter of band are sent out, is used
To describe the situation of user's current touch, it is MotionEvent objects in android system, which is used for describing such as user
The quantity of current touch point, corresponding coordinate and the state for touching, such as " when mobile ", " when pressing ", " during release " etc..
Embodiments in accordance with the present invention, customization touch event method build module 501 and can generate an object, allow its after
Hold web displaying control, to build the customization touch event method of their own, for example onTouchEvent methods and
DispatchTouchEvent methods.
Subsequently, touch point judge module 503 judges whether the operation to electronic equipment is to unclamp the n-1 in n touch point
Individual touch point and trigger touch event method, wherein n is the integer more than or equal to 2.
In case of n=2, i.e. assume Touch screen of the user with two fingers touch electronic equipments, wherein one
When root finger unclamps, touch place reason event methods will be triggered.
Embodiments in accordance with the present invention, for android system, touch point judge module 503 can utilize ACTION_
POINTER_UP objects or ACTION_POINTER_n_UP objects determine whether to unclamp n-1 touch in n touch point
Put and trigger touch event method.
Next, in the case where touch point judge module 503 is judged as YES, webpage word scaling setup module
The 505 display scalings that webpage word scaling is set to web displaying control.
Embodiments in accordance with the present invention, in the situation that the operating system of electronic equipment is Android2.3.x or more older version
Under, webpage word scaling setup module 505 reflects word scaling object from the web displaying control, and will
The value of the display scaling of web displaying control gives the word scaling object.
Embodiments in accordance with the present invention, for reflective operation, webpage word scaling setup module 505 can be adopted
Method or object are temporarily become public affairs from privately owned attribute being operated by the reflex mechanism of the offers such as Java language .Net language
There is attribute, for directly using and changing.It will be appreciated by those skilled in the art that webpage word scaling setup module 505
Other programming languages can be equally adopted, in a similar manner method or object is temporarily become from privately owned attribute publicly-owned
Attribute, to reach the purpose of reflective operation.
In addition, for android system, webpage word scaling setup module 505 can be by obtaining
Build.VERSION.SDK_INT objects are obtaining the version number of android system.
Embodiments in accordance with the present invention, in android system, the word scaling is to liking
MTextWrapScale objects.Webpage word scaling setup module 505 is by the display scaling of web displaying control
Value gives the word scaling object, i.e. make the value of the word scaling of word scaling object aobvious equal to webpage
Show the value of the display scaling of control.Wherein, word scaling refers to " web width "/" textwidth ", shows scaling
Ratio refers to " web width "/" screen width ".When the value of word scaling is equal to shows the value of scaling, text width
Degree is equal to web width, and the text just can be displayed in full screen.For example, if word scaling is 2, and WebView
The display scaling of control is 1, represents that the ratio of screen shared by word is 1/2;And if the displaying ratio of WebView controls
1 is with word scaling, then it represents that screen proportion shared by word is 1/1, namely full screen display.Even if in addition, user exists
Word segment is removed by screen by touch operation slip screen during use(For example slide into the rightmost side, until word it is complete
Portion removes screen), as word scaling is not changed in, therefore when word is slided by user by touch operation, one
When the left frame of denier word is alignd with the left frame of electronic equipment screen, then word must be paved with full frame.
In the case where the operating system of electronic equipment is Android4.0 or more redaction, webpage word scaling sets
Put module 505 word scaling object is reflected from the scaling manager object, and by the display of web displaying control
The value of scaling gives the word scaling object.Wherein, for android system, the scaling manager object
Can be mZoomManager objects, the object directly or indirectly can be called by WebView controls, thus will can be contracted
Put operation to detach out from script just very complicated WebView controls, become more independent module, and controlled by WebView
Part(Or even other controls)It is used.Wherein, in Android2.3.x or more older version, this java class is exactly WebView
Control class, i.e. WebView classes;And in Android3.0 and later version, the object is directly used for WebView controls
The object of one java class, the i.e. object of ZoomManager classes.
Afterwards, scaling calling module 507 is arranged and enables scaling method from reflection in scaling manager object
To be called, and touch event method performing module 509 performs the touch event method of heritable web displaying control.
In addition, in the case where the judged result of touch point judge module 503 is no, touch event method performing module 509 can be straight
Connect the touch event method for performing heritable web displaying control.
Embodiments in accordance with the present invention, for android system, the setting simultaneously enables scaling method and can be
SetZoomScale methods or setNewZoomScale methods, and transmit when scaling calling module 507 is performed and called
Parameter can include:It is arranged to the webpage word scaling of the display scaling of web displaying control, allows word to arrange
Version(It is set to true), and allow force text composition(It is set to true).
After scaling calling module 507 have invoked and arrange and enable scaling method, touch event method is held
Row module 509 can just perform the touch event method of heritable web displaying control, i.e., original touch event method is right
In android system, that is, the onTouchEvent methods and dispatchTouchEvent methods for calling its parent.This
Sample, it is possible to after realizing page zoom-in and zoom-out again typesetting, make content tile to the function of whole screen.
Fig. 6 schematically illustrates webpage contracting on the electronic equipment comprising each optional module according to an embodiment of the invention
The block diagram of the device put.Below in conjunction with Fig. 6 and figure 4 above for each optional module of device 200 is described.
As shown in fig. 6, alternatively, embodiments in accordance with the present invention, the device 600 of the webpage zoom on electronic equipment is also
Can include that scaling processor supports judge module 604, be suitable to webpage in the webpage word scaling setup module 605
Before word scaling is set to the display scaling of web displaying control, judge whether the operating system of electronic equipment props up
Hold scaling handler object.
For android system, the scaling handler object can be mListener objects, this pair as if be directed to
A certain control zooms in and out the module called during operation, the mListener of android system to as if scaling processor class-
The object of OnScaleGestureListener classes, which includes scaling start method, scaling process approach and the scaling side of completing
Method, for mListener objects, they are respectively onScaleBegin methods, onScale methods and onScaleEnd side
Method.By taking the scene that user is zoomed in and out using two fingers in the Touch screen of electronic equipment as an example, when user prepares double finger
During scaling, namely when user puts down double fingers and starts to drag, call the scaling start method of scaling handler object;In user
During scaling, the scaling process approach of scaling handler object is called;Double fingers are unclamped in user, when indication scaling is completed,
Call the scaling Method Of Accomplishment of scaling handler object.Each supports that the control of scaling can be realized at one's own scaling
Reason device object, WebView controls are one.
In the case where scaling processor supports that judge module is judged as not supporting, webpage word scaling setup module
The 605 display scalings that webpage word scaling can be set to web displaying control, and scaling calls mould
Block 607 can be arranged and enable scaling method to be called from reflection in scaling manager object, and touch event
Method performing module 609 performs the touch event method of heritable web displaying control.
And in the case where scaling processor supports that judge module is judged as supporting, touch event method performing module 609
The touch event method of the heritable web displaying control can directly be performed.
As shown in fig. 6, alternatively, embodiments in accordance with the present invention, the device 600 of the webpage zoom on electronic equipment is also
Can include that enabling widescreen browses object setup module 604 ', being suitable to will in the webpage word scaling setup module 605
Before webpage word scaling is set to the display scaling of web displaying control, whether is enabled widescreen and browsed object
Value is set to false.For android system, the widescreen that whether enables is browsed to liking setUseWideViewPort pair
As its value is present in WebView control setup modules(WebSettings objects in android system)In, by enabling width
Screen browses this operation of object setup module 604 ', and the user after displaying ratio is amplified can be avoided to pass through to touch electronic equipment
Screen is moving webpage.
Alternatively, embodiments in accordance with the present invention, enable widescreen and browse object setup module 604 ' and be further adapted in the contracting
Ratio calling module 607 is put from after reflection is arranged and scaling method enabled to be called in scaling manager object,
Whether enabled widescreen and browsed the value of object and be set to true.This behaviour of object setup module 604 ' is browsed by enabling widescreen
Make, can recover the function of webpage is moved by touch operation after word again typesetting.
Further optionally, embodiments in accordance with the present invention, the touch point judge module 603 are being judged to electronic equipment
Operation be whether, before touch event method is triggered in the n-1 touch point unclamped in n touch point, can also to judge currently
The quantity of touch point whether more than 1, and judge whether webpage supports scaling, in this judges twice, if any of which time
Judged result be no, just further do not processed, touch event method performing module 609 just directly performs described succession
Web displaying control touch event method.
Alternatively, the touch point judge module 603 judges whether webpage supports that zoom function can be in the following way
Realize:The touch point judge module 603 can obtain WebView control setup modules(In android system
WebSettings objects)In " whether support scaling " variable, the variable is Boolean, if true, then it represents that supported, if
For false, then it represents that do not support zoom function, terminate the judgement;The touch point judge module 603 can be from scaling manager
" the minimum zoom ratio of current web page " object and " the maximum zoom ratio of current web page " object are reflected in object to complete to obtain
Extract operation, they are respectively mMinZoomScale objects and mMaxZoomScale objects in android system.Normal conditions
Under, in the source code of webpage(It is invisible to user)In, some is understood for informing the scaling scope of the webpage, the value
It is underground under normal circumstances, therefore need to obtain by reflecting;Then, the touch point judge module 603 can compare " current
Whether the value of the minimum zoom ratio of webpage " object is equal with the value of " the maximum zoom ratio of current web page " object, if equal,
False is then directly returned, represents that the webpage does not support zoom function, if unequal, returned true, represent " whether support contracting
The value of playing function " variable is true, webpage support zoom function.
Due to above-mentioned each equipment(Device)Embodiment is corresponding with aforementioned approaches method embodiment, therefore no longer to each device reality
Apply example to be described in detail.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together based on teaching in this.As described above, construct required by this kind of system
Structure be obvious.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to use it is various
Programming language realizes the content of invention described herein, and the description done to language-specific above is to disclose this
Bright preferred forms.
In description mentioned herein, a large amount of details are illustrated.It is to be appreciated, however, that the enforcement of the present invention
Example can be put into practice in the case where not having these details.In some instances, known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help understand one or more in each inventive aspect, exist
Above to, in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes
In example, figure or descriptions thereof.However, should the method for the disclosure be construed to reflect following intention:I.e. required guarantor
The more features of feature is expressly recited in each claim by the application claims ratio of shield.More precisely, such as following
Claims it is reflected as, inventive aspect is less than all features of single embodiment disclosed above.Therefore,
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself
All as the separate embodiments of the present invention.
Those skilled in the art are appreciated that can be carried out adaptively to the module in the device in embodiment
Change and they are arranged in one or more different from embodiment device.Can be some modules in embodiment
A module or unit or component are combined into, and multiple submodule or subelement or sub-component can be divided in addition.
In addition at least some in such feature and/or process or module is excluded each other, any combinations pair can be adopted
This specification(Including adjoint claim, summary and accompanying drawing)Disclosed in all features and so disclosed any method
Or all processes or unit of equipment are combined.Unless expressly stated otherwise, this specification(Will including adjoint right
Ask, make a summary and accompanying drawing)Disclosed in each feature can be by providing identical, equivalent or similar purpose alternative features replacing.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments
In some included features rather than further feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in detail in the claims, embodiment required for protection one of arbitrarily
Can in any combination mode using.
The present invention each device embodiment can be realized with hardware, or with one or more processor operation
Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor(DSP)To realize some or all moulds in device according to embodiments of the present invention
The some or all functions of block.The present invention is also implemented as performing a part for method as described herein or complete
The program of device in portion(For example, computer program and computer program).Such program for realizing the present invention can be stored
On a computer-readable medium, or can have one or more signal form.Such signal can be from the Internet
Download on website and obtain, or provide on carrier signal, or provided with any other form.
It should be noted that above-described embodiment the present invention will be described rather than limits the invention, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference markss between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not
Element listed in the claims or step.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can come real by means of the hardware for including some different elements and by means of properly programmed computer
It is existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and be run after fame
Claim.
Embodiment of the invention discloses that the method that webpage is scaled in A1. a kind of electronic equipment, comprises the following steps:Inherit
Web displaying control, to build customization touch event method;Judge whether the operation to electronic equipment is to unclamp in n touch point
N-1 touch point and trigger touch event method, wherein n is the integer more than or equal to 2;In the situation that judged result is yes
Under, webpage word scaling is set to into the display scaling of web displaying control;Reflect from scaling manager object
Arrange and enable scaling method to be called;And perform the touch event method of heritable web displaying control.
A2. the method as described in A1, wherein the display scaling that webpage word scaling is set to web displaying control
The step of include:It is in the case where the operating system of electronic equipment is Android2.3.x or more older version, aobvious from the webpage
Word scaling object is reflected in showing control, and the word is given by the value of the display scaling of web displaying control
Scaling object;Or in the case where the operating system of electronic equipment is Android4.0 or more redaction, from the contracting
Word scaling object is reflected in putting manager object, and institute is given by the value of the display scaling of web displaying control
State word scaling object.A3. the method as described in A1, wherein judging whether the operation to electronic equipment is release described
N-1 touch point in n touch point and the step of trigger touch event method in, using ACTION_POINTER_UP objects
Or ACTION_POINTER_n_UP objects determine whether the n-1 touch point unclamped in n touch point and trigger touch thing
Part method.A4. the method as described in any one of A1 to A3, also including step:Webpage word scaling is set described
Before the step of being set to the display scaling of web displaying control, judge whether the operating system of electronic equipment is supported at scaling
Reason device object, in the case where not supporting, performs the display that webpage word scaling is set to web displaying control
Reflection in the step of scaling and the manager object from scaling arranges and enables scaling method to be called
And the step of performing the touch event method of heritable web displaying control;In the case of support, perform it is described by after
The step of touch event method of the web displaying control for holding.A5. the method as described in any one of A1 to A3, also including step
Suddenly:Before the step of display scaling that webpage word scaling is set to web displaying control described, will be whether
Enable widescreen and browse the value of object and be set to false;And the reflection in the manager object from scaling is arranged and enables contracting
After the step of ratio method is put to be called, whether enabled widescreen and browsed the value of object and be set to true.A6. such as A1 extremely
Method described in any one of A3, wherein reflection is arranged and enables scaling method in the manager object from scaling
In the step of to be called, the parameter transmitted when calling includes the net of the display scaling for being arranged to web displaying control
Text composition is forced in page word scaling, permission text composition and permission.A7. as described in any one of A1 to A3
Method, wherein the web displaying control is the WebView controls of android system, the scaling manager object is
MZoomManager objects, the scaling handler object are mListener objects, and the word scaling is to liking
MTextWrapScale objects, the touch event method include onTouchEvent methods and dispatchTouchEvent
Method, the setting to enable scaling method be setZoomScale methods or setNewZoomScale methods are described to be
The no widescreen that enables is browsed to liking setUseWideViewPort objects.
Embodiments of the invention also disclose the device of webpage scaling in B8. a kind of electronic equipment, including:Customization touches thing
Part method builds module, is suitable to inherit web displaying control, to build customization touch event method;Touch point judge module, fits
In judging that whether the operation to electronic equipment is to unclamp n-1 touch point in n touch point to trigger touch event method, its
Middle n is the integer more than or equal to 2;Webpage word scaling setup module, is suitable in judged result, in the case of being, to incite somebody to action
Webpage word scaling is set to the display scaling of web displaying control;Scaling calling module, is suitable to from scaling
Reflection in manager object arranges and enables scaling method to be called;And touch event method performing module, fit
In the touch event method for performing heritable web displaying control.B9. the device as described in B8, wherein in the behaviour of electronic equipment
Make system in the case of Android2.3.x or more older version, the webpage word scaling setup module is suitable to from described
Word scaling object is reflected in web displaying control, and institute is given by the value of the display scaling of web displaying control
State word scaling object;Or in the case where the operating system of electronic equipment is Android4.0 or more redaction, institute
State webpage word scaling setup module to be suitable to reflect word scaling object from the scaling manager object, and
The word scaling object is given by the value of the display scaling of web displaying control.B10. the device as described in B8,
Wherein described touch point judge module is suitable to using ACTION_POINTER_UP objects or ACTION_POINTER_n_UP pair
Touch event method is triggered as determining whether the n-1 touch point unclamped in n touch point.B11. as in B8 to B10
Device described in any one, also includes:Scaling processor supports judge module, is suitable to arrange in the webpage word scaling
Before webpage word scaling is set to the display scaling of web displaying control by module, the operation of electronic equipment is judged
Whether system is supported to scale handler object, and in the case where not supporting, the webpage word scaling setup module is by net
Page word scaling is set to the display scaling of web displaying control, and scaling calling module from scaling management
In device object reflection arrange and enable scaling method to be called, and touch event method performing module perform by after
The touch event method of the web displaying control for holding;In the case of support, touch event method performing module performs the quilt
The touch event method of the web displaying control of succession.B12. the device as described in any one of B8 to B10, also includes:Open
Object setup module is browsed with widescreen, is suitable to set webpage word scaling in the webpage word scaling setup module
Before being set to the display scaling of web displaying control, whether enabled widescreen and browsed the value of object and be set to false, and
It is suitable to arrange and enable scaling method to carry out from reflection in scaling manager object in the scaling calling module
After calling, whether enabled widescreen and browsed the value of object and be set to true.B13. the dress as described in any one of B8 to B10
Put, wherein arranging and enabling scaling method to enter from reflection in scaling manager object in the scaling calling module
When row is called, the parameter transmitted when calling includes the webpage word scaling of the display scaling for being arranged to web displaying control
Text composition is forced in ratio, permission text composition and permission.B14. the device as described in any one of B8 to B10, wherein
The web displaying control is the WebView controls of android system, and the scaling manager object is mZoomManager pair
As the scaling handler object is mListener objects, and the word scaling is to liking mTextWrapScale pair
As the touch event method includes onTouchEvent methods and dispatchTouchEvent methods, and the setting is simultaneously
It is setZoomScale methods or setNewZoomScale methods to enable scaling method, and the widescreen that whether enables is browsed
To liking setUseWideViewPort objects.