Diolor / Swipecards

A Tinder-like Android library to create the swipe cards effect. You can swipe left or right to like or dislike the content.
Apache License 2.0
2.34k stars 583 forks source link

Updated "if condition" to update view dynamically #147

Closed rahatshahzeb closed 8 years ago

rahatshahzeb commented 8 years ago

In order to update view dynamically after change in data set, this "if condition" need to be changed. Currently, you are only updating view on touch event but I had a scenario where I needed to change view dynamically without touching.

alexwalterbos commented 8 years ago

This calls removeAllViewsInLayout() a LOT, and will affect battery life. You could include a boolean field that can be set to true if continuous updating is needed, and use that in an or clause in the if/else:

if( !updateContinuously // if updateContinuously == true, it skips to the 'else'
    || mActiveCard!=null 
    && topCard!=null 
    && topCard==mActiveCard) {

Also, @Diolor are you still maintaining this repository? Last commit was >11 months ago..

rahatshahzeb commented 8 years ago

@alexwalterbos yes, a good suggestion.