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... "
Related
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!
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.
Hi I am a beginner in android and I want to know how to customize buttons,check box etc., I searched in web but found many ways and got confused...
Can you please tell me what are the ways to customize android widgets, can we do that using css, like we do for the HTML?
Thanks in advance...
There are a few ways. You can use 9patch to edit the files inside the SDK(which will typically be C:\Android\SDK\platforms\android-19\data\res\drawable-hdpi) - Android-19 is the api level, and then set them in your xml layout under the widget you want with
android:background="#drawable/your file"
Another way is to create a selector(Recommended because it can handle stuff like when clicked and more), shape(Simple creation with corners and stuff), layer list(Advanced selector) or solid(just a color) in /drawable and then set them in your xml under the widget you want with
android:background="#drawable/your file"
An example of the second solution can be found here android button selector
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
I would like to create a user interface which would contain network indication icons (3G, WiFi...) and I would like to use existing graphic elements which are displayed in notification bar.
Does anyone know how to get these existing elements and use it in custom layout?
I guess these icons are all ImageView elements and I am wondering whether it is possible to retrieve them with findViewById() method.
They are drawables in android.R.drawable. There is a list of avaiable drawables for 1.0 at drawable list
You can go to http://source.android.com/download to get instructions on how to download Android sources (images/drawables included), search for *.pngs and then reference the ones you need like this: getResources().getDrawable(android.R.drawable.ic_menu_save).
P.S. At least some of the drawables come with sdk: $SDK_PATH\platforms\android-1.5\data\res\drawable