Saturday, June 16, 2012

using the mgwt swipe panel

This post is part of a series of blogposts that show the usage of  some mgwt / gwt-phonegap components.

This blog post will show the use of the Carousel widget in mgwt. The widget can be used to display different content in a horizontal row. Users can access the content by swiping to it.

The widget looks like this:

To build this you need to do the following steps:

1. Setup the viewport for the mobile browser:
MGWT.applySettings(MGWTSettings.getAppSetting());

2. Instantiate an AnimationHelper and attach it to the RootPanel:

AnimationHelper animationHelper = new AnimationHelper();
RootPanel.get().add(animationHelper);

3. Instantiate a LayoutPanel and add in the Carousel widget:
LayoutPanel layoutPanel = new LayoutPanel();
  
Carousel carousel = new Carousel();
layoutPanel.add(carousel);

4. Add some content to the Carousel:
carousel.add(someWidget);

5. Animate to the created UI:
animationHelper.goTo(layoutPanel, Animation.SLIDE);


The complete code example can be found here. If you want to see the widget in action, take a look into the showcase.

10 comments:

  1. Hi Daniel.

    Thanks, the Carousel is almost what I need.
    The thing is that I need a circular carousel (i.e.
    where after the last page, the first page comes again).
    More preciselly, I need the effect of swiping from
    the last page to the first to be as if they were consecutive
    pages (and not a 'rewind' effect). There exist a way of using
    the carousel to achive that? Is there an easy way to provide
    this functionality?

    Thanks in advance,

    Mauro

    ReplyDelete
    Replies
    1. Thumbs up only to that mobile phone deal which fits to your budget requirement. Never go beyond your price limitation. If you are buying contract phone deal, then be sure that the charged line rental must be within your access.free business calls
      شادمهر عقیلی

      افشین

      Delete
  2. Thumbs up only to that mobile phone deal which fits to your budget requirement. Never go beyond your price limitation. If you are buying contract phone deal, then be sure that the charged line rental must be within your access.free business calls

    ReplyDelete
  3. a free mobile tracker has many uses, and should not be ignored. You should locate a free www.bestmobilenumbertracker.com/dnd-check/ well in advance of needing one so that you are familiar with the site and how it works.

    ReplyDelete
  4. Thanks a lot for your efforts to have had these things together on this blog site. Mary and i also very much appreciated your input through your articles with certain things. I recognize that you have many demands in your schedule hence the fact that you actually took the maximum amount of time as you did to guide people really like us via this article is actually highly valued. PSD to HTML

    ReplyDelete
  5. good ,we should do much , l like this ,so we can do much things , l have the sip speaker.sometime we will see the emergency roadside telephone and emergency call box.

    ReplyDelete
  6. This is among the most popular mobile website as it help me to a whole lot to locates my needs on my modest mobile phone accessories Ersatzteile Smartphones easily therefore normally i seem on this website everyday possibly 9 intervals daily i actually love this particular page many thanks a lot more power

    ReplyDelete
  7. https://www.travelaurochs.com/
    https://www.travelaurochs.com/products
    https://www.travelaurochs.com/bike-saddle-bag-best-waterproof
    https://www.travelaurochs.com/pannier-bag
    https://www.travelaurochs.com/handlebar-bags
    https://www.travelaurochs.com/bike-tube-bags
    https://www.travelaurochs.com/folding-bike-bag
    https://www.travelaurochs.com/cycling-backpack
    https://www.travelaurochs.com/moto-bags

    ReplyDelete
  8. hop over to these guys Look At This visit this web-site check this official site his response

    ReplyDelete