WindowView

Window as in windowsill.

Tilting to pan images.

An Android ImageView that can be panned around by tilting your device, as if you were looking through a window.

Usage

Add it to your project using Gradle:

compile 'com.jmedeisis:windowview:0.2.0'

Use in place of an ImageView. Example XML layout file:

<com.jmedeisis.windowview.WindowView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/my_image" />

Please refer to the included sample application project for a complete example.

Configuration

You will typically want to configure the following attributes for the WindowView class:

You may also want to configure more advanced attributes:

Example configuration:

<com.jmedeisis.windowview.WindowView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/my_image"
    app:wwv_tilt_sensor_mode="Manual"
    app:wwv_orientation_mode="Relative"
    app:wwv_translate_mode="Constant"
    app:wwv_max_constant_translation="100dp"
    app:wwv_sensor_sampling_period="fast"
    app:wwv_max_pitch="15"
    app:wwv_max_roll="15"
    app:wwv_vertical_origin="0"
    app:wwv_horizontal_origin="0" />

Limitations

Development

Pull requests are welcome and encouraged for bugfixes and features such as:

License

WindowView is licensed under the terms of the MIT License.