Showing posts with label API Level 5. Show all posts
Showing posts with label API Level 5. Show all posts

android:scrollbarFadeDuration - Slowly Fade a Scrollbar in a TextView

How to Slowly Fade a Scrollbar in a TextView

added in API Level 5

Defines the delay in milliseconds(1/1000th of a second) that a scrollbar takes to fade out.
1 millisecond is 0.001 seconds
1 second = 1,000 milliseconds(ms)
1 minute = 60,000 milliseconds (ms)


1. Add a HorizontalScrollView to a TextView, in your main.xml file.

2. Ensure to change the minSDKVersion to 5, or greater.

3. In the main.xml file, add the code below. This will slowly fade the scrollbar for 15 seconds.

  <HorizontalScrollView
        ...
       android:scrollbarFadeDuration = "15000"
  />

4. Compile and run!

Related Articles:


Resources:

android:scrollbarDefaultDelayBeforeFade - Delay the Fade of a Horizontal Scrollbar in a TextView

How to Delay the Fade of a Horizontal Scrollbar in a TextView

android:scrollbarDefaultDelayBeforeFade added in API Level 5

Defines the delay in milliseconds(1/1000th of a second) that a scrollbar waits before fade out.

1 millisecond is 0.001 seconds
1 second = 1,000 milliseconds(ms)
1 minute = 60,000 milliseconds (ms)

1. Add a HorizontalScrollView to a TextView, in your main.xml file.

2. Ensure to change the minSDKVersion to 5, or greater.

3. In the main.xml file, add the code below. This will display the scroll bar for 15 seconds before fading.

  <HorizontalScrollView
        ...
       android:scrollbarDefaultDelayBeforeFade = "15000"
  />

4. Compile and run!

Related Articles:
Resources:
http://developer.android.com/reference/android/view/View.html#attr_android:scrollbarDefaultDelayBeforeFade
http://developer.android.com/reference/android/R.attr.html#scrollbarDefaultDelayBeforeFade

android:fadeScrollbars

added in API Level 5

Defines whether to fade out scrollbars when they are not in use.

Doesn't seem to do anything with TextView or EditText.
Textview and HoriztonalScrollview, does nothing with fadeScrollbars
EditText and scrollHorizontally, does nothing with fadeScrollbars

android:fadeScrollbars = "true"
android:fadeScrollbars = "false"

Resources:
http://developer.android.com/reference/android/view/View.html#attr_android:fadeScrollbars
http://developer.android.com/reference/android/R.attr.html#fadeScrollbars