Android : Scroll / Move Text Within TextView On Home Screen Widget?

Apr 21, 2010

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.code...

Android : Scroll / move text within TextView on home screen widget?


Android : Droid Home Screen Widget Support Background Selector In A TextView?

Nov 4, 2010

I have a TextView in my home screen widget. Can I use the following selector as the background of the TextView so the TextView can be highlighted when clicked? I know I can do it in Activity, but I am not sure about home screen widget.code...

View 1 Replies View Related

Android :: Why Does TextView.setText Cause Enclosing Scroll View To Scroll?

Jun 24, 2010

I've got this odd problem which is happening on 1.6, 2.2, and a MyTouch 3G Slide (which is API #7, and listed as "2.1-Update1" in the Android Device Chooser). If anyone can explain what I'm doing wrong & how to fix it (or possibly confirm that this is an Android bug)The basic idea for my app is to make a stopwatch-sort of thing, in that the user can tap a button to start a timer, then tap it again to stop (pause) the timer; further taps alternate between resuming the timer and pausing the timer.I've got a top-level ScrollView which contains a RelativelLayout, which contains a bunch of widgets. The first widget is a HUGE button (so that it's easy to press), which pushes all my other widgets below the bottom of the screen. This is intentional, as I want to rely on the ScrollView (and an on-screen reminder to the user) to make the rest of the input options available.I've got a simple state-machine type setup, where mState is the current mode (STATE_ TIMER_ NOT_ STARTED before the user presses any buttons, RUNNING after the first press, and then PAUSED after the second, back to RUNNING after the third, etc, etc).

All this works great EXCEPT that when the timer is running, and the user presses the start/stop/resume button again, the ScrollView will scroll down a ways. I am NOT issuing this command (I don't even have a reference to ScrollView object), and I'm not sure why it's doing this.

REPRO:Compile + run the below samples. When the app starts, press the 'Start Timing' button. Use your thumb (or the mouse) to touch-drag the screen upwards (so you can see the RatingBar), then drag it back downwards (so the button is again completely on-screen). Tap the button (which now reads 'PauseTiming') again, and it'll jump down a bit. It should NOT be jumping/scrolling down, since there's no statement (that I can see) that tells it to scroll down. As near as I can tell, it's the setText that causes the scrolling ( when I comment those lines out, no scrolling occurs).WHAT I'M ASKING FOR:if I'm doing something dumb & you could point out what it is, I'd really appreciate it! I wonder if 'touch mode' might have something to do with this, since it does NOT appear to happen (in the emulator) when I use the mouse's scroll wheel to move the panel upwards (i.e.,instead of the simulated finger-dragging). I can't find a whole lot on touch-mode, and nothing specific on focus/selection in touch mode within a ScrollView if you can confirm that this error occurs for you too, that would be ok, too (since misery loves company.AHEM I mean, since it might help confirm that it's not just me MyTestApp.java package bug.android.scrollview;
import android.app.Activity;
import android.os.Bundle;
import android.text.format.Time;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
public class MyTestApp extends Activity {
public final static int STATE_TIMER_NOT_STARTED = 1;
public final static int STATE_TIMER_RUNNING = 2;
public final static int STATE_TIMER_PAUSED = 3;
private int mState;
Time t = new Time();
private Time data = new Time();
private Button btnStartStopResume;
private TextView lblSpacer;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.new_time_entry);
btnStartStopResume = (Button) findViewById(R.id.btnStartStopResume);
// Set the button's size so that the other info will also be visible
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE))
.getDefaultDisplay();
// This is such a hack, but the windowScroller doesn't appear to
// have a height at this point in the lifecycle (nor in 'onResume' :( )
btnStartStopResume.setHeight(display.getHeight() - 200);
lblSpacer = (TextView) findViewById(R.id.lblSpacer);
reset();
} public void doStartStopResume(View v) {
if (mState == MyTestApp.STATE_TIMER_NOT_STARTED) {
mState = MyTestApp.STATE_TIMER_RUNNING;
data.setToNow();
} else if (mState == MyTestApp.STATE_TIMER_RUNNING) {
mState = MyTestApp.STATE_TIMER_PAUSED;
String s = getString(R.string.add_scroll_down_to_add);
lblSpacer.setText(s);
} else if (mState == MyTestApp.STATE_TIMER_PAUSED) {
mState = MyTestApp.STATE_TIMER_RUNNING;
public void doReset(View v) {
}public void doNewRunClick(View v) {
public void doAddTiming(View v) {
public void reset() {
mState = STATE_TIMER_NOT_STARTED;
new_time_entry.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/windowScroller"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
> <RelativeLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
> <Button
android:id="@+id/btnStartStopResume"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:text="Start Timing"
android:textSize="40dp"
android:height="290dp"
android:onClick="doStartStopResume" />
<TextView
android:id="@+id/lblSpacer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/btnStartStopResume"
android:layout_centerHorizontal="true"
android:text="@string/add_scroll_down_for_more" />
<TextView
android:id="@+id/lblTimeStartLabel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/lblSpacer"
android:layout_alignParentLeft="true"
android:clickable="true"
android:onClick="adjustStartTime"
android:text="Start of this run:"
android:textSize="8dp" />
<TextView
android:id="@+id/lblTimeStart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/lblTimeStartLabel"
android:layout_alignParentLeft="true"
android:clickable="true"
android:onClick="adjustStartTime"
android:text="--:--:-- --"
android:textColor="#FFFFFF"
android:textSize="26dp" />
<TextView
android:id="@+id/lblElapsedLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/lblSpacer"
android:layout_alignRight="@id/lblSpacer"
android:layout_marginRight="5dp"
android:text="Elapsed Time:"
android:textSize="8dp" />
<TextView
android:id="@+id/lblTimeElapsed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/lblElapsedLabel"
android:layout_alignRight="@id/lblSpacer"
android:layout_marginRight="5dp"
android:textColor="#99ff66"
android:text="-- m -- sec"
android:textSize="26dp"
android:layout_marginBottom="10dip"/>
<CheckBox
android:id="@+id/chkNewRun"
android:onClick="doNewRunClick"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/lblTimeElapsed"
android:text="This is a new run of timings"
android:layout_marginBottom="10dip" />

<TextView
android:id="@+id/lblIntensity"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Intensity (1 = none 5 = max)"
android:layout_below="@id/chkNewRun" />
<RatingBar
android:id="@+id/rbIntensity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/lblIntensity"
android:numStars="5"
android:rating="2"
android:layout_marginBottom="5dip" />

<TextView
android:id="@+id/lblNotes"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Notes:"
android:layout_below="@id/rbIntensity" />
<EditText
android:id="@+id/txtNotes"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_below="@id/lblNotes"
android:layout_marginBottom="10dip" />
<Button
android:id="@+id/btnReset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/txtNotes"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:text="Reset"
android:onClick="doReset" />
<Button
android:id="@+id/btnOk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/txtNotes"
android:layout_toRightOf="@id/btnReset"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:text="Add Timing To List"
android:onClick="doAddTiming" />
</RelativeLayout>
</ScrollView>
strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Timer</string>
<string name="dlg_edit_timing_title">Edit A Timing</string>
<string name="add_scroll_down_for_more">< Scroll down for more options! ></string>
<string name="add_scroll_down_to_add">< Scroll down to save this timing! ></string>
<string name="start_timing">Start Timing
</string>
<string name="stop_timing">Pause Timing
</string>
<string name="resume_timing">Resume Timing
</string>
</resources>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="bug.android.scrollview"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".MyTestApp"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="5" />
</manifest>
UPDATE 1: Adding if( btnStartStopResume.isInTouchMode() )
Toast.makeText(this, "TOUCH MODE", 2000);
elseToast.makeText(this, "NOT touch mode", 2000);
then setting breakpoints in the debugger confirms that the button is always in touch mode (regardless of whether I finger-drag the panel up/down, or mouse-wheel it up/down). So it's a combination of being in touch-mode AND finger-dragging the panel after the 2nd button-press (i.e, when the app is in 'stopped/paused timing' mode) that's causing the odd extra-timing in subsequent pauses.
UPDATE 2:
I just noticed that it's scrolling down to the EditText, and no further. It looks like when you move the panel down the EditText gets the selection, and after the click event the ScrollView scrolls back to the thing that has the selection. Seems to explain why the mouse-wheel approach doesn't have this problem (it moves the selection/focus back up to the button).

View 1 Replies View Related

Android :: Need Widget Apps To Scroll Through Own User Inputed Text

Jul 3, 2010

i have a lot of quotes that i would like to have displayed as a widget where maybe it'll change daily to a different quote.

View 1 Replies View Related

Android :: Change Textview Text From String Array In Widget Without Global Variables

Nov 21, 2010

I am trying to make an android widget like the Google Voice Widget where users can go through an array of Strings which is retreived from the SQLite database. The problem is using global variables in the widget provider. I need to hold the index of the value they are currently on in order to pass it to the intents which are created when the left or right buttons are created. The variable is always returned as zero though.

CODE:..................

View 1 Replies View Related

HTC Droid Eris :: Scroll Ball - When Go To Home Page Ball Always Pulls To Left And Wont Let Move Any Other Way Besides Left

Sep 8, 2010

when i go to the home page the ball always pulls to the left and wont let me move any other way besides left. its giveing me alot of problems txting and just moveing around my phone.

View 3 Replies View Related

Android :: Passing Integer From Android Home Screen Widget To An Activity Opened By The Android Home Screen

Jun 12, 2010

How can we pass Android Home Screen Widget info ( putExtra maybe ) to an Activity.. What particular method callback will handle this one?

View 1 Replies View Related

Android :: Home Screen Widget Size In Normal Screen And Largest Screen

Mar 31, 2010

I am designing a home screen widget. I ran this widget on a HTC Hero device, which has a screen of 320 pixels * 480 pixels with mdpi. It ran perfect on HTC Hero. The widget takes 3 cells * 2 cells space, i.e. 240 pixels * 200 pixels.Then I ran this widget on a Nexus One device, which has a screen of 480 pixels * 800 pixels, mdpi. Since Nexus One also is mdpi, so I though 240dip is equivalent to 240 pixels on Nexus One and 200dip is equivalent to 200 pixels on Nexus One, so the widget will not take 3 cells * 2 cells space on Nexus One device. To my surprise, when running on Nexus One device, the widget take exact 3 cells * 2 cells, about 360 pixels * 300 pixels, on Nexus One device.I am confused. The layout xml above specifies 240dip in width and 200dip in height for the widget, but why did it take 360 pixels * 300 pixels on Nexus One Device? What am I missing?

View 2 Replies View Related

HTC Incredible :: How Can I Move Entire Home Screen?

May 26, 2010

How can I move an entire screen with all widgets etc to a different position (like next to the home screen)

View 2 Replies View Related

Motorola CLIQ : Whenever Reply To Message Off The Home Screen Widget - Automatically Defaults To Home Number For That Contact

Feb 21, 2010

This is more of an annoyance, but whenever I reply to a message off the home screen widget, it automatically defaults to the home number for that contact, instead of replying to the same (cell) number that it was sent from. If I go into the messaging app, it works as it should (replies to the same number).

View 2 Replies View Related

Android :: Scroll Down - Text Area Get Focus Scroll Little Bit And Also Display Bottom Buttons

Apr 19, 2010

I have text area and and down to that "ok" and "cancel" button. when i click on text area keyboard appear and focus on the text area and buttons get hide behind the keyboard.

I want when text area get focus scroll a little bit and also display the bottom buttons while text area id selected.

View 2 Replies View Related

Android :: TextView / Text To Show In Full Screen

May 29, 2010

I have an Android TextView where the view itself is limited to four lines.If the text exceeds this limit I want the end of the view to end with something like.<-- to notify that there is more text here so you can click and open in full screen for example.Not just suddenly stop in the middle of a sentence. Is there a quick fix for this?

View 1 Replies View Related

Sony Ericsson Xperia X10 :: Move Widgets On Home Screen

Nov 27, 2010

When I move some widgets on my Home Screen, I've seen message: "The application Home screen (process com.sonyericsson.homescreen) has stopped unexpectedly. Please try again" Than I switch off x10 mini, but I've already still have this error.

View 9 Replies View Related

Android :: Home Screen Widget Size For Large Screen Or Hdpi?

Mar 30, 2010

From Android widget screen guidelines,we know that, home screen has 4*4 cells, and in portrait orientation, each cell is 80 pixels wide by 100 pixels tall. I think these are for baseline HVGA screen. How about for large screens and hdpi screens, do they still have 4*4 cells for widget and each cell in portrait orientation is still 80 pixels * 100 pixels?

View 2 Replies View Related

Android :: TextView / Screen View Changes / Text Size Remains Same

Nov 16, 2010

I am developing an application in which the layout is independent of screen resolution.
Now my problem is that in TextView the textview layout does change itself when the resolution of screen changes but the size of text remain same.I want that when the resolution is high, according to that the text size should also adjust itself(i.e. text size should be changed).And similarly when resolution is low the text size should also shrink.But here when i reduce Y-AXIS to an extent the text vanishes.I will really appreciate any answer.

View 1 Replies View Related

HTC Droid Eris :: Good Widget To Show Weather Move On Screen?

Mar 8, 2010

Is there another good Weather Widget that will show the weather move on the screen? Like with the HTC Default on 2.1 if its raining there are rain drops all on your screen, if it is cloudy clouds move across the background..is there another widget that will do this?

View 16 Replies View Related

Android :: Make A Text Entry Fields Move Up When On Screen Keyboard Is Present?

Aug 6, 2010

How to make a text entry fields move up when on screen keyboard is present?

View 2 Replies View Related

Android :: Bug In Android 2.2 With Move To Sdcard & Home Screen Shortcuts?

Aug 27, 2010

I've discovered what may be a bug in the "app2sd" feature of Android 2.2.I haven't been able to find any information about it using the usual searches.My app will create a home screen shortcut in the usual way. Inside its intent that to be launched is a few extras describing the action to take.One of the extras is a string array.Now apparently, if someone creates a shortcut with my app, then moves the app to the sdcard, Android will strip out the string array intent from the shortcut.Other extras are left intact.This of course renders the shortcut useless to the app since key data is missing.Moving the app back to the phone doesn't restore the missing data.If the app is already on the sdcard and a shortcut is then created, it's OK.But then if the app is moved back to the phone, the string array extra is stripped again.I'm just going to take a wild-ass guess and say that Android does something to an app's shortcuts when it gets moved to and from the sdcard (maybe re-constructing it?) but it's not copying the string array extras.Is there any merit to this guess?

View 10 Replies View Related

Android :: Child TextView In ScrollView With Large Amount Of Text Pushes Other Views Off The Screen

May 6, 2009

I am trying to create an activity layout that has a top level vertical linear layout like so:

CODE:................

This works ok as long as the wordDefinition text isn't very long. But, when I set the text to something very long, it pushes the back button off the bottom of the screen. Why? Isn't the ScrollView supposed to scroll the text in the child TextView?

I've tried playing with weights (e.g., giving the top text view a weight of .2, the scroll view a weight of .7 and the button a weight of .1, but to no avail.

View 4 Replies View Related

Android :: Updating Android Home Screen TextView

Jun 11, 2010

How can we update the View of a Home Screen Widget on the onReceive method of AppWidgetProvider?.

I am trying to update the TextView of my Home screen widget but it seems that I cant access the TextView of my AppWidgetProvider on onReceive method.

Here is a sample code of my onReceive

CODE:.................

View 1 Replies View Related

Android :: Scroll A TextView To Specific Line?

Dec 22, 2009

I have a TextView inside a ScrollView. Let's say the ScrollView is named s and the TextView is named t.

I have many lines to be displayed in the TextView and at the same time I want to scroll the view to a specific line.

So I did this:

t.setText(aVeryLongString);
int y = t.getLayout().getLineTop(40); // e.g. I want to scroll to line 40
s.scrollTo(0, y);

But it won't scroll, except the second time. It seems that on the first time the code finishes, the ScrollView knows how much the total height of the TextView is.

So I think there must be something to force calculating the needed height before the scrollTo call. How to do that (or otherwise)?

View 1 Replies View Related

Android : Get A ListView And TextView To Scroll As One Unit?

Oct 11, 2010

I have a main menu screen with a simple ListView that contains "links" to further screens in my app (Browse, Bookmarks, Settings, About, etc.). Underneath the ListView there is a TextView (more accurately, a TextSwitcher that rotates TextViews) that changes every 10 seconds to display a new "tip".

In portrait mode, this works fine. There are my five list items in the ListView , and my tip label underneath. However, when I switch to landscape mode, the ListView is taller than the screen. The ListView scrolls normally, but I cannot scroll past the end of the ListView to see the TextView underneath.

I have tried every possible combination of Layouts, wrappers, ScrollViews, and layout_height parameters and I simply cannot get it to behave.

Here is the simplest code ...

Like I've said, I've already tried so many different combinations that I can't list them, and for the most part I was randomly inserting XML in an attempt to get something to work the way I wanted. So I'd greatly appreciate suggestions as to how I would go about doing this the right way.

View 1 Replies View Related

Android : TextView Supposed To Be Able To Scroll Its Contents?

Nov 10, 2009

It was my understanding that even though TextView is not a ScrollView, it has scrolling functionality built-in.

However, I'm not able to scroll the contents of a TextView (that's on 1.6). I've reduced my code to the most trivial example:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical"> Code...

I then defined a really long string for testing, which I set on this text view using setText(). The text is too long for the TextView, but there is no way to scroll it. So do I need to wrap it in a ScrollView after all?

View 2 Replies View Related

Android :: Sleep Widget For Home Screen

Jun 29, 2010

Im still looking for a widget to put my Incredible to sleep without pushing the power button. I am using No lock for the ability to use the touchpad to turn on but I hate using the power button to turn it off and leaving the screen on, even for 30 seconds, has to be draining the battery. (I am constantly on/off/on/off the phone throughout the day.)

I would like something I can put on the home screen that when touched, puts the phone to sleep. This will help save my power button in the long run as well. Ive searched and cant find anything.

View 15 Replies View Related

Android :: RSS Application With Home Screen Widget?

Apr 26, 2010

What's everybody using for an RSS app? I'm using NetaShare. I really like it, but it's lacking a home screen widget - I sorta wrote about it as part of my top 5 favorites, but I'm wondering if there might be something better that allows you to download and store RSS content on your phone and has a home screen widget.

View 13 Replies View Related

Android :: Home Screen Widget Container

Aug 22, 2010

Are home screen "pages" exposed in the API? Can you instantiate and control them?

View 3 Replies View Related

Android :: Home Screen Widget Graphics

Sep 17, 2010

HI took a look at the home screen widget design recently and I tried to deploy a simple widget with 4x1 portrait background provided in Widget.I tried it in HVGA emulator (screen size 320x480 or something) and on Nexus One (screen size 480x800) and the widget seems to be the same size with respect to other UI elements (search widget etc) on both devices. How is that possible when one screen is 320px wide and the other one is 480px? Is the graphics in png format being automatically resized somehow based on screen width? If so, is it better to create the home screen widget graphics to make it perfectly fit to HVGA screen with 320px or is it better to create the graphics to fit the largest screen width possible so it would shrink itself on smaller screens (based on assumption shrinking an image is always better than magnifying it)?

View 2 Replies View Related

Android :: Possible To Put Webview As Widget On Home Screen?

Jan 13, 2010

I've been seeking a way to embed an html widget on home screen. Is it possible to do so without changing the Android framework?

View 2 Replies View Related

Android :: How To Add Edittext Box In Home Screen Widget?

Mar 25, 2010

I want to create a custom widget for my application which should be used for doing search internally in my application.But i am not able to place an Edit text control inside a widget.While browsing further i found that Edittext box was not included for creating custom widgets.I was surprised to see google's search widget showing an edittext box.Is there a way to add an edittext box in a widget...?

View 5 Replies View Related

Android :: AudioManager Home-screen Widget

May 31, 2009

We just released our first widget to the market called AudioManager, it's available now and free to download to anyone who has cupcake already installed.AudioManager is a home-screen Widget that allows you to get live readings of your current volume levels on your Android phone (similar to your computer's "Volume Mixer").Tap on the screen and you can adjust the volume levels individually for the following streams: Alarm, music, notifications, ringer, system and voice call volume.The widget comes in two sizes, large (4x1) and small (2x1). The AudioManager Console is also available through your application launchpad in case you do not need the Widget on your screen but wish to access all volume streams from one place.Attached are a few screenshots, check it out and let us know. Only tested with Android's default home-screen, however, there are mixed reports of the widget working for aHome and dxTop with the latest versions.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved