How to apply code style in IntelliJ/AndroidStudio to whole project? - android-studio

I have recently changed my code style and I want to apply it to the whole project and commit it to repo in one shoot.
I'm able to reformat a class by Ctrl+Alt+L but it only applies to a single open class. I'm looking for a way to apply my change all classes of project. Is it possible?

Try selecting the radio button "Whole Project" instead of the individual file under Code>Reformat
Additionally, you could right click the folder in the tree and choose Reformat from there.

Related

What is this yellow-orange color bar at the top of Sublime Text?

What is this yellow-orange color bar at the top of Sublime Text?
Hi all,
I've used sublime text before, but last time I used it I think I tinkered with the theme among other things, but I cannot figure out what this orange bar is at the top of the window or how to remove it. I've looked at the documentation but I've had no luck.
TIA
That image is the placeholder image that Sublime uses when a theme references a texture image whose underlying image file can't be found. That can happen if the file is missing or if the .sublime-theme file is using the wrong name, for example.
The only way to get rid of it is thus to either:
Fix the theme to use the correct image name
Put the missing image in place
Switch to an alternate theme (e.g. Default or Adaptive, which ship with Sublime)
If you're using a custom theme it should be an easy thing to check your sublime-theme file to see what images it's referencing and compare that to images you've added to the theme package to see what's missing.
The most expedient would be the theme switch to one of the ones that ship with Sublime.
If you're already using one of those two themes and you're having this problem, then the issue is that you're augmenting the existing theme and causing it to break. In that case, there are two things to check.
Use Preferences > Browse Packages from the menu or command palette; do you see a folder named Theme - Default? If so, move it away, the files in it are overriding the default themes (including Adaptive; they're both in the same package).
Using the same command as above, look in the User package; look for sublime-theme files and move them away; such files will be combined with other files of the same name, which allows you to add rules to an existing theme in a way that could be breaking it.

XML layout doesn't line break in android studio

After I updated my android studio , the XML formatting is ruined in the layout editor. Initially each attribute was on a separate line. Now however two or three attributes take a line .
I went into Settings->Editor->CodeStyle->XML and under the Layout Files region I have Wrap Attributes set as Wrap Always and Insert Line Break After First attribute is checked.
Yet the effect doesn't appear .
Any pointers?
I had occurred. Coz u r using Project Scheme . To fix this go Preferences>>Code Style>>XML on Scheme Combo Box , change to Default IDE
For Me, I overwrite project to Project Scheme( one that u don't like) with Default IDE. select setting icon and Copy to Project.
After all finished, Close preference pane with OK ,And then u are good to go.
Good Luck!
Just go to File->Settings->Keymap and search Reformat Code. You can find your shortcut to format your code and also you can remove and add new shortcuts for this.

Sort project folders in alphabetical order in Sublime Text 3 sidebar?

In the Sublime Text sidebar is there a way to have project folders displayed in alphabetical order, instead of by the order that the folders were added.
This is driving me nuts. I've searched everywhere for this and have given up, but it's so painful.
The contents of side bar folders are displayed in a sorted (lexical) ordering, with all sub-folders brought to the top instead of being in their natural sort position. There is currently no setting available or internal API that allows for changing that.
That said, the ordering of top level folders that you have manually added to your project is entirely under your control and defaults (as you've noticed) to the order that they were added in.
The folders in the sidebar are listed in the order that they're listed in the folders section of the sublime-project file. You can use Project > Edit Project to open your project file and manually reorder the elements in the folders list.
Additionally you can also click and drag the top level folders to change their relative ordering. Doing so causes Sublime to automatically rewrite the project file for you.
If the Project > Edit Project setting is not enabled, you haven't saved the current session as a project yet. In that case there will be no project file until you create one, but you can still drag to reorder the folders.
You can use sublime plugins for this. One that I can think of is SortTabs
In Sublime Text 3, if you have "Project Manager" installed use it to CLEAR RECENT PROJECTS. Then when you look for a project to open with Ctrl-Alt-P, they will be in alphabetic order.
To install "Project Manager" on the menu go to Preferences-Package Control, then click on Install Package. Scroll to find "Project Manager". Click on it to install. Restart Sublime Text. It will be on menu at bottom of Projects.

How do I add an item to "Edit > Permute Lines" submenu?

According to this source the definition if Permute Lines submenu is following:
{
"caption": "Permute Lines",
"children": [...]
}
And it doesn't contain an id. Is there a way to add items to this submenu?
Also this source is 5 years old and is probably for Sublime Text 2. Is there a more recent version of default menu file?
To answer your second question first, you can always get at the most recent menu definition from your own copy of Sublime; it's stored in the file Default\Main.sublime-menu, which you can get to most easily using PackageResourceViewer to open it up.
That said, the part of the menu that you're referencing in your question is the same between Sublime Text 2 and Sublime Text 3 and neither of them has an id value directly within the Permute Lines sub-menu.
By creating a Main.sublime-menu in some other package (e.g. your User package) you could create entries that are adjacent to that sub menu, but in order to actually put new content directly inside of it you would need to create an Override.
You can do that via PackageResourceViewer; if you use it to open up the Default\Main.sublime-menu file, you can modify the file and when you save it, it will be saved as an override.
From this point forward your override becomes the new default menu; other packages that extend the menu can still do so, but they will be merged with your version and not the shipped version.
This is not without its risks in that if a future version of Sublime Text includes a modified version of the menu, your override will still take precedence and you won't be warned that it's happening, so you could potentially miss out on fixes.
This happened recently when the latest build of Sublime modified the base menu to include an install link for PackageControl, for example.
Also, this is only a viable solution if you want to edit the menu for your own purposes; if you're a package author, you can't use this method to distribute your own changes.

Add existing project to blank solution in source control

I am trying to put several existing projects in one blank solution. This solution plus existing projects then need to be added to TFS source control.
Is there any way to achieve this? I simply am not able to find out how to get this done. Adding the project to a blank solution is relatively easy. Except it only places references to the existing project, rather than adding the files to the solution.
So when checking-in at sourcecontrol, it does not recognise the projectfiles as they do not get added to the solution, just references.
How can I get this done?
I managed to figure it out.
Add projectfiles of the project to be added to the solutiondirectory.
Add a reference to existing project (the one now in your solution directory).
In Windows Explorer, rightclick on the projectmap you just added and navigate to "Team Foundation Server" --> "Add".
The showing messagebox will describe which files will be added (they should be ONLY projectfiles, no bindirectory or anything).
Then reopen the solution in Visual Studio and the project should appear to be in source control.
Edit: The changes to show up in the pending-changeswindow, you just have to add them manually. They should show as "detected". Select these to be promoted and you should be able to check them in.

Resources