I have an app that features a grid view. For each item in the grid view I want to provide a context menu, much like you see on the play store
I would like to use the built in android menu icon, but I can't find it anywhere in android.R.drawable, like one might expect it to be. Where, therefore, can I find the icon so I can set it as a drawable in my grid view item.
According to Dmags' answer to this question Google advises that
you should not reference these icons using the Android platform resource IDs (i.e. menu icons >under android.R.drawable).
(though the page linked no longer appears to contain this warning)
I am puzzled as to why this advice would be given? I would want the design to be consistent with the OS it is running on. If Android 5 decides to have an image of a lemon to display the menu, I'd want my app to also use the same image of a lemon to show sub menus.
So can anybody either give me a good reason as to why I should be creating my own graphic rather than use the default Android graphic, or give me the location in which the menu graphic can be found?
Have a look at your android-sdk folder:
C:\Program Files\android\sdk\platforms\android-18\data\res\drawable-hdpi\ic_menu_moreoverflow_normal_holo_light.png
I think this might be the one you are looking for.
It is not a good practice to use drawable direct from #android:... because android is an open-source platform and every customer (like Samsung or the cyanogen mod crew) can build their own version of it without the drawable u are using. so you can get a null pointer exception. The better way is to copy the drawable from the android sdk directly into your project.
Related
I'm trying to update an existing app, it's been a few years since the last update and I've updated Android Studio to the most recent version v3.5.3. Among other things I want to change the app icon, so I've updated all the PNG files.
However, in the emulator it keeps showing the old default icon.
If I understand correctly, there is a new feature since API-26 which allows for something called adaptive app icons, but I can't figure out how to update this icon.
The #mipmap/ic_launcher.xml file seems to be some sort of vector file, which describes paths and strokeWidth and lines to construct the default icon. I tried and searched all over, but I have no clue how customize this type of icon to something with my business logo.
Do I have to turn my custom logo into a vector image? If so, how can I do this? Using which app or utility? Can't I still just use my PNG files like previously?
For my app I need (like I think many and many devs) to customise colours and drawables; at the moment I need to customise a platform drawable (the action bar background, which for the android platform is ab_solid_light(or _dark)_holo.9.png) which can be taken from various sources (android.jar, git, etc.). In my case, I'd like to modify it from grey to another color; can I simply take it, modify it with gimp/Photoshop/similar application and include in my resources? Should I give credits to aosp in "open source licenses" section of my app? Is there a standard or conventional way to do these kind of things?
What I mean to say while you're just getting started with the development and say you add a slider theres a predefined skin for that and you can place it somewhere on the screen, but in some apps there are things like a knob in a place of slider which you can rotate to do the same stuff what the slider does . How do they do that, does it require openGL or something I am not asking for a complete tutorial or something just curious on what stuff goes into building such thing
Mostly, if something is not provided out of the box, you will have to build your own control.
For example, you mention a Knob. That isn't available in the Android SDK. Such a control could prove to be useful.
Here is a tutorial to build such a custom Control: http://go-lambda.blogspot.in/2012/02/rotary-knob-widget-on-android.html
This is an image of the final result from the tutorial linked above:
Here is an example of a custom slider / seek bar: http://permadi.com/blog/2011/11/android-sdk-custom-slider-bar-seekbar/
This should give you a rough idea on how to go about creating your own custom views.
And finally, what I personally find the best possible resource for keeping track of almost all good Custom Views is here: http://www.androidviews.net/
The androidviews.net website has shut down. Android Arsenal is a new website that lists several third party Android libraries.
I'm looking to add a menu option to change the font size in my Android application. Most applications I've seen that have this option (Kindle reader, Google Books) use an icon like "Aa" to indicate the ability to change the font size, but I can't seem to find a standard icon for this for Android. Is there one? Or am I better off creating my own?
I know what you mean but cant think that android have a designated icon, I would advise creating one of your own. It's more fun creating your own anyway.
On stock android, what is that thing called when you click a contact's picture and it brings up a list of quick links? this is also what you see when you long hold a icon in ADW Launcher.
More importantly though, i would like to know which png files in the folder frameworks/base/core/res/res/drawable-hdpi (from cm7 source, aka framework-res.apk) relate to that android view? (That is assuming they are in that folder, if not let me know).
I want to edit these but i cant for the life of me figure out which files relate to it. I have been searching around for a while and cant find anything on it.
This is known as Quick Contact Badge
See Here:
Android Quick Actions UI Pattern