Created
November 29, 2012 19:56
-
-
Save svenporto/4171444 to your computer and use it in GitHub Desktop.
Scrollable TextView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ScrollableTextView extends TextView { | |
public ScrollableTextView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
rotate(); | |
} | |
public ScrollableTextView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
rotate(); | |
} | |
public ScrollableTextView(Context context) { | |
super(context); | |
rotate(); | |
} | |
private void rotate() { | |
setSelected(true); | |
} | |
} | |
// Also be sure to use this class instead regular TextView in your XML layout | |
/* | |
<com.my.custom.ScrollableTextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:ellipsize="marquee" | |
android:fadingEdge="horizontal" | |
android:marqueeRepeatLimit="marquee_forever" | |
android:scrollHorizontally="true" | |
android:singleLine="true" | |
android:text="My dummy text" /> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment