How can I make a carousel? - java

I'm looking to create a carousel that snaps to whatever page covers most of the screen after a swipe, similar to how swipes can move through pages of android shortcuts and widgets. Similar to this. Each page should be able to display any assortment of layouts, data, or pictures.
I have looked at the resources on the "Creating an Android Image Carousel" page by Giancarlo Leonio. However, most questions are unanswered or do not apply to android.
I have seen tutorials with a viewpager, but they immediately switch pages after a swipe. I prefer that the pages appear to be connected.

You are looking for ViewPager. I don't know where you found these tutorials that lead you to believe that the interactions would appear that the pages are not interconnected.
You can find a good tutorial and demo transitions on the official documentation: http://developer.android.com/training/animation/screen-slide.html
Additionally, if you also want the indicators that Carousels would normally have you can take a look at the most popular library out there for ViewPagers...
ViewPagerIndicator
Sample App on Google Play

Related

How to create a working ViewPager App?

I am trying to develop an application which would be a lot better if it had a clean ViewPagerUI. I dont need fancy menus (yet), all I want is that if I start my application It starts out as one relative Layout, and i can then swipe left and right to view two more Relative Layouts.
I have read, watched and studied tons and tons of tutorials in the past week, but they all seem to either be outdated, don't fit my needs (because they create new "pages" with a while/for loop, which is definetely not what i'm looking for), or are way to complicated/ leave out important information( i am a fresh developer, but I really don't want to give up) like the official guide on the android developers webpage.
I get that experienced developers can get a lot out of these tutorials, but I don't find them to be very informative for beginners/newbs.
Questions I asked myself while reading different guides are:
Which differernt java classes/ xml files do I need to create, and which code goes where?
How does the ViewPager know which Fragment I want to display on any page?
How can I add working, "connected" code to all three fragments?
To give you some helpful information:
The first page should display a chart
The second page contains edit texts, which add items to an array and thus to the chart on the first page on button click
The third page contains settings for the chart
I don't need ANY other pages/activities/main menus whatsoever. Only these three interacting pages.
I`ve found it to be the best option to go with relative layouts.
The second page should be the main page.
I am sorry if you think that my issue is dumb, but i am trying to create this app for over a week now, and i seem to not get any traction.
Thanks in advance!

Display specific html tags in webview from wordpress website

I'm trying to develop an android app in order to display articles (in different sections) from my wordpress site and with the same site style. So I tried JSON-API plugin and I noticed that I cannot display articles as I would like to do. So I'm now thinking to work with webview and I'm wondering if there is a way to select only a div or a container (the one in wich there's the article list) in the web page bypassing header, footer and the other stuff. I tried to search for some examples but I couldn't find anything helpful.
Do you have examples/suggestions? I'm stuck since days and I can't find a solution.

Adding views to MuPDFReaderView

I am currently using the MuPDF library from here: http://www.mupdf.com/
I've successfully compiled the library and everything is working great, though I am at a loss on how to achieve the following.
I want to attach views, such as button views, textviews, webviews and imageviews to the MuPDFReaderView. But everytime I try to add the view I fail to get any visible results, I can not see the attached view anywhere and I'm sure it's being added because when I debug it, the code is successfully run.
The reason I want to do this is to overlay views on the PDF view which will then scale and move along with the PDF document.
I ofcourse realise there isn't any code in this question, but I can't really post the entire MuPDF source code here, so here's what I think is relevant in a pastebin:
http://pastebin.com/qJFNsvdV
So yeah, how and where would I attach views to the document so they scale and move with the document properly?
We have a similar feature in our Android customizable magazine app, using muPDF: we add views on top on the pdf view to display slide shows or videos inside a magazine page.
This app is open source and available on Github. It should be easy for you to review the code, and see how we implemented this feature.

Scrolling left/right to new pages

I am creating an application which displays several "pages" of content. Typically this is representative as tabs on a desktop based application.
On android, I want to be able to flick between the tabs of information, using there finger anywhere on the screen. The content of these tabs will just be XML views, or programmatically created views.
Looking at Applications on android, there are several applications that do this. Google Play, Gmail, Beautiful Widgets, BBC News, Contacts, Engadget.
I've looked for several terms, mostly scrollable tabs but haven't found anything that is similar to the above applications. I'm looking at TabHost, TabWidget and ViewPaper at the moment, but not sure if these do what I'm looking for.
Can anyone tell me which control can be used in android to get the functionality. Out of the apps listed I'm looking to have it styled more like the Google Play store, with the name of the tab at the top, and the names of the nearby tabs to the left and right if applicable.
There is an example on the android blog for this, used on google play app.
Horizontal View Swiping with ViewPager
Sounds like you're looking for this. It's compatible with ViewPager, the v4 compatibility library, and ActionBarSherlock.

Android View similar to Google's Youtube app?

I know that Android's Youtube app is not open source, but I pulled apart the apk with apktool and found that they have a class, YoutubeListView used frequently in their app. Is there already an open source implementation of the Youtube Player Activity's title/ fling view/ layout? I know of similar views like Joao Machete's FlingAndScrollViewer, but I need it to be rigge to a title menu and work as smoothly as that on the Youtube app. If there is no open source implementation, either how hard would it be to convince Google to release just that component's source, or to implement it myself?
Thanks
Btw, the footer in this layout is what I am talking about. It has titles like Info & Related videos that can be clicked and it scrolls to them, and it can be scrolled left and right.
I've come to the conclusion that there is no such view. It would be best to make my own custom layout.

Categories