updated deps and code to a more recent state
This commit is contained in:
@@ -26,7 +26,7 @@ buildscript {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
|
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.neenbedankt.gradle.plugins:android-apt:1.8'
|
||||||
classpath 'com.github.JakeWharton:sdk-manager-plugin:master'
|
classpath 'com.github.JakeWharton:sdk-manager-plugin:master'
|
||||||
}
|
}
|
||||||
@@ -44,49 +44,56 @@ repositories {
|
|||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 25
|
||||||
buildToolsVersion '23.0.3'
|
buildToolsVersion '25.0.2'
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.idlegandalf.ledd"
|
applicationId "com.idlegandalf.ledd"
|
||||||
minSdkVersion 18
|
minSdkVersion 18
|
||||||
targetSdkVersion 23
|
targetSdkVersion 25
|
||||||
versionCode System.getenv("BUILD_NUMBER") as Integer ?: 50
|
versionCode System.getenv("BUILD_NUMBER") as Integer ?: 50
|
||||||
versionName "1.0.4-SNAPSHOT"
|
versionName "1.0.4-SNAPSHOT"
|
||||||
archivesBaseName = "LedD-" + versionName + "-" + versionCode
|
archivesBaseName = "LedD-" + versionName + "-" + versionCode
|
||||||
manifestPlaceholders = [HOCKEYAPP_APP_ID: "7febd1d2266a4f0c81667ca4e3d11fd3"]
|
manifestPlaceholders = [HOCKEYAPP_APP_ID: "7febd1d2266a4f0c81667ca4e3d11fd3"]
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
zipAlignEnabled true
|
zipAlignEnabled true
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug {
|
||||||
|
zipAlignEnabled true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_7
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.android.support:appcompat-v7:23.4.0'
|
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
compile 'com.android.support:support-v4:23.4.0'
|
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.squareup.okhttp:okhttp:2.7.5'
|
||||||
compile 'com.jakewharton.timber:timber:4.1.2'
|
compile 'com.jakewharton.timber:timber:4.1.2'
|
||||||
compile 'com.google.code.gson:gson:2.6.2'
|
compile 'com.google.code.gson:gson:2.8.0'
|
||||||
compile 'com.jakewharton:butterknife:8.0.1'
|
compile 'com.jakewharton:butterknife:8.5.1'
|
||||||
apt 'com.jakewharton:butterknife-compiler:8.0.1'
|
compile 'com.koushikdutta.async:androidasync:2.1.9'
|
||||||
compile 'net.hockeyapp.android:HockeySDK:4.0.0'
|
compile 'com.android.support:design:25.1.1'
|
||||||
compile 'com.koushikdutta.async:androidasync:2.1.7'
|
compile 'com.larswerkman:HoloColorPicker:1.5@aar'
|
||||||
compile 'com.android.support:design:23.4.0'
|
compile 'com.google.guava:guava:21.0'
|
||||||
compile 'com.github.LED-Freaks:HoloColorPicker:master-SNAPSHOT'
|
|
||||||
compile 'com.google.guava:guava:19.0'
|
|
||||||
compile 'com.thetransactioncompany:jsonrpc2-base:1.38'
|
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
|
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);
|
ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
|
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
|
||||||
if (networkInfo == null || !networkInfo.isConnected() || networkInfo.getType() != ConnectivityManager.TYPE_WIFI) {
|
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() {
|
Snackbar.make(scrollView, R.string.snackbar_no_wlan, Snackbar.LENGTH_INDEFINITE).setAction("RETRY", v -> {
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
refreshStripes();
|
refreshStripes();
|
||||||
}
|
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,13 +128,10 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||||||
colorPicker.addValueBar(valueBar);
|
colorPicker.addValueBar(valueBar);
|
||||||
colorPicker.setShowOldCenterColor(false);
|
colorPicker.setShowOldCenterColor(false);
|
||||||
|
|
||||||
colorPicker.setOnColorChangedListener(new ColorPicker.OnColorChangedListener() {
|
colorPicker.setOnColorChangedListener(i -> {
|
||||||
@Override
|
|
||||||
public void onColorChanged(int i) {
|
|
||||||
if (mCurrentStripe != null && limiter.check() && !autoColorSet) {
|
if (mCurrentStripe != null && limiter.check() && !autoColorSet) {
|
||||||
mCurrentStripe.setColor(i);
|
mCurrentStripe.setColor(i);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
@@ -380,9 +374,7 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<LedStripe> stripes) {
|
public void onSuccess(List<LedStripe> stripes) {
|
||||||
ledStripes = stripes;
|
ledStripes = stripes;
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
PrimaryDrawerItem nDaemonMenu = null;
|
PrimaryDrawerItem nDaemonMenu = null;
|
||||||
long selectedItemId = -1;
|
long selectedItemId = -1;
|
||||||
for (IDrawerItem drawerItem : mDaemons) {
|
for (IDrawerItem drawerItem : mDaemons) {
|
||||||
@@ -448,12 +440,7 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||||||
final SecondarySwitchDrawerItem cItem = (SecondarySwitchDrawerItem) sItem;
|
final SecondarySwitchDrawerItem cItem = (SecondarySwitchDrawerItem) sItem;
|
||||||
cItem.withSwitchEnabled(true);
|
cItem.withSwitchEnabled(true);
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(() -> mDrawer.updateItem(cItem));
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mDrawer.updateItem(cItem);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -503,9 +490,7 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||||||
final HSV cColor = stripe.getColor();
|
final HSV cColor = stripe.getColor();
|
||||||
final int color = Color.HSVToColor(new float[]{(float) cColor.getHue(), (float) cColor.getSaturation(), (float) cColor.getValue()});
|
final int color = Color.HSVToColor(new float[]{(float) cColor.getHue(), (float) cColor.getSaturation(), (float) cColor.getValue()});
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
colorPicker.setColor(color);
|
colorPicker.setColor(color);
|
||||||
autoColorSet = false;
|
autoColorSet = false;
|
||||||
|
|
||||||
@@ -515,7 +500,6 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||||||
if (fItem != null)
|
if (fItem != null)
|
||||||
((SecondarySwitchDrawerItem) fItem).withSwitchEnabled(true);
|
((SecondarySwitchDrawerItem) fItem).withSwitchEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,7 +85,7 @@ public class ColorApplication extends Application {
|
|||||||
dHelper.teardown();
|
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() {
|
public void onResume() {
|
||||||
|
@@ -140,17 +140,12 @@ public class AddControllerDialog extends DialogFragment implements DialogInterfa
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
|
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v -> {
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
AddStripeDialog.instance.onResume();
|
AddStripeDialog.instance.onResume();
|
||||||
alertDialog.dismiss();
|
alertDialog.dismiss();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(v -> {
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (i2cText.getText().toString().isEmpty() || !isNumeric(i2cText.getText().toString())) {
|
if (i2cText.getText().toString().isEmpty() || !isNumeric(i2cText.getText().toString())) {
|
||||||
i2cLayout.setError("No valid i2c device number");
|
i2cLayout.setError("No valid i2c device number");
|
||||||
return;
|
return;
|
||||||
@@ -178,12 +173,7 @@ public class AddControllerDialog extends DialogFragment implements DialogInterfa
|
|||||||
helper.addController(c, new AddControllerCallback() {
|
helper.addController(c, new AddControllerCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onControllerAdded(final Controller controller) {
|
public void onControllerAdded(final Controller controller) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
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());
|
||||||
@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();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
dDaemon.getControllers().add(controller);
|
dDaemon.getControllers().add(controller);
|
||||||
dismiss();
|
dismiss();
|
||||||
@@ -191,30 +181,19 @@ public class AddControllerDialog extends DialogFragment implements DialogInterfa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAddFailed(final int code, final String msg) {
|
public void onAddFailed(final int code, final String msg) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
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());
|
||||||
@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();
|
AddStripeDialog.instance.onResume();
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnectionFailed(final String message) {
|
public void onConnectionFailed(final String message) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
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());
|
||||||
@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();
|
AddStripeDialog.instance.onResume();
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -108,18 +108,13 @@ public class AddDaemonDialog extends DialogFragment implements DialogInterface.O
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
|
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v -> {
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
mNsdManager.stopServiceDiscovery(AddDaemonDialog.this);
|
mNsdManager.stopServiceDiscovery(AddDaemonDialog.this);
|
||||||
AddStripeDialog.instance.onResume();
|
AddStripeDialog.instance.onResume();
|
||||||
alertDialog.dismiss();
|
alertDialog.dismiss();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(v -> {
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
String strIp = ip.getText().toString();
|
String strIp = ip.getText().toString();
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
@@ -148,7 +143,6 @@ public class AddDaemonDialog extends DialogFragment implements DialogInterface.O
|
|||||||
} else {
|
} else {
|
||||||
ip_lay.setError("No valid ip address");
|
ip_lay.setError("No valid ip address");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,9 +189,7 @@ public class AddDaemonDialog extends DialogFragment implements DialogInterface.O
|
|||||||
final LedDDaemon nLedDDaemon = new LedDDaemon(serviceInfo.getHost().getHostAddress(), serviceInfo.getPort());
|
final LedDDaemon nLedDDaemon = new LedDDaemon(serviceInfo.getHost().getHostAddress(), serviceInfo.getPort());
|
||||||
|
|
||||||
if (!ledDDaemons.contains(nLedDDaemon)) {
|
if (!ledDDaemons.contains(nLedDDaemon)) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
View v = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout
|
View v = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout
|
||||||
.host_row, hostContainer, false);
|
.host_row, hostContainer, false);
|
||||||
|
|
||||||
@@ -211,23 +203,20 @@ public class AddDaemonDialog extends DialogFragment implements DialogInterface.O
|
|||||||
host.setEnabled(false);
|
host.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
View.OnClickListener listener = new View.OnClickListener() {
|
View.OnClickListener listener = v1 -> {
|
||||||
@Override
|
if (v1.isEnabled()) {
|
||||||
public void onClick(View v) {
|
|
||||||
if (v.isEnabled()) {
|
|
||||||
LedDDaemon d;
|
LedDDaemon d;
|
||||||
|
|
||||||
if (v instanceof TextView) {
|
if (v1 instanceof TextView) {
|
||||||
d = (LedDDaemon) ((LinearLayout) v.getParent()).getTag();
|
d = (LedDDaemon) ((LinearLayout) v1.getParent()).getTag();
|
||||||
} else {
|
} else {
|
||||||
d = (LedDDaemon) v.getTag();
|
d = (LedDDaemon) v1.getTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
addDaemon(d);
|
addDaemon(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
v.setOnClickListener(listener);
|
v.setOnClickListener(listener);
|
||||||
@@ -237,7 +226,6 @@ public class AddDaemonDialog extends DialogFragment implements DialogInterface.O
|
|||||||
|
|
||||||
ledDDaemons.add(nLedDDaemon);
|
ledDDaemons.add(nLedDDaemon);
|
||||||
hostContainer.addView(v);
|
hostContainer.addView(v);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -286,25 +274,15 @@ public class AddDaemonDialog extends DialogFragment implements DialogInterface.O
|
|||||||
ColorApplication.getInstance().getHelperForDaemon(ledDDaemon).discover(new DiscoverCallback() {
|
ColorApplication.getInstance().getHelperForDaemon(ledDDaemon).discover(new DiscoverCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onConnectionFailed(final String message) {
|
public void onConnectionFailed(final String message) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
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());
|
||||||
@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();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
AddStripeDialog.instance.onResume();
|
AddStripeDialog.instance.onResume();
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDiscoverSuccessfully(final String version) {
|
public void onDiscoverSuccessfully(final String version) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(() -> Snackbar.make(((ViewGroup) getActivity().getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0),
|
||||||
@Override
|
getActivity().getString(R.string.snackbar_added_daemon_version, version), Snackbar.LENGTH_LONG).show());
|
||||||
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();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
((ColorActivity) getActivity()).refreshStripes();
|
((ColorActivity) getActivity()).refreshStripes();
|
||||||
AddStripeDialog.instance.onResume();
|
AddStripeDialog.instance.onResume();
|
||||||
|
@@ -104,16 +104,9 @@ public class AddProfileDialog extends DialogFragment implements DialogInterface.
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
|
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v -> alertDialog.dismiss());
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
alertDialog.dismiss();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(v -> {
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (nameText.getText().toString().isEmpty()) {
|
if (nameText.getText().toString().isEmpty()) {
|
||||||
nameLayout.setError("Please enter a name");
|
nameLayout.setError("Please enter a name");
|
||||||
return;
|
return;
|
||||||
@@ -144,7 +137,6 @@ public class AddProfileDialog extends DialogFragment implements DialogInterface.
|
|||||||
((ColorActivity) getActivity()).addProfile(profile);
|
((ColorActivity) getActivity()).addProfile(profile);
|
||||||
Toast.makeText(getActivity(), "Added profile " + nameText.getText().toString(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "Added profile " + nameText.getText().toString(), Toast.LENGTH_SHORT).show();
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -205,9 +205,7 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ImageButton.OnClickListener imgListener = new View.OnClickListener() {
|
ImageButton.OnClickListener imgListener = v -> {
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.imgbuttn_togglechannel_r:
|
case R.id.imgbuttn_togglechannel_r:
|
||||||
testChannel(channelR, (ImageButton) v);
|
testChannel(channelR, (ImageButton) v);
|
||||||
@@ -219,23 +217,15 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
|||||||
testChannel(channelB, (ImageButton) v);
|
testChannel(channelB, (ImageButton) v);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
channelRBttn.setOnClickListener(imgListener);
|
channelRBttn.setOnClickListener(imgListener);
|
||||||
channelGBttn.setOnClickListener(imgListener);
|
channelGBttn.setOnClickListener(imgListener);
|
||||||
channelBBttn.setOnClickListener(imgListener);
|
channelBBttn.setOnClickListener(imgListener);
|
||||||
|
|
||||||
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
|
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v -> alertDialog.dismiss());
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
alertDialog.dismiss();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(v -> {
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (!mDaemonSelected) {
|
if (!mDaemonSelected) {
|
||||||
Toast.makeText(getActivity(), "Please select Daemon and Controller", Toast.LENGTH_LONG).show();
|
Toast.makeText(getActivity(), "Please select Daemon and Controller", Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@@ -265,12 +255,7 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
|||||||
ColorActivity activity = ((ColorActivity) getActivity());
|
ColorActivity activity = ((ColorActivity) getActivity());
|
||||||
activity.refreshStripes();
|
activity.refreshStripes();
|
||||||
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
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());
|
||||||
@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();
|
dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,17 +266,11 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnectionFailed(final String message) {
|
public void onConnectionFailed(final String message) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
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());
|
||||||
@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();
|
dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
daemonArrayAdapter = new ArrayAdapter<>(getActivity().getApplicationContext(), R.layout.spinner_item);
|
daemonArrayAdapter = new ArrayAdapter<>(getActivity().getApplicationContext(), R.layout.spinner_item);
|
||||||
@@ -359,9 +338,7 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
ColorApplication.getInstance().onResume();
|
ColorApplication.getInstance().onResume();
|
||||||
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (daemonArrayAdapter != null) {
|
if (daemonArrayAdapter != null) {
|
||||||
daemonArrayAdapter.clear();
|
daemonArrayAdapter.clear();
|
||||||
daemonArrayAdapter.addAll(ColorApplication.getInstance().getDaemons());
|
daemonArrayAdapter.addAll(ColorApplication.getInstance().getDaemons());
|
||||||
@@ -370,7 +347,6 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
|||||||
if (controllerArrayAdapter != null && mDaemonSelected) {
|
if (controllerArrayAdapter != null && mDaemonSelected) {
|
||||||
refreshController((LedDDaemon) daemonSpinner.getSelectedItem());
|
refreshController((LedDDaemon) daemonSpinner.getSelectedItem());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,12 +385,9 @@ public class AddStripeDialog extends DialogFragment implements DialogInterface.O
|
|||||||
helper.getStripes(new StripesCallback() {
|
helper.getStripes(new StripesCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<LedStripe> stripes) {
|
public void onSuccess(List<LedStripe> stripes) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
controllerArrayAdapter.addAll(ledDDaemon.getControllers());
|
controllerArrayAdapter.addAll(ledDDaemon.getControllers());
|
||||||
toggleAll(stripeMapping, true);
|
toggleAll(stripeMapping, true);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
<!--
|
|
||||||
~ LEDD Project
|
~ LEDD Project
|
||||||
~ Copyright (C) 2015 LEDD Team
|
~ Copyright (C) 2015 LEDD Team
|
||||||
~
|
~
|
||||||
@@ -47,8 +46,7 @@
|
|||||||
android:layout_toRightOf="@id/img_host"
|
android:layout_toRightOf="@id/img_host"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/text_add_controller"
|
android:text="@string/text_add_controller"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium" />
|
||||||
/>
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
<android.support.design.widget.TextInputLayout
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
<!--
|
|
||||||
~ LEDD Project
|
~ LEDD Project
|
||||||
~ Copyright (C) 2015 LEDD Team
|
~ Copyright (C) 2015 LEDD Team
|
||||||
~
|
~
|
||||||
@@ -47,8 +46,7 @@
|
|||||||
android:layout_toRightOf="@id/img_host"
|
android:layout_toRightOf="@id/img_host"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/text_choose_daemon"
|
android:text="@string/text_choose_daemon"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium" />
|
||||||
/>
|
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:layout_width="35dp"
|
android:layout_width="35dp"
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
<!--
|
|
||||||
~ LEDD Project
|
~ LEDD Project
|
||||||
~ Copyright (C) 2015 LEDD Team
|
~ Copyright (C) 2015 LEDD Team
|
||||||
~
|
~
|
||||||
@@ -47,8 +46,7 @@
|
|||||||
android:layout_toRightOf="@id/img_host"
|
android:layout_toRightOf="@id/img_host"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/text_choose_daemon"
|
android:text="@string/text_choose_daemon"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:textAppearance="?android:textAppearanceSmall" />
|
||||||
/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@@ -100,8 +98,7 @@
|
|||||||
android:layout_toRightOf="@id/img_controller"
|
android:layout_toRightOf="@id/img_controller"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/text_choose_controller"
|
android:text="@string/text_choose_controller"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:textAppearance="?android:textAppearanceSmall" />
|
||||||
/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@@ -152,8 +149,7 @@
|
|||||||
android:layout_toRightOf="@id/img_stripe"
|
android:layout_toRightOf="@id/img_stripe"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/text_stripe_properties"
|
android:text="@string/text_stripe_properties"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:textAppearance="?android:textAppearanceSmall" />
|
||||||
/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@@ -181,8 +177,7 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/text_channel_mapping"
|
android:text="@string/text_channel_mapping"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:textAppearance="?android:textAppearanceSmall" />
|
||||||
/>
|
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
<!--
|
|
||||||
~ LEDD Project
|
~ LEDD Project
|
||||||
~ Copyright (C) 2015 LEDD Team
|
~ Copyright (C) 2015 LEDD Team
|
||||||
~
|
~
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
<!--
|
|
||||||
~ LEDD Project
|
~ LEDD Project
|
||||||
~ Copyright (C) 2015 LEDD Team
|
~ Copyright (C) 2015 LEDD Team
|
||||||
~
|
~
|
||||||
@@ -17,12 +16,11 @@
|
|||||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
~ 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"
|
android:id="@android:id/text1"
|
||||||
style="?android:attr/spinnerDropDownItemStyle"
|
style="?android:attr/spinnerDropDownItemStyle"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:singleLine="true"
|
android:maxLines="1"
|
||||||
android:textColor="@android:color/black" />
|
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
|
~ LEDD Project
|
||||||
~ Copyright (C) 2015 LEDD Team
|
~ Copyright (C) 2015 LEDD Team
|
||||||
~
|
~
|
||||||
@@ -17,13 +16,12 @@
|
|||||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
~ 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"
|
android:id="@android:id/text1"
|
||||||
style="?android:attr/spinnerItemStyle"
|
style="?android:attr/spinnerItemStyle"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:singleLine="true"
|
android:maxLines="1"
|
||||||
android:textAlignment="inherit"
|
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
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* 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 {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
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
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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