Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gofynd/gravity-view
Introducing Gravity View: Because swiping is so yesterday!
https://github.com/gofynd/gravity-view
android fb-paper-tilt gyroscope image-tilt instant-article-tilt scrolling sensor sensor-tilt tilt
Last synced: 3 months ago
JSON representation
Introducing Gravity View: Because swiping is so yesterday!
- Host: GitHub
- URL: https://github.com/gofynd/gravity-view
- Owner: gofynd
- License: apache-2.0
- Created: 2017-03-06T08:41:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T11:46:47.000Z (almost 2 years ago)
- Last Synced: 2024-05-03T06:58:23.832Z (6 months ago)
- Topics: android, fb-paper-tilt, gyroscope, image-tilt, instant-article-tilt, scrolling, sensor, sensor-tilt, tilt
- Language: Java
- Homepage:
- Size: 1.4 MB
- Stars: 219
- Watchers: 42
- Forks: 36
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- Android-Awesome-Resources - Gravity-view
README
# Gravity View for Android
[![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)
Gravity 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.
You can read more about Gravity View article [here](https://blog.gofynd.com/introducing-gravity-because-swiping-is-so-yesterday-4aebd89f0e21)
[![Gravity View video](http://img.youtube.com/vi/IrNr-J1s8f8/0.jpg)](http://www.youtube.com/watch?v=IrNr-J1s8f8)
## Demo
Install [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.
### Requirements
- Android 3.0 or higher## Usage
### Gradle dependency```
dependencies {
compile 'co.gofynd.library:gravity-view:1.0'
}
```### Sample Code:
#### Inside Layout XML File:
```
```
#### Inside Activity or Fragment:
```
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
gravityView = GravityView.getInstance(this)
.setImage(bg, R.drawable.landingbg)
.center();
}
@Override
protected void onResume() {
super.onResume();
gravityView.registerListener();
}
@Override
protected void onStop() {
super.onStop();
gravityView.unRegisterListener();
}
```### Check if device is supported:
```
boolean is_supported = gravityView.deviceSupported();
```## Roadmap
- Multiple image support
- Support for Non-Gyroscope devices using Accelerometer sensor## Contributions
Any contributions are welcome!
Please check the [contributing guideline](https://github.com/gofynd/gravity-view/blob/master/CONTRIBUTING.md) before submitting a new issue.## Developed By
* Fahim Sakri
## License
Copyright 2017 Shopsense Retail Technologies Pvt Ltd.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.