Featured post
Android : How to display more than one Marquee simultaneously (focus for two marquees) -
i want 2 marquees in application. 1 working always. if comment first one, second 1 work. otherwise first one. or 1 marquee getting focus @ time. if press down arrow, second 1 focus. how can both of these marquees focus?
how can display 2 marquees @ same time? following code :
<relativelayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/imglogotb"> <textview android:id="@+id/txt1" android:layout_width="wrap_content" android:text="start | lunch 20.00 | dinner 60.00 | travel 60.00 | doctor 5000.00 | lunch 20.00 | dinner 60.00 | travel 60.00 | doctor 5000.00 | end" android:layout_height="20dip" android:singleline="false" android:ellipsize="marquee" android:marqueerepeatlimit="marquee_forever" android:scrollhorizontally="true" android:focusable="true" android:focusableintouchmode="true" android:freezestext="true"> </textview> <textview android:id="@+id/txt2" android:layout_width="wrap_content" android:text="start | lunch 1.00 | dinner 2.00 | travel 3.00 | doctor 4.00 | lunch 5.00 | dinner 6.00 | travel 7.00 | doctor 8.00 | end" android:layout_height="20dip" android:singleline="false" android:ellipsize="marquee" android:marqueerepeatlimit="marquee_forever" android:scrollhorizontally="true" android:focusable="true" android:focusableintouchmode="true" android:freezestext="true"> </textview> </relativelayout>
please me giving solution.... thank you...
i dont answer old questions. in case facing same problem , interesting situation.
now found patch, might say, myself. marquee text works when in focus. our aim bring focus on every textview @ same time.
for make our own custom textview component class. , return true in method isfocusable(). here goes.....
public class scrollingtextview extends textview { @override protected void onfocuschanged(boolean focused, int direction, rect previouslyfocusedrect) { if(focused) super.onfocuschanged(focused, direction, previouslyfocusedrect); } @override public void onwindowfocuschanged(boolean focused) { if(focused) super.onwindowfocuschanged(focused); } @override public boolean isfocused() { return true; } }
now have add textview in xml layout follows.
android:text="long long long long text..................." android:singleline="true" android:ellipsize="marquee" android:marqueerepeatlimit="marquee_forever" android:scrollhorizontally="true" android:id="@+id/textview03" android:padding="5dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
and done, can add textview component many times want in xml layout. andall textview marquee simultaneously.
thanks.
- Get link
- X
- Other Apps
Comments
Post a Comment