Messages by ramezs

6 topics, 15 messages
Kuix bug report » ListItem bug when Screen Transaction!

Sorry I forgot the follwoing:

In KuixCanvas.java add the following function:

public boolean isTransitionRunning(){

        return transitionRunning;

}

 

Kuix bug report » ListItem bug when Screen Transaction!

   Fixing Bug: displaying a new screen, with transition effect, that has an initial focus on a Text doing slide animation causes the screen to not be rendered correctly:

Cause:

While the transition between the two screens is rendered the slideTextWorkerTask of the Text widget will shrink the repaint area of the canvas to the size of the Text widget, this happens as following:

slideTextWorkerTask ->  invalidateAppearance() -> Widget. invalidateAppearanceRegion(0, 0, width, height) -> Desktop.invalidateAppearanceRegion(..) -> canvas. repaintNextFrame(x, y, width, height)

Solution:

Disable the function of slideTextWorkerTask while rendering transition between screens

In Text.java:

 

if (isVisible()&& !Kuix.getCanvas().isTransitionRunning()) {

if (textX < minOffset || textX > maxOffset) {

                  slideTextIncrement *= -1;

      }

      textX += slideTextIncrement;

      invalidateAppearance();

}

In KuixCanvas.java add the following function:

public boolean isTransitionRunning(){
        return transitionRunning;
}

 

  Fixing Bug: Displaying an old (was displayed before) screen that has an initial focus on a TextWidget (that has slide animation) doesn’t trigger the slide animation of that TextWidget:

Cause:

While slideTextWorkerTask will be terminated when the container screen is not the current screen, this termination is cause by the following line of code in the task:

return !isInWidgetTree();

The task is not called again because the doLayout() is called only for the first time when creating the screen and adding widgets to it.

Solution:

When displaying a screen trigger all focused child Text widgets inside the screen, to start the slideTextWorkerTask.

 

In Desktop.java:

if (screen != null) {

                              super.add(screen);

            //By Wamsoft: triger text slid animation should be called here

            triggerSlideAnimation(this);

}

 

void triggerSlideAnimation(Widget widget) {

        for (widget = widget.getChild(); widget != null; widget = widget.next) {

            if (widget instanceof Text &&  widget.isFocusWidgetChild()){

                ((Text)widget).triggerSlideAnimation();

            }

if (widget instanceof Ticker) // Ticker is a custom widget

                      ((Ticker)widget).triggerSlideAnimation();

            if (widget.getChild()!=null)

                triggerSlideAnimation(widget);

        }

}

 

 

In  Text.java:

public void triggerSlideAnimation(){

       if (slideTextWorkerTask != null) {

                              Worker.instance.removeTask(slideTextWorkerTask);

            textX = originalTextX;

                              slideTextIncrement = 1;

                              Worker.instance.pushTask(slideTextWorkerTask);

                  }

}

 

ramezs@gmail.com

 

Kuix general board » Not to show scrollpanescrollbar if height of screen is long enough

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

 

Kuix technical support » touchscreen 'down' state

Dear pandora808

If you want to show the touchscreen down state on a Focusable widget, or in other words, make the widget focused only (without calling Action event) just change the code of processPointerEvent() method in FocusableWidget.java from:

if (isFocusable() && type == KuixConstants.POINTER_RELEASED_EVENT_TYPE) {
            requestFocus();
            return true;
}

To:

if (isFocusable() && (type == KuixConstants.POINTER_RELEASED_EVENT_TYPE||type==KuixConstants.POINTER_PRESSED_EVENT_TYPE)) {
            requestFocus();
            return true;
}

 

Best Reagrds,

ramezs@gmail.com

Kuix bug report » Scrollpane issues

Still no solution for the proplem in the function of focusloop for a list inside scrollpane when useMarker= true.

Kuix bug report » TextArea inside ScrollPane issues

I have a TextArea with long text inside it, I put the TextArea inside ScrollPane as following:

<screen  Title="Testing Scroll Pane">
    <scrollPane >
        <scrollpanecontainer >
        <textarea id="TextArea">
                <![CDATA[
                Paragraph 1:
                Hi,
                This is a test for TextArea with long text to see how it works with scrollpane.
                After this sentence there is anew line.
                If it doesn't appear this means there is a problem in rendering new lines
                Paragraph 2:
                Hi,
                This is a test for TextArea with long text to see how it works with scrollpane.
                After this sentence there is anew line.
                If it doesn't appear this means there is a problem in rendering new lines
                Paragraph 3:
                Hi,
                This is a test for TextArea with long text to see how it works with scrollpane.
                After this sentence there is anew line.
                If it doesn't appear this means there is a problem in rendering new lines
                ]]>
        </textarea>
        </scrollpanecontainer>
    </scrollPane>
    <screenSecondMenu onAction="back">back</screenSecondMenu>
</screen>

The result is in the following snapshot:

TextArea Snapshot

 

 

 

 

 

 

 

 

 

 

 

I found these two bugs:

1- I cannot scroll down or up although the scroll bar appears correctly (see snapshot).

2- New lines in TextArea are omitted and not rendered.

Kuix technical support » New line in i18n/messages.properties

How can I write a new line in the value of a label inside "i18n/messages.properties" file

Kuix technical support » Alignment parameter of Flowlayout

In kuix I found that the horizontal alignment (left or irght) passed to Flowlayout Object has no effect.

Is it the intended behavior?

Kuix bug report » bug in the documentation of setAuthorStyle() method

You wrote in the description of setAuthorStyle() method:

"Caution, if widget attribute are already cached, you need to call the invalidateStylePropertiesCache(propagateToChildern)"

But calling invalidateStylePropertiesCache() is not enough, clearCachedStyle() should be called also to make getStyles() reload cachedStyles using Kuix.getStyles(this) which in turns calls widget.getAuthorStyle(), and the last one will apply the new AuthorStyle set by setAuthorStyle() method.

Kuix technical support » Setting Screen's "layout" style property from java code

Your documntation says:
"Everything you can do with XML and CSS can be done directly with Java code, but it could be less flexible and less human readable."

In "kuixDemo" app, I tried to set the screen's layout property of "FlowLayoutScreen" from java code after it has been loaded from "flowLayoutScreen.xml" but I failed to do that after many tries.

Can you tell me what is the java code to set the "Layout" property?

Why is the structure of widget tree in java code differs from the one in XML, this making it hard to mange the UI from java code!

Kuix technical support » focusloop not working on screen

I also faced a similar problem for a list inside a scroll pane, check it @:

http://www.kalmeo.org/forum/topic/471/scrollpane-issues/1

Kuix bug report » Scrollpane issues

In "ScrollPane.java" I tried to set useMarkers=true, the follwoing problems are solved:

- The error in the function of focusLoop.

- At start: the first item in the list is not focused, and the focus is on nothing.

I want to ask: what is the function of "useMarkers" as it is not used be the user of "ScrollPane" class, in spite of it causes the previous problems.

 

Kuix bug report » Scrollpane issues
Kuix bug report » Scrollpane issues

But after I fixed the scrollBar code as you suggested, the scrollbar is always shown even if there is no need to scroll (example: only two items in the list).

Kuix bug report » Scrollpane issues

When I started to create a full screen list using Scrollpane I found the following two problems:

First: The scroll bar doesn't appear even if there is a number of items in the list that are not displayed.

Here is an example from Kprice application where we have 8 items in the main list:

this snapshot before navigating to last visible item (here item3)

Snapshot of main list in Kaprice

inthis the scrollbar appears after navigating to last visible item (item3)

Snapshot of main list in Kaprice


The scroll appears after I navigate down to the last visible item (in snapshot item 3), it is very strange behavior, because the user at first look will not notice that there is other items not visible and he should scroll down to see them.

Second: the function of "focusloop" attribute is not working correctly.

for example in Kprice main list it is not working at all although that focusloop="true" is set in  m_s.xml file. In other projects the function of focusloop sometime work and some times work if we scroll down after the last item in the list but doesn't loop if we move up from the first item.

I don't know how you or the community didn't notice these bugs, taking into account that the full-screen list is the main component of any mobile application, and your framework is in version 2 !!