HTC Hero Stocks Widget Scrolling Ticker functionality

by Jared » Thu, 26 Nov 2009 01:03:41 GMT


Sponsored Links
 I have an HTC Hero from Sprint in the US and was curious about the how
the Stocks HTC widget scrolls text like a ticker. It is only the 4x1
sized widget that scrolls quotes. As far as I know, homescreen widgets
can only use RemoteViews for the layout, which is limited to the
following layouts and widgets (from
 http://developer.android.com/guide/topics/appwidgets/index.html #CreatingLayout):

    * AbsoluteLayout
    * FrameLayout
    * LinearLayout
    * RelativeLayout
    * AnalogClock
    * Button
    * Chronometer
    * ImageButton
    * ImageView
    * ProgressBar
    * TextView
      Descendants of these classes are not supported.

I know that this could be done in an app with android.widget.scroller,
but that can't be used in a homescreen widget. Would this
functionality be specific to the Sense UI homescreen capabilities? I
guess, my main question is if this can be replicated for a standard
Android widget and if so how.

--



HTC Hero Stocks Widget Scrolling Ticker functionality

by Mark Murphy » Thu, 26 Nov 2009 01:14:56 GMT


 


Look at the android:marquee attribute on TextView, and see if that fits
your needs.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Warescription: Three Android Books, Plus Updates, $35/Year

--


Sponsored Links


HTC Hero Stocks Widget Scrolling Ticker functionality

by Jared » Thu, 03 Dec 2009 05:53:02 GMT


 I have this already in my xml layout:

<TextView
        android:id="@+id/left_text_box_0"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:focusable="true"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:marqueeRepeatLimit="marquee_forever"
/>

This marquee works if I scroll up with the trackball on my widget to
focus on the text. The only thing that I need to do now is find out
how to set the focus programatically in the code. For an Activity or
View, this can be done by using TextView.setSelected(true). For a
RemoteView though, you can't use findViewById to get the TextView
layout reference (For example: R.id.left_text_box0). Do you know a way
to do this for a RemoteView?

Here is another post describing the same thing I'm looking for:



HTC Hero Stocks Widget Scrolling Ticker functionality

by prashanth » Fri, 04 Dec 2009 01:12:08 GMT


  took ages for me to find a solution for this though it was hidden
somewhere in internet..
anyways the solution is to add the tag <requestFocus/> in your
textview:)

Eg:

<TextView
android:id="@+id/left_text_box_0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever">
<requestFocus/>
</TextView>


On Dec 2, 9:52pm, Jared <jaredstock...@gmail.com> wrote:

--



Other Threads

1. Need Help !!

Not sure if it's what you want.. but you could try using a
ViewFlipper...

http://developer.android.com/reference/android/widget/ViewFlipper.html




-- 

2. How to push the code change to Android open source project.

Hi all,

How to push the code change to Android open source project?
Anyone could provide a push command for me?

Many thanks for your help!

Thanks,
Chris

-- 

3. [0xlab-devel] Introduce 0xRobocat project

4. Inputtype for edit text not changing

5. SharedPreferences are not stored

6. google api ajax webservice

7. Doubt regarding redirection of websites to mobile version and address bar of browser.