Android :: ExpandableListView Displays Expand/Collpase Icon Even If There Are No Children

Nov 18, 2010

I have a ragged hierarchy of parents and children. In that there are some parents that have 5 children...and some parents have 0 children.

The expandableListView displays the "Expand/Collpase" icon even if there are no children.

Question-Is there a way to hide the icon for only those Parents(rows) that have no children? I still want to show the row of the Parents with no children. And allow a user to click on them. But the "Expand/Collapse" icon is confusing.

Android :: expandableListView displays Expand/Collpase icon even if there are no children


Android :: ListView - Making The Parent Expand To Show All Children When AddingListViews Within ListViews

Feb 9, 2010

Basically, I have a custom ListView in which each item looks like:

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

The ListView in each item is GONE by default and is set to VISIBLE when the button is clicked. Everything seems to work fine with the exception that when the ListView is long enough to scroll, it is just kind of truncated. http://img38.imageshack.us/img38/3269/listviewproblem.png

Is this a problem with the maximum height of an individual list item? Is there a way to force the list item to expand and force the child listview to expand to show all children?

View 1 Replies View Related

Android :: ExpandableListView Centains A Link Does Not Expand

Jan 27, 2010

I have an ExpandableListView contains a link, it does not expand when has a link, and i want the link is clickable.

CODE like this:

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

And:

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

View 1 Replies View Related

Sprint HTC Hero :: Weather Widget Displays Wrong Icon

Oct 20, 2009

On both the clock/weather and regular weather widgets I am getting the correct weather but the icon to represent what it looks like outside is off. For example, posting this at 9:30am, the moon icon is on the screen. I'm not quite sure what is causing this to happen.

View 1 Replies View Related

Android :: FrameLayout And Positioning Children

Jan 26, 2009

i'm in final stage of writing my custom widget (quite similar to Home's sliding panel). it works quite well except one thing: i have some problems with positioning it in FrameLayout (see 3 rightPanel* Panels in main.xml in attached eclipse project).basically i don't like the idea i'm using there: setting layout_marginTop in panelHandle children.

View 2 Replies View Related

Android :: Way To Use CheckBox As Children In ExpandableList?

Jul 13, 2009

I would like to have expandable text categories which reveal children that are checkable entries. I've used the "simple_list_item_multiple_choice" layout for the childLayout argument of SimpleExpandableListAdapter.

View 7 Replies View Related

Android :: How To Get All Children Views Of Layout?

Jul 9, 2010

Is there a way to get all the children views of a layout, from the Java code so that I can loop through them and set an attribute? Specifically, I'd like to set the "layout_width" based on the screen size. Since this "layout_width" would be the same for all the views, I'd prefer to loop through instead of calling each individual View separately by their id. The following is my main.xml:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:id="@+id/myRow1" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"> <TextView android:text="1" android:layout_width="wrap_content"
android:layout_height="50dip" android:layout_weight="1"/>
<TextView android:text="2" android:layout_width="wrap_content"
android:layout_height="50dip" android:layout_weight="1"/>
<TextView android:text="3" android:layout_width="wrap_content"
android:layout_height="50dip" android:layout_weight="1"/>
<TextView android:text="4" android:layout_width="wrap_content"
android:layout_height="50dip" android:layout_weight="1"/>
<TextView android:text="5" android:layout_width="wrap_content"
android:layout_height="50dip" android:layout_weight="1"/>
<TextView android:text="6" android:layout_width="wrap_content"
android:layout_height="50dip" android:layout_weight="1"/>
</LinearLayout> </LinearLayout>

View 8 Replies View Related

Android :: How To Make Children Of Selectable Table Row

Sep 23, 2010

I'm making a image gallery with infinite vertical and horizontal scrolling. I put images inside a ListView to make a column, and put the ListViews inside a TableRow. However, it seems that child views of TableRow is not selectable and as a result I can't select the images in my ListView (easily). Is there a way to pass the events down to child views of TableRow so they can be selectable?

View 2 Replies View Related

Android :: How To Make Children Of Selectable TableRow

Sep 23, 2010

I'm making a image gallery with infinite vertical and horizontal scrolling. I put images inside a ListView to make a column, and put the ListViews inside a TableRow. However, it seems that child views of TableRow is not selectable and as a result I can't select the images in my ListView (easily). Is there a way to pass the events down to child views of TableRow so they can be selectable?

View 1 Replies View Related

Android :: Two Children For ScrollView Vertical Orientation?

Aug 10, 2010

I am trying to create a very simple application (part of my learning program), vertically oriented, with an EditText at the top that receives a URL, and two buttons side by side just below that say "Get Image" or "Get Text" depending on the URL typed in (.html vs. .png, for example). The resulting elements may be later scavanged for use in a real app. I know that ScrollView can have only one child. Conceptually, I want the rest of the screen to be a vertically oriented content region for displaying either the text (TextView) of the URL and "Get Text" was clicked or the image (ImageView) in the case where it was an image and "Get Image" was clicked. I tried to do this (pseudocode) in main.xml:

<LinearLayout> <EditText /> --where to type the URL
<Button /> --click to treat URL as text
<Button /> --click to treat URL as image
<FrameLayout> --(used to be ScrollView) <LinearLayout>
<TextView /> --content region occupied by either text
<ImageView /> --or an image (but not both)
</LinearLayout> </FrameLayout> </LinearLayout>

In order not to violate the single-child requirement. However, this doesn't work and for now I'm not finding any sample out there that clues me in to how best to accomplish this. The last complaint I got while debugging was:
Caused by: java.lang.ClassCastException: android.widget.TextView

View 2 Replies View Related

Android :: How To Access All Children Of Preference Screen ?

May 11, 2010

I'm trying to programmatically uncheck all the CheckBoxPreference children of a PreferenceScreen in my app. How can I do that?

View 2 Replies View Related

Android :: Scale A View Without Resizing Its Children?

Apr 2, 2009

I need to resize the height of a layout so i tried to apply a scale animation. The view is resized but its children are resized too. Is there a way to resize the layout without resizing its children?

View 3 Replies View Related

Android : Extending AdapterView - Getting Only 1 Level Of Children

Feb 16, 2009

I'm creating a custom widget that extends AdapterView. Imagine something like a ListView except that the list items can overlap each other with some transparency. Because of the overlap, I'm trying to control the layout and drawing order of the children.

My issue is that the control renders it's children, but ONLY one level deep. Each child is inflated from an XML resource that contains a FrameLayout and an ImageView. The FrameLayout draws, but the ImageView is never visible. I assume I need to call some method to tell the FrameLayout to layout or draw it's children, but I'm not sure what, why, or where. Does anyone know what I'm missing?

Here is the relevant code for my custom widget: Code...

View 3 Replies View Related

Android :: Drawing Children In Custom Linear Layout

Feb 9, 2010

I have a linear layout that I have overridden because I want to > dynamically add other views to it. I am trying to add some textviews > to it and I call addViewToLayout in the onLayout method. Can't you just add your views to the layout using addView()? I have one custom LinearLayout and this is what I do and it works fine. No need to override onLayout() or onDraw(). Maybe try that

View 10 Replies View Related

Android :: Custom ListView Selected Item Children?

Oct 27, 2010

I have a custom listview row that contains a number of textView components. Instead of the "standard" single text item, I have created a item where each listview row contains several bits of information. For this example, I have a record id, a name, and a description for each row in the listview. I have my listview populated via
this.mDbHelper = new RecordDBAdapter(this); this.mDbHelper.open();
Cursor c = this.mDbHelper.fetchAllRecords(); startManagingCursor(c);
String[] from = new String[] {RecordDBAdapter.ROW_ID, RecordDBAdapter.NAME,
RecordDBAdapter.DESCRIPTION};
int[] to = new int[] {R.id.recordId, R.id.lblName, R.id.lblDescription};
// Now create an array adapter and set it to display using our row
SimpleCursorAdapter records = new SimpleCursorAdapter(this, R.layout.record_row, c, from, to); this.list.setAdapter(dives);

Now what I want is to be able to access the recordId value within each clicked item. I've tried to follow the Android tutorials to no avail. They do something like
Object o = adapter.getItemAtPosition(position);
but that still doesn't help either. What I really want is to get the value of the recordId within each selected listItem. Does anyone know how this would be accomplished? Here is my onItemClick event:
protected OnItemClickListener onListItemClick = new OnItemClickListener() {
@Override public void onItemClick(AdapterView<?> adapter, View view, int position, long rowId) {
// My goal is either to grab the value of the
// recordId value from the textView, or from the adapter.
//Object o = adapter.getItemAtPosition(position);
//Tried this, no joy
Intent intent = new Intent(NeatActivity.this, SomeOtherActivity.class);
// intent.putExtra("selectedRecordId",val); //val here is a numerical record row id being passed to another activity.
startActivity(intent); } };

View 1 Replies View Related

Android :: Block Click - Focus On Layout And On All Children?

May 26, 2009

I was wondering if its possible to block the onclick events on a layout and all the children inside the layout.

for example, I have a LinearLayout and inside that I have buttons and an editText. At a certain point I don't want the user to click on the buttons or edit the text. Is there a way to block that? Do I have to do it for each view? or I can do it for a Layout? What is the best way to do this?

View 2 Replies View Related

Android :: Unable To Select Children (textview) Of TableRow Programmatically / Fix It?

Nov 2, 2010

I'm trying to access the textviews (for starters, eventually replace with imageviews etc) which are stored in the tablerows in the code below.

The line beginning 'log.d' was the part I was working on, trying to get it to print out the contents of the 2nd text view in the first row, but I can only get as far as selecting the tablerow using "getChildAt(i)".

Trying "getChildAt(0).getChildAt(1)" doesn't select the textview as I would have expected it to; says that it's a View and as such, doesn't have this method - though unless I'm mistaken, aren't tablerows ViewGroups, which do have this method? code...

View 1 Replies View Related

Android :: Linear Layout Focus And Children Change Foreground Color?

Nov 18, 2009

I have a LinearLayout with 2 text View as its children. How can I make the children of LinearLayout to change foreground color (in this case, the text color of the text view) when the linearlayout has focus?

<LinearLayout> <TextView android:id="@+id/name" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textAppearance="?
android:attr/textAppearanceSmall" android:textColor="?android:attr/textColorInverse" />
<TextView android:id="@+id/value" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textAppearance="?
android:attr/textAppearanceSmall" android:textColor="?android:attr/textColorInverse" />
</LinearLayout>

View 2 Replies View Related

Android :: Code To Create On Click Event For Children In Expandable List?

Aug 5, 2010

I am playing around with this example.
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList2.html

I cannot figure out how to attach a listener to the children elements so that I can trigger some action when the user taps on the phone number.

View 2 Replies View Related

Android :: How To Make Listview With Selectable Children Stop Scrolling On Touch Event

Oct 20, 2009

As a work around to the issue where a list item isn't focusable if it has a focusable child item (a comment by Romain Guy was that this was intended behavior, for accessibility reasons) I simply filled the listItem with two children, each of which is focusable - There's nowhere to directly touch on the listItem anymore, just it's children.

For the most part this is a useable workaround, effectively invisible to the user, except for one thing- Although you can scroll by swiping without issue, touching to *stop* the scroll no longer works- I imagine because the child item is capturing the touch event and not passing it to the parent listitem, at least while the scroll is in effect.

Is there a known workaround for this? Perhaps someway to "pass the baton" of the touch event back up to the parent listItem, or a way to change my design?

BTW- I know there's some built-in functonality for single/multiple choice listviews (checkbox listviews) - That doesn't actually help in my case. The app is a contact list, and the row children are a relativelayout (populated with contact info) and a clickable phone icon (a one-touch dial for the contact), which needs to be visible or invisible depending on whether the stored contact has a phone number.

View 2 Replies View Related

Android :: Way To Expand VM Limit In Phone?

Nov 23, 2009

Is there a way to expand the VM limit in Android 2.0 on an actual device? Using java.lang.Runtime.maxMem() on a Droid reveals a limit of 24MB, and I've written some code that incrementally allocates memory until failure to verify that figure. You can set the VM size in the emulator, but I haven't yet found a way to do that for a connected phone. Is there some type of a properties file on the device itself that can be modified?

View 2 Replies View Related

Android :: How To Expand Screen Number

Oct 4, 2009

By default, there are only 3 screens for google g1. but i know some applications can expand them to 5 - 7 screens.

View 2 Replies View Related

Android :: ScaleType Expand To Screen

Nov 21, 2010

I need to resize several images inside ImageView to screen size. Currently I use scaleType="centerInside", it works good for bigger images to scale them down to screen size but doesn't expand small images.

All other suggested options crop or deform image. Is there any way to expand images (keeping ratio) via XML or do I have to do it manually in code?

View 1 Replies View Related

Android :: Expand The InputType Of EditText ?

Oct 18, 2010

I'd like to allow possible inputs of 0-9, "," or "-" for EditText and couldn't find an answer.

I know using the "|" as an separator is possible: android:inputType="number|text"

But how can I archive something like this (too bad it doesn't work): android:inputType="number|,|-"

Addition to the comment below:

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

View 1 Replies View Related

Android :: Eclipse ClassCastException When Trying To Expand XML Layout

Jan 16, 2010

I am new to java, eclipse, and android development, so I may be missing something simple although I have checked basic stuff like spelling several times.

Because there is no number picker control (such as that used in the date picker) in the public Android SDK, the conventional wisdom is to "clone and own" the control that exists in the Android source.

In an attempt to do that, I have copied the code for NumberPicker into my project and its dependency, NumberPickerButton. I have also copied the supporting resources.

The problem I am having is that when I try to include the NumberPicker in a layout, the rendered version of the layout within Eclipse does not work.

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

Adding that tag causes the Layout view of the XML file to only show the following error.

ClassCastException: com.spencerandbrown.PatientTracker1.NumberPickerButton cannot be cast to com.spencerandbrown.PatientTracker1.NumberPickerButton

I have tried both the fully qualified name and the unqualified name and it makes no difference.

The strange thing is that the control works at run time, it just will not render in Eclipse.

Is there a solution for this issue? Am I just doing something wrong?

If necessary, I can include more code from my project to clarify.

If I reference the internal Android widget, it works fine in the Eclipse layout view, but it is clumsy to interact with that way and it might break in the future.

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

Here is the stack trace from Eclipse.

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

View 2 Replies View Related

Android :: Slide Expand Animation In Droid?

Apr 24, 2010

I have a simple list view listing results in android. Upon click of each item, I would like it to slide down expand and show the content. Is there an easy way to do this in android?

View 1 Replies View Related

Android : Way To Expand Notification Text To Two Lines?

Sep 8, 2010

Is there any settings/flags to expand the summary text of a notification to two lines instead of 1? The text I am trying to put is too long and it goes over the visible area? Will try something like (text+"/n"+restOfText) tomorrow but I don't think it's going to work...

View 5 Replies View Related

Android :: Expand Notifications With A Key Press Instead Of Touch?

Jul 28, 2010

The reason: I'm trying to make Android work in a device without touch screen.

View 2 Replies View Related

Android :: How To Expand ListView As List Item Populate?

Aug 23, 2010

Basically I am trying to recreate the default contact screen when you click on "+" button another row of Phone number added to the list. Right now I have an ImageView as the "+" button and a ListView to contain the list of phone numbers. The problem is that the ListView doesn't expand when I add more item into the list. I could build the same look with LinearLayout but how can I save all those numbers that way? Below is the layout of the item that will be inflate with custom Adapter:

<?xml version="1.0" encoding="utf-8"?> <TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="60px"
android:stretchColumns="1" android:background="#FFFFFFFF"
android:gravity="center_vertical"> <TableRow>
<Button android:id="@+id/type" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:paddingLeft="10dp"
android:text="Home" /> <RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:paddingLeft="10dp"
android:paddingRight="10dp" >
<EditText android:id="@+id/value" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" android:text="" android:hint="Name"
android:lines="1" android:textSize="10pt" android:typeface="sans"
android:textColor="#FF000000" android:gravity="left" /
</RelativeLayout> <ImageView android:id="@+id/del"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentTop="true"
android:paddingRight="14dp" android:src="@android:drawable/ic_delete" />
</TableRow> </TableLayout>

This is the ListView portion.
<ListView android:id="@+id/phoneList" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="#FFFFFFFF"
android:scrollbars="none" />

View 2 Replies View Related

Android :: Expand Clickable Area Of An ImageView By Using Padding?

Nov 5, 2010

I have an ImageView, and I want it to be clickable. The image itself is only 32x32 pixels, but I want the clickable region to be larger so it's easier to hit. I was hoping I could set the layout margin values to increase the size of the imageview's clickable area:

<ImageView
layout_width="32dip"
layout_height="32dip"
layout_margin="20dip" />

That doesn't work, what I could do is just recreate the image resource to have a larger transparent region around it. That's a bit annoying because it's hard to tweak if I ever need to change the clickable region. It's not just a single png either, it's a statelistdrawable so I have to resize 3 different pngs if I ever need to tweak the clickable area.

Anything else I can do?

View 2 Replies View Related







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