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. Cant locate some apps

I have been on the android market for days now and can't find some
apps. Locale is one of them. I looked through the "tools" area until
it would scroll no more. I also did a search and only came up with
"Locale SMS", "Loot", and "BuzzOff". Locale is supposed to be in the
market but where is it? Am I missing something here? There are a few
others that should be there but they're not.

--~--~---------~--~----~------------~-------~--~----~

2. Grayscaling

Hi,

I am trying to grayscale bitmap as follows, But it is crashing as soon
as I run this method.
The problem is in last line. How can I assign "int" to "Color"? Or are
there any better ways? Thx

for(int y = 0; y < imgH; y++)
for(int x = 0; x < imgW; x++)
        {
                int color = bitmap.getPixel(x, y);

                int r = (color >> 16) & 0xff;
                int g = (color >> 8) & 0xff;
                int b = color & 0xff;

                color = Color.rgb(r/3, g/3, b/3);

                bm.setPixel(x, y, color);
        }

--~--~---------~--~----~------------~-------~--~----~

3. Canvas.drawBitmap() src/dst Rect precision

4. Control which items to redraw? (notifyDataSetChanged with a range)

5. Android default color madness, primary_text_light is color black?

6. breakpoints and widgets

7. Accessing java SIM card information from android