updated deps and code to a more recent state
This commit is contained in:
@@ -26,7 +26,7 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
|
||||
classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0'
|
||||
classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0'
|
||||
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
|
||||
classpath 'com.github.JakeWharton:sdk-manager-plugin:master'
|
||||
}
|
||||
@@ -44,49 +44,56 @@ repositories {
|
||||
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion '23.0.3'
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '25.0.2'
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.idlegandalf.ledd"
|
||||
minSdkVersion 18
|
||||
targetSdkVersion 23
|
||||
targetSdkVersion 25
|
||||
versionCode System.getenv("BUILD_NUMBER") as Integer ?: 50
|
||||
versionName "1.0.4-SNAPSHOT"
|
||||
archivesBaseName = "LedD-" + versionName + "-" + versionCode
|
||||
manifestPlaceholders = [HOCKEYAPP_APP_ID: "7febd1d2266a4f0c81667ca4e3d11fd3"]
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
zipAlignEnabled true
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
|
||||
debug {
|
||||
zipAlignEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.android.support:appcompat-v7:23.4.0'
|
||||
compile 'com.android.support:support-v4:23.4.0'
|
||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||
compile 'com.android.support:appcompat-v7:25.1.1'
|
||||
compile 'com.android.support:support-v4:25.1.1'
|
||||
compile 'com.squareup.okhttp:okhttp:2.7.5'
|
||||
compile 'com.jakewharton.timber:timber:4.1.2'
|
||||
compile 'com.google.code.gson:gson:2.6.2'
|
||||
compile 'com.jakewharton:butterknife:8.0.1'
|
||||
apt 'com.jakewharton:butterknife-compiler:8.0.1'
|
||||
compile 'net.hockeyapp.android:HockeySDK:4.0.0'
|
||||
compile 'com.koushikdutta.async:androidasync:2.1.7'
|
||||
compile 'com.android.support:design:23.4.0'
|
||||
compile 'com.github.LED-Freaks:HoloColorPicker:master-SNAPSHOT'
|
||||
compile 'com.google.guava:guava:19.0'
|
||||
compile 'com.google.code.gson:gson:2.8.0'
|
||||
compile 'com.jakewharton:butterknife:8.5.1'
|
||||
compile 'com.koushikdutta.async:androidasync:2.1.9'
|
||||
compile 'com.android.support:design:25.1.1'
|
||||
compile 'com.larswerkman:HoloColorPicker:1.5@aar'
|
||||
compile 'com.google.guava:guava:21.0'
|
||||
compile 'com.thetransactioncompany:jsonrpc2-base:1.38'
|
||||
compile('com.mikepenz:materialdrawer:5.2.6@aar') {
|
||||
compile('com.mikepenz:materialdrawer:5.8.1@aar') {
|
||||
transitive = true
|
||||
}
|
||||
provided 'org.projectlombok:lombok:1.16.8'
|
||||
provided 'org.projectlombok:lombok:1.16.12'
|
||||
}
|
||||
|
@@ -116,11 +116,8 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
||||
ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
|
||||
if (networkInfo == null || !networkInfo.isConnected() || networkInfo.getType() != ConnectivityManager.TYPE_WIFI) {
|
||||
Snackbar.make(scrollView, R.string.snackbar_no_wlan, Snackbar.LENGTH_INDEFINITE).setAction("RETRY", new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
refreshStripes();
|
||||
}
|
||||
Snackbar.make(scrollView, R.string.snackbar_no_wlan, Snackbar.LENGTH_INDEFINITE).setAction("RETRY", v -> {
|
||||
refreshStripes();
|
||||
}).show();
|
||||
}
|
||||
|
||||
@@ -131,12 +128,9 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
||||
colorPicker.addValueBar(valueBar);
|
||||
colorPicker.setShowOldCenterColor(false);
|
||||
|
||||
colorPicker.setOnColorChangedListener(new ColorPicker.OnColorChangedListener() {
|
||||
@Override
|
||||
public void onColorChanged(int i) {
|
||||
if (mCurrentStripe != null && limiter.check() && !autoColorSet) {
|
||||
mCurrentStripe.setColor(i);
|
||||
}
|
||||
colorPicker.setOnColorChangedListener(i -> {
|
||||
if (mCurrentStripe != null && limiter.check() && !autoColorSet) {
|
||||
mCurrentStripe.setColor(i);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -380,28 +374,26 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
||||
@Override
|
||||
public void onSuccess(List<LedStripe> stripes) {
|
||||
ledStripes = stripes;
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PrimaryDrawerItem nDaemonMenu = null;
|
||||
long selectedItemId = -1;
|
||||
for (IDrawerItem drawerItem : mDaemons) {
|
||||
if (((PrimaryDrawerItem) drawerItem).getName().getText().equals(dDaemon.toString())) {
|
||||
nDaemonMenu = (PrimaryDrawerItem) drawerItem;
|
||||
break;
|
||||
}
|
||||
runOnUiThread(() -> {
|
||||
PrimaryDrawerItem nDaemonMenu = null;
|
||||
long selectedItemId = -1;
|
||||
for (IDrawerItem drawerItem : mDaemons) {
|
||||
if (((PrimaryDrawerItem) drawerItem).getName().getText().equals(dDaemon.toString())) {
|
||||
nDaemonMenu = (PrimaryDrawerItem) drawerItem;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (nDaemonMenu == null) {
|
||||
nDaemonMenu = new PrimaryDrawerItem().withName(dDaemon.toString()).withTag(finalI).withSelectable(false).withIsExpanded(true).withIcon(R.drawable.ic_computer_black_48dp);
|
||||
mDrawer.addItemAtPosition(nDaemonMenu, 0);
|
||||
mDaemons.add(nDaemonMenu);
|
||||
}
|
||||
if (nDaemonMenu == null) {
|
||||
nDaemonMenu = new PrimaryDrawerItem().withName(dDaemon.toString()).withTag(finalI).withSelectable(false).withIsExpanded(true).withIcon(R.drawable.ic_computer_black_48dp);
|
||||
mDrawer.addItemAtPosition(nDaemonMenu, 0);
|
||||
mDaemons.add(nDaemonMenu);
|
||||
}
|
||||
|
||||
int lastStripeId = -1;
|
||||
if (PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).contains("lastStripe")) {
|
||||
lastStripeId = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getInt("lastStripe", -1);
|
||||
}
|
||||
int lastStripeId = -1;
|
||||
if (PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).contains("lastStripe")) {
|
||||
lastStripeId = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getInt("lastStripe", -1);
|
||||
}
|
||||
|
||||
List<IDrawerItem> mStripes = new ArrayList<>();
|
||||
for (LedStripe stripe : ledStripes) {
|
||||
@@ -411,13 +403,13 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
||||
.withIcon(R.drawable.ic_wb_iridescent_black_48dp)
|
||||
.withOnCheckedChangeListener(ColorActivity.this);
|
||||
|
||||
mStripes.add(sItem);
|
||||
mStripes.add(sItem);
|
||||
|
||||
if (lastStripeId != -1 && stripe.getId() == lastStripeId) {
|
||||
selectStripe(stripe);
|
||||
selectedItemId = sItem.getIdentifier();
|
||||
}
|
||||
if (lastStripeId != -1 && stripe.getId() == lastStripeId) {
|
||||
selectStripe(stripe);
|
||||
selectedItemId = sItem.getIdentifier();
|
||||
}
|
||||
}
|
||||
|
||||
nDaemonMenu.withSubItems(mStripes);
|
||||
nDaemonMenu.withBadge(String.valueOf(mStripes.size()));
|
||||
@@ -448,12 +440,7 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
||||
final SecondarySwitchDrawerItem cItem = (SecondarySwitchDrawerItem) sItem;
|
||||
cItem.withSwitchEnabled(true);
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mDrawer.updateItem(cItem);
|
||||
}
|
||||
});
|
||||
runOnUiThread(() -> mDrawer.updateItem(cItem));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -503,18 +490,15 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
||||
final HSV cColor = stripe.getColor();
|
||||
final int color = Color.HSVToColor(new float[]{(float) cColor.getHue(), (float) cColor.getSaturation(), (float) cColor.getValue()});
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
colorPicker.setColor(color);
|
||||
autoColorSet = false;
|
||||
runOnUiThread(() -> {
|
||||
colorPicker.setColor(color);
|
||||
autoColorSet = false;
|
||||
|
||||
if (stripe.isOn()) {
|
||||
IDrawerItem fItem = findItemForStripe(stripe);
|
||||
if (stripe.isOn()) {
|
||||
IDrawerItem fItem = findItemForStripe(stripe);
|
||||
|
||||
if (fItem != null)
|
||||
((SecondarySwitchDrawerItem) fItem).withSwitchEnabled(true);
|
||||
}
|
||||
if (fItem != null)
|
||||
((SecondarySwitchDrawerItem) fItem).withSwitchEnabled(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ public class ColorApplication extends Application {
|
||||
dHelper.teardown();
|
||||
}
|
||||
|
||||
PreferenceManager.getDefaultSharedPreferences(this).edit().putString("daemons", new Gson().toJson(ledDHelpers.keySet())).commit();
|
||||
PreferenceManager.getDefaultSharedPreferences(this).edit().putString("daemons", new Gson().toJson(ledDHelpers.keySet())).apply();
|
||||
}
|
||||
|
||||
public void onResume() {
|
||||
|
@@ -140,80 +140,59 @@ public class AddControllerDialog extends DialogFragment implements DialogInterfa
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AddStripeDialog.instance.onResume();
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v -> {
|
||||
AddStripeDialog.instance.onResume();
|
||||
alertDialog.dismiss();
|
||||
});
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (i2cText.getText().toString().isEmpty() || !isNumeric(i2cText.getText().toString())) {
|
||||
i2cLayout.setError("No valid i2c device number");
|
||||
return;
|
||||
}
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(v -> {
|
||||
if (i2cText.getText().toString().isEmpty() || !isNumeric(i2cText.getText().toString())) {
|
||||
i2cLayout.setError("No valid i2c device number");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!addressText.getText().toString().contains("0x") || !addressText.getText().toString().split("x")[1].matches("-?[0-9a-fA-F]+")) {
|
||||
addressLayout.setError("No valid hexdecimal address");
|
||||
return;
|
||||
}
|
||||
if (!addressText.getText().toString().contains("0x") || !addressText.getText().toString().split("x")[1].matches("-?[0-9a-fA-F]+")) {
|
||||
addressLayout.setError("No valid hexdecimal address");
|
||||
return;
|
||||
}
|
||||
|
||||
if (channelText.getText().toString().isEmpty() || !isNumeric(channelText.getText().toString()) && Integer.parseInt(channelText
|
||||
.getText().toString()) <= 0) {
|
||||
channelLayout.setError("No valid channel amount");
|
||||
return;
|
||||
}
|
||||
if (channelText.getText().toString().isEmpty() || !isNumeric(channelText.getText().toString()) && Integer.parseInt(channelText
|
||||
.getText().toString()) <= 0) {
|
||||
channelLayout.setError("No valid channel amount");
|
||||
return;
|
||||
}
|
||||
|
||||
Controller c = new Controller();
|
||||
c.setAddress(addressText.getText().toString());
|
||||
c.setI2c_device(Integer.parseInt(i2cText.getText().toString()));
|
||||
c.setChannels(Integer.parseInt(channelText.getText().toString()));
|
||||
Controller c = new Controller();
|
||||
c.setAddress(addressText.getText().toString());
|
||||
c.setI2c_device(Integer.parseInt(i2cText.getText().toString()));
|
||||
c.setChannels(Integer.parseInt(channelText.getText().toString()));
|
||||
|
||||
LedDHelper helper = ColorApplication.getInstance().getHelperForDaemon(dDaemon);
|
||||
LedDHelper helper = ColorApplication.getInstance().getHelperForDaemon(dDaemon);
|
||||
|
||||
if (helper != null) {
|
||||
helper.addController(c, new AddControllerCallback() {
|
||||
@Override
|
||||
public void onControllerAdded(final Controller controller) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0), String.format(getActivity().getString(R.string.snachbar_added_controller), controller.getId()), Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
if (helper != null) {
|
||||
helper.addController(c, new AddControllerCallback() {
|
||||
@Override
|
||||
public void onControllerAdded(final Controller controller) {
|
||||
getActivity().runOnUiThread(() -> Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0), String.format(getActivity().getString(R.string.snachbar_added_controller), controller.getId()), Snackbar.LENGTH_LONG).show());
|
||||
|
||||
dDaemon.getControllers().add(controller);
|
||||
dismiss();
|
||||
}
|
||||
dDaemon.getControllers().add(controller);
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAddFailed(final int code, final String msg) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0), getActivity().getString(R.string.snackbar_error) + msg, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
AddStripeDialog.instance.onResume();
|
||||
dismiss();
|
||||
}
|
||||
@Override
|
||||
public void onAddFailed(final int code, final String msg) {
|
||||
getActivity().runOnUiThread(() -> Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0), getActivity().getString(R.string.snackbar_error) + msg, Snackbar.LENGTH_LONG).show());
|
||||
AddStripeDialog.instance.onResume();
|
||||
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), String.format(getActivity().getString(R.string.snackbar_daemon_connection_failed), dDaemon, message), Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
AddStripeDialog.instance.onResume();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void onConnectionFailed(final String message) {
|
||||
getActivity().runOnUiThread(() -> Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0), String.format(getActivity().getString(R.string.snackbar_daemon_connection_failed), dDaemon, message), Snackbar.LENGTH_LONG).show());
|
||||
AddStripeDialog.instance.onResume();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -108,46 +108,40 @@ public class AddDaemonDialog extends DialogFragment implements DialogInterface.O
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mNsdManager.stopServiceDiscovery(AddDaemonDialog.this);
|
||||
AddStripeDialog.instance.onResume();
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v -> {
|
||||
mNsdManager.stopServiceDiscovery(AddDaemonDialog.this);
|
||||
AddStripeDialog.instance.onResume();
|
||||
alertDialog.dismiss();
|
||||
});
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String strIp = ip.getText().toString();
|
||||
int port;
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(v -> {
|
||||
String strIp = ip.getText().toString();
|
||||
int port;
|
||||
|
||||
if (strIp.contains(":")) {
|
||||
strIp = strIp.split(":")[0];
|
||||
try {
|
||||
port = Integer.parseInt(ip.getText().toString().split(":")[1]);
|
||||
} catch (NumberFormatException e) {
|
||||
ip_lay.setError("Please check your port");
|
||||
return;
|
||||
}
|
||||
|
||||
if (port < 1024 || port > 65535) {
|
||||
ip_lay.setError("Port is out of range");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
port = 1425;
|
||||
if (strIp.contains(":")) {
|
||||
strIp = strIp.split(":")[0];
|
||||
try {
|
||||
port = Integer.parseInt(ip.getText().toString().split(":")[1]);
|
||||
} catch (NumberFormatException e) {
|
||||
ip_lay.setError("Please check your port");
|
||||
return;
|
||||
}
|
||||
|
||||
if (InetAddresses.isInetAddress(strIp)) {
|
||||
LedDDaemon daemon = new LedDDaemon(strIp, port);
|
||||
|
||||
if (!ledDDaemons.contains(daemon)) addDaemon(new LedDDaemon(strIp, port));
|
||||
else ip_lay.setError("Daemon already exist");
|
||||
} else {
|
||||
ip_lay.setError("No valid ip address");
|
||||
if (port < 1024 || port > 65535) {
|
||||
ip_lay.setError("Port is out of range");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
port = 1425;
|
||||
}
|
||||
|
||||
if (InetAddresses.isInetAddress(strIp)) {
|
||||
LedDDaemon daemon = new LedDDaemon(strIp, port);
|
||||
|
||||
if (!ledDDaemons.contains(daemon)) addDaemon(new LedDDaemon(strIp, port));
|
||||
else ip_lay.setError("Daemon already exist");
|
||||
} else {
|
||||
ip_lay.setError("No valid ip address");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -195,49 +189,43 @@ public class AddDaemonDialog extends DialogFragment implements DialogInterface.O
|
||||
final LedDDaemon nLedDDaemon = new LedDDaemon(serviceInfo.getHost().getHostAddress(), serviceInfo.getPort());
|
||||
|
||||
if (!ledDDaemons.contains(nLedDDaemon)) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
View v = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout
|
||||
.host_row, hostContainer, false);
|
||||
getActivity().runOnUiThread(() -> {
|
||||
View v = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout
|
||||
.host_row, hostContainer, false);
|
||||
|
||||
|
||||
TextView host = (TextView) v.findViewById(R.id.text_host);
|
||||
TextView host = (TextView) v.findViewById(R.id.text_host);
|
||||
|
||||
host.setText(nLedDDaemon.toString());
|
||||
host.setText(nLedDDaemon.toString());
|
||||
|
||||
if (ColorApplication.getInstance().getDaemons().contains(nLedDDaemon)) {
|
||||
v.setEnabled(false);
|
||||
host.setEnabled(false);
|
||||
}
|
||||
|
||||
View.OnClickListener listener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.isEnabled()) {
|
||||
LedDDaemon d;
|
||||
|
||||
if (v instanceof TextView) {
|
||||
d = (LedDDaemon) ((LinearLayout) v.getParent()).getTag();
|
||||
} else {
|
||||
d = (LedDDaemon) v.getTag();
|
||||
}
|
||||
|
||||
if (d != null) {
|
||||
addDaemon(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
v.setOnClickListener(listener);
|
||||
host.setOnClickListener(listener);
|
||||
|
||||
v.setTag(nLedDDaemon);
|
||||
|
||||
ledDDaemons.add(nLedDDaemon);
|
||||
hostContainer.addView(v);
|
||||
if (ColorApplication.getInstance().getDaemons().contains(nLedDDaemon)) {
|
||||
v.setEnabled(false);
|
||||
host.setEnabled(false);
|
||||
}
|
||||
|
||||
View.OnClickListener listener = v1 -> {
|
||||
if (v1.isEnabled()) {
|
||||
LedDDaemon d;
|
||||
|
||||
if (v1 instanceof TextView) {
|
||||
d = (LedDDaemon) ((LinearLayout) v1.getParent()).getTag();
|
||||
} else {
|
||||
d = (LedDDaemon) v1.getTag();
|
||||
}
|
||||
|
||||
if (d != null) {
|
||||
addDaemon(d);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
v.setOnClickListener(listener);
|
||||
host.setOnClickListener(listener);
|
||||
|
||||
v.setTag(nLedDDaemon);
|
||||
|
||||
ledDDaemons.add(nLedDDaemon);
|
||||
hostContainer.addView(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -286,25 +274,15 @@ public class AddDaemonDialog extends DialogFragment implements DialogInterface.O
|
||||
ColorApplication.getInstance().getHelperForDaemon(ledDDaemon).discover(new DiscoverCallback() {
|
||||
@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), String.format(getActivity().getString(R.string.snackbar_daemon_connection_failed), ledDDaemon, message), Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
getActivity().runOnUiThread(() -> Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0), String.format(getActivity().getString(R.string.snackbar_daemon_connection_failed), ledDDaemon, message), Snackbar.LENGTH_LONG).show());
|
||||
AddStripeDialog.instance.onResume();
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDiscoverSuccessfully(final String version) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0),
|
||||
getActivity().getString(R.string.snackbar_added_daemon_version, version), Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
getActivity().runOnUiThread(() -> Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0),
|
||||
getActivity().getString(R.string.snackbar_added_daemon_version, version), Snackbar.LENGTH_LONG).show());
|
||||
|
||||
((ColorActivity) getActivity()).refreshStripes();
|
||||
AddStripeDialog.instance.onResume();
|
||||
|
@@ -104,47 +104,39 @@ public class AddProfileDialog extends DialogFragment implements DialogInterface.
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
alertDialog.dismiss();
|
||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v -> alertDialog.dismiss());
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(v -> {
|
||||
if (nameText.getText().toString().isEmpty()) {
|
||||
nameLayout.setError("Please enter a name");
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (nameText.getText().toString().isEmpty()) {
|
||||
nameLayout.setError("Please enter a name");
|
||||
return;
|
||||
int checked = 0;
|
||||
for (CheckBox c : mCheckboxes) {
|
||||
if (c.isChecked()) {
|
||||
checked++;
|
||||
mStripes.get(checkboxContainer.indexOfChild(c)).getColor();
|
||||
}
|
||||
|
||||
int checked = 0;
|
||||
for (CheckBox c : mCheckboxes) {
|
||||
if (c.isChecked()) {
|
||||
checked++;
|
||||
mStripes.get(checkboxContainer.indexOfChild(c)).getColor();
|
||||
}
|
||||
}
|
||||
|
||||
if (checked < 2) {
|
||||
Toast.makeText(getActivity(), "Please select at least two stripes for your profile", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
Profile profile = new Profile(nameText.getText().toString());
|
||||
|
||||
for (CheckBox c : mCheckboxes) {
|
||||
if (c.isChecked()) {
|
||||
LedStripe stripe = mStripes.get(checkboxContainer.indexOfChild(c));
|
||||
profile.getValues().append(stripe.getId(), stripe.getColor());
|
||||
}
|
||||
}
|
||||
|
||||
((ColorActivity) getActivity()).addProfile(profile);
|
||||
Toast.makeText(getActivity(), "Added profile " + nameText.getText().toString(), Toast.LENGTH_SHORT).show();
|
||||
dismiss();
|
||||
}
|
||||
|
||||
if (checked < 2) {
|
||||
Toast.makeText(getActivity(), "Please select at least two stripes for your profile", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
Profile profile = new Profile(nameText.getText().toString());
|
||||
|
||||
for (CheckBox c : mCheckboxes) {
|
||||
if (c.isChecked()) {
|
||||
LedStripe stripe = mStripes.get(checkboxContainer.indexOfChild(c));
|
||||
profile.getValues().append(stripe.getId(), stripe.getColor());
|
||||
}
|
||||
}
|
||||
|
||||
((ColorActivity) getActivity()).addProfile(profile);
|
||||
Toast.makeText(getActivity(), "Added profile " + nameText.getText().toString(), Toast.LENGTH_SHORT).show();
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -205,20 +205,17 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
||||
}
|
||||
});
|
||||
|
||||
ImageButton.OnClickListener imgListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.imgbuttn_togglechannel_r:
|
||||
testChannel(channelR, (ImageButton) v);
|
||||
break;
|
||||
case R.id.imgbuttn_togglechannel_g:
|
||||
testChannel(channelG, (ImageButton) v);
|
||||
break;
|
||||
case R.id.imgbuttn_togglechannel_b:
|
||||
testChannel(channelB, (ImageButton) v);
|
||||
break;
|
||||
}
|
||||
ImageButton.OnClickListener imgListener = v -> {
|
||||
switch (v.getId()) {
|
||||
case R.id.imgbuttn_togglechannel_r:
|
||||
testChannel(channelR, (ImageButton) v);
|
||||
break;
|
||||
case R.id.imgbuttn_togglechannel_g:
|
||||
testChannel(channelG, (ImageButton) v);
|
||||
break;
|
||||
case R.id.imgbuttn_togglechannel_b:
|
||||
testChannel(channelB, (ImageButton) v);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -226,71 +223,53 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
||||
channelGBttn.setOnClickListener(imgListener);
|
||||
channelBBttn.setOnClickListener(imgListener);
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
alertDialog.dismiss();
|
||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v -> alertDialog.dismiss());
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(v -> {
|
||||
if (!mDaemonSelected) {
|
||||
Toast.makeText(getActivity(), "Please select Daemon and Controller", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!mDaemonSelected) {
|
||||
Toast.makeText(getActivity(), "Please select Daemon and Controller", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
if (stripeNameText.getText().toString().isEmpty()) {
|
||||
stripeNameLay.setError("Please set the Stripe name");
|
||||
return;
|
||||
}
|
||||
|
||||
if (stripeNameText.getText().toString().isEmpty()) {
|
||||
stripeNameLay.setError("Please set the Stripe name");
|
||||
return;
|
||||
}
|
||||
if (channelR.getText().toString().isEmpty() || channelG.getText().toString().isEmpty() || channelB.getText().toString().isEmpty()) {
|
||||
Toast.makeText(getActivity(), "Please add mapping for all channels", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (channelR.getText().toString().isEmpty() || channelG.getText().toString().isEmpty() || channelB.getText().toString().isEmpty()) {
|
||||
Toast.makeText(getActivity(), "Please add mapping for all channels", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
LedStripe stripe = new LedStripe(Integer.parseInt(channelR.getText().toString()), Integer.parseInt(channelG.getText().toString()),
|
||||
Integer.parseInt(channelB.getText().toString()), stripeNameText.getText().toString());
|
||||
stripe.setLedDDaemon((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
stripe.setController((Controller) controllerSpinner.getSelectedItem());
|
||||
|
||||
LedStripe stripe = new LedStripe(Integer.parseInt(channelR.getText().toString()), Integer.parseInt(channelG.getText().toString()),
|
||||
Integer.parseInt(channelB.getText().toString()), stripeNameText.getText().toString());
|
||||
stripe.setLedDDaemon((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
stripe.setController((Controller) controllerSpinner.getSelectedItem());
|
||||
LedDHelper helper = ColorApplication.getInstance().getHelperForDaemon((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
|
||||
LedDHelper helper = ColorApplication.getInstance().getHelperForDaemon((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
if (helper != null) {
|
||||
helper.addStripe(stripe, new AddStripeCallback() {
|
||||
@Override
|
||||
public void onAddSuccessfully(final LedStripe stripe) {
|
||||
ColorActivity activity = ((ColorActivity) getActivity());
|
||||
activity.refreshStripes();
|
||||
|
||||
if (helper != null) {
|
||||
helper.addStripe(stripe, new AddStripeCallback() {
|
||||
@Override
|
||||
public void onAddSuccessfully(final LedStripe stripe) {
|
||||
ColorActivity activity = ((ColorActivity) getActivity());
|
||||
activity.refreshStripes();
|
||||
getActivity().runOnUiThread(() -> Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0), String.format(getActivity().getString(R.string.snackbar_added_stripe_id), 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), String.format(getActivity().getString(R.string.snackbar_added_stripe_id), stripe.getId()), Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
dismiss();
|
||||
}
|
||||
@Override
|
||||
public void onAddFailed(int code, String msg) {
|
||||
|
||||
@Override
|
||||
public void onAddFailed(int code, String msg) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@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), getActivity().getString(R.string.snackbar_failed_add_stripe) + message, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void onConnectionFailed(final String message) {
|
||||
getActivity().runOnUiThread(() -> Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0), getActivity().getString(R.string.snackbar_failed_add_stripe) + message, Snackbar.LENGTH_LONG).show());
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -359,17 +338,14 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
||||
super.onResume();
|
||||
ColorApplication.getInstance().onResume();
|
||||
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (daemonArrayAdapter != null) {
|
||||
daemonArrayAdapter.clear();
|
||||
daemonArrayAdapter.addAll(ColorApplication.getInstance().getDaemons());
|
||||
}
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (daemonArrayAdapter != null) {
|
||||
daemonArrayAdapter.clear();
|
||||
daemonArrayAdapter.addAll(ColorApplication.getInstance().getDaemons());
|
||||
}
|
||||
|
||||
if (controllerArrayAdapter != null && mDaemonSelected) {
|
||||
refreshController((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
}
|
||||
if (controllerArrayAdapter != null && mDaemonSelected) {
|
||||
refreshController((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -409,12 +385,9 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
||||
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);
|
||||
}
|
||||
getActivity().runOnUiThread(() -> {
|
||||
controllerArrayAdapter.addAll(ledDDaemon.getControllers());
|
||||
toggleAll(stripeMapping, true);
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ LEDD Project
|
||||
~ Copyright (C) 2015 LEDD Team
|
||||
~
|
||||
@@ -18,15 +17,15 @@
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="true"
|
||||
android:minWidth="350dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="15dp">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="true"
|
||||
android:minWidth="350dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="15dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
@@ -36,7 +35,7 @@
|
||||
android:id="@+id/img_host"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:src="@drawable/ic_developer_board_black_48dp"/>
|
||||
android:src="@drawable/ic_developer_board_black_48dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -47,8 +46,7 @@
|
||||
android:layout_toRightOf="@id/img_host"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_add_controller"
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
/>
|
||||
android:textAppearance="?android:textAppearanceMedium" />
|
||||
</RelativeLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
@@ -64,7 +62,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_i2c_device"
|
||||
android:inputType="number"
|
||||
android:minWidth="350dp"/>
|
||||
android:minWidth="350dp" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
@@ -80,7 +78,7 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_controller_address"
|
||||
android:minWidth="350dp"/>
|
||||
android:minWidth="350dp" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
@@ -97,7 +95,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_channels"
|
||||
android:inputType="number"
|
||||
android:minWidth="350dp"/>
|
||||
android:minWidth="350dp" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</LinearLayout>
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ LEDD Project
|
||||
~ Copyright (C) 2015 LEDD Team
|
||||
~
|
||||
@@ -18,15 +17,15 @@
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="true"
|
||||
android:minWidth="250dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="15dp">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="true"
|
||||
android:minWidth="250dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="15dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
@@ -36,7 +35,7 @@
|
||||
android:id="@+id/img_host"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:src="@drawable/ic_computer_black_48dp"/>
|
||||
android:src="@drawable/ic_computer_black_48dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -47,8 +46,7 @@
|
||||
android:layout_toRightOf="@id/img_host"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_choose_daemon"
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
/>
|
||||
android:textAppearance="?android:textAppearanceMedium" />
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="35dp"
|
||||
@@ -56,7 +54,7 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:indeterminate="true"/>
|
||||
android:indeterminate="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -70,7 +68,7 @@
|
||||
android:id="@+id/host_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"/>
|
||||
android:orientation="vertical" />
|
||||
|
||||
</ScrollView>
|
||||
|
||||
@@ -81,7 +79,7 @@
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/text_or"
|
||||
android:textAppearance="?android:textAppearanceMedium"/>
|
||||
android:textAppearance="?android:textAppearanceMedium" />
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/input_ip_layout"
|
||||
@@ -94,7 +92,7 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_daemon_ip_port"
|
||||
android:minWidth="250dp"/>
|
||||
android:minWidth="250dp" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</LinearLayout>
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ LEDD Project
|
||||
~ Copyright (C) 2015 LEDD Team
|
||||
~
|
||||
@@ -18,15 +17,15 @@
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="true"
|
||||
android:minWidth="250dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="15dp">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="true"
|
||||
android:minWidth="250dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="15dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
@@ -36,7 +35,7 @@
|
||||
android:id="@+id/img_host"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@drawable/ic_computer_black_48dp"/>
|
||||
android:src="@drawable/ic_computer_black_48dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -47,8 +46,7 @@
|
||||
android:layout_toRightOf="@id/img_host"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_choose_daemon"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
/>
|
||||
android:textAppearance="?android:textAppearanceSmall" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -68,14 +66,14 @@
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_add_circle_black_48dp"/>
|
||||
android:src="@drawable/ic_add_circle_black_48dp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner_daemon"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_toLeftOf="@id/imgbuttn_adddaemon"/>
|
||||
android:layout_toLeftOf="@id/imgbuttn_adddaemon" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -89,7 +87,7 @@
|
||||
android:id="@+id/img_controller"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@drawable/ic_developer_board_black_48dp"/>
|
||||
android:src="@drawable/ic_developer_board_black_48dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -100,8 +98,7 @@
|
||||
android:layout_toRightOf="@id/img_controller"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_choose_controller"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
/>
|
||||
android:textAppearance="?android:textAppearanceSmall" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -121,14 +118,14 @@
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_add_circle_black_48dp"/>
|
||||
android:src="@drawable/ic_add_circle_black_48dp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner_controller"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_toLeftOf="@id/imgbuttn_addcontroller"/>
|
||||
android:layout_toLeftOf="@id/imgbuttn_addcontroller" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -141,7 +138,7 @@
|
||||
android:id="@+id/img_stripe"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@drawable/ic_wb_iridescent_black_48dp"/>
|
||||
android:src="@drawable/ic_wb_iridescent_black_48dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -152,8 +149,7 @@
|
||||
android:layout_toRightOf="@id/img_stripe"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_stripe_properties"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
/>
|
||||
android:textAppearance="?android:textAppearanceSmall" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -171,7 +167,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_stripe_name"
|
||||
android:inputType="text"
|
||||
android:minEms="12"/>
|
||||
android:minEms="12" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
@@ -181,8 +177,7 @@
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_channel_mapping"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
/>
|
||||
android:textAppearance="?android:textAppearanceSmall" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -207,7 +202,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="2"
|
||||
android:hint="@string/hint_channel_r"
|
||||
android:inputType="number"/>
|
||||
android:inputType="number" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<ImageButton
|
||||
@@ -218,7 +213,7 @@
|
||||
android:layout_marginLeft="5dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_visibility_off_black_48dp"/>
|
||||
android:src="@drawable/ic_visibility_off_black_48dp" />
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/input_channel_g_lay"
|
||||
@@ -232,7 +227,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="2"
|
||||
android:hint="@string/hint_channel_g"
|
||||
android:inputType="number"/>
|
||||
android:inputType="number" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<ImageButton
|
||||
@@ -243,7 +238,7 @@
|
||||
android:layout_marginLeft="5dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_visibility_off_black_48dp"/>
|
||||
android:src="@drawable/ic_visibility_off_black_48dp" />
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/input_channel_b_lay"
|
||||
@@ -257,7 +252,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="2"
|
||||
android:hint="@string/hint_channel_b"
|
||||
android:inputType="number"/>
|
||||
android:inputType="number" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<ImageButton
|
||||
@@ -268,7 +263,7 @@
|
||||
android:layout_marginLeft="5dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_visibility_off_black_48dp"/>
|
||||
android:src="@drawable/ic_visibility_off_black_48dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ LEDD Project
|
||||
~ Copyright (C) 2015 LEDD Team
|
||||
~
|
||||
@@ -18,19 +17,19 @@
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="7dp">
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="7dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@drawable/ic_developer_board_black_48dp"/>
|
||||
android:src="@drawable/ic_developer_board_black_48dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_host"
|
||||
@@ -43,6 +42,6 @@
|
||||
android:gravity="center_vertical"
|
||||
android:text=""
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
android:textColor="@color/primaryColorDark"/>
|
||||
android:textColor="@color/primaryColorDark" />
|
||||
|
||||
</LinearLayout>
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ LEDD Project
|
||||
~ Copyright (C) 2015 LEDD Team
|
||||
~
|
||||
@@ -17,12 +16,11 @@
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<CheckedTextView
|
||||
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@android:id/text1"
|
||||
style="?android:attr/spinnerDropDownItemStyle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||
android:ellipsize="marquee"
|
||||
android:singleLine="true"
|
||||
android:textColor="@android:color/black"/>
|
||||
android:maxLines="1"
|
||||
android:textColor="@android:color/black" />
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ LEDD Project
|
||||
~ Copyright (C) 2015 LEDD Team
|
||||
~
|
||||
@@ -17,13 +16,12 @@
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<TextView
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@android:id/text1"
|
||||
style="?android:attr/spinnerItemStyle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:textAlignment="inherit"
|
||||
android:textColor="@android:color/black"/>
|
||||
android:textColor="@android:color/black" />
|
@@ -15,13 +15,13 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.1.0'
|
||||
classpath 'com.android.tools.build:gradle:2.2.3'
|
||||
}
|
||||
}
|
||||
|
||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
#Sat Apr 30 20:15:11 CEST 2016
|
||||
#Tue Jan 31 15:43:37 CET 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
|
||||
|
Reference in New Issue
Block a user