
moved from assistant to one single activity model with dialogs and navigation drawer as main content holder completed separate threaded queue based service to communicate with daemon(s) added first few elements to the nav drawer
65 lines
1.5 KiB
Java
65 lines
1.5 KiB
Java
package com.idlegandalf.ledd.components;
|
|
|
|
|
|
import com.idlegandalf.ledd.helper.LedDHelper;
|
|
|
|
import org.json.JSONException;
|
|
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
|
|
public class StripeGroup {
|
|
private String mNiceName;
|
|
private String mDescription;
|
|
private ArrayList<RGBStripe> mStripes;
|
|
|
|
public String getNiceName() {
|
|
return mNiceName;
|
|
}
|
|
|
|
public void setNiceName(String mNiceName) {
|
|
this.mNiceName = mNiceName;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return mDescription;
|
|
}
|
|
|
|
public void setDescription(String mDescription) {
|
|
this.mDescription = mDescription;
|
|
}
|
|
|
|
public RGBStripe getStripeByPos(int pos) {
|
|
return mStripes.get(pos);
|
|
}
|
|
|
|
public RGBStripe getStripeById(int sid) {
|
|
for (int i = 0; i < mStripes.size(); i++) {
|
|
if (mStripes.get(i).getId() == sid) {
|
|
return mStripes.get(i);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public void setRGB(int r, int g, int b, LedDHelper api) throws JSONException, IOException {
|
|
for (int i = 0; i < mStripes.size(); i++) {
|
|
//mStripes.get(i).setRGB(r, g, b, api);
|
|
}
|
|
}
|
|
|
|
public int addStripe(RGBStripe stripe) {
|
|
mStripes.add(stripe);
|
|
return mStripes.size() - 1;
|
|
}
|
|
|
|
public void removeStripeByObject(RGBStripe stripe) {
|
|
for (int i = 0; i < mStripes.size(); i++) {
|
|
if (mStripes.get(i).getId() == stripe.getId()) {
|
|
mStripes.remove(i);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|