CN103336655B - A kind of method controlling the switching of mobile phone horizontal/vertical screen - Google Patents
A kind of method controlling the switching of mobile phone horizontal/vertical screen Download PDFInfo
- Publication number
- CN103336655B CN103336655B CN201310251462.6A CN201310251462A CN103336655B CN 103336655 B CN103336655 B CN 103336655B CN 201310251462 A CN201310251462 A CN 201310251462A CN 103336655 B CN103336655 B CN 103336655B
- Authority
- CN
- China
- Prior art keywords
- mobile phone
- inclination angle
- angle value
- screen
- screen state
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 230000001133 acceleration Effects 0.000 claims abstract description 42
- 230000008569 process Effects 0.000 claims abstract description 12
- 238000012545 processing Methods 0.000 claims abstract description 5
- 230000001960 triggered effect Effects 0.000 claims abstract description 3
- 230000008859 change Effects 0.000 claims description 16
- 238000001514 detection method Methods 0.000 claims description 14
- 230000005484 gravity Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 206010044565 Tremor Diseases 0.000 description 1
- JZCCFEFSEZPSOG-UHFFFAOYSA-L copper(II) sulfate pentahydrate Chemical compound O.O.O.O.O.[Cu+2].[O-]S([O-])(=O)=O JZCCFEFSEZPSOG-UHFFFAOYSA-L 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Landscapes
- Telephone Function (AREA)
Abstract
The invention discloses a kind of method controlling the switching of mobile phone horizontal/vertical screen, comprise the steps: step one, read the inclination angle value of mobile phone current acceleration sensor, according to this inclination angle value, service layer judges that mobile phone is perpendicular screen state or transverse screen state;Step 2, starts gyroscope or the interrupt mode of acceleration transducer of mobile phone, interrupts if triggered, then send interrupt signal, and this interrupt signal is passed to service layer;Step 3, after service layer receives interrupt signal, obtains inclination angle value from acceleration transducer and processes;Step 4, carries out horizontal/vertical screen switching according to the inclination angle value after processing to mobile phone.After implementing the present invention, user can carry out the switching of horizontal/vertical screen by shaking way to mobile phone screen, and without purposely going to select horizontal/vertical screen state, reach the purpose of selection horizontal/vertical screen state quick, accurate, even if so in the case of lying on the back, lying on one's side, the horizontal/vertical screen state of mobile phone screen also can be selected easily.
Description
Technical field
The present invention relates to mobile phone screen display technical field, particularly to a kind of method controlling the switching of mobile phone horizontal/vertical screen.
Background technology
At present, mobile phone is provided with a switch controlling horizontal/vertical screen switching, i.e. " screen rotation " switch.If " screen
Curtain rotates " switch is set to cut out, then and mobile phone no matter which kind of state can be only in transverse screen or perpendicular screen interface;If
" screen rotation " switch is set to open, then work as remote holder by acceleration transducer or gyro sensor detection
The angle of inclination of the state of machine, i.e. mobile phone, thus control mobile phones transverse screen or the switching of perpendicular screen.But, at present
There are the following problems for this design: one is cannot to be constantly in transverse screen state, such as user at some nets
Page browsing interface, or photo checks interface, it is desirable to mobile phone can be made to be constantly in transverse screen state, but such as
Really mobile phone placed angle has deflected, and is just likely to be switched to perpendicular screen interface, if it is desired to be switched to transverse screen interface,
It is necessary for resetting transverse screen state;Two is when user lies on a bed and lies on one's side object for appreciation mobile phone when, the most anyhow
Screen switching mode is the most contrary with normal laying state.The horizontal/vertical screen testing mechanism of mobile phone is all based on quiet at present
State mode judges, i.e. detects the angle of inclination of mobile phone to regulate horizontal/vertical screen state, it is impossible to quickly, accurately
Ground selects horizontal/vertical screen state, it is impossible to solving user needs mobile phone screen to be constantly in transverse screen or perpendicular screen state
Problem, also cannot solve user and couch or be always maintained at mobile phone screen transverse screen or perpendicular screen shape under lateral position
The problem of state.
In the prior art, Chinese patent (publication number: CN102789322A) discloses rotation of screen picture
Method and system, itself mainly solving the technical problems that screen level place in the case of how according to screen
The direction rotated and angle rotate picture, thus realize picture transverse screen show with perpendicular screen show between automatic
Switching, and user cannot be solved and couching or under lateral position, be always maintained at mobile phone screen transverse screen or perpendicular screen shape
The problem of state.Chinese patent (publication number: CN102929406A) discloses mobile end panel under the pattern of couching
The method of curtain switching and mobile terminal thereof, although under the pattern of couching how it mainly solving the technical problems that
Switching mobile terminal screen, but its technical way used is current by gyro sensor detection
Angle value between attitude direction and reference attitude direction judges whether to switch horizontal/vertical screen display pattern, and this is also
The horizontal/vertical screen testing mechanism judging mobile terminal based on static mode, and cannot by dynamical fashion quickly,
Select horizontal/vertical screen state exactly.
Summary of the invention
It is an object of the invention to overcome the shortcoming of prior art, it is provided that a kind of shake by detection mobile phone is moved
The method made thus realize being switched fast mobile phone horizontal/vertical screen state.
The purpose of the present invention is achieved through the following technical solutions:
A kind of method controlling the switching of mobile phone horizontal/vertical screen, comprises the steps:
Step one, reads the inclination angle value of mobile phone current acceleration sensor, and service layer is according to this inclination angle
Angle value judges that mobile phone is perpendicular screen state or transverse screen state;
Step 2, starting gyroscope or the interrupt mode of acceleration transducer of mobile phone, interrupting if triggered,
Then send interrupt signal, and this interrupt signal is passed to service layer;
Step 3, after service layer receives interrupt signal, obtains inclination angle value from acceleration transducer
And process;
Step 4, carries out horizontal/vertical screen switching according to the inclination angle value after processing to mobile phone.
Preferably, according to this inclination angle value, the service layer described in step one judges that mobile phone is to erect screen state also
It is transverse screen state, specifically refers to when inclination angle value changes near 90 degree or 270 degree, it is judged that Mobile phone screen
Tentiform state is transverse screen state;When inclination angle value changes near 0 degree or 360 degree, it is judged that mobile phone screen
State is perpendicular screen state.
Preferably, the gyroscope of the mobile phone described in step 2 or the interrupt mode of acceleration transducer, specifically
Refer to after gyroscope detection angular velocity changes, or after acceleration transducer detection acceleration change, then touch
Send out interrupt mode.
Preferably, the change of described gyroscope detection angular velocity, specifically refer to when gyroscope detects x-axis value
Time bigger, represent and in the x-axis of now gyroscope, create bigger angular velocity, then this angular velocity is amassed
Point, detect its within the setting time, the amplitude of angle changing in x-axis, vary more than preset value when this angle,
X-axis has rotated over preset value the most in a short period of time, then it is assumed that mobile phone there occurs shake, now triggers
Interrupt mode.
Preferably, the change of described acceleration transducer detection acceleration, specifically refer to acceleration transducer and exist
In the time set, the acceleration change in its x-axis has exceeded preset value, then it is assumed that mobile phone there occurs shake,
Now trigger interrupt mode.
Preferably, from the service layer described in step 3 obtains inclination angle value from acceleration transducer and carries out
Reason, after specifically referring to obtain inclination angle value from acceleration transducer, adds and subtracts this inclination angle value
90 degree of process.
Preferably, described in step 4 according to process after inclination angle value mobile phone is carried out horizontal/vertical screen switching,
Specifically refer to when inclination angle value changes near 90 degree or 270 degree, it is judged that mobile phone screen state is transverse screen
State;When inclination angle value changes near 0 degree or 360 degree, it is judged that mobile phone screen state is perpendicular screen shape
State;After having judged, mobile phone screen is carried out the switching of corresponding state.
Hinge structure of the present invention has such advantages as and effect:
Under the horizontal/vertical screen state of existing mobile phone, detect mobile phone by gyroscope or acceleration transducer
Shake action, if shake action exceedes default threshold values, then makes mobile phone screen be switched to separately from current state
One state, thus realize quickly carrying out the switching of horizontal/vertical screen, after implementing the present invention, user can be by trembling
Flowing mode carries out the switching of horizontal/vertical screen to mobile phone screen, and without purposely going to select horizontal/vertical screen state, reaches
Quickly, the purpose of horizontal/vertical screen state is accurately selected, even if so in the case of lying on the back, lying on one's side, also may be used
The very convenient horizontal/vertical screen state selecting mobile phone screen quickly.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of a kind of method controlling the switching of mobile phone horizontal/vertical screen of the present invention.
Detailed description of the invention
Below in conjunction with embodiment and accompanying drawing, the present invention is described in further detail, but the embodiment party of the present invention
Formula is not limited to this.
Embodiment 1
As it is shown in figure 1, a kind of method controlling the switching of mobile phone horizontal/vertical screen of the present invention, comprise the steps:
Step one, reads the inclination angle value of mobile phone current acceleration sensor, and service layer is according to this inclination angle
Angle value judges that mobile phone is perpendicular screen state or transverse screen state.In the android system of mobile phone, sensor
Framework be service layer, hardware device level and driving layer, acceleration transducer or gyro the most successively
The data of instrument are all to drive layer to obtain, the most successively to upper layer transfers, be eventually transferred at service layer
Reason.And the inclination angle value of mobile phone also carries out computing acquisition in service layer.Acceleration transducer can be surveyed
Current acceleration of gravity at x, y, the component size on z-axis three axle, due to the vector side of acceleration of gravity
To being vertically downward, as long as learning x, the component of y, z, so that it may learn inclining of current phone screen
Rake angle.And the inclination angle value that service layer records especially by acceleration transducer is to judge that mobile phone is perpendicular screen
State or transverse screen state, when inclination angle value changes near 90 degree or 270 degree, it is judged that mobile phone screen
State is transverse screen state;When inclination angle value changes near 0 degree or 360 degree, it is judged that Mobile phone screen tentiform
State is perpendicular screen state.
Step 2, starts the interrupt mode of mobile phone gyroscope.When after gyroscope detection angular velocity change, then touch
Send out and interrupt, send interrupt signal, and this interrupt signal is passed to service layer.
Gyroscope is also called angular-rate sensor, can measure x, y, the z tri-angular velocity on axle, thus can
To learn x, y, the z tri-angle change on axle.When mobile phone is in perpendicular screen state, the angular velocity of three axles is all
Close to 0.When gyroscope detects that the x-axis value angular velocity more than preset value, i.e. x-axis is more than preset value, example
Such as 90 degrees second, then it represents that now x-axis creates shake.Specifically, within the detection setting time, such as
In 0.5 second, the angle of change in x-axis, is integrated this angular velocity, and integral process is: within every 0.05 second, obtain
One x-axis data (the x-axis data every time obtained all change), obtains 10 times (0.05 second × 10=0.5
Second), Δ t=0.05, the selected angle of x-axis in so can obtaining 0.5 second, when varying more than of this angle
Preset value, such as 45 degree, x-axis has rotated over 45 degree the most in a short period of time, then it is assumed that mobile phone is sent out
Give birth to shake, now trigger interrupt mode.
Step 3, after service layer receives interrupt signal, obtains inclination angle value from acceleration transducer,
Afterwards this inclination angle value is added and subtracted 90 degree of process.In the inclination angle value of acceleration transducer processes,
Typically be not related to negative value angle, need keep inclination angle value on the occasion of, when inclination angle value is negative value,
Need plus 180 degree.Specifically, the angle of inclination of current phone screen is 30 degree, when receiving interruption
After signal, carrying out adding 90 degree of process, the most now angle of inclination just becomes 120 degree;When carrying out subtracting 90 at degree
During reason, now angle of inclination becomes (30 degree of-90 degree+180 degree), then remain 120 degree.
Step 4, carries out horizontal/vertical screen switching according to the inclination angle value after processing to mobile phone.Work as inclination angle value
Near 90 degree or 270 degree during change, then mobile phone screen state is transverse screen state;When inclination angle value is 0
When degree or 360 degree of neighbouring changes, then mobile phone screen state is perpendicular screen state.Judge accordingly, nothing in step 3
Inclination angle value is added deduct 90 degree after processing by opinion, all draws 120 degree, then mobile phone screen is carried out transverse screen shape
State switches.
Embodiment 2
The present embodiment is same as in Example 1 in addition to following characteristics:
Step 2, starts the interrupt mode of mobile phone acceleration sensor.Interrupt mode supported by acceleration transducer,
We need to preset threshold values and the time value of interruption, in order to trigger interrupt mode.When acceleration transducer detects
After acceleration change, then trigger interruption, send interrupt signal, and this interrupt signal is passed to service layer.
Specifically, acceleration transducer can record x, and y, the z tri-accekeration on axle, when adding in x-axis
Velocity amplitude exceedes preset value, and such as 10mg(acceleration of gravity is 1g), the most this state continue for presetting
Time, such as 0.5 second, then it is assumed that mobile phone there occurs shake, now trigger interrupt mode.
Above-described embodiment is the present invention preferably embodiment, but embodiments of the present invention are not by above-mentioned reality
Execute the restriction of example, the change made under other any spirit without departing from the present invention and principle, modification,
Substitute, combine, simplify, all should be the substitute mode of equivalence, within being included in protection scope of the present invention.
Claims (3)
1. the method controlling the switching of mobile phone horizontal/vertical screen, it is characterised in that comprise the steps:
Step one, reads the inclination angle value of mobile phone current acceleration sensor, and service layer is according to this inclination angle
Angle value judges that mobile phone is perpendicular screen state or transverse screen state;
Step 2, starting gyroscope or the interrupt mode of acceleration transducer of mobile phone, interrupting if triggered,
Then send interrupt signal, and this interrupt signal is passed to service layer;
Step 3, after service layer receives interrupt signal, obtains inclination angle value from acceleration transducer
And process;
Step 4, carries out horizontal/vertical screen switching according to the inclination angle value after processing to mobile phone;
According to this inclination angle value, service layer described in step one judges that mobile phone is perpendicular screen state or transverse screen
State, specifically refers to when inclination angle value changes near 90 degree or 270 degree, it is judged that Mobile phone screen tentiform
State is transverse screen state;When inclination angle value changes near 0 degree or 360 degree, it is judged that mobile phone screen state
For perpendicular screen state;
The gyroscope of the mobile phone described in step 2 or the interrupt mode of acceleration transducer, specifically refer to work as top
After the detection angular velocity change of spiral shell instrument, or after acceleration transducer detection acceleration change, then trigger and interrupt mould
Formula, sends interrupt signal, and this interrupt signal is passed to service layer;
The change of described gyroscope detection angular velocity, specifically refers to when gyroscope detects that x-axis value is bigger,
Represent and in the x-axis of now gyroscope, create bigger angular velocity, then this angular velocity is integrated, detection
It is within the setting time, the amplitude of angle changing in x-axis, varies more than preset value when this angle, i.e. exists
In the shortest time, x-axis has rotated over preset value, then it is assumed that mobile phone there occurs shake, now triggers interruption
Pattern;
Described acceleration transducer detection acceleration change, specifically refer to acceleration transducer set time
In, the acceleration change in its x-axis has exceeded preset value, then it is assumed that mobile phone there occurs shake, now touches
Send out interrupt mode.
The method controlling the switching of mobile phone horizontal/vertical screen the most according to claim 1, it is characterised in that: step
Service layer described in three obtains inclination angle value from acceleration transducer and processes, and specifically refers to from adding
After velocity sensor obtains inclination angle value, this inclination angle value is added and subtracted 90 degree of process.
The method controlling the switching of mobile phone horizontal/vertical screen the most according to claim 1, it is characterised in that: step
Described in four according to process after inclination angle value mobile phone is carried out horizontal/vertical screen switching, specifically refer to work as inclination angle
When angle value changes near 90 degree or 270 degree, it is judged that mobile phone screen state is transverse screen state;Work as inclination angle
When angle value changes near 0 degree or 360 degree, it is judged that mobile phone screen state is perpendicular screen state;After having judged
Mobile phone screen is carried out the switching of corresponding state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310251462.6A CN103336655B (en) | 2013-06-21 | 2013-06-21 | A kind of method controlling the switching of mobile phone horizontal/vertical screen |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310251462.6A CN103336655B (en) | 2013-06-21 | 2013-06-21 | A kind of method controlling the switching of mobile phone horizontal/vertical screen |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103336655A CN103336655A (en) | 2013-10-02 |
CN103336655B true CN103336655B (en) | 2016-08-10 |
Family
ID=49244839
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310251462.6A Expired - Fee Related CN103336655B (en) | 2013-06-21 | 2013-06-21 | A kind of method controlling the switching of mobile phone horizontal/vertical screen |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103336655B (en) |
Families Citing this family (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103530036A (en) * | 2013-10-18 | 2014-01-22 | 惠州Tcl移动通信有限公司 | Horizontal screen switching control method and mobile terminal |
CN103618959A (en) * | 2013-11-28 | 2014-03-05 | 乐视网信息技术(北京)股份有限公司 | Method and device for video playing |
CN105446419A (en) * | 2014-08-12 | 2016-03-30 | 富泰华工业(深圳)有限公司 | Electronic device and screen rotation method |
CN104267892B (en) * | 2014-09-20 | 2018-07-06 | 北京智谷睿拓技术服务有限公司 | The method and apparatus for adjusting direction |
CN106325492B (en) * | 2015-10-30 | 2020-06-02 | 北京智谷睿拓技术服务有限公司 | Orientation adjusting method and device and electronic equipment |
CN105511770B (en) * | 2015-12-09 | 2019-02-05 | Oppo广东移动通信有限公司 | Control method, device and the mobile terminal of mobile terminal |
JP6700775B2 (en) * | 2015-12-22 | 2020-05-27 | キヤノン株式会社 | Electronic device and control method thereof |
CN106210544B (en) * | 2016-08-18 | 2020-06-02 | 惠州Tcl移动通信有限公司 | Mobile terminal and anti-shake processing method and system for video shot by mobile terminal |
CN107102835B (en) * | 2017-02-10 | 2020-04-14 | 珠海市魅族科技有限公司 | Display control method and system |
CN107145269B (en) * | 2017-04-19 | 2023-06-23 | 腾讯科技(深圳)有限公司 | Data rotation method and device |
CN107727133B (en) * | 2017-10-31 | 2020-12-25 | 东莞华贝电子科技有限公司 | Method and system for testing internal sensor of intelligent terminal |
CN108007433A (en) * | 2017-11-13 | 2018-05-08 | 青岛海信移动通信技术股份有限公司 | A kind of terminal determines the method and terminal at inclination angle |
CN108111689A (en) * | 2017-12-26 | 2018-06-01 | 深圳市万普拉斯科技有限公司 | Dynamic regulating method, device and the mobile terminal of pressure touch |
CN109163723A (en) * | 2018-08-16 | 2019-01-08 | 东南大学 | A kind of angle measurement method when mobile phone is swung in pocket |
CN111625128A (en) * | 2020-05-12 | 2020-09-04 | Oppo广东移动通信有限公司 | Control method and control device of touch screen, mobile terminal and storage medium |
CN111866275A (en) * | 2020-07-13 | 2020-10-30 | 珠海格力电器股份有限公司 | Screen adjustment method and device, storage medium and processor |
CN112887477B (en) * | 2021-01-26 | 2023-11-14 | 努比亚技术有限公司 | Voice processing method, device, mobile terminal and computer readable storage medium |
CN114090867B (en) * | 2021-08-02 | 2024-08-23 | 浙江绍兴苏泊尔生活电器有限公司 | Menu pushing method and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103034416A (en) * | 2012-12-25 | 2013-04-10 | 珠海金山办公软件有限公司 | Method for turning screen display of equipment to gravity direction through shaking |
CN103034423A (en) * | 2012-12-25 | 2013-04-10 | 珠海金山办公软件有限公司 | Method for rotating screen display direction of equipment through shaking equipment |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013070194A (en) * | 2011-09-21 | 2013-04-18 | Kyocera Corp | Portable terminal device, program, and display control method |
-
2013
- 2013-06-21 CN CN201310251462.6A patent/CN103336655B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103034416A (en) * | 2012-12-25 | 2013-04-10 | 珠海金山办公软件有限公司 | Method for turning screen display of equipment to gravity direction through shaking |
CN103034423A (en) * | 2012-12-25 | 2013-04-10 | 珠海金山办公软件有限公司 | Method for rotating screen display direction of equipment through shaking equipment |
Also Published As
Publication number | Publication date |
---|---|
CN103336655A (en) | 2013-10-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103336655B (en) | A kind of method controlling the switching of mobile phone horizontal/vertical screen | |
JP5121963B2 (en) | Electronic device and control method | |
KR101517459B1 (en) | Method for automatically switching user interface of handheld terminal device, and handheld terminal device | |
US20150035781A1 (en) | Electronic device | |
EP2667291A1 (en) | Method and apparatus for moving an object | |
US20130194176A1 (en) | Method for adjusting display manner of portable electronic device | |
US20150212336A1 (en) | Passive damping for optical image stabilization | |
KR20150000632A (en) | Portable device and controlling method thereof | |
CN104995541A (en) | Voice coil motor optical image stabilization | |
CN102915188B (en) | A kind of method of display state of control terminal screen and device | |
CN106354331A (en) | Touch and hover switching | |
CN104471519A (en) | Method and apparatus for displaying panoramic photo in mobile terminal, and mobile terminal | |
CN102750102A (en) | Mobile terminal and operation control element position replacing method | |
CN103927075A (en) | Method and terminal for operating interfaces | |
US20150242100A1 (en) | Detecting intentional rotation of a mobile device | |
US20150169180A1 (en) | Rearranging icons on a display by shaking | |
CN105700708A (en) | Terminal interface adjusting method and terminal | |
CN105892848A (en) | Page browsing method and device | |
CN103076953A (en) | Method for previewing picture files on user terminal equipment and user terminal equipment | |
JP2012058332A (en) | Mobile terminal device and program | |
JP2010282459A (en) | Mobile terminal device | |
JP5800361B2 (en) | Display control device and display device using the same | |
JP2010251844A5 (en) | ||
CN111352524A (en) | Information input device | |
TW201403446A (en) | System and method for displaying software interface |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
CP01 | Change in the name or title of a patent holder | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160810 |
|
CF01 | Termination of patent right due to non-payment of annual fee |