How do I configure Android Studio (or Intellij generally) to correctly generate getters and setters for member variables with prefixes?
If I have a class
public class Foo{ int mBar; }
I want it to create getBar()
instead of getMBar
when I do Refactor->Encapsulate
or Generate
EDIT
I found the way to do it per-project basis: You just go File->Settings->Project Settings->Code Style
But it created a settings file somewhere in my project directory.
I want a solution which allows me to do it once for all projects, present and future.
In Mac OS
code generation tab
Try going to File-->Other Settings-->Default Settings. Your should be able to make prefixes for every other project that you do if you change prefix settings with the scheme set to default instead of Project. The prefix change would be in Java and Code Generation. That will fix setters and getters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With