Questions tagged [rotation]

A rotation is a circular movement of an object around a center (or point) of rotation. On a mobile device, it indicates the change of orientation.

A three-dimensional object rotates always around an imaginary line called a rotation axis. If the axis is within the body, and passes through its center of mass the body is said to rotate upon itself, or spin. A rotation about an external point, e.g. the Earth about the Sun, is called a revolution or orbital revolution, typically when it is produced by gravity.

Mathematically, a rotation is a rigid body movement which, unlike a translation, keeps a point fixed. This definition applies to rotations within both two and three dimensions (in a plane and in space, respectively.)

A rotation is commonly represented using , a rotation or .

On a mobile device, it indicates the change of orientation.

11204 questions
1425
votes
33 answers

Activity restart on rotation Android

In my Android application, when I rotate the device (slide out the keyboard) then my Activity is restarted (onCreate is called). Now, this is probably how it's supposed to be, but I do a lot of initial setting up in the onCreate method, so I need…
Isaac Waller
  • 32,041
  • 27
  • 93
  • 107
467
votes
14 answers

Rotating videos with FFmpeg

I have been trying to figure out how to rotate videos with FFmpeg. I am working with iPhone videos taken in portrait mode. I know how to determine the current degrees of rotation using MediaInfo (excellent library, btw) but I'm stuck on FFmpeg…
jocull
  • 17,542
  • 18
  • 95
  • 139
421
votes
25 answers

Why does an image captured using camera intent gets rotated on some devices on Android?

I'm capturing an image and setting it to image view. public void captureImage() { Intent intentCamera = new Intent("android.media.action.IMAGE_CAPTURE"); File filePhoto = new File(Environment.getExternalStorageDirectory(), "Pic.jpg"); …
Shirish Herwade
  • 10,601
  • 18
  • 66
  • 105
327
votes
15 answers

Prevent screen rotation on Android

I have one of my activities which I would like to prevent from rotating because I'm starting an AsyncTask, and screen rotation makes it restart. Is there a way to tell this activity "DO NOT ROTATE the screen even if the user is shaking his phone…
Sephy
  • 48,024
  • 30
  • 119
  • 129
295
votes
7 answers

CSS3 Rotate Animation

Cannot get this animated image to work, it is supposed to do a 360 degrees rotation. I guess something's wrong with the CSS below, as it just stays still. .image { float: left; …
Nikk
  • 5,862
  • 5
  • 30
  • 61
284
votes
29 answers

Evenly space multiple views within a container view

Auto Layout is making my life difficult. In theory, it was going to be really useful when I switched, but I seem to fight it all of the time. I've made a demo project to try to find help. Does anyone know how to make the spaces between views…
nothappybob
  • 3,027
  • 4
  • 13
  • 14
173
votes
2 answers

css rotate a pseudo :after or :before content:""

anyway to make a rotation work on the pseudo content:"\24B6"? I'm trying to rotate a unicode symbol.
devric
  • 2,922
  • 4
  • 19
  • 34
169
votes
25 answers

Android: Rotate image in imageview by an angle

I am using the following code to rotate a image in ImageView by an angle. Is there any simpler and less complex method available. ImageView iv = (ImageView)findViewById(imageviewid); TextView tv = (TextView)findViewById(txtViewsid); Matrix mat = new…
rijinrv
  • 1,831
  • 2
  • 14
  • 17
164
votes
12 answers

JS Client-Side Exif Orientation: Rotate and Mirror JPEG Images

Digital camera photos are often saved as JPEG with an EXIF "orientation" tag. To display correctly, images need to be rotated/mirrored depending on which orientation is set, but browsers ignore this information rendering the image. Even in large…
flexponsive
  • 5,516
  • 6
  • 23
  • 36
163
votes
17 answers

Positions fixed doesn't work when using -webkit-transform

I am using -webkit-transform (and -moz-transform / -o-transform) to rotate a div. Also have position fixed added so the div scrols down with the user. In Firefox it works fine, but in webkit based browsers it's broken. After using the…
iSenne
  • 2,476
  • 5
  • 23
  • 25
144
votes
19 answers

Android: Bitmaps loaded from gallery are rotated in ImageView

When I load an image from the media gallery into a Bitmap, everything is working fine, except that pictures that were shot with the camera while holding the phone vertically, are rotated so that I always get a horizontal picture even though it…
Manuel
  • 7,885
  • 10
  • 29
  • 29
111
votes
3 answers

Further understanding setRetainInstance(true)

What exactly happens when you call setRetainInstance(true) on a Fragment? The documentation is virtually non-existent and this seems like a very important function. Specifically I want to know how much of this sequence (that I made up) is…
Timmmm
  • 68,359
  • 51
  • 283
  • 367
102
votes
16 answers

Best practices for circular shift (rotate) operations in C++

Left and right shift operators (<< and >>) are already available in C++. However, I couldn't find out how I could perform circular shift or rotate operations. How can operations like "Rotate Left" and "Rotate Right" be performed? Rotating right…
Elroy
  • 597
  • 4
  • 11
  • 20
97
votes
4 answers

Python list rotation

Possible Duplicate: Efficient way to shift a list in python I'd like to rotate a Python list by an arbitrary number of items to the right or left (the latter using a negative argument). Something like this: >>> l = [1,2,3,4] >>>…
Drew Noakes
  • 266,361
  • 143
  • 616
  • 705
95
votes
6 answers

Statically rotate font-awesome icons

I'd like to statically rotate my font-awesome icons by 45 degrees. It says on the site that: To arbitrarily rotate and flip icons, use the fa-rotate-* and fa-flip-* classes. However, doing
user592419
  • 4,535
  • 7
  • 37
  • 64
1
2 3
99 100