Updated dependencies. Migrated to androidx (mostly). Stripping JSONRPC
next.
This commit is contained in:
parent
97b1f37164
commit
ac5cb93fd9
|
@ -23,24 +23,17 @@ buildscript {
|
|||
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
|
||||
classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.jakewharton.hugo'
|
||||
apply plugin: 'com.github.ben-manes.versions'
|
||||
|
||||
repositories {
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '25.0.2'
|
||||
compileSdkVersion 28
|
||||
buildToolsVersion '28.0.3'
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
|
@ -48,48 +41,31 @@ android {
|
|||
|
||||
defaultConfig {
|
||||
applicationId "com.idlegandalf.ledd"
|
||||
minSdkVersion 18
|
||||
targetSdkVersion 25
|
||||
versionCode System.getenv("BUILD_NUMBER") as Integer ?: 50
|
||||
versionName "1.0.4-SNAPSHOT"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 28
|
||||
versionCode System.getenv("BUILD_NUMBER") as Integer ?: 100
|
||||
versionName "2.0.0-SNAPSHOT"
|
||||
archivesBaseName = "LedD-" + versionName + "-" + versionCode
|
||||
manifestPlaceholders = [HOCKEYAPP_APP_ID: "7febd1d2266a4f0c81667ca4e3d11fd3"]
|
||||
jackOptions.enabled true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
zipAlignEnabled true
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
|
||||
debug {
|
||||
zipAlignEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility 1.8
|
||||
sourceCompatibility 1.8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||
compile 'com.android.support:appcompat-v7:25.3.1'
|
||||
compile 'com.android.support:support-v4:25.3.1'
|
||||
compile 'com.squareup.okhttp:okhttp:2.7.5'
|
||||
compile 'com.jakewharton.timber:timber:4.5.1'
|
||||
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.3.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.8.1@aar') {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.koushikdutta.async:androidasync:2.2.1'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
|
||||
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||
implementation 'com.google.code.gson:gson:2.8.5'
|
||||
implementation 'com.jakewharton:butterknife:8.8.1'
|
||||
implementation 'com.github.madrapps:pikolo:1.1.6'
|
||||
implementation 'com.google.guava:guava:27.0-android'
|
||||
implementation('com.mikepenz:materialdrawer:6.1.1@aar') {
|
||||
transitive = true
|
||||
}
|
||||
provided 'org.projectlombok:lombok:1.16.12'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.4'
|
||||
compileOnly 'org.projectlombok:lombok:1.18.4'
|
||||
}
|
||||
|
|
|
@ -57,9 +57,6 @@
|
|||
</activity>
|
||||
|
||||
<service android:name=".services.ColorService"/>
|
||||
<meta-data
|
||||
android:name="net.hockeyapp.android.appIdentifier"
|
||||
android:value="${HOCKEYAPP_APP_ID}" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
|
@ -28,9 +28,6 @@ import android.net.NetworkInfo;
|
|||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.SparseArray;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
|
@ -39,6 +36,7 @@ import android.view.View;
|
|||
import android.widget.CompoundButton;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.google.gson.Gson;
|
||||
import com.idlegandalf.ledd.callbacks.ReceiveColorCallback;
|
||||
|
@ -51,9 +49,8 @@ import com.idlegandalf.ledd.fragments.AddProfileDialog;
|
|||
import com.idlegandalf.ledd.fragments.AddStripeDialog;
|
||||
import com.idlegandalf.ledd.helper.LedDHelper;
|
||||
import com.idlegandalf.ledd.utils.RateLimiter;
|
||||
import com.larswerkman.holocolorpicker.ColorPicker;
|
||||
import com.larswerkman.holocolorpicker.SaturationBar;
|
||||
import com.larswerkman.holocolorpicker.ValueBar;
|
||||
import com.madrapps.pikolo.HSLColorPicker;
|
||||
import com.madrapps.pikolo.listeners.SimpleColorSelectionListener;
|
||||
import com.mikepenz.materialdrawer.Drawer;
|
||||
import com.mikepenz.materialdrawer.DrawerBuilder;
|
||||
import com.mikepenz.materialdrawer.holder.BadgeStyle;
|
||||
|
@ -65,13 +62,12 @@ import com.mikepenz.materialdrawer.model.SecondarySwitchDrawerItem;
|
|||
import com.mikepenz.materialdrawer.model.SwitchDrawerItem;
|
||||
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
|
||||
|
||||
import net.hockeyapp.android.CrashManager;
|
||||
import net.hockeyapp.android.UpdateManager;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import timber.log.Timber;
|
||||
|
@ -83,11 +79,7 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||
@BindView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
@BindView(R.id.picker)
|
||||
ColorPicker colorPicker;
|
||||
@BindView(R.id.saturationbar)
|
||||
SaturationBar saturationBar;
|
||||
@BindView(R.id.valuebar)
|
||||
ValueBar valueBar;
|
||||
HSLColorPicker colorPicker;
|
||||
Drawer mDrawer;
|
||||
private List<IDrawerItem> mDaemons;
|
||||
private refreshDaemonsListener daemonsListener;
|
||||
|
@ -124,17 +116,15 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||
mDaemons = new ArrayList<>();
|
||||
limiter = new RateLimiter(30.0, 1000);
|
||||
|
||||
colorPicker.addSaturationBar(saturationBar);
|
||||
colorPicker.addValueBar(valueBar);
|
||||
colorPicker.setShowOldCenterColor(false);
|
||||
|
||||
colorPicker.setOnColorChangedListener(i -> {
|
||||
if (mCurrentStripe != null && limiter.check() && !autoColorSet) {
|
||||
mCurrentStripe.setColor(i);
|
||||
colorPicker.setColorSelectionListener(new SimpleColorSelectionListener() {
|
||||
@Override
|
||||
public void onColorSelected(int color) {
|
||||
if (mCurrentStripe != null && limiter.check() && !autoColorSet) {
|
||||
mCurrentStripe.setColor(color);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setSupportActionBar(toolbar);
|
||||
toolbar.setTitle(R.string.app_name);
|
||||
|
||||
mDrawer = new DrawerBuilder()
|
||||
|
@ -182,7 +172,6 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||
daemonsListener = new refreshDaemonsListener();
|
||||
registerReceiver(daemonsListener, new IntentFilter(ColorApplication.INTENT_ACTION_REFRESH));
|
||||
|
||||
checkForUpdates();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -219,8 +208,8 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||
if (stripe != null) {
|
||||
if (isChecked) {
|
||||
if (stripe == mCurrentStripe) {
|
||||
if (colorPicker.getColor() != Color.BLACK)
|
||||
stripe.setColor(colorPicker.getColor());
|
||||
if (colorPicker.getSolidColor() != Color.BLACK)
|
||||
stripe.setColor(colorPicker.getSolidColor());
|
||||
else {
|
||||
colorPicker.setColor(Color.WHITE);
|
||||
}
|
||||
|
@ -253,7 +242,6 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
unregisterManagers();
|
||||
ColorApplication.getInstance().teardown();
|
||||
unregisterReceiver(daemonsListener);
|
||||
|
||||
|
@ -268,7 +256,6 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
ColorApplication.getInstance().teardown();
|
||||
unregisterManagers();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -282,7 +269,6 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||
} else {
|
||||
fromOnCreate = false;
|
||||
}
|
||||
checkForCrashes();
|
||||
}
|
||||
|
||||
|
||||
|
@ -395,13 +381,13 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||
lastStripeId = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getInt("lastStripe", -1);
|
||||
}
|
||||
|
||||
List<IDrawerItem> mStripes = new ArrayList<>();
|
||||
for (LedStripe stripe : ledStripes) {
|
||||
final SwitchDrawerItem sItem = new SecondarySwitchDrawerItem()
|
||||
.withName(stripe.getName())
|
||||
.withTag(stripe.getId())
|
||||
.withIcon(R.drawable.ic_wb_iridescent_black_48dp)
|
||||
.withOnCheckedChangeListener(ColorActivity.this);
|
||||
List<IDrawerItem> mStripes = new ArrayList<>();
|
||||
for (LedStripe stripe : ledStripes) {
|
||||
final SwitchDrawerItem sItem = new SwitchDrawerItem()
|
||||
.withName(stripe.getName())
|
||||
.withTag(stripe.getId())
|
||||
.withIcon(R.drawable.ic_wb_iridescent_black_48dp)
|
||||
.withOnCheckedChangeListener(ColorActivity.this);
|
||||
|
||||
mStripes.add(sItem);
|
||||
|
||||
|
@ -411,19 +397,19 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||
}
|
||||
}
|
||||
|
||||
nDaemonMenu.withSubItems(mStripes);
|
||||
nDaemonMenu.withBadge(String.valueOf(mStripes.size()));
|
||||
//noinspection deprecation
|
||||
nDaemonMenu.withBadgeStyle(new BadgeStyle().withColor(getResources().getColor(R.color.material_drawer_accent)).withTextColor(Color.WHITE));
|
||||
mDrawer.updateItem(nDaemonMenu);
|
||||
if (selectedItemId != -1)
|
||||
mDrawer.setSelection(selectedItemId);
|
||||
nDaemonMenu.withSubItems(mStripes);
|
||||
nDaemonMenu.withBadge(String.valueOf(mStripes.size()));
|
||||
//noinspection deprecation
|
||||
nDaemonMenu.withBadgeStyle(new BadgeStyle().withColor(getResources().getColor(R.color.material_drawer_accent)).withTextColor(Color.WHITE));
|
||||
mDrawer.updateItem(nDaemonMenu);
|
||||
if (selectedItemId != -1)
|
||||
mDrawer.setSelection(selectedItemId);
|
||||
|
||||
//noinspection ConstantConditions
|
||||
Snackbar.make(findViewById(android.R.id.content), R.string.snackbar_stripes_reloaded, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
//noinspection ConstantConditions
|
||||
Snackbar.make(findViewById(android.R.id.content), R.string.snackbar_stripes_reloaded, Snackbar.LENGTH_LONG).show();
|
||||
});
|
||||
|
||||
|
||||
for (LedStripe stripe : ledStripes) {
|
||||
stripe.getColor(new ReceiveColorCallback() {
|
||||
@Override
|
||||
|
@ -530,19 +516,6 @@ public class ColorActivity extends AppCompatActivity implements Drawer.OnDrawerI
|
|||
return null;
|
||||
}
|
||||
|
||||
private void checkForCrashes() {
|
||||
CrashManager.register(this);
|
||||
}
|
||||
|
||||
private void checkForUpdates() {
|
||||
// Remove this for store builds!
|
||||
UpdateManager.register(this);
|
||||
}
|
||||
|
||||
private void unregisterManagers() {
|
||||
UpdateManager.unregister();
|
||||
}
|
||||
|
||||
protected class refreshDaemonsListener extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,7 +21,6 @@ package com.idlegandalf.ledd;
|
|||
import android.app.Application;
|
||||
import android.content.Intent;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
@ -34,6 +33,8 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
public class ColorApplication extends Application {
|
||||
public static final String TAG = "LedD";
|
||||
public static final String INTENT_ACTION_REFRESH = "com.idlegandalf.ledd.action.refreshStripes";
|
||||
|
@ -74,10 +75,7 @@ public class ColorApplication extends Application {
|
|||
}
|
||||
|
||||
public List<LedDDaemon> getDaemons() {
|
||||
ArrayList<LedDDaemon> ledDDaemons = new ArrayList<>();
|
||||
ledDDaemons.addAll(ledDHelpers.keySet());
|
||||
|
||||
return ledDDaemons;
|
||||
return new ArrayList<>(ledDHelpers.keySet());
|
||||
}
|
||||
|
||||
public void teardown() {
|
||||
|
@ -92,7 +90,7 @@ public class ColorApplication extends Application {
|
|||
TypeToken<Set<LedDDaemon>>() {
|
||||
}.getType());
|
||||
|
||||
Log.i(ColorApplication.TAG, "Loaded " + ledDDaemons.size() + " Daemons from preferences");
|
||||
Timber.i("Loaded " + ledDDaemons.size() + " Daemons from preferences");
|
||||
|
||||
for (final LedDDaemon ledDDaemon : ledDDaemons) {
|
||||
final LedDHelper helper = new LedDHelper(ledDDaemon, getApplicationContext());
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* LEDD Project
|
||||
* Copyright (C) 2015 LEDD Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.idlegandalf.ledd;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import com.idlegandalf.ledd.fragments.SettingsFragment;
|
||||
|
||||
public class SettingsActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
// Display the fragment as the main content.
|
||||
getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit();
|
||||
}
|
||||
}
|
|
@ -50,10 +50,7 @@ public class LedDDaemon {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof LedDDaemon) {
|
||||
if (address.equals(((LedDDaemon) o).address) && port == ((LedDDaemon) o).port) return true;
|
||||
}
|
||||
return false;
|
||||
return o instanceof LedDDaemon && address.equals(((LedDDaemon) o).address) && port == ((LedDDaemon) o).port;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,8 +22,6 @@ import android.app.Dialog;
|
|||
import android.app.DialogFragment;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -31,6 +29,8 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.google.gson.Gson;
|
||||
import com.idlegandalf.ledd.ColorApplication;
|
||||
import com.idlegandalf.ledd.R;
|
||||
|
|
|
@ -25,8 +25,6 @@ import android.content.DialogInterface;
|
|||
import android.net.nsd.NsdManager;
|
||||
import android.net.nsd.NsdServiceInfo;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -38,6 +36,8 @@ import android.widget.EditText;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.google.common.net.InetAddresses;
|
||||
import com.idlegandalf.ledd.ColorActivity;
|
||||
import com.idlegandalf.ledd.ColorApplication;
|
||||
|
|
|
@ -22,7 +22,6 @@ import android.app.Dialog;
|
|||
import android.app.DialogFragment;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -33,6 +32,7 @@ import android.widget.EditText;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.idlegandalf.ledd.ColorActivity;
|
||||
import com.idlegandalf.ledd.R;
|
||||
import com.idlegandalf.ledd.components.LedStripe;
|
||||
|
|
|
@ -23,8 +23,6 @@ import android.app.Dialog;
|
|||
import android.app.DialogFragment;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -39,6 +37,8 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.google.gson.Gson;
|
||||
import com.idlegandalf.ledd.ColorActivity;
|
||||
import com.idlegandalf.ledd.ColorApplication;
|
||||
|
|
|
@ -23,9 +23,7 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
|
||||
import com.idlegandalf.ledd.ColorApplication;
|
||||
import com.idlegandalf.ledd.callbacks.AddControllerCallback;
|
||||
import com.idlegandalf.ledd.callbacks.AddStripeCallback;
|
||||
import com.idlegandalf.ledd.callbacks.DiscoverCallback;
|
||||
|
@ -53,6 +51,8 @@ import java.util.Map;
|
|||
import java.util.UUID;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
public class LedDHelper {
|
||||
final String ACTION_SETCOLOR = "set_color";
|
||||
final String ACTION_GETCOLOR = "get_color";
|
||||
|
@ -70,7 +70,7 @@ public class LedDHelper {
|
|||
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName className, IBinder service) {
|
||||
Log.d(ColorApplication.TAG, "ColorService bound!");
|
||||
Timber.d("ColorService bound!");
|
||||
requestWorker = new Worker<>(dRequests, (ColorService.ColorBinder) service, ledDDaemon);
|
||||
mBound = true;
|
||||
new Thread(requestWorker).start();
|
||||
|
|
|
@ -31,7 +31,6 @@ import com.koushikdutta.async.AsyncSocket;
|
|||
import com.koushikdutta.async.ByteBufferList;
|
||||
import com.koushikdutta.async.DataEmitter;
|
||||
import com.koushikdutta.async.Util;
|
||||
import com.koushikdutta.async.callback.ConnectCallback;
|
||||
import com.koushikdutta.async.callback.DataCallback;
|
||||
import com.thetransactioncompany.jsonrpc2.JSONRPC2ParseException;
|
||||
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
|
||||
|
@ -55,7 +54,7 @@ public class ColorService extends Service {
|
|||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
return -1;
|
||||
return Service.START_STICKY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -136,32 +135,26 @@ public class ColorService extends Service {
|
|||
null);
|
||||
sendableHashMap.put((String) sendable.getRequest().getID(), sendable);
|
||||
if (!poolExecutor.isTerminating() && !poolExecutor.isTerminated())
|
||||
timeoutHashMap.put((String) sendable.getRequest().getID(), poolExecutor.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
sendable.onNoResponse();
|
||||
timeoutHashMap.remove(sendable.getRequest().getID());
|
||||
sendableHashMap.remove(sendable.getRequest().getID());
|
||||
}
|
||||
timeoutHashMap.put((String) sendable.getRequest().getID(), poolExecutor.schedule(() -> {
|
||||
sendable.onNoResponse();
|
||||
timeoutHashMap.remove(sendable.getRequest().getID());
|
||||
sendableHashMap.remove(sendable.getRequest().getID());
|
||||
}, 1000, TimeUnit.MILLISECONDS));
|
||||
} else {
|
||||
socketHashMap.put(sendable.getRecipient(), null);
|
||||
AsyncServer.getDefault().connectSocket(new InetSocketAddress(sendable.getRecipient().getAddress(), sendable
|
||||
.getRecipient().getPort()), new ConnectCallback() {
|
||||
@Override
|
||||
public void onConnectCompleted(Exception ex, final AsyncSocket socket) {
|
||||
if (ex == null) {
|
||||
socket.setDataCallback(dataCallback);
|
||||
.getRecipient().getPort()), (ex, socket) -> {
|
||||
if (ex == null) {
|
||||
socket.setDataCallback(dataCallback);
|
||||
|
||||
socketHashMap.put(sendable.getRecipient(), socket);
|
||||
socketHashMap.put(sendable.getRecipient(), socket);
|
||||
|
||||
//if (!workQueue.contains(item)) -> needs equals implementation
|
||||
workQueue.add(item);
|
||||
} else {
|
||||
sendable.onConnectionFailed(ex.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
//if (!workQueue.contains(item)) -> needs equals implementation
|
||||
workQueue.add(item);
|
||||
} else {
|
||||
sendable.onConnectionFailed(ex.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException ex) {
|
||||
|
|
|
@ -16,58 +16,26 @@
|
|||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
|
||||
<!-- The main content view -->
|
||||
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:minHeight="?android:attr/actionBarSize"
|
||||
app:titleTextColor="@android:color/black">
|
||||
android:titleTextColor="@android:color/black" />
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<com.larswerkman.holocolorpicker.ColorPicker
|
||||
<com.github.madrapps.HSLColorPicker
|
||||
android:id="@+id/picker"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="25dp"
|
||||
app:color_center_radius="100dp"
|
||||
app:color_pointer_halo_radius="13dp"
|
||||
app:color_pointer_radius="12dp"
|
||||
app:color_wheel_radius="180dp"
|
||||
app:color_wheel_thickness="20dp" />
|
||||
|
||||
<com.larswerkman.holocolorpicker.SaturationBar
|
||||
android:id="@+id/saturationbar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="15dp"
|
||||
app:bar_pointer_halo_radius="11dp"
|
||||
app:bar_pointer_radius="10dp"
|
||||
app:bar_thickness="15dp" />
|
||||
|
||||
<com.larswerkman.holocolorpicker.ValueBar
|
||||
android:id="@+id/valuebar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
app:bar_pointer_halo_radius="11dp"
|
||||
app:bar_pointer_radius="10dp"
|
||||
app:bar_thickness="15dp" />
|
||||
android:layout_marginTop="25dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -18,14 +18,15 @@
|
|||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
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">
|
||||
android:paddingTop="15dp"
|
||||
android:paddingRight="15dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -35,28 +36,29 @@
|
|||
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"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/img_host"
|
||||
android:layout_alignTop="@id/img_host"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_toRightOf="@id/img_host"
|
||||
android:layout_alignBottom="@id/img_host"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_toEndOf="@id/img_host"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_add_controller"
|
||||
android:textAppearance="?android:textAppearanceMedium" />
|
||||
</RelativeLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_i2c_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
app:errorEnabled="true">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_i2c"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -64,32 +66,32 @@
|
|||
android:inputType="number"
|
||||
android:minWidth="350dp" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_address_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
app:errorEnabled="true">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_address"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_controller_address"
|
||||
android:minWidth="350dp" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_channel_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
app:errorEnabled="true">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_channel"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -97,5 +99,5 @@
|
|||
android:inputType="number"
|
||||
android:minWidth="350dp" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="true"
|
||||
|
@ -35,25 +36,28 @@
|
|||
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"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/img_host"
|
||||
android:layout_alignTop="@id/img_host"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_toRightOf="@id/img_host"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_toEndOf="@id/img_host"
|
||||
android:layout_toStartOf="@id/progress_daemon"
|
||||
android:gravity="start|center_vertical"
|
||||
android:text="@string/text_choose_daemon"
|
||||
android:textAppearance="?android:textAppearanceMedium" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_daemon"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:indeterminate="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -81,18 +85,18 @@
|
|||
android:text="@string/text_or"
|
||||
android:textAppearance="?android:textAppearanceMedium" />
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_ip_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:errorEnabled="true">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_ip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_daemon_ip_port"
|
||||
android:minWidth="250dp" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="true"
|
||||
|
@ -35,17 +36,18 @@
|
|||
android:id="@+id/img_host"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:src="@drawable/ic_save_black_48dp" />
|
||||
android:src="@drawable/ic_save_black_48dp"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/img_host"
|
||||
android:layout_alignTop="@id/img_host"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_toRightOf="@id/img_host"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_toEndOf="@id/img_host"
|
||||
android:gravity="center"
|
||||
android:text="Add Profile"
|
||||
android:text="@string/add_profile"
|
||||
android:textAppearance="?android:textAppearanceMedium" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -53,12 +55,12 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Choose stripes to include" />
|
||||
android:text="@string/choose_stripes_to_include" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -69,20 +71,20 @@
|
|||
|
||||
</ScrollView>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_profile_name_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
app:errorEnabled="true">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_profile_name"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Profile name"
|
||||
android:hint="@string/profile_name"
|
||||
android:inputType="text"
|
||||
android:minWidth="350dp" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="true"
|
||||
|
@ -35,15 +36,16 @@
|
|||
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"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/img_host"
|
||||
android:layout_alignTop="@id/img_host"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_toRightOf="@id/img_host"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_toEndOf="@id/img_host"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_choose_daemon"
|
||||
android:textAppearance="?android:textAppearanceSmall" />
|
||||
|
@ -60,20 +62,21 @@
|
|||
android:id="@+id/imgbuttn_adddaemon"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="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"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<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_toStartOf="@id/imgbuttn_adddaemon" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -87,15 +90,16 @@
|
|||
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"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/img_controller"
|
||||
android:layout_alignTop="@id/img_controller"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_toRightOf="@id/img_controller"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_toEndOf="@id/img_controller"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_choose_controller"
|
||||
android:textAppearance="?android:textAppearanceSmall" />
|
||||
|
@ -112,20 +116,21 @@
|
|||
android:id="@+id/imgbuttn_addcontroller"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="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"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<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_toStartOf="@id/imgbuttn_addcontroller" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -138,42 +143,43 @@
|
|||
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"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/img_stripe"
|
||||
android:layout_alignTop="@id/img_stripe"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_toRightOf="@id/img_stripe"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_toEndOf="@id/img_stripe"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_stripe_properties"
|
||||
android:textAppearance="?android:textAppearanceSmall" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_stripe_name_lay"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="15dp"
|
||||
app:errorEnabled="true">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_stripe_name"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_stripe_name"
|
||||
android:inputType="text"
|
||||
android:minEms="12" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="9dp"
|
||||
android:layout_marginStart="9dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_channel_mapping"
|
||||
|
@ -182,7 +188,7 @@
|
|||
<HorizontalScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -191,79 +197,82 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_channel_r_lay"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_channel_r"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="2"
|
||||
android:hint="@string/hint_channel_r"
|
||||
android:inputType="number" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/imgbuttn_togglechannel_r"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="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"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_channel_g_lay"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp">
|
||||
android:layout_marginStart="10dp">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_channel_g"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="2"
|
||||
android:hint="@string/hint_channel_g"
|
||||
android:inputType="number" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/imgbuttn_togglechannel_g"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="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"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_channel_b_lay"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp">
|
||||
android:layout_marginStart="10dp">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_channel_b"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="2"
|
||||
android:hint="@string/hint_channel_b"
|
||||
android:inputType="number" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/imgbuttn_togglechannel_b"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="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"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
|
@ -24,24 +25,28 @@
|
|||
android:clickable="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="7dp">
|
||||
android:paddingStart="7dp"
|
||||
android:focusable="true"
|
||||
tools:ignore="RtlSymmetry">
|
||||
|
||||
<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"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_host"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:text=""
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
android:textColor="@color/primaryColorDark" />
|
||||
android:textColor="@color/primaryColorDark"
|
||||
android:focusable="true" />
|
||||
|
||||
</LinearLayout>
|
|
@ -22,5 +22,5 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||
android:ellipsize="marquee"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@android:color/black" />
|
|
@ -22,6 +22,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textAlignment="inherit"
|
||||
android:textColor="@android:color/black" />
|
|
@ -46,5 +46,8 @@
|
|||
<string name="snackbar_added_daemon_version">Added LedD Daemon version: %1$s</string>
|
||||
<string name="snackbar_added_stripe_id">Added Stripe (Id=%1$d)</string>
|
||||
<string name="snackbar_failed_add_stripe">Failed to add Stripe: </string>
|
||||
<string name="add_profile">Add Profile</string>
|
||||
<string name="choose_stripes_to_include">Choose stripes to include</string>
|
||||
<string name="profile_name">Profile name</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ LEDD Project
|
||||
~ Copyright (C) 2015 LEDD Team
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<EditTextPreference
|
||||
android:defaultValue="0.0.0.0"
|
||||
android:inputType="phone"
|
||||
android:key="pref_key_host"
|
||||
android:summary="hostip the dameon is running on (restart required)"
|
||||
android:title="IP"/>
|
||||
<EditTextPreference
|
||||
android:defaultValue="8825"
|
||||
android:inputType="phone"
|
||||
android:key="pref_key_port"
|
||||
android:summary="port the dameon is running on (restart required)"
|
||||
android:title="Port"/>
|
||||
<EditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="phone"
|
||||
android:key="pref_key_chan"
|
||||
android:summary="start channel of the stripe"
|
||||
android:title="Channel"/>
|
||||
|
||||
</PreferenceScreen>
|
|
@ -19,14 +19,16 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.1'
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
#Fri Apr 14 19:59:17 CEST 2017
|
||||
#Sat Dec 01 13:51:30 CET 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
|
|
Loading…
Reference in New Issue