What about the solution proposed above? Does it answer the concern about the panel?
This is a bit of a hack, but you can let the user write the cache size in the Tag field (to override a reasonable default value).
/**
* Gets or sets the view's left position.
*/
public int getLeft() {
BALayout.LayoutParams lp = (LayoutParams) getObject().getLayoutParams();
return lp.left;
}
public void setLeft(@Pixel int left) {
BALayout.LayoutParams lp = (LayoutParams) getObject().getLayoutParams();
lp.left = left;
getObject().getParent().requestLayout();
}
One option is to let the user set the other parameters programmatically. If these parameters must be set before the view is created then for now you cannot use this feature.Sorry I don't understand. If I have two or three parameters, what am I supposed to do?
Without it you can use code similar to:
If these parameters must be set before the view is created then for now you cannot use this feature.
It is certainly possible that new options will be added in the future. The designer component is not a "standalone" component. Adding a custom property depends on support for custom properties in the doclet tool, the IDE, classes and so on.
It is not too difficult however it is something I prefer to add in a later version (when we all better understand the requirements).
One of the "problems" with a tool such as Basic4android is that you can only add features. It is almost impossible to modify or remove features without breaking backwards compatibility. For that reason I prefer to start simple and then extend the features when things are more clear.
No, but I'm too busy to do it in a near future.Oh, i understand...
would it be a lot of work to create 'full' B4A library with this switch class ?
Oh I agree. Performance is not what bothers me. It's the use.
I attached to this post the Switch library (copied from post #1, with two properties added: Left and Top) and a test project.
My steps:
1) I create a layout with the switch in the middle.
2) I open the layout with LoadLayout. Ok, my switch is loaded and it appears where I placed it.
3) I set its left and top properties to move it to the top left corner, but it does not move. It's logical: it's embedded inside a panel, so its coordinates are not relative to the activity but to this panel. I have to move the panel (cumbersome!). The problem is that I have no access to this panel. And getParent, with the Reflection library, raises an error.
So how can I move the view dynamically?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?