Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
janishar committed Oct 12, 2016
2 parents 43936a5 + 155deb1 commit 109f0b1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,21 @@ public class ImageTypeBig {
2. `setLayoutManager(layoutManager)`: Add custom layout manager
3. `addView()`: Add views to the PlaceHolderView
4. `removeView()`: Removes the existing view
5. `SmoothLinearLayoutManager`: This class is bundled with the library, and should be used for those view which has dynamic heavy contents. It reduces the screen flikering on bind
5. `SmoothLinearLayoutManager`: This class is bundled with the library, and should be used for those view which has dynamic heavy contents. It reduces the screen flickering on bind

## Annotations
1. `@Layout`: Bind the XML layout with the class.
2. `@View`: Bind the variable with the view defined in the above layout.
3. `@Click`: Bind the `OnClickListener` to a view.
4. `@LongClick`: Bind the long click listerner to a view.
4. `@LongClick`: Bind the long click listener to a view.
5. `@Resolve`: Any operation being performed on the view reference defined by `@View` should be annotated with this.
6. `@Animate(Animation.ENTER_LEFT_DESC)`: Sets the defined animations in the Animation class on this item view.
7. `@NonReusable`: Releases the view reference along with all the attached references in the view object. This view object should not be used again in the `addView()`.
8. `@Position`: This annotation binds an int variable to the position of the item view after the item view is attached to the display.

## Important
1. `PlaceHolderView` will recycle the viewItems and will try to use similar/same viewtype viewItem to populate the data of the current viewItem. So, the method annotated with `@Resolve` will be called everytime the viewItem is attached to the window. Meaning if you don't explicitly manage to populate the viewItem in method annotated with `@Resolve` then that viewItem may show history of the reused viewItem.
2. Try to instantiate any class in the contructor rather than method annotated with `@Resolve`.
2. Try to instantiate any class in the constructor rather than method annotated with `@Resolve`.
3. If the itemView contains PlaceHolderView/ListViews and item are being adding through method annotated with `@Resolve`, then first make the list empty. This is required because duplicate viewitems may get added if the recycled view contains PlaceHolderView/ListViews of other itemView. For PlaceHolderView: call removeAllViews() before adding views in method annotated with `@Resolve`.

# `ExpandablePlaceHolderView`
Expand Down Expand Up @@ -153,7 +153,7 @@ public class ImageTypeBig {
6. `@SwipeView`: It binds the android.view.View reference to the tinder view

# `InfinitePlaceHolderView`
#### This class provides a machanism to load the data in bunches for infinite loading. If the scroll reaches the last item, it calls for LoadMore and show the defined loadmore indicator view. When new data it added the indication is removed. To get the callback for loadmore create a class like that used in PlaceHolderView and define a method with `@LoadMore` annotation. This method should be used to do network calls and to add new fetched views.
#### This class provides a mechanism to load the data in bunches for infinite loading. If the scroll reaches the last item, it calls for LoadMore and show the defined loadmore indicator view. When new data it added the indication is removed. To get the callback for loadmore create a class like that used in PlaceHolderView and define a method with `@LoadMore` annotation. This method should be used to do network calls and to add new fetched views.

# Methods(`InfinitePlaceHolderView`)
1. `setLoadMoreResolver(T loadMoreResolver)`: This method is used to add a class to be used as indicator for load more. The class can define a view with a progessbar to reflect loading. The class has to be defined in the same way as a class that is used in the PlaceHolderView. See above for PlaceHolderView example.
Expand All @@ -163,8 +163,6 @@ public class ImageTypeBig {
# Annotations(`InfinitePlaceHolderView`)
1. `@LoadMore`: This annotation calls a method of the class provided in `setLoadMoreResolver` with callback when load more is required, i.e. when last item has been seen.

#### See loadmore example here: [Infinite List](https://github.com/janishar/Tutorials/tree/master/InfiniteList)

###### The Full Documentation is in the process of writing. For any query post it in the discussion or [[email protected]](mailto:[email protected])

# Gradle
Expand Down Expand Up @@ -200,15 +198,17 @@ dependencies {

[Android Tinder Swipe](https://medium.com/@janishar.ali/android-tinder-swipe-view-example-3eca9b0d4794#.413dgor3o)

[Android Infinite List with Load More](https://medium.com/@janishar.ali/android-infinite-list-with-load-more-example-3749ea7bc33#.e3juocg6s)

# Recent Library: [`JPost`](https://github.com/janishar/JPost)
#### `JPost` is a pubsub library based on massages over a channel. It's very efficient and much powerful than other pubsub libraries. It prevents memory leak and increases code control. Also, provide a mechanism to run code asynchronously.

#### Why should you use this library
1. In contrast to the existing pub-sub libraries, it hold the subscribers with weakreference. Thus it doesn't create memory leaks.
2. Single message can be sent to selected subscribes. This avoids the problem of event getting received at undesirable places. Thus minimising the chances of abnormal application behaviour.
3. The subscriber addition can be controlled by using private channels. It minimises the chances of adding subscribes by mistake to receive undesirable messages.
4. It is a tiny library < 55kb . Thus not effecting the application overall size.
5. It facilicates synchronous as well as asynchronous message delivery and processing.
4. It is a tiny library < 55kb . Thus not affecting the application overall size.
5. It facilitates synchronous as well as asynchronous message delivery and processing.
6. It provides a mechanism to run code asynchronously.

# License
Expand Down

0 comments on commit 109f0b1

Please sign in to comment.