如何阻止 Android Studio 包装方法行和构造函数?
这就是 Android Studio 目前的做法:
一个类
public class Foo {
public Foo(Context context, AttributeSet attrs) { super(context, attrs); }
}
一种方法
public static void doSomething(Foo foo) { foo.doWork(); }
这就是我想要的:
一个类
public class Foo {
public Foo(Context context, AttributeSet attrs) {
super(context, attrs);
}
}
一种方法
public static void doSomething(Foo foo) {
foo.doWork();
}
导航到
Settings >> Editor >> General >> Code Folding
你会发现 One-line methods
在那里被选中。取消选中它。还有其他设置,你可以根据需要进行更改。我也附上了截图。
最后重新启动您的 IDE。完成!
希望这有帮助。
我是一名优秀的程序员,十分优秀!