Just updated to latest version (2.2) and saw the checkboxes that you can check in the properties window. There is three different options to choose from which two is pretty self explanatory, the checkbox that is checked and the one with minus in it. But what does the blank one mean? I tried all three and didn't notice any difference between the blank and minus. Probably not only specific to android studio but first time I se it.
It might be a bit late for an answer, but I've just had the same question while playing around with Android Studio. The meaning of the three states of the check boxes for boolean properties can be found by looking at the text view of the layout xml-file:
checked -> property set "true"
blank -> property set "false"
minus symbol -> property unused, will not appear in the xml-file
Related
Basically every time i try to Select Button or anything that extends Button (AppCompatButton, MaterialButton)
Android studio freezes for few seconds when selecting Button in layout editor. every other component works normally (i think so).
On new project this behavior is not present.
p.s. 3.5.{latest} also had this issue but it was less annoying since xml editor and layout editor was two separate things.
Simply putting marker on anything that is inside xml button declaration (in my layout) causes this lag of (3-4 seconds). In that period of time i can't use Android studio at all.
So my question is what could cause such behavior and how could i avoid it?
Anyone facing AS freeze while editing XML or editing Material components like Button, do the following steps:
Open Layout Editor -> Click on Attributes Tab -> Settings Icon -> Will show list of options, disable all options with "Attributes", like "All Attributes", "Common Attributes", "Declared Attributes"
Will solve the issue for now.
UPDATE:
Issue is already reported and AS team is working on the fix:
https://issuetracker.google.com/issues/139716861
Actual fix requires new AS release or 4.1 canary 10 (as per AS Team comment).
When editing Java files, if I'm at the end of the line and I type the Enter key, it starts the next line properly indented 4 columns, to match the line above. That's OK but it's indenting with a tab, not spaces, even though in File>Settings>Editor>Java>Tabs and Indents the checkbox for Use tab character is unchecked, and always has been.
If I just type the tab key I also get a tab, not spaces.
I never want to use tab characters; I always want to use spaces. I don't have this problem in Eclipse or Microsoft Visual Studio so it's not some system setting for my PC. Is there some other setting in Android Studio for this?
Edit: I tried the suggestion that Omar Al Halabi (below) made and it didn't work but while testing it I noticed something interesting: This tab problem seems to mainly apply to the beginning of the line, i.e., if I type Enter on the previous line, it immediately tabs over to the first indent position on the following line, using real tabs, not spaces. On the other hand if I'm typing some text on an existing line, once I've typed a little text, if I hit tab, it then tabs over using spaces.
hope this helps,
check Use Tab Character,
give all that values to zero than you not get space on enter in java code, like in below image,
one more thing is you have to change your code format settings or may need to disable it
This is not an answer, but I don't have enough reputation points to post my questions as a comment.
- Is this issue happening in all your Android Studio projects?
- Are you using the Default scheme for the general File->Settings->Editor->Code Style and also for the Java Code Style?
- Have you tried making a new Java Code Style scheme at the Project level for just one project as a test?
EDIT: This is a brute-force/shotgun approach.
Rename your \Users\<username>\.AndroidStudio2.1 directory (e.g., .AndroidStudio2.1_orig)
Open Android Studio and force it to use the default settings by choosing the "I do not have a previous version of Studio or I do not want to import my settings" option when the "Complete Installation" dialog window appears.
Run a recursive 'diff' between the new and old .AndroidStudio2.1 directories to find any changes you've made to the default settings so you can re-apply them. The settings are kept in XML files so they are human-readable. Keep an eye out for any differences that may affect Android Studio use of tabs & spaces, because those might be the source of the problem.
If this does not work, then you may have to re-install Android Studio.
Try opening Settings->Editor->Code Style->Java. Check "Use tab character". Click OK.
Then go to File->Invalidate Caches\Restart -> Invalidate and Restart.
Then, again, go to Settings->Editor->Code Style->Java. Now uncheck "Use tab character" and hit OK.
If it still doesn't work change tab size and indent and then restore them back if you want.
The IDE tries to position the lines as if they belong to the same block. Also very likely you had used the tabs on the previous line. You can try to deactivate Detect and use Existing file indents for editing
Properties in the Outline-view are mostly in seemingly disabled state, while using Android visual editor. Only those properties, which already had some content when opening a layout-file are available for editing. Others might pop up some window when clicked, but even after selecting something nothing gets changed.
There doesn't seem to be anything meaningful to update via Android SDK Manager or among the Eclipse-plugins. I'm using Eclipse 3.7. What's wrong with the editor?
Android Visual editor properties http://hoito.org/kuvat/toisaanne/eclipse-androidvisualeditor-properties.png
If the property line has gray background (what you describe as "disabled"), it means that property has the "default" value set. In that case, no attribute entry is set in the xml.
If you select multiple elements, properties are shown gray if none of the elements has that property set, white and empty if the property is set by some but not all elements, and white with text when all selected elements have the same value. Note that multi-selection only works properly when you use the "sort alphabetically" button.
At times, the property editor can be a bit unwilling, but if you double click an entry shown in the popup, or press enter when selecting a proposed value, the property should be set.
I'm developing an application for Android and I recently changed the API level target from 8 to 15, and now Eclipse is warning me when the Buttons are inside Linear Layouts or Table Rows.
The same doesn't happen when the Button is in a Relative Layout.
The warning says:
Buttons in button bars should be borderless; use
style="?android:attr/buttonBarButtonStyle" (and
?android:attr/buttonBarStyle on the parent)
I can get rid of the warning by following the suggestion or even by suppressing it, but I'm interested to know why this now? What's wrong with bordered buttons?
The borderless buttons are for cohesiveness of design throughout the android platform. It's recommended you follow the guidelines so that the user feels that your app is native and does not stick out like a sore thumb, but there are many cases where it just doesn't make sense, like if it makes your app look unprofessional. If that is the case, you may want to turn off the warning.
To turn off the warning, go to the project properties -> Android Lint Preferences. Search for "border" or "ButtonStyle" and change the severity to ignore on the bottom right.
You can also do this in Eclipse preferences for all projects.
For Android Studio Users:
File -> Settings -> Editor -> Inspections -> Android Lint. Search for "borderless" and uncheck or change the severity.
Here is another simple way to get rid of it.
The compiler is trying to tell you to set the style of the button. So simply add the following style for the Android default borderless style and the error will be gone.
<Button
...
style="?android:attr/borderlessButtonStyle"/>
Here is the proof
In my case adding that style to ALL buttons which were ONLY elements in some linerar layout gave buttons without any borders. After adding style also to the layout I got buttons separated with small edges exsacly like in some epements of my (4.1.2) android interface eg. like in dialog possitive/negative buttons. It worked correctly. Standard Holo buttons are ugly but with that styles they look "professional";-)
You can add this code to fix it " style="?android:attr/borderlessButtonStyle"/> "
but if your emulator is too old then that problem can occur aswell.Try to change your emulator Pixel 6 Pro.
Eclipse Android Graphical Layout is not giving the options on properties window.
example: When i select any widget on my graphical layout editor to show the properties, when i click on "Text" property (value field) it shows the "..." button to select a string. When i click on the button, nothing happens and i have to fill it by myself. The same for other properties like Gravity (i have to fill it by myself instead of show me the options like "center", etc.
I've just updated to the last version available, anyway, this installation is very fresh (last weekend). I'm running on a ubuntu 11.04 also updated today. But this always happened to me, it never worked actually :( very frustrating.
I submitted this to android-developers mailing list and found that there is a bug (fortunately already fixed) on ADT for linux:
http://code.google.com/p/android/issues/detail?id=18348
the solution is:
Download the ADT r14 preview available here:
http://tools.android.com/download/adt-14-preview
many other bugs, mainly on interface design layout issues were fixed lately (and many linux-specific bugs).
On the Outline window, Right click on the relative layout (lets say) tree
choose "other properties" and then "All By Name". a window should pop up for you to enter the desired action.
the only thing that worked for me in order to relate action to button in Graphic layout on eclipse
(using windows 7 X64 Build: v22.3.0- 887826)