Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. package com.mipixel.rgblamp;
  2.  
  3. import android.app.Activity;
  4. import android.os.Bundle;
  5. import android.graphics.Color;;
  6.  
  7.  
  8. public class RGBLamp extends Activity
  9.         implements ColorPickerView.OnColorChangedListener {
  10.    
  11.     int lampColor = Color.WHITE;
  12.    
  13.     // Declare the view, so we can access it later
  14.     private ColorPickerView colorPicker;
  15.    
  16.     /** Called when the activity is first created. */
  17.     @Override
  18.     public void onCreate(Bundle savedInstanceState) {
  19.         super.onCreate(savedInstanceState);
  20.        
  21.         // Set activity layout
  22.         setContentView(R.layout.main);
  23.        
  24.         colorPicker = (ColorPickerView)findViewById(R.id.colorPicker);
  25.         //colorPicker = new ColorPickerView(this);
  26.         //setContentView(colorPicker);
  27.         colorPicker.setOnColorChangedListener(this);
  28.         setTitle("Pick a Color");
  29.     }
  30.    
  31.     @Override
  32.     public void onColorChanged(int color) {
  33.         lampColor = color;
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement