Android Open Source - ArduinoRGBLighting U I Manager






From Project

Back to project page ArduinoRGBLighting.

License

The source code is released under:

Apache License

If you think the Android project ArduinoRGBLighting listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.dannixon.rgblighting;
/*from  ww w .  ja  v a2s. c om*/
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.TextView;

public class UIManager {
  private SeekBar redSeekBar;
  private SeekBar greenSeekBar;
  private SeekBar blueSeekBar;
  private SeekBar whiteSeekBar;
  private TextView timeText;
  private Spinner transSelect;
  
  UIManager(SeekBar redSeekBar, SeekBar greenSeekBar, SeekBar blueSeekBar, SeekBar whiteSeekBar, TextView timeText, Spinner transSelect) {
    this.redSeekBar = redSeekBar;
    this.greenSeekBar = greenSeekBar;
    this.blueSeekBar = blueSeekBar;
    this.whiteSeekBar = whiteSeekBar;
    this.timeText = timeText;
    this.transSelect = transSelect;
  }
  
  public int getRed() {
    return redSeekBar.getProgress();
  }
  
  public int getGreen() {
    return greenSeekBar.getProgress();
  }
  
  public int getBlue() {
    return blueSeekBar.getProgress();
  }
  
  public int getWhite() {
    return whiteSeekBar.getProgress();
  }
  
  public int getTransition() {
    return transSelect.getSelectedItemPosition();
  }
  
  public int getTime() {
    try {
      return Integer.parseInt(timeText.getText().toString());
    } catch (NumberFormatException e) {
      return 0;
    }
  }
  
  public void setRGB(int r, int g, int b) {
    redSeekBar.setProgress(r);
    greenSeekBar.setProgress(g);
    blueSeekBar.setProgress(b);
  }
  
  public void setWhite(int w) {
    whiteSeekBar.setProgress(w);
  }
  
  public void setTransition(int trans) {
    transSelect.setSelection(trans);
  }
  
  public void setTime(Integer time) {
    timeText.setText(time.toString());
  }
}




Java Source Code List

com.dannixon.rgblighting.ColourSliderListener.java
com.dannixon.rgblighting.ControlMain.java
com.dannixon.rgblighting.DeviceConnector.java
com.dannixon.rgblighting.SettingsActivity.java
com.dannixon.rgblighting.UIManager.java
com.dannixon.rgblighting.WhiteSliderListener.java