Where can I find a list of Android style items? - android

Where can I find a list of all possible items in an android style xml? It seems like a single reference document listing them and summarizing what they do would be an extremely useful thing to have bookmarked, but I can't find one anywhere.

Here you go for every attributes you want in single file: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/styles.xml
And If you want only attributes list then you can refer R.style xml directly but It's not well documented so It would be better to view actual source code given in above link.

Related

Complete reference of Android XML styles

Google's Android documentation is relatively complete when it comes to classes, interfaces, and such. But I have not been able to find a complete reference of all the style-related XML -- not just backgrounds and padding and whatnot but also action bar options, etc. Does such a thing exist or is it really just scattered amongst the other docs?
It doesn't really show all of the options contained in each style in the docs, but just has a reference to the tag.
I find that using GitHub is the best bet :-\
As an addition to hwrdprkns answer, I would suggest the Android Resource Navigator for Chrome. It's an extension that allows you to type "arn" in the URL bar / omnibox and then begin searching whatever resources (XML styles) you want. When you click on any of the results it will ink you to the GitHub when you select one.
https://chrome.google.com/webstore/detail/android-resource-navigato/agoomkionjjbejegcejiefodgbckeebo

How to know what android:id Android expects?

In some android classes you can set a custom layout. As far as my understanding goes, these custom layouts need certain android:ids to work.
For example, for the ListActivity a ListView with #android:id/list has to be provided and this is specified in the documentation.
What about other views? For example, I was checking the API Demos and came across
<CheckBoxPreference
android:key="child_checkbox_preference"
android:dependency="parent_checkbox_preference"
android:layout="?android:attr/preferenceLayoutChild"
android:title="#string/title_child_preference"
android:summary="#string/summary_child_preference" />
There's a layout specified for the preference. That layout seems to be preference_child.xml, in which there's #+android:id/title and #+android:id/summary, which I assume the view will use to provide the title and the summary, but is this documented anywhere?
How do I know what resource IDs I have to use so that everything automagically works?
AFAIK, there's no trick to find out but to know the documentation or open the android's id.xml and look for references.
P.S.
Your code demonstrates how to use a specific attribute out of an entire style (the use of "?"), it has nothing to do with ID's

CheckedTextView Attributes ID and checkMark

Just start developing with android and think instead of reading a book a webinar could be better because a webinar could also teach me short ways and how an android developer thinks when writing the code but now got a problem
<CheckedTextView
android:id="#android:id/text1"
android:checkMark="?android:attr/listChoiseIndicatorMultiple"
</>
I dont understand the above code up to now see lots of different id definitions some of them was for resources and start with #resource/name, and some of those id definitions was like #+id/name just for creating a new id for the component but this time it is using android:id/text1 and I dont understand why it is using it in that manner
Besides, the checkMark thing make me confuse more what are all those ?android:attr/listChoiseIndicatorMultiple means?
Could you please explain me and show me some resource where can I find all those magic attributes so I can cope next time by myself and hope someday can answer other newbie questions
Thanks a lot in advance, and all comment will be appreciated.
Well, reading the docs has always been helpful to me:
Android Developer Site
XML Layout specific docs
#android:id/text1 is just a format used when the id has been previously defined. When you put a + in there that means the framework should create the resource id if it doesn't already exist.
It's normal to use #+id/thisid when defining a new view in a layout, and then use #id/thisid to reference the aforementioned view from another part of the layout (say, in a RelativeLayout where you need to tell one widget to be below another).
A question mark before the ID indicates that you want to access a style attribute that's defined in a style theme, rather than hard-coding the attribute.
#android:id/text1 basically this is used when you create any android component like button, layout, textviews etc.
but when you need any external component which is general for different platform like any color, image etc then you can declare it as #resource/name.
actually there is nothing different just keep one thing in mind that in #android:id/text1, id will simply work as an class name will contains other objects like textview, imageview or any other.
now if you declare #resource/name then in that also instead of id class name will be resource. actually when you will use it in java then these(#android:id/text1) will be converted into object hierarchy.

Where to find a List of Possible XML-Attributes of a Specific Android Widget?

Would like to know if there is any resource on the web that conveniently lists all possible attributes of an XML-element representing a specific Android widget (e.g., <TextView>)
Please use Android documentation example for TextView. Section "XML Attributes".
The javadoc for the widget has a section for the XML Attributes

How to get class/method/attribute info in Android XML file?

When I am in a Java class file, I can get context info of a certain method/attribute/etc. (in IntelliJ, this shortcut is Ctrl+Q), which is basically a short help file describing what that element does. Look at the image 1.
But when I am in an XML file, I cannot get any contextual info on any element. Look at the image 2.
How should I enable it? Do I have to download some additional Android doc (javadoc?) file?
For Android code support in Eclipse, you might want to checkout http://android-developers.blogspot.com/2011/06/new-editing-features-in-eclipse-plug-in.html.
In particular :
XML editing has been improved with new quick fixes, code completion in more file types and many “go to declaration” enhancements.
basically a short help file describing what that element does
FYI: It's called Javadoc.
For the xml:
Go to Window, Show View, Other, General, Properties.
Then, when you have opened an Android xml, you can switch to the Graphical Layout. Clicking on an element will show you it's properties in the property view. Hovering over the elements there at least will give you contextual information.
As CrazyCoder suggested, there is no way to get such contextual info because of the lack of sources to fetch such info from. Until better times...

Categories

Resources