Hi Justin,

On Tue, Jan 26, 2010 at 6:34 PM, Justin Anderson <[email protected]>wrote:

> It is done via a selector...  There is not a lot of documentation about
> them, the basic premise is that it is an xml file that defines drawables to
> be used when certain conditions/states are met... such as when something
> gets focus.  It goes in the res/drawable folder just like any other drawable
> and is referenced the same way.
>
> I am quite new to this XML selector. I could not find out such files in
android's webkit for displaying rectangular box around the link. Could you
please give me some pointer from android-webkit code, so I can proceed
further ? I would be very thankful to you.

Actually, I could display the box around the URL link, but if my URL link
spans over more than one line, then my code shows the one rectangle on 1
line. But, in android-browser, in the same case, whole URL (still if it
spans over multiple lines) gets surrounded by single large rectangle. I am
not getting how this is achieved in android ?


Thanks in advance,
Vivek Satpute

> Here is an example of a selector that I use in one of my apps:
> <?xml version="1.0" encoding="utf-8"?>
> <selector xmlns:android="http://schemas.android.com/apk/res/android";>
>     <!--  Focused -->
>     <item android:drawable="@drawable/gallery_selection_red_small"
> android:state_focused="true" android:state_selected="true"
> android:state_pressed="true" />
>     <item android:drawable="@drawable/gallery_selection_orange_small"
> android:state_focused="true" android:state_selected="true"
> android:state_pressed="false" />
>     <item android:drawable="@drawable/gallery_selection_orange_small"
> android:state_focused="true" android:state_selected="true"
> android:state_pressed="true" />
>     <item android:drawable="@drawable/gallery_selection_orange_small"
> android:state_focused="true" android:state_selected="false"
> android:state_pressed="true" />
>
>     <!--  Not Focused -->
>     <item android:drawable="@drawable/gallery_selection_blue_small"
> android:state_focused="false" android:state_selected="true"
> android:state_pressed="false" />
>     <item android:drawable="@drawable/gallery_selection_red_small"
> android:state_focused="false" android:state_selected="true"
> android:state_pressed="true" />
>     <item android:drawable="@drawable/gallery_selection_red_small"
> android:state_focused="false" android:state_selected="false"
> android:state_pressed="true" />
>
>     <!--  Default -->
>     <item android:drawable="@drawable/translucent_box" />
> </selector>
>
> Hope that helps,
> Justin
>
> ----------------------------------------------------------------------
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> ----------------------------------------------------------------------
>
>
> On Mon, Jan 25, 2010 at 9:16 PM, Vivek Satpute <[email protected]>wrote:
>
>> Hi,
>>
>> In android-sdk emulator, we have a default browser. Suppose I opened any
>> site in
>> that browser. Whenever I click on any link in browser webpage, I can see a
>> rectangular
>> box around that link. Could anyone tell me how that is implemented ?
>>
>>
>> Any suggestions will be appreciated.
>>
>>
>> Thanks,
>> Vivek
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Beginners" group.
>>
>> NEW! Try asking and tagging your question on Stack Overflow at
>> http://stackoverflow.com/questions/tagged/android
>>
>> To unsubscribe from this group, send email to
>> [email protected]<android-beginners%[email protected]>
>> For more options, visit this group at
>> http://groups.google.com/group/android-beginners?hl=en
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> [email protected]<android-beginners%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to