TiCollectionView icon indicating copy to clipboard operation
TiCollectionView copied to clipboard

Waterfall?

Open kosso opened this issue 11 years ago • 17 comments

Nice work.

How hard would it be to add a pinterest-like 'Waterfall' Layout ability using this?

https://github.com/chiahsien/CHTCollectionViewWaterfallLayout

kosso avatar Nov 12 '14 17:11 kosso

Should be pretty easy to implement, once the main module is stable!

mpociot avatar Nov 12 '14 19:11 mpociot

+1

kosso avatar Nov 12 '14 19:11 kosso

+1

justadaniel avatar Dec 23 '14 03:12 justadaniel

I think this might be a good Android counterpart https://github.com/etsy/AndroidStaggeredGrid

mpociot avatar Jan 06 '15 13:01 mpociot

iOS is now implemented in version 1.1.0

mpociot avatar Jan 12 '15 21:01 mpociot

:+1: very nice!

viezel avatar Jan 12 '15 21:01 viezel

Cool! thanks!

kosso avatar Jan 12 '15 21:01 kosso

Just tested it out in simulator! played nicely :)

Works also with animations when adding an item:

// Insert Item in List View with Animation
var addItemBtn = Ti.UI.createButton({title:'Add Item', bottom: 5, width: 250, backgroundColor:'white', height: 50});
addItemBtn.addEventListener('click', function(e){
    fruitSection.insertItemsAt(
                                0, // At Index
                               [{  
                                   properties: {height:400,width:400, backgroundColor:'gray'}, // Properties of Main View
                                   // Bind properties to bindId in Template
                                   info: {text: 'Something', color:'white'}, 
                                   es_info: {text: 'Manzana'}, 
                                   pic: {image: 'http://www.noao.edu/image_gallery/images/d2/ngc2237_400.jpg'}
                                }], {animated:true, animationStyle: Titanium.UI.iPhone.RowAnimationStyle.LEFT});
});
win.add(addItemBtn);

and add the following to childTemplates:

childTemplates: [
        {                        
            type: 'Ti.UI.ImageView', // Use an image view for the image
            bindId: 'pic',           // Maps to a custom pic property of the item data
            properties: {            // Sets the image view  properties
                width: Ti.UI.FILL, height: Ti.UI.FILL,
            }
        }, ...

add about 100 items, and ... it Runs Smoothly :+1:

yozef avatar Jan 12 '15 23:01 yozef

Thanks for testing this @yozef !

mpociot avatar Jan 13 '15 20:01 mpociot

+1

AppWerft avatar Jan 28 '15 17:01 AppWerft

Hi @yozef,

I tried your solution on Android but it did not work! The item gets inserted on the listView but it shows just a white square instead. Did you experience this behaviour on your tests?

My best,

deckameron avatar Jan 29 '15 18:01 deckameron

@deckameron I just tried it on iOS

yozef avatar Jan 29 '15 18:01 yozef

@yozef Thanks! :)

deckameron avatar Jan 29 '15 18:01 deckameron

Hey @deckameron ,

the waterfall layout is not available for Android. I'm working on it ;)

mpociot avatar Jan 29 '15 19:01 mpociot

@mpociot Hi! What about waterfall layout on Android? Maybe I could help you to implement it if you'l tell me what to do?

IonRod avatar Apr 17 '15 10:04 IonRod

@mpociot you never actually had the change to implement on Android, Im correct?

nuno avatar Oct 08 '16 20:10 nuno

It never was the change to implement on Android, sorry :( I accept PR :)

nuno avatar Sep 29 '17 22:09 nuno