To do this in Android Studio go to Preferences > Editor > Code Style
and set Right margin (columns)
to 150
(or the line width you want)
Now go to File -> Settings > Editor > Code Style > Java > Wrapping and Braces
import 'dart:html'; | |
import 'package:camera/camera.dart'; | |
import 'package:flutter/material.dart'; | |
Future<void> main() async { | |
runApp(CameraApp()); | |
} | |
class CameraApp extends StatefulWidget { |
import "package:flutter/material.dart"; | |
import 'package:flutter/services.dart'; | |
import 'dart:math'; | |
const CURVE_HEIGHT = 160.0; | |
const AVATAR_RADIUS = CURVE_HEIGHT * 0.28; | |
const AVATAR_DIAMETER = AVATAR_RADIUS * 2; | |
void main() => runApp(new MyApp()); |
Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View view = inflater.inflate(R.layout.expandable, container, false); | |
ExpandableAdapter adapter = new ExpandableAdapter(); | |
expandableListView.setAdapter(adapter); | |
setExpandableListViewHeight(expandableListView, -1); | |
expandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() { | |
@Override | |
public boolean onGroupClick(ExpandableListView parent, View v, int position, long id) { |