{"id":21130358,"url":"https://github.com/justasm/WindowView","last_synced_at":"2025-07-09T01:33:22.520Z","repository":{"id":19897761,"uuid":"23162763","full_name":"justasm/WindowView","owner":"justasm","description":"Android ImageView you pan by tilting your device.","archived":false,"fork":false,"pushed_at":"2016-06-18T18:45:38.000Z","size":2605,"stargazers_count":266,"open_issues_count":1,"forks_count":44,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-03-23T19:10:26.169Z","etag":null,"topics":["android","device-tilt","imageview"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justasm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-20T20:15:47.000Z","updated_at":"2024-03-23T19:10:26.170Z","dependencies_parsed_at":"2022-07-20T17:52:14.916Z","dependency_job_id":null,"html_url":"https://github.com/justasm/WindowView","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justasm%2FWindowView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justasm%2FWindowView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justasm%2FWindowView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justasm%2FWindowView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justasm","download_url":"https://codeload.github.com/justasm/WindowView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476370,"owners_count":17480215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","device-tilt","imageview"],"created_at":"2024-11-20T05:32:39.090Z","updated_at":"2024-11-20T05:32:47.042Z","avatar_url":"https://github.com/justasm.png","language":"Java","funding_links":[],"categories":["Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"WindowView\n==========\n\n*Window as in windowsill.*\n\n![Tilting to pan images.](/sample/sample_in_action.gif)\n\nAn Android `ImageView` that can be panned around by tilting your device, as if you were looking\nthrough a window.\n\nUsage\n-----\nAdd it to your project using Gradle:\n\n```groovy\ncompile 'com.jmedeisis:windowview:0.2.0'\n```\n\nUse in place of an `ImageView`. Example XML layout file:\n\n```xml\n\u003ccom.jmedeisis.windowview.WindowView\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:src=\"@drawable/my_image\" /\u003e\n```\n\nPlease refer to the included [sample application project](sample/) for a complete example.\n\nConfiguration\n-------------\nYou will typically want to configure the following attributes for the `WindowView` class:\n\n- `wwv_max_pitch` - maximum angle (in degrees) from origin for vertical device tilts.\n*Default - 30\u0026deg;*\n\n- `wwv_max_roll` - maximum angle (in degrees) from origin for horizontal device tilts.\n*Default - 30\u0026deg;*\n\n- `wwv_vertical_origin` - (in degrees) when device pitch equals this value, the image is centered\nvertically. *Default - 0\u0026deg;*\n\n- `wwv_horizontal_origin` - (in degrees) when device roll equals this value, the image is centered\nhorizontally. *Default - 0\u0026deg;*\n\nYou may also want to configure more advanced attributes:\n\n- `wwv_orientation_mode` - `Absolute` or `Relative` (default). Specifies whether device tilt should\nbe tracked with respect to `Absolute` world coordinates (i.e. pitch, roll w.r.t. ground plane) or\nwith respect to the device orientation when `WindowView` is created, which `WindowView` refers to as\nthe 'orientation origin'. If using the latter, i.e. `Relative`, you may use\n`WindowView#resetOrientationOrigin(boolean)` to set the orientation origin to that of the device\nwhen the method is called.\n\n- `wwv_translate_mode` - `Constant` or `Proportional` (default). Specifies how much the image is\ntranslated in response to device tilt. If `Proportional`, the image moves within the full range\ndefined by `max_pitch` / `max_roll`, with the extremities of the image visible when device pitch /\nroll is at those angles. If `Constant`, the image moves a constant amount per unit of tilt which is\ndefined by `max_constant_translation`, achieved when pitch / roll are at `max_pitch` / `max_roll`.\n\n- `wwv_max_constant_translation` - see above. *Default - 150dp*\n\n- `wwv_sensor_sampling_period` - the desired rate of sensor events. In microseconds or one of\n`fast`, `normal` (default) or `slow`. If using microsecond values, higher values result in slower\nsensor updates. Directly related to the rate at which `WindowView` updates in response to device\ntilt.\n\n- `wwv_tilt_sensor_mode` - `Manual` or `Automatic` (default). Specifies whether `WindowView` is\nresponsible for when tilt motion tracking starts and stops. If `Automatic`, `WindowView` works out\nof the box and requires no extra configuration. If `Manual`, you must explicitly start and stop tilt\nmotion tracking. You have two options:\n    * Use `WindowView#startTiltTracking()` and `WindowView#stopTiltTracking()`, e.g. in your\n    `Activity`'s `onResume()` and `onPause()`, respectively.\n\n    * Use `WindowView#attachTiltTracking(TiltSensor)` and\n    `WindowView#detachTiltTracking(TiltSensor)`. This approach is recommended when using multiple\n    `WindowView`s in a single logical layout. The externally managed `TiltSensor` should be started\n    and stopped using `TiltSensor#startTracking(int)` and `TiltSensor#stopTracking()` as appropriate.\n\nExample configuration:\n\n```xml\n\u003ccom.jmedeisis.windowview.WindowView\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:src=\"@drawable/my_image\"\n    app:wwv_tilt_sensor_mode=\"Manual\"\n    app:wwv_orientation_mode=\"Relative\"\n    app:wwv_translate_mode=\"Constant\"\n    app:wwv_max_constant_translation=\"100dp\"\n    app:wwv_sensor_sampling_period=\"fast\"\n    app:wwv_max_pitch=\"15\"\n    app:wwv_max_roll=\"15\"\n    app:wwv_vertical_origin=\"0\"\n    app:wwv_horizontal_origin=\"0\" /\u003e\n```\n\nLimitations\n-----------\n- Only supports the CENTER_CROP scale type.\n- Works for API levels 9+.\n\nDevelopment\n-----------\nPull requests are welcome and encouraged for bugfixes and features such as:\n\n- adaptive smoothing filters tuned for different sensor accuracy and rates\n- bi-directional image panning\n\nLicense\n-------\nWindowView is licensed under the terms of the [MIT License](LICENSE.txt).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustasm%2FWindowView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustasm%2FWindowView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustasm%2FWindowView/lists"}