Android :: Inherit Parent Style And Set Background For Non- Focused Enabled Child Item?
Dec 14, 2009
I'm using ExpandableListView in my app and one of the complains is that when expanded it's hard to visually distinguish where the child item ends and next group item begins. So I would like to change background of the child list item to the different shade. Brutal attempts that I've made so far were based on directly changing background color and text of the elements inside the child view item but that leads to loss of hovers and highlights. So my question is - what is a good strategy to achieve the above? I tried styles and selectors but what really bums me out - that if I change one thing then I need to add selectors for all combinations of focus/enabled etc. when all I'm trying to do it to overwrite a single thing. Is there a way to inherit parent style and set just a background for non- focused, enabled child item?
View 2 Replies
Feb 17, 2009
If my custom Activity style inherite from android: style/Theme.Dialog: <style name="MyTransparent" parent="android:style/Theme.Dialog"> </style>
The menu associated with my activity pop up on the center of the screen.
Is this the expected behaviour? Is there any workaround?
View 2 Replies
View Related
Oct 17, 2009
I have a TextView inside a LinearLayout. The LinearLayout is able to receive focus, and I want the textColor of the TextView to change when it does. I thought using a ColorStateList would work, but it would seem that the TextView does not receive focus when the LinearLayout does. I know that, because I have tried this code...
And nothing gets logged. I don't want to use an OnFocusChangeListener on the LinearLayout to change the textColor of the TextView, I think this has to be done from XML. The reason for that is because in another activity I have an ExpandableListView with a custom adapter and custom views and Android changes the textColors of the TextViews (from light to dark) inside my custom views when items are focused.
View 2 Replies
View Related
Oct 15, 2009
I have this custom layout:
- LinearLayout
- FrameLayout
- ImageView
- TextView
This layout reacts to click events (using LinearLayout.setOnClickListener()) and is made focusable using android:focusable="true" in the layout XML file. This all works fine if you're using the touchscreen, but I'm thinking about users who don't use the touchscreen that much and prefer navigation keys or maybe even don't have a touchscreen. These users won't be able to see when that ViewGroup is focused (although it can be focused using the keyboard).
My question is: how can I make a change in that layout when it is focused (I need to change the android:background of the ImageView)? I suppose I could use LinearLayout.setOnFocusChangeListener(), but I'm thinking maybe there's a better way, using just XML files.
View 2 Replies
View Related
Nov 5, 2010
Is it possible for the child of an ExpandableListView also be a parent?
For example, I need something like the following: ParentA ChildA ChildB ParentB ChildC GrandchildA? GrandchildB? ParentC
View 4 Replies
View Related
Dec 14, 2009
I know it's considered taboo to place a ListView inside a scrolling container, so is there any "proper" way to accomplish scrolling of a container that has a ListView child in it? An example layout would look something like:
Header
---
"Sub" header
---
ListView with list items
---
Footer
Header and Footer need to remain static on the screen, and the middle content (Subheader and ListView) should scroll between them. I can't have just the ListView scrollable, because the subheader takes up too much space. As it is currently, the Header comes from an <include />, the Subheader contains several views including an Image and some text, and the ListView (actually part of a ViewFlipper) would contain an indeterminate number of items. The Footer has a couple buttons/tabs that are used to control the ViewFlipper (only one of the views in the flipper is a ListView).
The only way I can think of to accomplish this efficiently would be to place the Subheader inside the ListView as the first item -- is there any better way?
View 1 Replies
View Related
Mar 30, 2010
My child activity X is called from Parent activity P through startActivity(intent). I want to close P when X called its finish() method. I override a method finishFromChild(Activity child) in P and called finish() in it. But this functions (finishFromChild(Activity child)) is not being called after X finish() Is it a known bug or I am missing some thing? I googled and also searched the groups but no help.
An alternative could be... using StartActivityForResult() and a "fake" onActivityResult, where I can finish the parent activity, but this way is quite bad, i think...
I prefer the first one, if it would work....
View 3 Replies
View Related
Jul 2, 2010
I have a parent activity, and a child activity that extends the parent activity. When the parent starts the child activity,
Which onCreate gets executed first? The child's or parent's?
There is a particular variable I am setting in the Child activity's onCreate method, and right now, it looks like it takes a while to get to the Child activity's onCreate, and so the methods in the Parent are reporting an empty variable. Whereas when I make the Parent sleep for a while, it reports the correct variable.
CODE:............
So, basically, even after the Parent starts the Child, it still returns "Parent Value", but when I have the thread sleep, it return "Child Value".
View 1 Replies
View Related
Nov 8, 2010
I want to open new child activity in the parent LinearLayout. Just similar like Tabs.
View 1 Replies
View Related
Aug 30, 2009
How to add image in expandable List in parent in android ?
If possible how to customize the child in expandable list?
View 3 Replies
View Related
Sep 5, 2009
1) I have made an customizable expandable List .
2) Where I can customize the child.
3) But in parent(Group ID) I want to change the default icon of the parent.which look like(>).
View 1 Replies
View Related
Jun 8, 2010
I have an application, which (for the sake of simplicity) has two types of activities - Overview and DetailView. The Overview activity shows a list of steps and allows the user to start a DetailView activity corresponding to the step chosen.
In the DetailView activity, the user can start another Overview, which shows different steps than the ones in the parent of the current DetailView.
In the Overview, DetailView is started by using startActivityForResult (). In the DetailView, when the user decides to start a second Overview, I call setResult () and finish () and then start the new Overview. In this scenario, onActivityResult () and finishFromChild () do not fire. Instead, they fire when the parent finishes (?).
Code from Overview:
CODE:....
Code from DetailView:
CODE:..........................
View 1 Replies
View Related
Nov 7, 2010
At the moment my base style inherits from android:style/Theme.Light.NoTitleBar. Is there any way I can change it to inherit from Theme.Black.NoTitleBar in code? I notice apps like Handcent has a settings option to do this, but I can't quite figure out how to do this.
View 1 Replies
View Related
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
Nov 24, 2010
we are wroking on the displaying of mails from an email . we got the list of emails stored . we need to show a small text screen which consists of the some content of the body when the email in the list gets focus .
View 4 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
Mar 20, 2010
I need to draw a child view containing a rectangle and button on top of the content view at particular location on the parent (content view). How can I do this? Did not find an explicit way to set origin of child view?
View 1 Replies
View Related
Aug 17, 2010
As the title says, what is the method to access which item is displayed in an Android spinner, so I can have multiple spinners, then wait on a button click?
View 1 Replies
View Related
Jul 25, 2010
I have a main screen with buttons to launch other subactivities. I have to press back button each time to go back to the main screen of my application. How do I finish a child activity and automatically return from the caller?
View 5 Replies
View Related
Oct 29, 2010
I am an Android newbie trying to learn the UI side of things and it's doing my head in. Here's what I have right now:
CODE:.....
What I am struggling to figure out is how do I style the selected item? At the moment the selected item has a ghastly orange background which, under the rounded green rectangle, gives an orange outline effect.
View 2 Replies
View Related
Oct 10, 2010
I have a spinner with items, populated via ArrayAdapter. I want to change font style for some (not for all) of spinner items, both for spinner's combobox and listbox. I guess that I need to subclass something, but I don't understand what. How can I do that?
View 2 Replies
View Related
Jul 19, 2010
Is there an exception in the lifetime rules for a parent activity that's in the background after invoking startActivityForResult()? From my understanding, in low memory scenarios, the background activities are killed before the foreground. Does this rule still apply even if the background activity started the foreground one for the purpose of obtaining some result?
In this case, I think it would make sense for the foreground child activity to get killed first or to equalize the lifetime of the parent and child.
View 5 Replies
View Related
Sep 15, 2010
I have next problem, I have got parent activity and few sub- activities, if app goes to the background by pressed HOME button for long time, all children will be killed, and my app restart from parent activity.
For example: A1 - parent, A2,A3,A4 - sub-activities. A1-->A2-- >A3(top), from A3 I go to the background (HOME). wait 30-40 min and
View 7 Replies
View Related
Aug 1, 2010
I have a simple LinearLayout. When I add the android:background to the LinearLayout, the TextView is no longer visible. What am I not understanding?
<LinearLayout
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="53px"
android:background="@drawable/glossy_black_top_bar" >
<TextView android:text="This is the Title"
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textColor="#FFFFFF">
</TextView>
</LinearLayout>
View 1 Replies
View Related
Apr 23, 2010
How to do a listview which looks like this? I'm interesting in the style of rows with an own background and the selector working fine.
View 1 Replies
View Related
Sep 11, 2010
I've set my Friendstream to update every hour, and this was working fine for weeks. Recently, although it's still refreshing the sync time icon at the bottom every hour, it's not actually updating the widget with the new information. It takes a manual sync for it to refresh. Auto-sync is on, background data is enabled.
View 4 Replies
View Related
Sep 26, 2010
I would like to change the background color of a ListView Item after it has been touched until a further event.
This is my code:
CODE:............
Changing the background color of view yields weird results.
View 1 Replies
View Related
Feb 16, 2010
CODE:.............
This is my current row. If I created a .JPEG, and I want that to be for each item...how would I change this .xml file? Where would I put the image? In Assets?
View 2 Replies
View Related
Jun 2, 2010
I got an app with tabs and a notification bar entry, when I send it to background (click on home button) and try to re-open the application via click on the notification bar, the app restarts (last selected tab is lost).
When I hold the home button if the application is in the background and select it from there or click the app's icon on the homescreen, the previous state is restored per default (the correct tab is selected)
IMO the intent of the notification is wrong, but I'm not sure how to fix it.
In short: How to get a background application back to foreground when I click the notification entry?
View 1 Replies
View Related
Mar 10, 2010
I have a background color applied to a ListView but everytime the list is scrolled the background color changes back to the system default (black). When the scrolling stops the color goes back to @color/window_background.The style is applied in AndroidManifest.xml:<activity android:name=".event.EventList" android:theme="@style/CKButtons"></activity> and my ListView looks like this: <?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="fill_parent"
><ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/android:list"/>
<TextView
android:id="@+id/android:empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/eventlist_no_items"/>
</LinearLayout>How can I prevent this from happening?
View 2 Replies
View Related