1

How can I make a smooth scroll of a textview in my application? This is a example of a main.xml similar to mine:

<?xml version="1.0" encoding="utf-8"?>
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
    android:id="@+id/textView5"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_marginTop="10dp"
    android:text="ANDROID APPLICATION INFO"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textColor="#FF8000"
    tools:ignore="HardcodedText" />

<RadioButton
    android:id="@+id/radio_english"
    android:layout_width="201dp"
    android:layout_height="55dp"
    android:onClick="onRadioButtonClicked"
    android:text="English"
    tools:ignore="HardcodedText" />

<RadioButton
    android:id="@+id/radio_it"
    android:layout_width="200dp"
    android:layout_height="55dp"
    android:onClick="onRadioButtonClicked"
    android:text="Ita"
    tools:ignore="HardcodedText" />

<TextView
    android:id="@+id/AndroidInfo"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Android Info.:"
    tools:ignore="HardcodedText" />

<TextView
    android:id="@+id/Ainfo"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    tools:ignore="SelectableText"
    android:text="blablablablabla blablablabla blablablablabla blablablabla `blablablablabla blablablabla blablablablabla blablablabla blablablablabla blablablabla" />`

</RadioGroup>

The Ainfo textview is that I want to make scrollable. But with a smooth scroll. I tried different ways but everything I tried was result a not smooth scroll. Any tips to di it? Don't take consider to the functionally because is an example.. Just want to understand how make the scroll smooth.

Cœur
  • 32,421
  • 21
  • 173
  • 232
Atlas91
  • 5,238
  • 14
  • 53
  • 117
  • do you want to make a marque text? That will auto scroll? – Basim Sherif May 28 '13 at 09:58
  • I want a "normal" smooth scroll down/up. Like every application with a scroll. I don't know exacly what you mean with "auto scroll". but i think is the same ahaha. I want when i scroll with the finger the textvew (yeah it's the same i suppose) auto scroll for 5/6/7 lines or 1/2 second (i don't know how it works) – Atlas91 May 28 '13 at 10:04

1 Answers1

5

You want something like this?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity$DummySectionFragment" xmlns:app="http://schemas.android.com/apk/res/com.threesixtydgreen">

<ScrollView
    android:id="@+id/horizontalScrollView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:scrollbars="none" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="blablablablabla blablablabla blablablablabla blablablabla `blablablablabla blablablabla blablablablabla blablablabla blablablablabla blablablabla"
            android:textAppearance="?android:attr/textAppearanceLarge" />


</ScrollView>

Basim Sherif
  • 5,128
  • 7
  • 45
  • 87