Initialize member vars in onCreate

This commit is contained in:
edr
2020-04-19 21:01:26 +02:00
parent 4ab2b83eb5
commit 8c8e711f3b
2 changed files with 33 additions and 25 deletions

View File

@@ -13,10 +13,10 @@ import java.util.LinkedList;
public class VolumeView extends View {
private static final int MAX_HISTORY = 10_000;
private double volume = 0;
private double maxVolume = 0;
private Paint paint = new Paint();
private LinkedList<Double> volumeHistory = new LinkedList<>();
private double volume;
private double maxVolume;
private Paint paint;
private LinkedList<Double> volumeHistory;
public VolumeView(Context context) {
super(context);
@@ -34,6 +34,10 @@ public class VolumeView extends View {
}
private void init() {
volume = 0;
maxVolume = 0;
paint = new Paint();
volumeHistory = new LinkedList<>();
paint.setColor(Color.rgb(255, 127, 0));
}