Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mipixel.rgblamp;
- import android.app.Activity;
- import android.os.Bundle;
- import android.graphics.Color;;
- public class RGBLamp extends Activity
- implements ColorPickerView.OnColorChangedListener {
- int lampColor = Color.WHITE;
- // Declare the view, so we can access it later
- private ColorPickerView colorPicker;
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // Set activity layout
- setContentView(R.layout.main);
- colorPicker = (ColorPickerView)findViewById(R.id.colorPicker);
- //colorPicker = new ColorPickerView(this);
- //setContentView(colorPicker);
- colorPicker.setOnColorChangedListener(this);
- setTitle("Pick a Color");
- }
- @Override
- public void onColorChanged(int color) {
- lampColor = color;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement