updated deps
removed workaround for issue with the navigationHeader added handling of empty responses
This commit is contained in:
@@ -38,7 +38,7 @@ apply plugin: 'com.github.ben-manes.versions'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 23
|
||||||
buildToolsVersion '23.0.1'
|
buildToolsVersion '23.0.2'
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
abortOnError false
|
abortOnError false
|
||||||
@@ -66,13 +66,13 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
compile 'com.android.support:appcompat-v7:23.1.0'
|
compile 'com.android.support:appcompat-v7:23.1.1'
|
||||||
compile 'com.android.support:support-v4:23.1.0'
|
compile 'com.android.support:support-v4:23.1.1'
|
||||||
compile 'com.squareup.okhttp:okhttp:2.5.0'
|
compile 'com.squareup.okhttp:okhttp:2.5.0'
|
||||||
compile 'com.google.code.gson:gson:2.4'
|
compile 'com.google.code.gson:gson:2.4'
|
||||||
compile 'com.jakewharton:butterknife:7.0.1'
|
compile 'com.jakewharton:butterknife:7.0.1'
|
||||||
compile 'com.koushikdutta.async:androidasync:2.1.6'
|
compile 'com.koushikdutta.async:androidasync:2.1.6'
|
||||||
compile 'com.android.support:design:23.1.0'
|
compile 'com.android.support:design:23.1.1'
|
||||||
compile 'com.larswerkman:HoloColorPicker:1.5@aar'
|
compile 'com.larswerkman:HoloColorPicker:1.5@aar'
|
||||||
compile 'com.google.guava:guava:19.0-rc2'
|
compile 'com.google.guava:guava:19.0-rc2'
|
||||||
compile 'com.thetransactioncompany:jsonrpc2-base:1.38'
|
compile 'com.thetransactioncompany:jsonrpc2-base:1.38'
|
||||||
|
@@ -97,8 +97,7 @@ public class ColorActivity extends AppCompatActivity implements NavigationView.O
|
|||||||
setContentView(R.layout.activity_color);
|
setContentView(R.layout.activity_color);
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
// workaround for issue #190226 in design libary
|
headerLayout = navigationView.getHeaderView(0);
|
||||||
headerLayout = navigationView.inflateHeaderView(R.layout.navigation_header);
|
|
||||||
mStripeName = ButterKnife.findById(headerLayout, R.id.nvh_name);
|
mStripeName = ButterKnife.findById(headerLayout, R.id.nvh_name);
|
||||||
System.out.println("name: " + mStripeName.getText().toString());
|
System.out.println("name: " + mStripeName.getText().toString());
|
||||||
mStripeType = ButterKnife.findById(headerLayout, R.id.nvh_type);
|
mStripeType = ButterKnife.findById(headerLayout, R.id.nvh_type);
|
||||||
|
@@ -83,11 +83,14 @@ public class ColorService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
public void onDataAvailable(DataEmitter emitter, ByteBufferList bb) {
|
public void onDataAvailable(DataEmitter emitter, ByteBufferList bb) {
|
||||||
JSONRPC2Response reqIn = null;
|
JSONRPC2Response reqIn = null;
|
||||||
|
String dataStr = new String(bb.getAllByteArray());
|
||||||
|
|
||||||
try {
|
if (!dataStr.isEmpty()) {
|
||||||
reqIn = JSONRPC2Response.parse(new String(bb.getAllByteArray()));
|
try {
|
||||||
} catch (JSONRPC2ParseException e) {
|
reqIn = JSONRPC2Response.parse(dataStr);
|
||||||
e.printStackTrace();
|
} catch (JSONRPC2ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reqIn != null) {
|
if (reqIn != null) {
|
||||||
|
@@ -94,6 +94,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
|
app:headerLayout="@layout/navigation_header"
|
||||||
app:menu="@menu/navigation_drawer"/>
|
app:menu="@menu/navigation_drawer"/>
|
||||||
|
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
Reference in New Issue
Block a user