Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    What animation effect is used for the smartgwt demo application

    Hi,

    Could you please mention what animation effect, along with the code snippet, you are using on the click on the 'Show Example' button for the smartgwt demo application. I tried looking through the source code, but could not find it.

    Thanks.

    #2
    That's just a Canvas with a border using animateResizeTo() to grow to fill the screen.

    Comment


      #3
      I tried using the animateResize() function. But that is giving performance issues.

      Here is the scenario
      1. From a page, I click on an image
      2. I go to the new page and in the constructor of the page I create the layout and add members to the layout and do the animateResize(). Code snippet as below :

      public Contructor(final int magazineID) {
      querySource = new QueryDataSource();
      magazineSource = DataSource.get("customDataSource_magazine");
      articleSource = DataSource.get("customDataSource_article");
      luvSource = DataSource.get("customDataSource_luv");

      final Slider timeSlider = new Slider();
      timeSlider.setValue(2250);
      timeSlider.setVisibility(Visibility.HIDDEN);

      this.magazineID = magazineID;
      initComponents();

      buildView();
      getLUVs();
      setupList();
      setupCenter();
      setupRight();

      setArticleListDataGrid();
      setMagazine(magazineID);

      Window.addWindowClosingHandler(new Window.ClosingHandler(){
      @Override
      public void onWindowClosing(ClosingEvent event){
      System.out.println("size of preference:" + preference.size());
      System.out.println(preferenceText);
      HashMap<String, String> articlePreference = null;
      if(currentArticle != null) {
      articlePreference = currentArticle.getPreference();
      }
      if(articlePreference != null && articlePreference.size() != 0) {
      preference.putAll(articlePreference);
      }
      preferenceText = PreferenceSettings.buildPreferenceXML(preference);
      Offline.put(Integer.toString(magazineID), preferenceText);
      }
      });
      outterContainer.animateResize(Window.getClientWidth(), Window.getClientHeight(), null, (int) timeSlider.getValue());
      }

      On doing this, this new page does a resize, but since the data within the listgrid controls and other controls are loading in during that time, the animation effect gets interrupted in between. It resizes to a particular height and width, waits for the data to complete the load and then again resumes expanding to full screen. How can a get a smooth effect?

      Can you also show the code snippet for the Demo application' 'Show Example' button?

      Comment


        #4
        Not sure what the question is here.. if you draw in the middle of an animation that can indeed cause the animation to jerk, so don't do so if you want the best chance of a smooth animation.

        Comment

        Working...
        X