Not to show scrollpanescrollbar if height of screen is long enough

2 messages - 552 views

is it possible do not show scrollpanescrollbar if height  of screen is long enough. if it's possible show/hide when flipping from portrait to landscape view of screen on device?

Thanks!!!

Making ScrollBar invisible when no need to scroll inside ScrollPane:

In ScrollBar.java  the code of setSelection(int selection) method should be modified to include the following line:

this.setVisible(!barHidden);

 

So the whole code of setSelection(int selection) will be:

 

public void setSelection(int selection) {

              int lastSelection = this.selection;

              this.selection = Math.min(MathFP.ONE, Math.max(0, selection));

              if (this.selection != lastSelection) {

                     if (horizontal) {

                           barLayoutData.width = this.selection;

                           barLayoutData.height = -1;

                     } else {

                           barLayoutData.width = -1;

                            barLayoutData.height = this.selection;

                     }

                     barHidden = this.selection == MathFP.ONE || this.selection == 0;

                     bar.invalidate();

            this.setVisible(!barHidden);

              }

       }

 

ramezs@gmail.com