Some of the things can be done with drawable state list(s) and stuff.

The standard EditText uses a state-list drawable for its background, it can be found under:

android-sdk\platforms\platform-X\data\drawable.

The name can be found by looking in the platform's styles.xml:

<style name="Widget.EditText">
<item name="android:focusable">true</item>
<item name="android:focusableInTouchMode">true</item>
<item name="android:clickable">true</item>
<item name="android:background">@android:drawable/edit_text</item>
<item name="android:textAppearance">?android:attr/textAppearanceMediumInverse</item>
<item name="android:textColor">@android:color/primary_text_light</item>
<item name="android:gravity">center_vertical</item>
</style>

So it's drawable/edit_text.xml you want.

It should be possible to create a similar background state-list XML, to be transparent (or white without the border) for when the EditText is not focused.

As for the rest of you requirements, including a long press to enter editing...

I believe - as a user - that UIs should be predictable and consistent with the platform's conventions, but maybe I'm just too old for this mobile computing thing :)

-- Kostya

07.10.2011 20:29, Studio LFP пишет:
You could still use my code but instead of using it straight, you could just wrap it in a custom view. So instead of just a TextView or EditView, use the above code wrapped in a custom View and have the TextView/EditView inside it. Use the swap code there and it would actually a bit more simple because you could hold the data on the custom view and it would still fit inside your layout like the existing views.

Steven
Studio LFP
http://www.studio-lfp.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Kostya Vasilyev

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to