Hi.
I´ve had this question here before an then i got it sorted by i didnt get the pics to show fullview with that solution.
http://developer.appcelerator.com/question/137186/more-pictures-in-coverflow-with-navbar-buttons
So i now kindly ask if anyone has any solution to this problem.
Here is my default code for getting the pics from facebook.
What i look for is a line of code for using the data.paging.next and data.paging.previous from the API so i can make buttons and load 25 more pictures if the album has more than 25 pics in it. So here is my gallery tableview
var win = Ti.UI.currentWindow; win.showNavBar(); Titanium.UI.setBackgroundColor('#ffffff'); var bgImage = Ti.UI.createImageView({ image : 'images/h0.jpg', zIndex : 0 }); win.add(bgImage); var artist ='YourFacebookID'; var url = "https://graph.facebook.com/" + artist + "/albums"; var table = Ti.UI.createTableView({ top: 10, bottom: 10, backgroundColor: 'transparent', separatorColor:'transparent', }); var tableData = []; var json, data, name, picture, description; var xhr = Ti.Network.createHTTPClient({ onload: function() { // Ti.API.debug(this.responseText); json = JSON.parse(this.responseText); for (i = 0; i < json.data.length; i++) { data = json.data[i]; row = Ti.UI.createTableViewRow({ height:'90dp', backgroundColor: 'transparent', separatorColor:'transparent', }); var name = Ti.UI.createLabel({ text: data.name, font:{ fontSize:'17dp', fontWeight:'bold' }, height:'18dp', left:'90dp', top:'8dp', color:'#eee', touchEnabled:true }); row.add(name); var desc = Ti.UI.createLabel({ text: data.description, font:{ fontSize:'14dp' }, height:'50dp', left:'90dp', right: '10dp', top:'28dp', color:'#eee', touchEnabled:true }); row.add(desc); // Avatar var img = Ti.UI.createImageView({ image : 'https://graph.facebook.com/' + data.cover_photo + '/picture?type=thumbnail' , width : 70, height : 70, top : 5, bottom : 5, borderRadius : 7, borderColor : 'transparent', left : 10 }); row.add(img); row.id = data.id; row.name = data.name; tableData.push(row); } table.setData(tableData); }, onerror: function(e) { Ti.API.debug("STATUS: " + this.status); Ti.API.debug("TEXT: " + this.responseText); Ti.API.debug("ERROR: " + e.error); alert('There was an error retrieving the remote data. Try again.'); }, timeout:5000 }); xhr.open("GET", url); xhr.send(); win.add(table); win.open(); // Handle a click event on the table table.addEventListener('click',function(e) { // Create the new window with the link from the post var faceWindow = Ti.UI.createWindow({ title : e.row.name, data: e.row.id, // Pass the row data to the new window for use url: 'gallview.js', barColor: '#050505', backgroundColor: '#000' }); var close = Titanium.UI.createButton({ title: 'Tillbaka', style: Titanium.UI.iPhone.SystemButtonStyle.PLAIN }); faceWindow.setLeftNavButton(close); // Handle the close event close.addEventListener('click',function() { faceWindow.close(); }); Titanium.UI.currentTab.open(faceWindow, { animated:true }); });And here is my view for the pics in tha album choosen.
var win = Ti.UI.currentWindow; win.showNavBar(); var bgImage = Ti.UI.createImageView({ height : 'auto', top : -11, image : 'images/h-6.jpg', zIndex : 0 }); win.add(bgImage); var url = "https://graph.facebook.com/" + win.data + "/photos"; var loader = Titanium.Network.createHTTPClient(); loader.onload = function() { var data = JSON.parse(this.responseText); var images = []; for (var c=0;c<data.data.length;c++) { images[c]= {image: data.data[c].source, width:'150dp', height:'150dp'}; } var view = Titanium.UI.iOS.createCoverFlowView({ images:images, backgroundColor:'#000', }); win.add(view); // click listener - when image is clicked view.addEventListener('click',function(e) { var imgWindow = Ti.UI.createWindow({ modal: true, barColor: '#050505', backgroundColor: '#050505' }); var fullImage = Ti.UI.createWebView({ html: '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2, user-scalable=yes" /><img src="'+ images[e.index].image + '" / Width="100%">', backgroundColor: '#050505' }); var close_modal = Titanium.UI.createButton({title:'Stäng'}); imgWindow.rightNavButton = close_modal; close_modal.addEventListener('click', function() { imgWindow.close(); }); imgWindow.add(fullImage); imgWindow.open(); }); } loader.open("GET", url); loader.send();Or if anyone has the solution for getting the pics show fullview with the code used in the link above that would work for me also.
Thanx.
Your Answer
Think you can help? Login to answer this question!