tags:

views:

372

answers:

3

As far as I have read in the Internet and official documentation, it isn't possible to make a scrollable app widget. Also all my tries failed. I even tried to subclass TextView to implement my own scroll method, but nothing worked.

Are there any ways to achieve that?

Btw.... there are solutions if you use for example htc sense or home desktop ++, but i want to make it available to other users which don't use this

A: 

Usually you put your view directly inside a ScrollView (http://developer.android.com/reference/android/widget/ScrollView.html).

<?xml version="1.0" encoding="utf-8"?>                                           
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent">
     <!-- Your view
          Note : if you need more than one view you need to use a Layout -->
</ScrollView>

But you maybe want to handle the scrolling events yourself, and if so why?

Edit: doesn't answer the question.

Gautier Hayoun
check this: http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
Roflcoptr
I read your question too fast...I thought you wanted to make a normal view scrollable.
Gautier Hayoun
+4  A: 

Are there any ways to achieve that?

Not directly. You can always add buttons to rotate you through various options. But true scrolling is not possible.

CommonsWare
do you know why it isn't possible?
Roflcoptr
It is not possible because of the delicate interaction between Launcher apps and scrolling widgets. Adding vertically scrolling widgets would for instance prevent Launcher app to use vertical swipes themselves and the Android team is not ready to add such a limitation to the platform.
Romain Guy
Also, the only way you can change appearance in App-widget is thru the RemoteViews, and the only interaction you can set on remoteviews is onclick. It is the api that makes this impossible.
xandy
+1  A: 

HTC provides scrollable app widgets because these are built-in. Only their Launcher can create and display them. Regular app widgets do not support scrolling.[link text][1]

Romain Guy