Sorry I forgot the follwoing:
In KuixCanvas.java add the following function:
public boolean isTransitionRunning(){
return transitionRunning;
}
|
ramezs 15 messages 2010-07-16 |
|
|
ramezs 15 messages 2010-07-15 |
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(){
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
|
|
ramezs 15 messages 2010-07-15 |
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
|
|
ramezs 15 messages 2009-11-11 |
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) { To: if (isFocusable() && (type == KuixConstants.POINTER_RELEASED_EVENT_TYPE||type==KuixConstants.POINTER_PRESSED_EVENT_TYPE)) {
Best Reagrds, ramezs@gmail.com |
|
ramezs 15 messages 2009-03-23 |
|
|
ramezs 15 messages 2009-03-22 |
I have a TextArea with long text inside it, I put the TextArea inside ScrollPane as following: <screen Title="Testing Scroll Pane"> The result is in the following snapshot:
I found these two bugs: 2- New lines in TextArea are omitted and not rendered. |
|
ramezs 15 messages 2009-03-20 |
|
|
ramezs 15 messages 2009-03-20 |
|
|
ramezs 15 messages 2009-03-19 |
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. |
|
ramezs 15 messages 2009-03-18 |
Your documntation says: 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! |
|
ramezs 15 messages 2009-03-18 |
|
|
ramezs 15 messages 2009-03-14 |
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.
|
|
ramezs 15 messages 2009-03-14 |
|
|
ramezs 15 messages 2009-03-14 |
|
|
ramezs 15 messages 2009-03-11 |
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)
inthis the scrollbar appears after navigating to last visible item (item3)
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. |