What happens if you change your declare-styleable name from
PrecariouslyUsefulCustomView
to CustomView (or conversely if you rename your custom view from CustomView
to PrecariouslyUsefulCustomView) ?

I think that name is what binds the two together as far as the editing
logic is concerned.

(I've been meaning to add a lint check to warn when this is not the case,
e.g. when in a custom view you initialize the view with a typed array for a
styleable whose name does not match the custom view.)

-- Tor


On Sun, Aug 3, 2014 at 1:12 PM, Kaushik Gopal <m...@kaush.co> wrote:

> This is just a feature request for the ability to autocomplete custom
> attribute "values" within the layout xml.
>
> For e.g.
>
>     <declare-styleable name="PrecariouslyUsefulCustomView">
>         <attr name="drawable" format="integer"/>
>         <attr name="txt" format="string"/>
>         <attr name="color" format="color"/>
>         <attr name="txtAllCaps" format="boolean"/>
>     </declare-styleable>
>
> When i use my custom view in a layout like so:
>
>
>         <com.precarious.useful.sometimes.CustomView
>             android:layout_height="wrap_content"
>             android:layout_width="wrap_content"
>             icobutton:drawable="@drawable/drawable_within_project"
> ----> 1
>             icobutton:txt="Some string"    ----> 2
>             icobutton:txtAllCaps="true"    ----> 3
>             icobutton:color="@color/color_in_colorsxml"/>  ----> 4
>
>
> It would be super nice to have all the autocomplete + lint checking
> goodness here.For e.g.
>
> 1. autocompletes to drawable files within my project (as is the case with
> android:backgroundDrawable etc)
> 2. provides a lint warning to make sure this is pushed to the strings.xml
> file (along with the extract string resource helper of course)
> 3. autcompletes only permitted values as specified in my attributes file
> (boolean in this case)
> 4. similar to above mentioned - autopicks colors in my project (i notice
> that it shows the nice thumbnail color preview on the side, even for custom
> attribute. good job!)
>
> Cheers
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "adt-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to adt-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adt-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to