I followed a template on android studio to create a navigation drawer app. As you know it creates an initial activity with a floating action button and the email icon in it. I just want to change it to a plus sign. Here is the problem. It turns out there is no plus sign available as the ones I can see in every single example ( There is just one I can use but then the plus sign color is green, and I want it white! ).
I followed this steps how to download Material icons , I get the icon ic_plus, and I put every single file in its correspondent folder ( drawables, drawables-hdpi... ).
Problem is when I try to use it here:
The name turns red as it can't find it. As I said, I copied all files one by one to its correspondent drawable folder. I even tried this drawable importer
but the same happen.
What am I missing? And why plus sign icon it is not shipped as default icon, as for example the e-mail icon is, as I can see it in every single app using floating action button? I use Android Studio 1.5. Thank you!
EDITED
Looks like images are correctly placed in correspondent folders because if I try to use it on menu bar, I can find it through #drawables/ . Still don't know why I can't do the same for the floating action button. Ideas?
Put your image in the drawable folder.
Use the design editor and when you click on the FAB scroll down to the src and click that little square button with 3 dots on the right side to pull up all your options. You should be able to search for the name of the icon you uploaded and select it from here.
I tried to type in my file name using text editor and it couldn't find my image either.
Related
I'm trying to add an image in Android studio by right clicking on the drawable folder->new->Image Asset, I add an Action Bar and Tab Bar icon with a custom image and I click finish and it looks like its doing something but nothing appears in the drawable folder. I'm also unable to reference the new image name in any xml. What's funny is if I go to re-add this image, it says the image already exists and it will be overwritten. Am I doing something wrong?
I create a new project with Android Studio and generate image asset in the new project. It begins to work. I don't know what's wrong with the previous project. Hope it also helps for you.
As #Varun said, Before click on Finish, check save path by click on "Next" button.
TLTR: fix any other icon type you touched before.
In my case it was because of wrong path to foreground image path (the source image was deleted):
So even after changing the icon type the error does not disappear (buttons are disabled):
So fix other icon types.
In Background Layer set Asset Type to "Color"
I have a problem with my Floating Action Button. I want to get the same "plus" button as in google design, however, when I import the "add_white" icon from material design studio and put it into project, it is redefined to have black background which completely distorts the effect.
I show on the attached picture how the problem looks like - the image in all possible dimensions is correctly inserted in the folder, however, the android studio reads it differently.
Thank you in advance,
Grzegorz
How to fix it/ or just get the proper "cross/plus" sign to the button?
I'd recommend you to download the icon in svg format from https://design.google.com/icons/#ic_add, you can add it to Android Studio by doing a right-click on the project and selecting Vector assets, you'll be able to remove your 5 ic_apps_white_48 pngs and use the one imported.
I have to address this type of views which has buttons below example.
http://www.planet1107.net/blog/custom-shape-uibutton-tutorial/
It is in the iOS. so is there any way to make it in Android.
I also have to give click events on all of those buttons.
I would recommend just exporting these custom images to pngs. Then adding the pngs to your Android project and simply referencing them in the code or XML. Then on a click event you can simply change the icon to indicate that it has been clicked and if the user clicks on it one more time change it back.
This will also ensure that the Android images look identical to the iOS ones.
as title says, my ic_launcher cut into half, here is the pic
this is the original:
how did this happen, is there any suggestion?
Try using a png file.
or simple right click on your project, select new and then choose Image Asset. Now you will have plenty of options.
It should work
I suggest you use the following method.
Right click on drawable: new ->Image Asset
Select Launcher Icon in asset type
Select the path of the image you want to use as icon and keep the name as ic_launcher only.
next and finish.
You can customize it using the different checkboxes and options.
This should work for the launcher icons.
ps: not enough reputation to comment, so posting as a new answer. :/
I am trying to find the color code for the bright light blue color used by the Android framework in some of their widgets. I understand that the framework uses 9 patch images to draw these widgets, so the color code would theoretically not be stored in the framework code.
But is there a way to find what was the color code used in the SeekBar or the ToggleButton(the small blue line when Checked)?
I generally use #33B5E5 for the color.
Take a screenshot of the image and upload it to this site and click the color you want to know about.
http://html-color-codes.info/colors-from-image/
In Android-Studio you can do it in the Program itself too. To do that, follow this steps:
Put the Item in your view that you wish to know the color from or have a picture or screenshot ready and open on the PC
Select an item (Button, View, etc) in the "Component-Tree" on right side and go to the "Color-Property" or the prop "Backgroud" of the selected item (one has to be in Design-Mode to see the Component-Tree).
Then click the "..." behind the Property-Edittextfield and a menu opens up where you can choose a color, by either go to the System-Tab and choose a predefined Android-System Color (you see all the different greens here for example). After select a color you see the value of it in the value window below.
You can also go to the Color-Tab and click the little color-selector item, then hover it over the Layout-item that you draged to the view in step 1 and try to hover the spot where the needed color is. You can have also a screenshot open, or the android emulator or something. The color-picker lets you hover also over outside program views, not only insde Androidstudio.
Voila, there you have all system colors.