general post-release cleanup
removed lots of unused strings/resources/drawables extracted all translatable strings added new logo
This commit is contained in:
@@ -50,9 +50,6 @@ import com.idlegandalf.ledd.components.LedDDaemon;
|
||||
import com.idlegandalf.ledd.components.LedStripe;
|
||||
import com.idlegandalf.ledd.helper.LedDHelper;
|
||||
|
||||
import org.json.JSONException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParsePosition;
|
||||
import java.util.List;
|
||||
@@ -259,50 +256,38 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
||||
stripe.setLedDDaemon((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
stripe.setController((Controller) controllerSpinner.getSelectedItem());
|
||||
|
||||
LedDHelper helper = null;
|
||||
try {
|
||||
helper = ColorApplication.getInstance().getHelperForDaemon((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
LedDHelper helper = ColorApplication.getInstance().getHelperForDaemon((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
|
||||
|
||||
if (helper != null) {
|
||||
try {
|
||||
helper.addStripe(stripe, new AddStripeCallback() {
|
||||
@Override
|
||||
public void onAddSuccessfully(final LedStripe stripe) {
|
||||
ColorActivity activity = ((ColorActivity) getActivity());
|
||||
try {
|
||||
activity.refreshStripes();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
helper.addStripe(stripe, new AddStripeCallback() {
|
||||
@Override
|
||||
public void onAddSuccessfully(final LedStripe stripe) {
|
||||
ColorActivity activity = ((ColorActivity) getActivity());
|
||||
activity.refreshStripes();
|
||||
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content))
|
||||
.getChildAt(0), "Added stripe (" + stripe.getId() + ")", Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
dismiss();
|
||||
}
|
||||
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content))
|
||||
.getChildAt(0), "Added stripe (" + stripe.getId() + ")", Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionFailed(final String message) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content))
|
||||
.getChildAt(0), "Failed to add stripe: " + message, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
} catch (JSONException | IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@Override
|
||||
public void onConnectionFailed(final String message) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content))
|
||||
.getChildAt(0), "Failed to add stripe: " + message, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -398,19 +383,11 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
||||
}
|
||||
text.setTag(toggle);
|
||||
|
||||
LedDHelper helper = null;
|
||||
try {
|
||||
helper = ColorApplication.getInstance().getHelperForDaemon((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
LedDHelper helper = ColorApplication.getInstance().getHelperForDaemon((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
|
||||
|
||||
if (helper != null) {
|
||||
try {
|
||||
helper.testChannel((Controller) controllerSpinner.getSelectedItem(), Integer.parseInt(text.getText().toString()), val);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
helper.testChannel((Controller) controllerSpinner.getSelectedItem(), Integer.parseInt(text.getText().toString()), val);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -418,40 +395,31 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
||||
|
||||
private void refreshController(final LedDDaemon ledDDaemon) {
|
||||
controllerArrayAdapter.clear();
|
||||
LedDHelper helper = null;
|
||||
try {
|
||||
helper = ColorApplication.getInstance().getHelperForDaemon(ledDDaemon);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
LedDHelper helper = ColorApplication.getInstance().getHelperForDaemon(ledDDaemon);
|
||||
|
||||
if (helper != null) {
|
||||
try {
|
||||
helper.getStripes(new StripesCallback() {
|
||||
@Override
|
||||
public void onSuccess(List<LedStripe> stripes) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
controllerArrayAdapter.addAll(ledDDaemon.getControllers());
|
||||
toggleAll(stripeMapping, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
helper.getStripes(new StripesCallback() {
|
||||
@Override
|
||||
public void onSuccess(List<LedStripe> stripes) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
controllerArrayAdapter.addAll(ledDDaemon.getControllers());
|
||||
toggleAll(stripeMapping, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetFailed(String message) {
|
||||
@Override
|
||||
public void onGetFailed(String message) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionFailed(String message) {
|
||||
@Override
|
||||
public void onConnectionFailed(String message) {
|
||||
|
||||
}
|
||||
});
|
||||
} catch (JSONException | IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user