Hi...
I found this snippit of Java code, but I can't figure out how to translate it into B4A. Any help would be appreciated. Is this even possible?
This I think would solve a big problem for me now.
Thanks in advance...
I found this snippit of Java code, but I can't figure out how to translate it into B4A. Any help would be appreciated. Is this even possible?
B4X:
protected void setMarqueeSpeed(TextView tv, float speed, boolean speedIsMultiplier) {
try {
Field f = tv.getClass().getDeclaredField("mMarquee");
f.setAccessible(true);
Object marquee = f.get(tv);
if (marquee != null) {
String scrollSpeedFieldName = "mScrollUnit";
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.L)
scrollSpeedFieldName = "mPixelsPerSecond";
Field mf = marquee.getClass().getDeclaredField(scrollSpeedFieldName);
mf.setAccessible(true);
float newSpeed = speed;
if (speedIsMultiplier)
newSpeed = mf.getFloat(marquee) * speed;
mf.setFloat(marquee, newSpeed);
}
} catch (Exception e) {
e.printStackTrace();
}
}
This I think would solve a big problem for me now.
Thanks in advance...