TextView restarts Marquee when changing another TextView in same LinearLayout

Viewed 6052

I have LinearLayout and inside 2 TextView both have marquee and when I update text in first then second TextView restarts marquee.

            <LinearLayout
                android:id="@+id/panel"
                android:layout_width="320dp"
                android:layout_height="match_parent"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="2dp"
                android:gravity="center_vertical"
                android:orientation="vertical" >

                <TextView
                    android:id="@+id/first"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ellipsize="marquee"
                    android:gravity="bottom|center_horizontal"
                    android:marqueeRepeatLimit="marquee_forever"
                    android:singleLine="true" />

                <TextView
                    android:id="@+id/second"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ellipsize="marquee"
                    android:gravity="top|center_horizontal"
                    android:marqueeRepeatLimit="marquee_forever"
                    android:singleLine="true"
                      />
            </LinearLayout>

I found that if for R.id.first and R.id.second i set layout_width="320dp" the effect don't occurs. But I want to set android:layout_width="match_parent" there is some workaround?

I found similar problem but without solution: Android, RelativeLayout restarts Marquee-TextView when changing ImageView in same RelativeLayout

3 Answers
Related