Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Scrolling TextView without the dimming effect?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
shawn@kfold.org  
View profile  
 More options Apr 8 2009, 2:00 am
From: "sh...@kfold.org" <sh...@kfold.org>
Date: Tue, 7 Apr 2009 23:00:12 -0700 (PDT)
Local: Wed, Apr 8 2009 2:00 am
Subject: Scrolling TextView without the dimming effect?
I have an application that uses TextView with scrolling and it has a
very annoying effect that dims the text when touch based scrolling is
used so you can barely see the text you are trying to scroll. (Same
effect in the emulator when you click the mouse and scroll).

I'm not sure where this effect is coming from or how to get rid of it.
(I have a guess that it may have something to do with text selection
for copy/paste?) Anyone know how to help?

More info:

TextView is nested in LinearLayout like so:
...
        <TextView android:layout_height="wrap_content" android:id="@+id/text"
                android:scrollbars="vertical" android:scrollHorizontally="true"
                android:textSize="10sp" android:typeface="monospace"
                android:layout_width="fill_parent" android:layout_weight="1"></
TextView>
...

In onCreate() I make the TextView scollable like so:
        TextView tv = (TextView) findViewById(R.id.text);
        tv.setMovementMethod(ScrollingMovementMethod.getInstance());

Note that when I nest TextView in a ScrollView (and disable scrolling
on the TextView) it does not dim and works nicely... only problem is
that ScrollView doesn't support horizontal scrolling of TextView which
I need.

You can download beta1 of RoboTop though the Market to see what I
mean.
Full source is available here: http://www.kfold.com/m/RoboTop-beta1.zip


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
shawn@kfold.org  
View profile  
 More options Apr 8 2009, 2:49 pm
From: "sh...@kfold.org" <sh...@kfold.org>
Date: Wed, 8 Apr 2009 11:49:43 -0700 (PDT)
Local: Wed, Apr 8 2009 2:49 pm
Subject: Scrolling TextView without the dimming effect?
When scrolling in a TextView it has an annoying effect that dims the
background while scrolling (touch scrolling). This makes the text very
hard to read and difficult for the user to know when to stop
scrolling. See RoboTop application in the market to see what I mean.

I'm not sure what is causing the dimming effect or how to disable it.
Any thoughts? (One guess is that it may have something to do with text
selection for cut and paste).

Note that wrapping a TextView in a ScrollView (and disabling the
scrolling on the TextView and enabling it on the ScrollView) scrolls
nicely without dimming. However, ScrollView can only scroll vertically
and I need to scroll both horizontally and vertically (which TextView
can do when enabled).

More details:

TextView is in a LinearLayout like so:
        <TextView android:layout_height="wrap_content" android:id="@+id/text"
                android:scrollbars="vertical" android:scrollHorizontally="true"
                android:textSize="10sp" android:typeface="monospace"
                android:layout_width="fill_parent" android:layout_weight="1"></
TextView>

Scrolling of TextView is enabled in OnCreate() like so:
       _Text = (TextView) findViewById(R.id.text);
        _Text.setMovementMethod(ScrollingMovementMethod.getInstance
());

Full source is available at http://www.kfold.com/m/RoboTop-beta1.zip


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
shawn@kfold.org  
View profile  
 More options Apr 10 2009, 7:07 pm
From: "sh...@kfold.org" <sh...@kfold.org>
Date: Fri, 10 Apr 2009 16:07:44 -0700 (PDT)
Local: Fri, Apr 10 2009 7:07 pm
Subject: Re: Scrolling TextView without the dimming effect?
Answer for posterity:

Need to setClickable and setLongClickable to false (must be both,
setting one or the other still causes dimming).

Need to set above _after_ calling setMovementMethod
(ScrollingMovementMethod.getInstance()). Setting XML properties
doesn't work since they seem to be overridden by call to
ScrollingMovementMeathod.

   _Text = (TextView) findViewById(R.id.text);
   _Text.setMovementMethod(ScrollingMovementMethod.getInstance());
   _Text.setClickable(false);     // Both Clickable and LongClickable
must be turned off
   _Text.setLongClickable(false); // after setting the MovementMeathod
in order to avoid dimming effect

On Apr 8, 11:49 am, "sh...@kfold.org" <sh...@kfold.org> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »