Android: Locating basic drawable - android

How do you reference the drawable for the 'home as up' icon?
I am trying to add this drawable in a custom XML layout. I do not want to change the icon displayed in the ActionBar, but rather use the drawable for something completely different
Tips on how to go about finding it without searching through every item are appreciated!

This image is named as ic_ab_back_holo_dark_am.png
or ic_ab_back_holo_light_am.png
These images are at sdk/platforms/version/data/res/drawable-versions where version must be 11 or later.
like
sdk/platforms/android-19/data/res/drawable-hdpi. You can find all images from there with there actual name.

Related

AndroidStudio Adding an image to draw with srcCompat

I am trying to do a drawer activity with Android Studio and I'm wanting to personalize the icons used. I've downloaded the icons I want to use and for the most part, it's okay.
In fact, I can modify all the android:icon icons but I have no idea how to modify the app:srcCompat icons. I don't know how to detect the image I want to use in this case...
Do you know how I can do it? Could you explain this to me?
Thanks a lot!
Edit: The file I'm working on as a base is the generated project with Drawer activity as the main activity. For example, if I wanted to modify the icon in the nav_header_main.xml file, how could I do to have my image (.png) transformed in a way detected by Android Studio as compatible with srcCompat
Ensure your image file is in res/drawable folder(or drawable-xhdpi/xxhdpi, determined by your design)
Refer it by app:srcCompact="#drawable/$IMAGE_FILE_NAME" in your xml.
Then you should see what you want.
Please check the doc to further understand the official usage.
Well... I was blind! I was wondering how I could add my icons but they were, I was just mistaking on the address... #android:drawable/... is obviously not #drawable/... but I didn't notice. So be aware that there is a difference and it'll be okay I think!

Android Wheel-like loading icon

I'm trying to render a loading circle in one activity whose data gets populated by an async task. I'm not using default progressbar, because the icon in older version of Android looks like this:
I know how to use an ImageView or ProgressBar with a custom image and a rotation animation, but I haven't been able to find new official Android's looking icon anywhere. The one that looks like this:
Or maybe there is another way to generate this kind of spinning wheel animation in Android 2.2.
In general it's good to stick with the style set on that system.
If you still want the newer spinning wheel animation, set the indeterminateDrawable XML property on the ProgressBar. You can find the drawable XML files in the SDK folder under [android-sdk]\platforms\android-17\data\res\drawable called progress_medium.xml and others. You'll also need the referenced icon files stored in the drawable-**** folders.
check folder SDK_DIR\platforms\android-x\data\res\drawable-hdpi.
There should be spinner drawables like "spinner... "

Drawing indicator between activated list row and main fragment

I am trying to emulate the UI used by the gmail tablet app. When an item in the list view to the left is in an "activated" state I wish to draw an arrow indicator linking the list row to the main content fragment on the right-hand side. The "arrow" I am referring to is circled in this image:
Gmail App Screenshot
I have achieved this by using background drawables for the list rows which is satisfactory; however, I want to make use of a divider to separate the list and the main content area. So my question is how could I achieve this without using a background drawable? I tried having the arrow indicator as a child of the list row and attempting to draw it 1 pixel outside the row to cover the divider but this did not work.
Any help is appreciated, thanks.
Your question is similar to these:
Shadow Separator Between Android Fragments
ListView row marker ala GMail
Reading their answers it seems the easiest way to do what you want is using background 9-patch drawables.
In fact, the Gmail app uses 9-patch PNGs to achieve this effect. You can see it for yourslef if you take a look to the PNG files inside Gmail APK's res/drawable-hdpi folder (you will need a tool like AirDroid to obtain the APK from your device).

Custom progressDialog xml

I want to know where I can find the original XML used for the progressDialog because I want exactly the same design except change color of the background, border,text color and center also the rotating image.
I tried to use my own XML layout, but I didn't succeed in reproducing the same design as the original one (the small arrow, the line between the title etc....)
http://thedevelopersinfo.files.wordpress.com/2009/10/with_title2.jpg
Big thanks !
You can find it in your android sdk directory.
\android-sdk\platforms\android-XX\data\res\layout\progress_dialog.xml

android system drawable ic_btn_round_more

is there some way how to access android system private drawable: ic_btn_round_more?
This is the more icon which is used
in DialogPreference (res.layout.preference_dialog.xml)
It's not accessible through android.R.drawable
I don't want to copy bitmap file, because
that icon can be different for every device.
I found this: http://www.androidjavadoc.com/2.3/android/R.attr.html#moreIcon But I'm not sure how can I use it. Basically I'm trying to add more icon to my custom ListView,
which whould look exactly android way.
You can use Nine-patch to create your own rounded button which can be exactly the same as drawable ic_btn_round_more. you can get more information about how to use Nine-Patch here : http://developer.android.com/guide/developing/tools/draw9patch.html

Categories

Resources