Closed indrac closed 8 years ago
@indrac can you provide some code for me to look at? Prefereably if you could link to your project so I can see all the code that is in question would be best.
Also, see which branch of the YouTubePlaylist are you using ? I have a couple of branches with various changes. I would recommend you to try the data-binding branch or the rx-java branch as those are a bit further along than the master branch.
I posted my code on gist github 3 files, the YoutubeViewFragment.java is the main view of youtube playlist, I hardcoded it and set playlist ID value on number 1 and 2 on that spinner menu. PlaylistCardAdapter.java is same like your code, I changed a lil bit image loader to Universal Image Loader. And the last file fragment_youtubeview.xml is the layout for my YoutubeViewFragment class.
YoutubeViewFragment.java Link PlaylistCardAdapter.java Link fragment_youtubeview.xml Link
So thanksful for your reply in this issue.
@indrac Not sure what exactly is wrong with your code. It might have something to do with the StatefulLayout
class that you are using. Take a look at the recent changes I just made in the master branch. I added support for selecting a playlist using a spinner from a list of playlist id's. As an added bonus I also added the capability of fetching the playlist titles and updating the spinner with the playlist title data.
Thanks for answering my question, and finally I know what is wrong with my code. I compile and debug with my Nexus tablet, and I just have to declare this :
mLayoutManager = new StaggeredGridLayoutManager(resources.getInteger(R.integer.columns), StaggeredGridLayoutManager.VERTICAL);
to my OnItemSelected inside spinner.setOnItemSelectedListener.
Glad to hear you were able to figure out the issue you were facing!
I use your code to my app, and add spinned menu on top of recyclerview. Each menu have different value/playlist id, I successfully load the data from that API playlist. But the weird thing, when I select second/third option from spinned menu, the result of recyclerview is new data placed on bottom layout, I have to scroll it up to view the result. Any solution for this? Or why this is happen? Much appreciate for your help and thanks for the code.