0

I have a launcher application for each item, I display an ImageView with TextView, my problem is with applications that have a very long name.

I use one line to display the text so I would have a part and all the title is not displayed but what i want is to display the text that rotates and allows the user to read all the title. So how to put the text in motion.

I saw this technique on a Samsung smartphone. my items are given by the code below.

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/label"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:ellipsize="end"
    android:singleLine="true"
    android:paddingTop="4dp"
    android:textSize="14dip"
    android:textColor="@android:color/black"
    android:gravity="center_horizontal|center_vertical" />
codeling
  • 11,056
  • 4
  • 42
  • 71
zied
  • 201
  • 3
  • 7
  • 17

2 Answers2

0

You can use marquee for that:

Use

android:ellipsize="marquee"

instead of

android:ellipsize="end"

And repeat limit as per your requirement.

Hoe this helps.

MysticMagicϡ
  • 28,593
  • 16
  • 73
  • 124
0

use

android:singleLine="true"
android:ellipsize="marquee"

Alternatively,

android:ellipsize="4"// 4 is the integer equivalent for marquee

or

textView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
Linga
  • 10,379
  • 10
  • 52
  • 104