How to make a LinearLayout fousable and its children change foreground color

by n179911 » Thu, 19 Nov 2009 12:46:46 GMT


Sponsored Links
 Hi,

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>

Thank you.

--



How to make a LinearLayout fousable and its children change foreground color

by surya prakash » Thu, 19 Nov 2009 14:54:08 GMT


 


Thank you.


>


Sponsored Links


Other Threads

1. Android Development Phone Setup - Vodafone India

You can skip the initial setup by connecting the phone to PC via USB and
then type :

# adb shell "echo app.setupwizard.disable=1 > /data/local.prop"
# adb shell reboot

Register later when you are connect to a WiFi network.

Cheers!
V





--~--~---------~--~----~------------~-------~--~----~

2. Share data between tabbed intents

I need to share an id key (int) between three ListActivities hosted in
a TabActivity.

I have a TabActivity with three tabs that each start ListActivities
via intents like this:

...
tabHost.addTab(tabHost.newTabSpec("tab1")
                .setIndicator("Recipes")
                .setContent(new Intent(this, RecipeList.class)));
tabHost.addTab(tabHost.newTabSpec("tab2")
                .setIndicator("Ingredients")
                .setContent(new Intent(this, IngredientList.class)));
tabHost.addTab(tabHost.newTabSpec("tab3")
                .setIndicator("Method")
                .setContent(new Intent(this, MethodList.class)));
...

These three activities use a content provider with three normalised
tables:

RecipeList uses the Recipes table:           | _ID | RecipeName |
IngredientList uses the Ingredients table:   | _ID | RecipeID |
IngredientText |
MethodList uses the Methods table:          | _ID | RecipeID |
MethodText |

The RecipeID column in the Ingredients and Methods tables refers to
the _ID column of the Recipes Table, thus linking ingredients and
methods to the relevant recipe.

So what I plan to do is when a row is selected in the RecipeList tab,
store the _ID somewhere accesible by IngredientList and MethodList
activities. Then when IngredientList or MethodList tabs are selected a
cursor query is made using the stored id in a where statement, thus
only displaying ingredients/methods that have a RecipeID value
matching the _ID of the selected recipe on RecipeList.

The only real solution I have come up with so far is using a static
int in the tabhost activity that the other activities can all read,
but this seems very messy and would require that only one instance of
any of the activities is created.

I'm sure there must be a neat way to do this with intents or
something, does anyone have any advice or examples?



--~--~---------~--~----~------------~-------~--~----~

3. Replace the current view by an other view

4. After the ADT 0.9 update, Eclipse can not create R.java automatically

5. Exposing build-time-configurable aspects

6. displaying progressbar

7. unknown exception for create object of FileTransferManager() of smack library