CN103034416B - A kind of by shaking the method making device screen display forward gravity direction to - Google Patents

A kind of by shaking the method making device screen display forward gravity direction to Download PDF

Info

Publication number
CN103034416B
CN103034416B CN201210569365.7A CN201210569365A CN103034416B CN 103034416 B CN103034416 B CN 103034416B CN 201210569365 A CN201210569365 A CN 201210569365A CN 103034416 B CN103034416 B CN 103034416B
Authority
CN
China
Prior art keywords
acceleration
screen
mistiming
great change
screen display
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.)
Active
Application number
CN201210569365.7A
Other languages
Chinese (zh)
Other versions
CN103034416A (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 Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software 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 Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN201210569365.7A priority Critical patent/CN103034416B/en
Publication of CN103034416A publication Critical patent/CN103034416A/en
Application granted granted Critical
Publication of CN103034416B publication Critical patent/CN103034416B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Telephone Function (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The present invention proposes a kind of by shaking the method making device screen display forward gravity direction to, when it enters application-specific, getting the relevant service of current device sensor by call operation system; Whether judgment device has acceleration transducer and gravity sensor; Obtain the data that acceleration transducer exports, judge whether user carries out effective screen and shake action according to the time of acceleration obtained and accekeration; Obtain the data that gravity sensor exports, the gravity direction of heavier force snesor report and current screen display direction, when both are inconsistent, Rotation screen display is to gravity direction; Exit or reset routine time, by Operation system setting or program itself acquiescence configuration setting screen display direction.No matter which kind of user carried out to system orientation is arranged, with realizing roller blind that is provisional, gravity direction operation by " shaking " equipment per family, and fixed mask, make it meet the demand of user.

Description

A kind of by shaking the method making device screen display forward gravity direction to
Technical field
The present invention relates to a kind of method changing screen of hand-held device display direction, especially a kind ofly realize device screen display by shake equipment in a program and turn to the method for gravity direction.
Background technology
Current mobile phone other mobile computing devices such as (or) panel computers, often all with gravity sensing equipment, makes these equipment can perceive the anglec of rotation of the vertical direction of screen, and can allow screen display content synchronous automatic rotation with it.The setting of this automatic rotation screen content is all generally the Default Value of these equipment.Meanwhile, equipment manufacturers also notice, sometimes user can wish that the direction of screen is fixed, and the direction that gravity sensor does not detect rotates, and its reason is that the major part of certain customers checks that custom is fixed as some directions, to reach certain convenience.Such as, mobile phone screen is fixed as perpendicular screen direction by certain user, so neither affects him and plays the activities such as phone at ordinary times, when can also ensure that he reads web page contents in the situation of lying on one's side, web page contents can not become horizontal screen because of the reason of gravity sensing, causes reading.But for the user in this fixed mask direction, they also exist inconvenience: such as check webpage or document content in perpendicular screen situation, sometimes font is too small, is not easy to check, horizontal screen display is now needed to show.And when now mobile phone laterally holds by this user, screen content can't automatic rotation (because being set to lock perpendicular the screen by himself).If now this user wants the object reaching horizontal screen reading, the setting of aforementioned lock-screen manually must be removed.And after horizontal screen reading is complete, again obtain the convenience that the perpendicular screen of locking brings if wish, need to remember screen to be manually set to again lock perpendicular screen.
Now, the usual way of application software is on program interface, provide Rotation screen button or menu, but this needs to take interface shape, and likely because itself there is more function button or menu, cause this function cannot by user's Timeliness coverage.
Or when equipment rotates, position ejector button obvious on screen, prompting user presses rear roller blind, and this not only blocks the sight line of user, and likely not all situation user needs roller blind, always ejects such button and user can be allowed to feel to bother.
Summary of the invention
The problem to be solved in the present invention is, when user's fixed mask direction, by a kind of simple, can operate intuitively and be transformed into gravity screen orientation temporarily.Therefore, the object of the invention is to thisly often be in lock-screen direction state to allow, but frequently have that to change the user that screen orientation needs more convenient to use.
The present invention is realized by shake equipment the method that device screen display turns to gravity direction in a program realized this object by a kind of, and it comprises following steps:
Step one: get the relevant service of current device sensor by call operation system when entering application-specific;
Step 2: whether judgment device has acceleration transducer and gravity sensor;
Step 3: obtain the data that acceleration transducer exports, the time of the acceleration of record acceleration transducer report and accekeration, calculate the first adjacent acceleration and the mistiming of the second acceleration, and mobile phone screen X, Y, the absolute value of acceleration change between first acceleration and the second acceleration on Z tri-axle, following formulae discovery is utilized to go out the mean value of rate of acceleration change according to the absolute value of described mistiming and acceleration change again: speed=(deltaX+deltaY+deltaZ) × C/diff, wherein speed is the mean value of rate of acceleration change, deltaX, deltaY, deltaZ is respectively mobile phone screen X, Y, the absolute value of acceleration change on Z axis, diff is the first adjacent acceleration and the mistiming of the second acceleration, C is amplification coefficient, by described mean value speed compared with the threshold value preset, judge when mean value is greater than mean value threshold value to create primary acceleration great change, and record current acceleration great change generation time, in acceleration great change counter, 1 is added to the number of times of acceleration great change, if the mistiming that the time of wherein current acceleration great change and last time acceleration great change produce be greater than one preset mistiming threshold value time, degree of will speed up great change counter clear, when the number of times of acceleration great change reaches default frequency threshold value, judge that producing user shakes screen action, when judging that producing user shakes screen action, calculate and currently shake screen action and last mistiming of shaking screen action, and will the mistiming of screen action be shaken compared with the mistiming threshold value preset, judge that when the described mistiming is greater than mistiming threshold value user shakes screen action effectively, and degree of will speed up great change counter clear,
Step 4: obtain the data that gravity sensor exports, the gravity direction of record gravity sensor report;
Step 5: the gravity direction of heavier force snesor report and current screen display direction, rotate current screen display direction according to gravity direction in the case of inconsistencies;
Step 6: exit or reset routine time, by Operation system setting or program itself acquiescence configuration setting screen direction.
Like this, when equipment is locked into any direction, user shakes one and to shake the hand machine, if the direction of current screen content display and the direction that should turn to by gravity sensing inconsistent, then the direction that current screen content shows is converted to consistent with the screen orientation that gravity sensing indicates.The problem of the interim Rotation screen of the hope that the user solving lock-screen faces, and there is not the defect of prior art.And; this scheme has very strong intuitive: according to the observation to use scenes; user is after slewing to some directions; find the words that screen does not rotate; the equipment of the subconscious shake of frequent meeting oneself (mobile phone, panel computer, etc.); this is because user thinks that in subconsciousness equipment is container, screen content is the object that can slide with gravity in container.The present invention just in time when the in-mind anticipation of identical user, can meet the demand of user.
Embodiment
In this particular embodiment, we are described to use the smart mobile phone of android system, and the realization of the present invention on the smart mobile phone adopting other operating system similarly.
First, the present invention realizes the judgement to the action that user " shakes " by the acceleration transducer that android system provides, and this judgement can Activate Phone the change in screen display direction.Particularly, the Activity.getSystemService (Context.SENSOR_SERVICE) by calling android system gets the relevant service SensorManager of current device sensor; Then from SensorManager, the acceleration transducer on equipment is got by getDefaultSensor (Sensor.TYPE_ACCELEROMETER), if return null, then current device does not support acceleration transducer, cannot realize shaking function, otherwise, pass through SensorManager.registerListener, the monitoring of registration acceleration transducer, realizes the acquisition to acceleration transducer signals thus.
The upper acceleration transducer of Android comprises the acceleration on equipment three directions:
X-axis: device screen level to the right
Y-axis: device screen straight up
Z axis: outside device screen Vertical dimension
So, equipment constantly reports current acceleration (per second be more than or equal to 5 times) by onSensorChanged (SensorEvent event), contain when the real time acceleration on first three direction in the values of wherein event, values [0] represents the acceleration in X-axis, values [1] represents the acceleration in Y-axis, and values [2] represents the acceleration on Z axis.
The present invention is by the change to the acceleration on these three directions, and judge " shaking " action, concrete scheme is as follows:
Wherein, predefined variable and meaning thereof comprise:
Event: system reports the subsidiary acceleration information object of acceleration
MLastTime: upper subsystem reports the time of acceleration
MLastX: the X-axis acceleration that last time reports
MLastY: the Y-axis acceleration that last time reports
MLastZ: the Z axis acceleration that last time reports
MLastHugeChangeTime: the time (implication of acceleration great change is explained in 2) that acceleration great change last time produces
MHugeChangeCount: the acceleration great change number of times produced continuously, is initially 0
MLastShakeTime: the record last time of shaking a shake and doing to produce, be initially 0
Like this, when first time reports acceleration, record current time mLastTime, and acceleration mLastX=event.values [0], mLastY=event.values [1], mLastZ=event.values [2].
When again reporting acceleration, obtain current time now, mistiming diff is calculated by now-mLastTime, calculate the absolute value of the acceleration change on three directions, what namely current X-axis acceleration event.values [0] deducted mLastX thoroughly deserves deltaX, correspondingly calculate deltaY, deltaZ, three cumulative after be multiplied by amplification coefficient C(at this for 10000 divided by mistiming diff, namely 10000 times are expanded), obtain the mean value speed that describes rate of acceleration change on three directions, by judging whether this speed exceedes default mean value threshold values (such as 350, this is experiment value, this value is used to judge to shake error quite little).If do not arrive this mean value threshold values, only record current time and present acceleration.If arrival threshold values, then judge to create primary acceleration great change, and record current acceleration great change generation time mLastHugeChangeTime, and make the number of times mHugeChangeCount of the acceleration great change in acceleration great change counter add 1.Wherein, when system reports acceleration, obtain current time, if the time mLastHugeChangeTime that current time and last time acceleration great change produce differ by more than one preset mistiming threshold value (such as 500ms) time, decision people just moves equipment, does not shake a shake and does, now mHugeChangeCount is set to 0, otherwise continue to increase great change number of times, namely mHugeChangeCount adds 1.
When mHugeChangeCount number reaches default frequency threshold value, such as 3 times time, judge the action creating " shaking ", and the time of active user the being shaken screen action user that deducts last registration shakes the time of screen action, obtain the mistiming between the two, (such as 1000ms when only once mLastShakeTime is greater than default mistiming threshold value in current time distance, wherein mLastShakeTime is defaulted as 0, so when first time, generation was shaken, must satisfy condition), be just judged as and effectively shake screen action.The object of record mLastShakeTime does not stop in user's short time to shake mobile phone to prevent, and causes and once produce the too much situation of shaking effect.When shaking screen action and being judged as effective, first arranging mHugeChangeCount is 0, restarts counting, and records the current time to mLastShakeTime.
Then, the data of gravity sensor output are obtained by the operating system of equipment, the gravity direction of record gravity sensor report.The gravity direction of heavier force snesor report and current screen display direction, rotate current screen display direction according to gravity direction in the case of inconsistencies, makes both consistent.
When arranging screen orientation, obtain current screen orientation, another kind of screen orientation is being arranged to according to gravity direction, this arranges not write-in program configuration, the setting of system is not changed yet, therefore, when program exits and restarts, setting screen direction can be come by the configuration of the setting of system or program itself.
Like this, when equipment is locked into any direction, user shakes one and to shake the hand machine, if the direction of current screen content display and the direction that should turn to by gravity sensing inconsistent, then the direction that current screen content shows is converted to consistent with the screen orientation that gravity sensing indicates.The problem of the interim Rotation screen of the hope that the user solving lock-screen faces, and there is not the defect of prior art.And; this scheme has very strong intuitive: according to the observation to use scenes; user is after slewing to some directions; find the words that screen does not rotate; the equipment of the subconscious shake of frequent meeting oneself (mobile phone, panel computer, etc.); this is because user thinks that in subconsciousness equipment is container, screen content is the object that can slide with gravity in container.The present invention just in time when the in-mind anticipation of identical user, can meet the demand of user.
Certainly, the present invention is except above-mentioned embodiment, and other equivalent technical solutions also should within its protection domain.

Claims (3)

1. make device screen show the method forwarding gravity direction to by shake, it is characterized in that comprising following steps:
Step one: get the relevant information of current device sensor by the operating system of equipment when entering application-specific;
Step 2: whether judgment device has acceleration transducer and gravity sensor;
Step 3: obtain the data that acceleration transducer exports, the time of the acceleration of record acceleration transducer report and accekeration, according to time and the accekeration of the acceleration of acceleration transducer report, calculate two acceleration successively produced, first acceleration and the second acceleration, mistiming, and three of mobile phone screen geometric spaces axially between the first acceleration and the second acceleration acceleration change each absolute value and it is amplified, again according to described mistiming and the mean value calculating rate of acceleration change through the absolute value summation meter of the 3-axis acceleration change of amplifying, by described mean value compared with the mean value threshold value preset, judge when described mean value is greater than mean value threshold value to create primary acceleration great change, record current acceleration great change generation time, calculate the mistiming of current acceleration great change and last acceleration great change, if the mistiming of described acceleration great change is less than a mistiming threshold value preset, in acceleration great change counter, 1 is added to the number of times of acceleration great change, if the mistiming of described acceleration great change is more than or equal to default mistiming threshold value, then degree of will speed up great change counter clear, when the number of times of acceleration great change reaches default number of times threshold values, judge that producing user shakes screen action, after judgement generation user shakes screen action, calculate and currently shake screen action and last mistiming of shaking screen action, and the mistiming of shaking screen action and shaking of presetting shields compared with difference limen value actuation time, the described mistiming be greater than shake screen difference limen value actuation time time the setting of calling system screen display direction,
Step 4: obtain the data that gravity sensor exports, the gravity direction of record gravity sensor report;
Step 5: the gravity direction of heavier force snesor report and current screen display direction, rotate current screen display direction according to gravity direction in the case of inconsistencies.
2. according to claim 1ly make device screen show the method for gravity direction of forwarding to by shake, it is characterized in that, judge user shake screen action effective after degree of will speed up great change counter clear.
3. according to claim 1ly make device screen show the method for gravity direction of forwarding to by shake, it is characterized in that also comprising step 6: exit or reset routine time, the configuration setting screen display direction given tacit consent to by Operation system setting or program itself.
CN201210569365.7A 2012-12-25 2012-12-25 A kind of by shaking the method making device screen display forward gravity direction to Active CN103034416B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210569365.7A CN103034416B (en) 2012-12-25 2012-12-25 A kind of by shaking the method making device screen display forward gravity direction to

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210569365.7A CN103034416B (en) 2012-12-25 2012-12-25 A kind of by shaking the method making device screen display forward gravity direction to

Publications (2)

Publication Number Publication Date
CN103034416A CN103034416A (en) 2013-04-10
CN103034416B true CN103034416B (en) 2015-09-09

Family

ID=48021359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210569365.7A Active CN103034416B (en) 2012-12-25 2012-12-25 A kind of by shaking the method making device screen display forward gravity direction to

Country Status (1)

Country Link
CN (1) CN103034416B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102009037835B4 (en) 2009-08-18 2012-12-06 Metaio Gmbh Method for displaying virtual information in a real environment
CN103336655B (en) * 2013-06-21 2016-08-10 广东欧珀移动通信有限公司 A kind of method controlling the switching of mobile phone horizontal/vertical screen
CN103345304B (en) * 2013-07-05 2016-08-31 百度在线网络技术(北京)有限公司 The sensor-based timesharing of mobile device triggers the method and apparatus carrying out operating
EP3050030B1 (en) * 2013-09-24 2020-06-24 Apple Inc. Method for representing points of interest in a view of a real environment on a mobile device and mobile device therefor
CN103973885B (en) * 2014-04-02 2016-08-17 联想(北京)有限公司 A kind of method of reported data and mobile terminal
CN105446419A (en) * 2014-08-12 2016-03-30 富泰华工业(深圳)有限公司 Electronic device and screen rotation method
CN105630345B (en) * 2014-11-06 2019-02-19 阿里巴巴集团控股有限公司 A kind of method and apparatus controlling display direction
CN105138217A (en) * 2015-07-08 2015-12-09 广州优蜜移动科技股份有限公司 Suspended window operation method and system for intelligent terminal
CN107091940B (en) * 2016-11-09 2020-03-06 北京星选科技有限公司 Equipment identification method and device
CN107357539A (en) * 2017-06-15 2017-11-17 深圳市文鼎创数据科技有限公司 display screen display direction switching method and terminal device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101155363A (en) * 2006-09-30 2008-04-02 海尔集团公司 Method and apparatus for implementing mobile phone control by action induction
CN101800816A (en) * 2010-04-08 2010-08-11 华为终端有限公司 Method for horizontal and vertical switching of touch screen of mobile terminal and mobile terminal
CN101989126A (en) * 2009-08-07 2011-03-23 深圳富泰宏精密工业有限公司 Handheld electronic device and automatic screen picture rotating method thereof
CN102291492A (en) * 2011-08-25 2011-12-21 中兴通讯股份有限公司 Method and device for controlling calling ring tone state of communication terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040201595A1 (en) * 2003-04-11 2004-10-14 Microsoft Corporation Self-orienting display
KR100879517B1 (en) * 2006-08-16 2009-01-22 삼성전자주식회사 Mobile Terminal and Method for Changing Mode thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101155363A (en) * 2006-09-30 2008-04-02 海尔集团公司 Method and apparatus for implementing mobile phone control by action induction
CN101989126A (en) * 2009-08-07 2011-03-23 深圳富泰宏精密工业有限公司 Handheld electronic device and automatic screen picture rotating method thereof
CN101800816A (en) * 2010-04-08 2010-08-11 华为终端有限公司 Method for horizontal and vertical switching of touch screen of mobile terminal and mobile terminal
CN102291492A (en) * 2011-08-25 2011-12-21 中兴通讯股份有限公司 Method and device for controlling calling ring tone state of communication terminal

Also Published As

Publication number Publication date
CN103034416A (en) 2013-04-10

Similar Documents

Publication Publication Date Title
CN103034416B (en) A kind of by shaking the method making device screen display forward gravity direction to
CN103034423B (en) A kind of method being realized rotating in its screen display direction by shake equipment
US9588609B2 (en) Mobile terminal and method of controlling the operation of the mobile terminal
CN104350728B (en) The operational control to the wearable accessory of multisection type based on segmentation change in orientation
US9313321B2 (en) Screen unlocking method and device for mobile terminal
CN102109945B (en) Portable electronic equipment provided with touch screen and control method thereof
US9509834B2 (en) Mobile device and method for controlling the same
CN106534796A (en) Method and device for monitoring safety of infant and child
CN102144213B (en) Scrollable area multi-scale viewing
US20150046831A1 (en) Method and Apparatus for Unlocking Terminal
US9043715B2 (en) Alert event notification
CN110750188A (en) Message display method and electronic equipment
DE202013100255U1 (en) Display device, remote control device and operating function of the same
CN101292218A (en) Mobile terminal, and its menu display method
CN110647266A (en) Information display method and terminal equipment
CN107113468A (en) Automatic main screen based on display device is determined
WO2013000296A1 (en) Method for unlocking mobile terminal
CN107992342B (en) Application configuration changing method and mobile terminal
CN109002340A (en) A kind of screen locking method and electronic equipment
CN106775692B (en) Component editing method and electronic equipment
DE102015102639A1 (en) Method for operating a mobile terminal, application for a mobile terminal and mobile terminal
CN101958968A (en) Method for previewing mobile phone multi-screen desktops
JP5555044B2 (en) Camera control device and camera system
CN105279897B (en) Car alarming method and device
CN111104288A (en) Information processing method and electronic equipment

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
CP01 Change in the name or title of a patent holder

Address after: Jinshan software building No. 8 Jingshan Hill Road, Lane 519015 Lianshan Jida Zhuhai city in Guangdong Province

Patentee after: Zhuhai Kingsoft Office Software Co., Ltd.

Patentee after: Beijing Kingsoft office software Limited by Share Ltd

Address before: Jinshan software building No. 8 Jingshan Hill Road, Lane 519015 Lianshan Jida Zhuhai city in Guangdong Province

Patentee before: Zhuhai Kingsoft Office Software Co., Ltd.

Patentee before: Beijing Kingsoft WPS Office Co., Ltd.