I'm trying to have an auto scroll Text-view vertically when video is playing. My text is too long to fit the screen and I want to auto scroll it when activity started. I followed every tutorial or tips posted here on stack-overflow but I couldn't figure out.
Here my class file:
public class TextSrcollActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_text_srcoll);
TextView tv=(TextView)findViewById(R.id.textView1);
tv.setMovementMethod(new ScrollingMovementMethod());
tv.setSelected(true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.text_srcoll, menu);
return true;
}
}
And here is my XML file:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginRight="3dp"
android:layout_marginTop="3dp"
android:background="#ff737373"
android:gravity="center"
android:minWidth="64dp"
android:orientation="vertical"
android:padding="3dp" >
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:maxWidth="100px"
android:scrollHorizontally="false"
android:scrollbars="vertical"
android:gravity="bottom"
android:singleLine="false"
android:textColor="#ffd9d9d9"
android:textSize="16sp"/>
</LinearLayout>
In the XML file, I tried to change some properties but I still have nothing.