https://github.com/oliveroneill/imagefeedview
An android library for displaying Facebook/Instagram inspired feeds
https://github.com/oliveroneill/imagefeedview
android feed kotlin kotlin-android photo-browser
Last synced: 4 months ago
JSON representation
An android library for displaying Facebook/Instagram inspired feeds
- Host: GitHub
- URL: https://github.com/oliveroneill/imagefeedview
- Owner: oliveroneill
- License: mit
- Created: 2017-10-11T09:56:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-24T03:15:03.000Z (over 7 years ago)
- Last Synced: 2025-01-07T14:11:36.472Z (5 months ago)
- Topics: android, feed, kotlin, kotlin-android, photo-browser
- Language: Kotlin
- Homepage:
- Size: 205 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ImageFeedView
[](https://bintray.com/oliveroneill/ImageFeedView/ImageFeedView/_latestVersion)
[](https://travis-ci.org/oliveroneill/ImageFeedView)A simple Android library for creating data feeds so that data can be loaded
dynamically as the user scrolls. This is inspired by scrolling through photos
on Facebook or Instagram.This is still a work in progress. See [TODO](#todo)
This library uses [GestureViews](https://github.com/alexvasilkov/GestureViews)
for its photo viewer and wraps this for easy usage with a feed.This is roughly based on the `FeedCollectionViewController` library for Swift
that you can find [here](https://github.com/oliveroneill/FeedCollectionViewController)## Example
To run the example project, clone the repo, and run the `sample` configuration.
The example project demonstrates the functionality without using any actual content, it creates
coloured images to illustrate its use with a large amount of content.## Installation
Through `build.gradle`:
```gradle
compile 'com.oliveroneill:imagefeedview:1.0.2'
```## Usage
To set up a feed, you need to extend `ImageFeedView` with your image class:
```kotlin
class ExampleImageFeedView : ImageFeedView {
constructor(ctx: Context) : super(ctx)
constructor(ctx: Context, attrs: AttributeSet) : super(ctx, attrs)
}
```
Then use this class in your layout file:
```xml```
Then implement an `ImageFeedController` for loading images:
```kotlin
override fun loadImage(item: ExampleImageClass, imgView:ImageView, listener: LoadListener?) {
// TODO
}override fun recycleImage(imgView:ImageView) {
// TODO
}override fun clear() {
// TODO
}
```
Then set up an `ImageFeedConfig`:
```kotlin
val config = ImageFeedConfig(controller)
.setToolbar(toolbar)
.setTranslucentStatusBar(true)
feed.show(config)
```
For custom grid items or photo viewers, use
`setGridAdapter(adapter : PhotoListAdapter)` and
`setPagerAdapter(adapter : PhotoPagerAdapter)`.## Testing
Testing is done through JUnit, these tests are located in the `imagefeedview` project.## Todo
- Figure out why double tap breaks with data uri images when loaded a second time
- Set placeholder images
- Make pager toolbar easily configurable
- Make grid item views configurable
- Make pager item views configurable (specify a common layout and have simple setters for that)
- Allow custom error messages## Author
Oliver O'Neill
## License
ImageFeedView is available under the MIT license. See the LICENSE file for more info.