Browse Source

goRicochetMobile changed namespace: moving od work to specific namespace

master
Dan Ballard 5 years ago
parent
commit
66a25b0efa
  1. 1
      app/build.gradle
  2. 4
      app/src/main/java/im/ricochet/androidod/ConnectActivity.java
  3. 12
      app/src/main/java/im/ricochet/androidod/RemoteActivity.java
  4. 3
      goRicochetMobile/build.gradle
  5. 11
      goRicochetMobileOd/build.gradle
  6. 2
      settings.gradle

1
app/build.gradle

@ -25,6 +25,7 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':goRicochetMobile')
compile project(':goRicochetMobileOd')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'

4
app/src/main/java/im/ricochet/androidod/ConnectActivity.java

@ -16,6 +16,8 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import goRicochetMobile.GoRicochetMobile;
import od.Od;
public class ConnectActivity extends AppCompatActivity {
@ -120,7 +122,7 @@ public class ConnectActivity extends AppCompatActivity {
String privateKey = params[0];
String connectToAddr = params[1].replaceFirst(RICOCHET_ADDRESS_PREFIX, "");
try {
GoRicochetMobile.odClientConnect(privateKey, connectToAddr);
Od.odClientConnect(privateKey, connectToAddr);
return "";
} catch (Exception e) {
Log.e(TAG, e.toString());

12
app/src/main/java/im/ricochet/androidod/RemoteActivity.java

@ -8,7 +8,7 @@ import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import goRicochetMobile.GoRicochetMobile;
import od.Od;
public class RemoteActivity extends AppCompatActivity {
private static final String DEVICE_NAME_KEY = "deviceName";
@ -118,7 +118,7 @@ public class RemoteActivity extends AppCompatActivity {
private class GetDeviceNameTask extends AsyncTask<Void, Void, String> {
@Override
protected String doInBackground(Void... params) {
String name = GoRicochetMobile.getDeviceName();
String name = Od.getDeviceName();
return name;
}
@ -131,7 +131,7 @@ public class RemoteActivity extends AppCompatActivity {
private class GetBatteryTask extends AsyncTask<Void, Void, String> {
@Override
protected String doInBackground(Void... params) {
String batteryLevel = GoRicochetMobile.getBatteryLevel();
String batteryLevel = Od.getBatteryLevel();
return batteryLevel;
}
@ -144,7 +144,7 @@ public class RemoteActivity extends AppCompatActivity {
private class GetLevelTask extends AsyncTask<Void, Void, Integer> {
@Override
protected Integer doInBackground(Void... params) {
Integer vibeLevel = (int) GoRicochetMobile.getVibeLevel();
Integer vibeLevel = (int) Od.getVibeLevel();
return vibeLevel;
}
@ -158,7 +158,7 @@ public class RemoteActivity extends AppCompatActivity {
@Override
protected Integer doInBackground(Integer... params) {
Integer newVibeLevel = params[0];
GoRicochetMobile.setVibeLevel(newVibeLevel);
Od.setVibeLevel(newVibeLevel);
return newVibeLevel;
}
@ -171,7 +171,7 @@ public class RemoteActivity extends AppCompatActivity {
private class DisconnectTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void ...params) {
GoRicochetMobile.odClientDisconnect();
Od.odClientDisconnect();
return null;
}

3
goRicochetMobile/build.gradle

@ -8,4 +8,5 @@ gobind {
GOMOBILE = "/home/user/src/go/bin/gomobile"
GOBIND = "/home/user/src/go/bin/gobind"
GO = "/home/user/go/bin/go"
}
}

11
goRicochetMobileOd/build.gradle

@ -0,0 +1,11 @@
plugins {
id "org.golang.mobile.bind" version "0.2.7"
}
gobind {
pkg = "github.com/dballard/goRicochetMobile/od"
GOPATH = "/home/user/src/go"
GOMOBILE = "/home/user/src/go/bin/gomobile"
GOBIND = "/home/user/src/go/bin/gobind"
GO = "/home/user/go/bin/go"
}

2
settings.gradle

@ -1 +1 @@
include ':app', 'goRicochetMobile'
include ':app', 'goRicochetMobile', 'goRicochetMobileOd'

Loading…
Cancel
Save