Android :: Setting Focus To Listitem's Child Views
Jun 8, 2010
Is it possible to give Focus on listitem chile views , what i need is i have an custom list view , i creating each row using linear layout with two views like button and textview, now i want to get that button click event and have to change the background color while focusing is it possible?
View 2 Replies
Jan 6, 2010
I have a simple ListView and on that ListView I have placed a number of custom defined Views. The CustomView has ImageView and two TextViews.
The CustomView also has a "stateful drawable" as background, so that the background image (a 9-patch) changes if you press the Row in the ListView. When pressing the Row, the background image changes to a Red-ish thing.
The problem is that when the background changes from the default greyish, all the Views in the CustomView (ImageView and TextViews) still have their greyish background and thus creates very ugly greay boxes on top of the now redish background.
What is the best way to solve that problem? I hoped that such things were handled automatically (as it is done in for example .NET), but I was wrong it seems.
View 1 Replies
View Related
Apr 19, 2010
When using a View within a View, for example an ImageView within a LinearLayout, both of which have xml drawable resources (the LinearLayout as a background) specifying PNG drawables to use for the on/off states, shouldn't children Views receive the focus state when their parent gets focus? So as far as I understand, both my LinearLayout and ImageView should be switching to their focus states right? Apparently not Or, more likely, apparently my implementation is incorrect.
The focus state works on the LinearLayout but my ImageView never receives focus.. I have both Views set to android:focusable="true".
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
View 2 Replies
View Related
Jan 25, 2010
Is there any way to query a root view of an activity for all of its child views even before the root view or its children have been inflated? I guess what I'm looking for is whether a view knows ahead of time what children it will have before it gets inflated, and can I get that list in some way. Bizarre I realize, but I think it will help me with some unconventional automation testing I'm working on. I haven't found anything in the API like this.
View 1 Replies
View Related
Mar 12, 2009
I have ListView, where each row contains two edittext boxes. I'd like on list item selected(using Dpad) place focus on first edittext box. I tried the following code, but it does not work: ListView list = (ListView) findViewById(R.id.list); OnItemClickListener click_listener = new OnItemClickListener() {public void onItemClick(AdapterView<?> parent, View view, int position, long id){EditText box1= (EditText ) view.findViewById(R.id.box1); box1.requestFocus(); return ;} list.setOnItemClickListener(click_listener);}
View 2 Replies
View Related
Nov 19, 2010
I have a list view which contains different numbers and i have a button below with the name "Call". The expected spec is to change the button background to blue, only if user clicks on list item, and if user clicks on some other views, i need to change the button background to white.
My work around for this issue:
I have set onfocusChangeListener() for the list live, but onFocusChanged() is getting called if next view gets the focus.
Expected result:
1) Background of the button should change to blue if user clicks on list child item.
2) Background of the button should change to white if user clicks on other views.
View 2 Replies
View Related
Nov 20, 2010
I have a list View in my app (this is the xml layout):
CODE:.............
Each item of my list View is composed of two TextView:
CODE:.............
I would like to change background color (and text color) of each item of my ListView on focus (and, if possibile on selection). How can i do it?
View 6 Replies
View Related
Oct 23, 2010
I am trying to figure out how to add a child view to a parent view so I can use the MotionEvent.ACTION_MOVE feature to move from one child view to the next. Is this possible?
View 4 Replies
View Related
Sep 7, 2009
I am facing problem in fixing the child in particular place in views or layout.
1) Can I fix the child at the starting and ending of Layout directly?
2) Can I fix the child at the starting or ending of the view directly?
View 1 Replies
View Related
Aug 29, 2010
I have a number of child views, each child is a TableRow and I need to be able to change the order of the TableRows, such that I can swap the rows into any order. I know there is a method called removeAllViews() but I don't really want to remove and re-create the views if its possible to access and change the order. I really want the display to update as smoothly as possible, taking the minimum amount of time, is it possible?
View 2 Replies
View Related
Mar 17, 2010
I've been programming in Android for two years now and just joined an Android project where they are using a TabActivity to host multiple Activities. It's unclear why this is better than rewriting the TabActivity to simply use Views instead.
TabActivity extends ActivityGroup which means TabActivity can host both Activities and Views. But what's the use of this capability? I was under the impression that Activities should be treated as individual screens of an application.
In short, what is an example use case where it's recommended that TabActivity should host multiple Activities rather than multiple Views?
View 4 Replies
View Related
Sep 20, 2010
i've got an ExpandableListView with my own layouts for the group and child views. a certain group-type will require a different layout. is that possible - i.e. a ELV with different layouts for a group view. i've got my own sub-class of SimpleExpandableListAdapter.
View 6 Replies
View Related
Aug 31, 2010
Can someone help me with my Syntax/Methodology? I would like to set up a bunch of different views in a viewgroup. My code fails at the addView method.
Unfortunately, I can't find jack for examples (which is how I learn) using the ViewGroup class online.code...
View 2 Replies
View Related
Feb 28, 2010
ExpandableListView has a setOnChildClickListener method, but lacks of setOnChild*Long*ClickListener method.
When I added setOnLongClickListener() on child view in getChildView(), whole sublist became completely unclickable (despite of parentView.setOnChildClickListener() present and working before).
How can I enable long clicks on child views?
View 1 Replies
View Related
Sep 27, 2009
I need a LinearLayout to contain 3 TableLayouts, and I can't get it to work. This is where the problem is I'm sure:
mTableLayout.addView(mLinearLayout, LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); mLinearLayout.addView(nTableLayout, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); mLinearLayout.addView(oTableLayout, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); mLinearLayout.addView(pTableLayout, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
How Do I make this work? I can get it to work just find when I only add a single child view, but when I have multiple children view objects my app crashes.
View 6 Replies
View Related
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
Jun 25, 2010
In my app i'm setting background to each child views in listview. So that listview default focus ( orange color ) is not focusing. Is there any way to set both ( listview focus & child view background)?
View 1 Replies
View Related
Aug 28, 2010
I have subclassed ExpandableListActivity to create an activity that presents a simple tree view of the 'world at large' and allows the user to select one for further use by the app. I am having trouble setting focus programatically. One thing that baffles me is that I can use the D-pad to set focus on any of the child or group items in my ExpandableListView, but inside my onChildClick() callback, isFocusable() returns false. If I can set focus with the D-pad, how can isFocusable() return false?
My goal is to avoid having the user have to touch individual ExpandableListView entries to select them and to provide a couple of buttons to move the focus up and down inside the list. I want selection to be easy for folks with no D-pad or with a phone that only presents the D-pad when in landscape mode (e.g. Droid) .
Is there some way I can programatically inject D-pad key clicks into my app input event stream?
View 2 Replies
View Related
Jul 15, 2009
Here is my screen description: It is a TableLayout and it contains multiple Rows. I have set TableRow as clickable, as I want to go to next screen on click of a tableRow. Everything I am doing through Java programming (instead of XML layout, because number of TableRows changes each time) On next screen, I wanted to display all the views of that particular clicked TableRow. Here the problem i am facing is how to capture particular tableRow on onclick() even and how do I get all the textviews of that particular Row. I tried to set id at runtime, and tried to get id of view, but it's not working, giving error resourcenotfoundexception.
View 2 Replies
View Related
Jun 19, 2010
I have yet to get a decent picture with the camera. My Blackberry Tour took great shots without any fuss. I tap to set the focus to specific points in the shot, but it never gets sharp. They always look grainy or soft. Anyone else having this issue or do you have hints?
View 1 Replies
View Related
Jan 12, 2010
I've created a custom Typeface by adding a TTY file to the assets folder, and I use the set Typeface method to apply this font to each of the text views, and everything works great. The only problem I have, is that I write a lot of code lines in order to apply this font to all text views. Is there a way to make this font the default font in my project, or to apply it to all text views at once?
View 2 Replies
View Related
Nov 16, 2010
I am implementing a music player application in Android. My play list selection screen is implemented as a tab selector widget which contains a ListActivity inside each of the tabs: Artist, Albums, Songs.
I want to update the ListView in each of the ListActivity when I delete an item from any of the lists.
i.e. When I long press an item in the Artists list a context menu is drawn with "Delete Artist"
And it should delete all the songs from this artist in the Songs ListView, delete all the albums by this artist in the Albums ListView, and finally delete the entry for the artist in the Artist ListView.
Each of the ListActivity has its own fillData() method, which updates the ListView when the button in the context menu is pressed.
How can I call the fillData() method of the Albums ListActivity after I update the ListView inside of the Artists ListActivity?
View 1 Replies
View Related
Jul 31, 2010
I have a listActivity which I use ArrayAdapter insider it. When user scrolls the scroll ball, one listitem would be focused. How can I know itemlist is highlighted?
It looks simple to me at first, however, it takes several days and still can't find answer.
View 2 Replies
View Related
Feb 28, 2010
I want to populate a table, defined in layout xml file through the programmatic way. I have define Table with a single row defining its header, with all the attributes set. Now i want to know a way so that i can just replicate that header row in the table with new content.
I tried using inflator inflate(int,view) method, but at runtime it showed up with error.
Here is the XML code for the layout file defining the table
CODE:.................
View 1 Replies
View Related
Aug 29, 2010
I loved the camera on the Eris and the Incredible, not only did they have a whole lot more of a crisp high-res detail, the auto-focus absolutely rocked. With my droid x, I can be getting a little artsy and focus on an object with the crosshair but it'll take me 20 tries to get it to lock on, its insane, I know I'm not getting too close to my subject because it will definitely eventually focus on that object if I try over and over and over again. It's not just close ups that I find myself and my buddy with this issue either. macro shooting mode does not help. My buddie's droid X has the same exact behaviors. Eris and incredible just LOCKED ON first try with even very low contrast / detail subjects, on top of that, have a ton better camera GUI when it comes to "click to focus". I know this thing ain't no SLR but, blows me away of how terrible the camera performance is vs. the HTC android based devices. Ihink motorola will fix this? I know this thing ain't no SLR but it just blows me away how the HTC android devices camera performance (except for video) blows the Droid X away.
View 9 Replies
View Related
Mar 6, 2010
I have the following XML code:.................
The idea is to change the views, whenever I press one of the radio buttons. When I press a button the first time everything works out fine, but the second time I press a button, I get an IllegalStateException, and I can't quite see why I'm getting this.
Also, the Activity seems to set all my global variables to null, which is why I have to create them every time I switch from portrait to landscape or vice versa. So I would like to know if there is a way I can save my views in the Bundle, or any other way in which I can permanently save my views, so I don't have to add or create them every time, I flip the phone. And whenever I flip the phone, it seems that it rereads the main XML file, causing the RadioGroup to be set to 2D even if the 3D button is checked. This is because I've said the 2D button to be checked from when the app is first created, but I would like to also save the state of that RadioGroup.
View 5 Replies
View Related
Nov 4, 2009
I want to remove the listitem from listview in android.i don't know that how to do it.
View 1 Replies
View Related
Aug 25, 2010
The Listitem would not be retrieved from the db. It is passed over from another class.
View 1 Replies
View Related
Jun 16, 2010
How do you align views relative to the "middle" part of another view? I think it is best explained with a pic of the UI I'm trying to create in android.
View 2 Replies
View Related
May 6, 2010
I have a View that extends Activity. A ListView will display a number of listitems. When the user long clicks I would like to present them with a contextmenu allowing them to select edit, delete etc. and then identify the listitem that was selected as the item to perform the action on.
In onCreate I have:
listView.setAdapter(adapter);
listView.setOnItemClickListener(onListClick);
listView.setOnItemLongClickListener(onListLongClick);
registerForContextMenu(listView);
I have a method onCreateContextMenu
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Context Menu");
menu.add(0, v.getId(), 0, "Edit");
menu.add(0, v.getId(), 0, "Delete");
and also onContextItemSelected
@Override
public boolean onContextItemSelected(MenuItem item) {
if (item.getTitle() == "Edit") {
// edit action
} else if (item.getTitle() == "Delete") {
// delete action
} else {
return false;
return true;
}I am not sure where to go from here to get the correct row/listitem.
View 1 Replies
View Related