Alias custom view path in XML

by Ward Willats » Tue, 24 Mar 2009 22:42:16 GMT


Sponsored Links
 Is there a way to alias the path to my custom view class (perhaps in 
its <styleable>) so I can say

<MyGreatView>

in the XML, instead of

<com.myco.myapps.MyGreatView>

(I played around with the months ago, namespaces and what-not, but 
never found a solution.)

Just a "nice to have" thing.

Thanks

-- Ward

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



Alias custom view path in XML

by Mark Murphy » Tue, 24 Mar 2009 22:50:35 GMT


 


Not that I'm aware of. Otherwise, I would have expected Google to avail
itself of the technique with MapView. Right now, we have to spell out
the whole fully-qualified class name when putting MapView in our layouts
(unless something changed on that front that I missed).

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

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


Sponsored Links


Alias custom view path in XML

by mawei1981 » Sat, 11 Apr 2009 00:52:26 GMT


 I like the full namespace, so I can find my custom component easy and
clear.








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



Other Threads

1. In GridView the focus item position moved to left when we press space key to page down.

In Android when we open app using Gridview Ex. Gallery.
In device with keyboard, when we press Shift key, the focused item
will change its position to left.
Is it Android's SPEC or bug??

I checked the Gridview.java source code.
In PageScroll() function, when we press space key, it does page down.
And focused item is Math.min(mItemCount - 1, mSelectedPosition +
getChildCount() - 1);
It will plus getChildCount() which means number of one page items.
However, why does it minus 1?? it leads focus item move to left
position.

 if (direction == FOCUS_UP) {
            nextPage = Math.max(0, mSelectedPosition - getChildCount()
- 1);
        } else if (direction == FOCUS_DOWN) {
            nextPage = Math.min(mItemCount - 1, mSelectedPosition +
getChildCount() - 1);
        }
        if (nextPage >= 0) {
            setSelectionInt(nextPage);
            invokeOnItemScrollListener();
            awakenScrollBars();
            return true;
        }

-- 

2. Froyo for Galaxy S.. tomorrow

http://www.androidguys.com/2010/07/27/site-collects-distributes-official-samsung-firmware-promises-froyo-firmware-rom-galaxy-tomorrow/

http://www.samsung-firmware.webs.com/

-- 
"Indonesian Android Community [id-android]" 

3. Background in PreferenceScreen

4. Broadcast business card

5. How to install apk in device using window machine

6. Blutooth API Problem

7. Intent.ACTION_SEND "Use by default..." - Multiple defaults?