android:scrollHorizontally I am not sure whether this shud be set as well
On Fri, Apr 23, 2010 at 1:46 AM, Kumar Bibek <coomar.101@gmail.com> wrote:
Ummm, well, on the widget , this can't be done. Because you dont have
a reference to that TextView.
On Apr 23, 11:00 am, ravindra singhai <singhai.ravin...@gmail.com>
Thanks and Regards,
Kumar Bibek
wrote:
> Hi Kumar,
>
> Thanks for your reply :)
>
> There is one property supported for TextView named *
> android:ellipsize="marquee"*
>
> I read in android dev-guide/forums that it works only when TextView is in
> focus in home screen, but i am not able to find any api or way to set
> TextView as focused item/view so i suspect that is the main reason behind my
> problem.
>
> Somehow if i can set TextView as focused view than text displayed within
> widget might scroll/move within single line.
>
> Please suggest if anybody already tried this or some other way for the same.
>
> /Ravi
>
> Thanks,
> Ravi
>
>
>
> > > android-developers+unsubscribe@googlegroups.com<android-developers%2Bunsubscribe@googlegroups.com>> On Fri, Apr 23, 2010 at 10:38 AM, Kumar Bibek <coomar....@gmail.com> wrote:
> > Scrolling is not supported on the Widget Framework right now. So, you
> > cannot do this.
>
> > Thanks and Regards,
> > Kumar Bibek
>
> > On Apr 21, 3:18 pm, Ravi <singhai.ravin...@gmail.com> wrote:
> > > Hi All,
>
> > > I have created a widget to be displayed on android emulator's home
> > > screen to display some long text. In my main.xml layout file i've
> > > already set TextView properties like singleLine="true",
> > > ellipsize="marquee", focusable="true" etc, but still when my widget is
> > > displayed on home screen text does not move/scroll.
>
> > > ----------------- main.xml layout file ------------------------
>
> > > <?xml version="1.0" encoding="utf-8"?>
> > > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> > > android"
> > > android:layout_width="fill_parent"
> > > androidrientation="vertical"
> > > android:layout_gravity="center"
> > > android:layout_height="wrap_content" android:background="@drawable/
> > > background">
> > > <TextView android:id="@+id/widget_textview"
> > > android:text="@string/widget_text"
> > > android:layout_height="wrap_content"
> > > android:layout_width="wrap_content"
> > > android:layout_gravity="center_horizontal|center"
> > > android:layout_marginTop="5dip"
> > > androidadding="10dip"
> > > android:textColor="@android:color/black"
> > > android:singleLine="true"
> > > android:ellipsize="marquee"
> > > android:focusable="true" />
> > > </LinearLayout>
>
> > > ----------------- end of main.xml layout file ------------------------
>
> > > ------------- My WidgetProvider.java file ----------------------
>
> > > package com.android.weatherdata;
>
> > > import android.util.Log;
> > > import android.widget.RemoteViews;
> > > import android.appwidget.AppWidgetManager;
> > > import android.appwidget.AppWidgetProvider;
> > > import android.content.Context;
> > > import android.content.Intent;
> > > import android.app.PendingIntent;
>
> > > public class WeatherWidget extends AppWidgetProvider{
>
> > > private static final String TAG = "WeatherWidget";
>
> > > @Override
> > > public void onUpdate(Context context, AppWidgetManager
> > > appWidgetManager, int[] appWidgetIds)
> > > {
> > > Log.d("WEATHER-WIDGET", "onUpdate(): ");
>
> > > final int N = appWidgetIds.length;
> > > // Perform this loop procedure for each App Widget that belongs to
> > > this provider
> > > for (int i=0; i<N; i++) {
> > > int appWidgetId = appWidgetIds[i];
>
> > > // Create an Intent to launch ExampleActivity
> > > Intent intent = new Intent(context, Weather.class);
> > > PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
> > > intent, 0);
>
> > > Log.i("WEATHER-WIDGET", " Create and Attach Text-view click handler
> > > ");
> > > // Get the layout for the App Widget and attach an on-click listener
> > > to the button
> > > RemoteViews views = new RemoteViews(context.getPackageName(),
> > > R.layout.main);
> > > views.setOnClickPendingIntent(R.id.widget_textview , pendingIntent);
>
> > > // Tell the AppWidgetManager to perform an update on the current App
> > > Widget
> > > appWidgetManager.updateAppWidget(appWidgetId, views);
>
> > > }
> > > }
> > > }
>
> > > ----------------- End of WidgetProvider file--------------------
>
> > > When i add widget on home screen than only some part of text is
> > > displayed as " Latest Weather Infor" but i would like to write the
> > > code in such a way that the complete text should scroll till the
> > > complete string/text is displayed.
>
> > > Please suggest whether i need to change my layout file or what logic i
> > > can write so that i can scroll the text.
>
> > > Thanks in advance,
> > > Ravi
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > For more options, visit this group athttp://> > android-developers+unsubscribe@googlegroups.com<android-developers%2Bunsubscribe@googlegroups.com>
> > groups.google.com/group/android-developers?hl=en
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment