Skip to content

This is an Android class for creating a TextView that will Marquee or Auto Scroll Vertically.

Notifications You must be signed in to change notification settings

tbdawg/VerticalMarqueeTextView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

This is an Android class to create a vertical textview marquee e.g. vertical autoscrolling textview. It may not be the best but it is what I came up with after several tries to get something working. Modify it as needed.

Usage:

Add VerticalMarqueeTextView.java (VMTV) to your project.
Change the VMTV package to that of your project.
Create an instance of the VMTV class.
In the onCreate() method instantiate your instance of the VMTV class using findViewByID().
 optional: call the pauseMarquee() method to pause it until Activity starts.
           use the setDuration() and or setPixelYOffset() method(s) to adjust the speed and scrolling of your VMTV.
           
In your xml layout use the full package name to create your VMTV within the view as you would with any other TextView and set your properties.
	NOTE: It will error in the Graphical Layout. You can try using View.isInEditMode() if you wish but it isn't needed.
 
You should make a call to the resumeMarquee() method in the Activities onResume() method. Likewise a call to pauseMarquee() should be made in the Activities onPause() method.

There should be a call to stopMarquee() in the Activities onDestroy() method.
NOTE: Once the marquee has been stopped it cannot be restarted. This is due to the behavior of the AsynTask within the VMTV class.

NOTE: If you add additional padding to the TextView being passed to the VMTV then you may need to modify the textViewNotDrawn() method within the subclassed AsynTask of the VMTV class in order to get the proper pixel height of your TextView.

See Example.java, main.xml, strings.xml, and VerticalMarqueeTextView.java. 

Releases

No releases published

Packages

No packages published

Languages