textview

android TextView with HTML & seperator

I have a TextView that is part of a ListView row item. In that TextView, i have some HTML rendered using Html.fromHtml(). I'm wondering if there is a way to do what is effectively an <hr> tag within the html so that it'll render a horizontal line in between 2 items within the TextView. is this even possible? thx Ben ...

Vertically Center TextView in RelativeLayout

In the image below, i want the textview in red to be vertically centered, I would like to keep using just RelativeLayout not any LinearLayouts, I think i can figure out how to do this with LinearLayout but do not want to use these. This is all based off of the examples i found here android devleper's blog - Android Layout Tricks #1 ...

Scrolling TextView in a ScrollView to a specific substring of text

For starters, I'm a C++/Qt Developer jumping into Android/Java development, so please don't assume I know anything. :) So, I have an application with a TextView contained with in a ScrollView. The text contained in the TextView is the results of a web query from my web server application. Depending on the query, the text can be pretty...

Set the layout weight of a TextView programmatically

I'm trying to dynamically create TableRow objects and add them to a TableLayout. The TableRow objects have 2 items, a TextView and a CheckBox. The TextView items need to have their layout weight set to 1 to push the CheckBox items to the far right. I can't find documentation on how to programmatically set the layout weight of a TextView ...

Simple Chinese ebook reader + Dictionary

Hi there, I am thinking of writing a very simple ebook reader for foreign language (Chinese for starters) that doubles as a simple dictionary. So, basically I envision this app will function like a simple ebook reader (read txt file or epub) and allows you to flip the pages using keys or gesturing, remember where you last stopped etc....

Ellipsize only a section in a TextView

Hi! I was wondering if it is possible to abbreviate only a portion of a string in a TextView. What I would like to do is something like this: Element with short title (X) Element with a very lo...(X) The title should be ellipsized, but the X must be always visible. In my case, is not possible to use more than one TextView. Do you thi...

How to generate Styled text for TextView while assembling string?

I have a TextView that will hold a styled, multiline string. This text is generated line by line as the data is drawn from different sources bit by bit. As I grab each field, I add a Bold header to the TextView on a new line, then I add the data for that field in italics on a new line. Example formatting: Due Date July 22, 2010 ...

Set TextView text from html-formatted string resource in XML

I have some fixed strings inside my strings.xml, something like: <resources> <string name="somestring"> <B>Title</B><BR/> Content </string> </resources> and in my layout I've got a TextView which I'd like to fill with the html-formatted string. <TextView android:id="@+id/formattedtext" android:layout_width="fi...

android RelativeLayout, trying to vertically center a TextView when the TextView below has no text

I have a ListView that contains an Image on the left of two vertically-oriented TextViews using a RelativeLayout. When both TextViews have text it looks fine. Sometimes the TextView on the bottom won't have any text, and the problem is that the entire layout is several pixels above where it should be because it still reserves that space ...

android textview fill parent

I have a simple ExpandalbeList. For the group header view, I'm using a simple TextView, I am setting the background of the text to a drawable. I have the textview parameters set to FILL_PARENT, but the background of the TextView only covers the width of the text. I realize that I can put this all inside of a Linear Layout, but that ju...

Scrollable text in Android widget

I have created a widget to display some long text. I want this text to have "marquee" effect . I've already set TextView propertie ellipsize="marquee" but it doesn't works . Any idea? Edit: For example Stocks widget of HTC ...

Android Set Text to TextView

Hi out there, have a problem, setting a Text to a TextView. TextView android:editable = "true". In my .java it seems like that text = (EditText) findViewById(R.id.this_is_the_id_of_textview); text.setText("TEST"); But it doesnt work, dont know, whats wrong..hope u can help me:) ...

Scrolling EditText on ScrollView programmatically

Hi there, I am trying to make a non-editable EditText that is placed in a ScrollView and scrolling is controlled programmatically (when a left/right fling is detected). Ok, here's my simple layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientatio...

Set color of TextView span in Android

Is it possible to set the color of just span of text in a TextView? I would like to do something similar to the Twitter app, in which a part of the text is blue. See image below: Thanks! ...

Android relative layout placement problems

I have been having problems creating a relative layout in XML for a list item to be used for a series of items in a ListView. I have tried for hours and am tearing my hair out trying to get it to look how I want but cannot get everything to appear in the correct spot and not overlap or mis-align. I can get the first image and next two te...

Shadow Effect for a Text in Android?

Hi Folks, How can i make shadow effect Text in Text View. Any Idea? Thanks.. ...

Android - How much space does a TextView take

How much space does a TextView take? When I declare a TextView, is it possible to calculate how much space (height and width) it is going to take when actually rendered on the phone? I have noticed that based on the different screen sizes of phones (or density), the TextView is rendered accordingly. I want to be able to calculate the e...

Degrees symbol (as in Degrees Celsius/Farenheight) in a TextView

Is there a way to include the small circular degrees symbol to a TextView? This would be for temperature readings, as in degrees celsius or farenheight. I'm finding this an awkward question to Google, and wondering if anyone has done this programatically before. ...

Android - TextView and VideoView problem

I have a TextView inside a LinearLayout and a VideoView inside a LinearLayout. The parent layout is a RelativeLayout that includes the TextView's linear layout and VideoView's linear layout. Since I add the VideoView with FILL_PARENT, FILL_PARENT params (coz I want it to fill the screen in landscape mode), in some phones when I rotat...

How do I prevent TextView from stretching out it's parent LinearLayout?

It seems that a TextView inside a LinearLayout forces that LinearLayout to be larger. I am trying split my screen top 50% and bottom 50% and also the bottom 50% is split into 3 parts. So I did my weights 3 (for the top), and then 1, 1, 1 (for the bottom) for a total of 6. Here is what it looks like. http://i.imgur.com/3FJSW.jpg As so...