Custom layout that can rotate it's view
- Add to you project as Android library
- In your layout file add
<com.github.rongi.rotate_layout.layout.RotateLayout
app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<YourLayoutHere
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_angle="90"> <!-- Specify rotate angle here -->
</YourLayoutHere>
</com.github.rongi.rotate_layout.layout.RotateLayout>
Voila! Your layout will be rotated 90 degrees.
- Handles all touch events in correct way. You press the same button you touch!
- Layout measures itself in a correct way. This means that if original view is 50x100, then 90 degree rotated it will measure itself as 100x50 and can fit in another layouts with this dimensions.
- Supports only multiple of 90 angles atm. Still can be easily modifyed to support any angle.