Could perhaps do with a reset function?
Example on Osama's numbers
Ok Adding that. But at this moment it will reset only the last used component.
Added the Reset() function.
@TIMAI2 Is it working ?
@Anke I tried to solve this one too, please check once more.
Much thanks to both of you.
ShubhamText.aix (8.1 KB)
I don't get this error.
Probably this one should not give the error.
ShubhamText (1).aix (8.1 KB)
I know the places where the error could occur, this change wont give an error atleast.
Unfortunately, it shows the same error message
That should have been a compilation error. Don't know why it was runtime.
Reset try no. 3
ShubhamText (2).aix (8.1 KB)
No error but no reset.
Need to take a timeout and iron out all the bugs before representing....
@TIMAI2 Do you think you can help in the code ?
The part that stores a String is :
lastText = textview.getText().toString();
lastText
is a String, textview.getView()
returns a SpannableStringBuilder, the toString()
method converts it to a string.
First line of the reset function.
Here, the String is converted to a CharSequence.
text = (CharSequence)lastText;
text
is a CharSequence.
Here, the object is made.
ss = new SpannableStringBuilder(text);
ss
is a SpannableStringBuilder.
These are the only places where the problem can occur.
Other parts are working fine. (According to me.)
Does the toString()
method somehow copy the styling too ?
Do you need to clear what was previously set in terms of styling ?
SHUBHAMR69 If you can design an extension to change the size of font for only the ten digits from ( 0 - 9) and the two brackets between the digits
I hope you can do it SHUBHAMR69
No. I don't need to clear anything. I just set the styling, which automatically removes the previous styling.
Also, after many attempts to connect to the Companion, I got connected for almost half a minute.
I found out that we can easily reverse the text size.
For example, try setting relative size to 2 and then 0.5
[Couldn't check the reset() function. Got Disconnected.]