How to add custom component in pallete of android studio - android

I want to know if there any way to add custom UI components in palette.
I tried searching in documentation, but i could not find any such option.
It seems like IntelliJ IDEA has this option, but i could not see it in Android Studio.

Related

Android Studio navigation graph visualization export

I want to use the Navigation graph diagram in the project wiki.
For that, I'm trying to find a way to export the Navigation graph visualization from
Navigation Editor in Android Studio.
Maybe is there a way to export it in PNG image, Vector or PDF format? Just a screenshot doesn't work for big graphs.
It seems Android Studio doesn't have it out of the box.
Tried to find any kind of similar plugins, unfortunately found none. Your problem seems similar to this one. Unfortunately there probably isn't an easy way to achieve that currently.

Display Design Support Library in palette

Is there any way to add widgets provided by Design Support Library in android studio design palette to drag & drop them in screen?
I am referring to android.support.design.widget.TextInputLayout, android.support.design.widget.TextInputEditText etc... in here:
I use some of them in my app and it compiles/runs on kitkat fine but I have to copy/paste them after googling or from old projects each time.
Am I doing something wrong on including them in my project or there is no way to display them there?

How to render ui from xml

I wanted to create my own tool for android where i will change xml and that should reflect android ui side by side likewise what android studio and eclipse does.
Can someone tell me what android studio and eclipse uses to render ui from xml as shown in screenshot.
First off: it is not really clear what you want to achieve so I think I should ask some questions first.
- Do you want to create an add-on for an existing IDE?
- Do you want to create an Android Application?
- Do you want to create an IDE similar to Android Studio/ Eclipse?
Answer: If you want to create your own IDE then you need to implement the parsers and preview using 2D drawing. The tools AndroidStudio or Eclipse use to display the XML Views are part of the IDE. As far as I know there is no tool that will display your XML preview as they do. Follow the next instructions in order to implement that part.
But regardless of the answer to any of the questions above, here are some directions.
Since you need to know what kind of content you're using, you should start with an xml parser. How to do that can be found here.
Next step would be to actually draw the Views hierarchy somewhere. For that you need a basic 2D drawing knowledge, and you can start here
Access the resources for different platform and draw them to your window, using processed xml information and Android specific images. You can access the Android specific resources (images) for different platform, through the AOSP here
I hope i managed to point out some directions.
This is a complex thing to do:
One and only solution , Making the compiler for XML, If there are openSource XML parser for java Use them.
If there are not any I am afraid you have to make your own.
unity can do it for you its funny but you can do it with unity you can make android native views like button and ... in as objects in unity and load xml for adding views in right place,its so hard but possible and intresting

How to reference Android material icons from app?

I'm trying to use Android's material icons in a View from within my app. I can't seem to find an example anywhere of how to reference them. I can't imagine, for this standard set of icons, that I'm required to copy and paste them into my actual app under the res directory. Surely there must be a simpler way since 90% of Android apps are using the same drawables! What I'm looking for is something like:
<TextView
...
android:drawableLeft="???" />
Is it possible to do this and reference the drawable from some package that I import? Or do I actually have to copy all the icons I want to use into my application resources? That seems completely unnecessary to me.
The developer guide says they're named */drawable-{{density}}/ic_{{name}}_{{color}}_{{size}}dp.png but it's precisely the * which I would like to know (and I hope it's not myapp/res/drawable!).
You can try Android Material Design Icon Generator plugin for Android Studio, If you are using Android Studio. Link to the plugin development Git repo is here
It is Easy and convenient. You can go through the image set and get the name from the google material design official website and then, you search for it and you can add that one to your project without any hassel.
Yes, you have to copy all your icons to your res folder. It's been said by Google somewhere. The "Material Icons" website clearly is oriented towards that and it makes it easier. One important reason to do this is that you'll want the icons to work not only in Lollipop, but also in previous Android versions.

How to use Android Design Pack provided by Google with Eclipse

I am trying to use these cool set of add-ins that Google provides in the link below
http://developer.android.com/design/downloads/index.html
But I cannot understand how to integrate it with eclipse so that they are available directly as a drag and drop. Do you have any idea how to use it?
You cannot integrate into eclipse, because it only allows valid Views "linked" to your project (directly or from a library). These are just sources to make drawables. You have to create your own drawables from it. But if you're interested in holo theme, you should check the sources of android (API 11+). If you've installed, you can find it at /platforms/android-11/data/res/ . Maybe you find useful the HoloEverywhere project. But you can use the Action Bar Icon Pack, you have to copy the appropriate drawables to your project and when you drag an ImageView into the layout editor, you can choose the source from a dialog or you can enter path in xml.
EDIT
Forgot to mention, there is a very great online tool which will generate holo drawables with custom colors here.
After some digging up and watching Google IO 2012 videos on Design, the Design pack is actually a template for designers to create a UI before actually developing it. It contains a pack of action bar icons (These can be imported into your project), bunch of stencils that can be used with Adobe products to create an initial mock ups of your applications. Though, they cannot be directly imported into eclipse and used (as they are actually available already with the SDK), its a good guide to start design instead of actually coding and re-inventing afterwards.

Categories

Resources