{"id":13786859,"url":"https://github.com/gofynd/gravity-view","last_synced_at":"2025-05-07T12:22:02.114Z","repository":{"id":98524917,"uuid":"84049740","full_name":"gofynd/gravity-view","owner":"gofynd","description":"Introducing Gravity View: Because swiping is so yesterday!","archived":false,"fork":false,"pushed_at":"2023-01-25T11:46:47.000Z","size":1473,"stargazers_count":219,"open_issues_count":2,"forks_count":36,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-03-31T10:01:31.732Z","etag":null,"topics":["android","fb-paper-tilt","gyroscope","image-tilt","instant-article-tilt","scrolling","sensor","sensor-tilt","tilt"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gofynd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-03-06T08:41:26.000Z","updated_at":"2024-12-27T09:53:31.000Z","dependencies_parsed_at":"2023-10-03T07:34:23.806Z","dependency_job_id":null,"html_url":"https://github.com/gofynd/gravity-view","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gofynd%2Fgravity-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gofynd%2Fgravity-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gofynd%2Fgravity-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gofynd%2Fgravity-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gofynd","download_url":"https://codeload.github.com/gofynd/gravity-view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252874210,"owners_count":21817781,"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","fb-paper-tilt","gyroscope","image-tilt","instant-article-tilt","scrolling","sensor","sensor-tilt","tilt"],"created_at":"2024-08-03T20:00:20.019Z","updated_at":"2025-05-07T12:22:02.092Z","avatar_url":"https://github.com/gofynd.png","language":"Java","funding_links":[],"categories":["Library"],"sub_categories":[],"readme":"# Gravity View for Android\n\n[![API](https://img.shields.io/badge/API-11%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=11) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Gravity%20View-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5477)\n\nGravity View is an Android adaptation of Facebook instant articles. The concept behind the library is to utilize the motion sensors of an Android device and allow the end user to explore the product by rotating his device. It uses gyroscope motion sensor readings to scroll the image.\n\nYou can read more about Gravity View article [here](https://blog.gofynd.com/introducing-gravity-because-swiping-is-so-yesterday-4aebd89f0e21)\n\n\n[![Gravity View video](http://img.youtube.com/vi/IrNr-J1s8f8/0.jpg)](http://www.youtube.com/watch?v=IrNr-J1s8f8)\n\n## Demo\n\nInstall [Demo](https://github.com/gofynd/gravity-view/releases/download/v1.0/gravityview-1.0.apk) app or APK from [Releases](https://github.com/gofynd/gravity-view/releases) on your device and experience the gravity view.\n\n### Requirements\n  - Android 3.0 or higher\n\n## Usage\n### Gradle dependency\n\n```\ndependencies {\n    compile 'co.gofynd.library:gravity-view:1.0'\n}\n```\n\n### Sample Code:\n\n#### Inside Layout XML File:\n\n```\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cRelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/activity_main\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\u003e\n    \u003cHorizontalScrollView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:scrollbars=\"none\"\u003e\n        \u003cImageView\n            android:id=\"@+id/bg\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" /\u003e\n    \u003c/HorizontalScrollView\u003e\n\u003c/RelativeLayout\u003e\n```\n\n#### Inside Activity or Fragment:\n\n```\n@Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        gravityView = GravityView.getInstance(this)\n                .setImage(bg, R.drawable.landingbg)\n                .center();\n    }\n    @Override\n    protected void onResume() {\n        super.onResume();\n        gravityView.registerListener();\n    }\n    @Override\n    protected void onStop() {\n        super.onStop();\n        gravityView.unRegisterListener();\n    }\n```\n\n### Check if device is supported:\n\n```\nboolean is_supported = gravityView.deviceSupported();\n```\n\n## Roadmap\n\n- Multiple image support\n- Support for Non-Gyroscope devices using Accelerometer sensor\n\n## Contributions\n\nAny contributions are welcome!\nPlease check the [contributing guideline](https://github.com/gofynd/gravity-view/blob/master/CONTRIBUTING.md) before submitting a new issue.\n\n\n## Developed By\n\n* Fahim Sakri\n\n\n## License\n    Copyright 2017 Shopsense Retail Technologies Pvt Ltd.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgofynd%2Fgravity-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgofynd%2Fgravity-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgofynd%2Fgravity-view/lists"}