Are there open source versions of the standard Options, Home, Back, and Search icons that appear on every phone?
Check out this page, it offers a convenient way to browse the built-in drawables, most of which you can use just by referencing them in your layout.
See for example, the item ic_menu_home. You can probably use it in a layout like so
<android:Whatever
android:icon="#drawable/android:ic_menu_home"/>
Although, as the author of the page mentions, you sometimes have to copy items from the SDK resources folder if the above method throws an error.
Note also that while this method isn't guaranteed to match the icon you see, it will match what the user will see for that logical name. For example, I used this technique to add the "Preferences" icon to an options menu, and the emulator had a different icon than what was shown there. When you want a "standard" icon, this is good, although if you really wanted an exact image you could copy it into your app's res folder.
Related
Changing names in Android Studio is a nightmare, particularly as it seems to use a number of different names. I think I worked out how to change most of them, but what is this (see yellow highlighting on screenshot attached) and how do I change it?
for your problem with names, if you want to change a name of a file/variable in all of the places that it was mentioned in you should use the refractor.
right click on whatever you're changing its name.
refractor.
rename/rename file.
it will ask you for the new name and whether you want to change it everywhere (even in comments if you want) or not.
choose what you see fit and click refractor, he will then check where it exists and ask for confirmation on all the place he found what you're changing name and if you're 100% sure to change its name there.
warning : sometimes refractor operations are non reversible so you should double check before clicking do refractor.
as for the name up there its called project name and you can change it as instructed here
I am using this icon in my code:
android.R.drawable.ic_menu_close_clear_cancel
But it looks outlined, not simple cross:
I want to make it like this: https://storage.googleapis.com/spec-host-backup/mio-design%2Fassets%2F1Xlq7_lXkjBJDE6arihpaS3YWm4TSf2-S%2Fdialogs-fullscreen-behavior.mp4
Should I use another resource or tinting?
You can do it either way but Android advices against using platform resource ids. You can copy the icon into your drawables and use that resource id instead (and in your case tint it).
Android docs about the matter: https://developer.android.com/guide/practices/ui_guidelines/icon_design_menu
Warning: Because these resources can change between platform versions, you should not reference these icons using the Android platform resource IDs (i.e. menu icons under android.R.drawable). If you want to use any icons or other internal drawable resources, you should store a local copy of those icons or drawables in your application resources, then reference the local copy from your application code. In that way, you can maintain control over the appearance of your icons, even if the system's copy changes. Note that the grid below is not intended to be complete.
This is what I see when I right click res>New Resource Directory. I've looked this up, and it's supposed to give me and option for a version. But I don't see it. I want to create a Values v-21 directory. Help will be great.
Scroll down and select as the qualifier, then specify the version, in this case 21. Note that in the screenshot it shows as selected but that's simply because the item you move to the right disappears when it's added to the chosen qualifiers
I'm a new to Android development and I've been giving Android Studio a spin. I've followed Google's tutorial and I still haven't been able to get the ActionBar up and running either on the emulator or on the real device. I've specified the min version in the manifest file and I've also edited the menu and activity xml files accordingly.
Confusingly, the UIs shown in the activity_foo.xml and menu_foo.xml are different:
activity_foo.xml:
menu_foo.xml:
Even more confusingly, the final app when built shows both the Search and Settings in the hamburger menu though I do not recall seeing it in the GUI previews:
How can I fix this?
Confusingly, the UIs shown in the activity_foo.xml and menu_foo.xml are different
They are supposed to be different. One is showing you a layout file. The other is showing you a menu resource. Their previews are not supposed to necessarily match. After all, an Android app that is bigger than a breadbox will have many layout resources, few of which will be defining the contents of an activity.
For those layouts that do define the contents of an activity, IIRC, you can have the same tools:context=".FooActivity" in the root element of your layout file, and the preview may take that into account.
Even more confusingly, the final app when built shows both the Search and Settings in the hamburger menu though I do not recall seeing it in the GUI previews:
In the preview, the search item is represented by a toolbar-style button (icon is a magnifying glass).
In your menu resource, you have one <item> that has android:showAsAction and one <item> that has app:showAsAction. Either you are using the appcompat-v7 action bar backport, or you are not. That would be determined by things like:
what Java class your activity inherits from (ActionBarActivity or AppCompatActivity for appcompat-v7)
what theme you are using for the activity in your manifest (if it is based on Theme.AppCompat.*, you are using appcompat-v7)
If you are using appcompat-v7, you need to change the android:showAsAction to app:showAsAction. Given the results of your run of the project in the emulator, my guess is that you are using appcompat-v7. If you make the change to the menu resource and run the project again, you may see the search item show up as the magnifying glass icon, as you see in the preview. I say "may" because there may or may not be room to show that toolbar-style icon, depending on screen size and orientation of the device that runs your app — action bar items with ifRoom will show as toolbar-style buttons if there is room or will fall into the overflow menu if not.
So I am editing a go launcher template theme and i saw there were some parts i wanted to change that wasn't included in the template. For example the little icons on top of the apps when you want to delete (kill.png kill_light.png etc.) I added this code
<AppIcon text_color="#FFFFFFFF" text_bg_color="#ff3f3f3f" delete_app="kill"
delete_app_highlight="kill_light" new_app_icon="new_install_app"
update_icon="appfunc_app_update" locker_icon="promanage_lock_icon"
close_app_icon="promanage_close_normal" close_app_light="promanage_close_light"/>
With png's with the right names in the drawable hdpi folder but they don't show up when I test it out. Am I missing something? I was able change the media management icons in the app drawer by adding this
<SwitchButtonBean button_galleryicon="appfunc_mediamanagement_switch _button_gallery"
button_gallerylighticon="appfunc_mediamanagement_s witch_button_gallery_light"
button_musicicon="appfunc_mediamanagement_switch_b utton_music"
button_musiclighticon="appfunc_mediamanagement_swi tch_button_music_light"
button_videoicon="appfunc_mediamanagement_switch_b utton_video"
button_videolighticon="appfunc_mediamanagement_swi tch_button_video_light"
button_appicon="appfunc_mediamanagement_switch_but ton_app"
button_appiconlight="appfunc_mediamanagement_switc h_button_app_light"/>
But it didn't work for the other part (the smaller versions of those same icons in the media management menu).
What am I missing?