package dk.cmol.arduinorgb_controller;

import android.graphics.Color;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

public class ColorDotsFragment extends Fragment {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.fragment_color_dots,
				container, false);

		boolean[] lamps = ((ArduinoRGBActivity) getActivity()).lamp_toggle;

		Button btns[] = { (Button) getActivity().findViewById(R.id.lamp1),
				(Button) getActivity().findViewById(R.id.lamp2),
				(Button) getActivity().findViewById(R.id.lamp3),
				(Button) getActivity().findViewById(R.id.lamp4) };

		for (int i = 0; i < lamps.length; i++) {
			if (lamps[i]) {
				btns[i].getBackground().setColorFilter(Color.GREEN,
						PorterDuff.Mode.MULTIPLY);
			}
		}

		return rootView;
	}

}

@@ -37,75 +37,8 @@
 r;%0A%0A
-import android.graphics.Color;%0Aimport android.graphics.PorterDuff;%0A
 impo
@@ -59,16 +59,16 @@
 Bundle;%0A
+
 import a
@@ -195,38 +195,8 @@
 oup;
-%0Aimport android.widget.Button;
 %0A%0Apu
@@ -424,16 +424,16 @@
 r_dots,%0A
+
 %09%09%09%09cont
@@ -452,471 +452,8 @@
 );%0A%0A
-%09%09boolean%5B%5D lamps = ((ArduinoRGBActivity) getActivity()).lamp_toggle;%0A%0A%09%09Button btns%5B%5D = %7B (Button) getActivity().findViewById(R.id.lamp1),%0A%09%09%09%09(Button) getActivity().findViewById(R.id.lamp2),%0A%09%09%09%09(Button) getActivity().findViewById(R.id.lamp3),%0A%09%09%09%09(Button) getActivity().findViewById(R.id.lamp4) %7D;%0A%0A%09%09for (int i = 0; i %3C lamps.length; i++) %7B%0A%09%09%09if (lamps%5Bi%5D) %7B%0A%09%09%09%09btns%5Bi%5D.getBackground().setColorFilter(Color.GREEN,%0A%09%09%09%09%09%09PorterDuff.Mode.MULTIPLY);%0A%09%09%09%7D%0A%09%09%7D%0A%0A
 %09%09re

Remove unused imports