Merge branch 'develop' of github.com:Agorise/graphenej into develop
This commit is contained in:
commit
39afcd26c2
2 changed files with 32 additions and 0 deletions
|
@ -7,6 +7,7 @@ import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.DividerItemDecoration;
|
import android.support.v7.widget.DividerItemDecoration;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
@ -14,14 +15,23 @@ import android.widget.TextView;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import cy.agorise.graphenej.RPC;
|
import cy.agorise.graphenej.RPC;
|
||||||
|
import cy.agorise.graphenej.api.ConnectionStatusUpdate;
|
||||||
|
import cy.agorise.graphenej.api.android.RxBus;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.disposables.CompositeDisposable;
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
import io.reactivex.functions.Consumer;
|
||||||
|
|
||||||
public class CallsActivity extends AppCompatActivity {
|
public class CallsActivity extends AppCompatActivity {
|
||||||
|
private final String TAG = this.getClass().getName();
|
||||||
|
|
||||||
private static final String REMOVE_CURRENT_NODE = "remove_current_node";
|
private static final String REMOVE_CURRENT_NODE = "remove_current_node";
|
||||||
|
|
||||||
@BindView(R.id.call_list)
|
@BindView(R.id.call_list)
|
||||||
RecyclerView mRecyclerView;
|
RecyclerView mRecyclerView;
|
||||||
|
|
||||||
|
private CompositeDisposable compositeDisposable = new CompositeDisposable();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -31,6 +41,21 @@ public class CallsActivity extends AppCompatActivity {
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
mRecyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
|
mRecyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
|
||||||
mRecyclerView.setAdapter(new CallAdapter());
|
mRecyclerView.setAdapter(new CallAdapter());
|
||||||
|
|
||||||
|
Disposable disposable = RxBus.getBusInstance()
|
||||||
|
.asFlowable()
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<Object>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void accept(Object message) throws Exception {
|
||||||
|
if(message instanceof ConnectionStatusUpdate){
|
||||||
|
ConnectionStatusUpdate statusUpdate = (ConnectionStatusUpdate) message;
|
||||||
|
Log.d(TAG, String.format("ConnectionStatusUpdate. code: %d, api: %d", statusUpdate.getUpdateCode(),statusUpdate.getApi()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
compositeDisposable.add(disposable);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class CallAdapter extends RecyclerView.Adapter<CallAdapter.ViewHolder> {
|
private final class CallAdapter extends RecyclerView.Adapter<CallAdapter.ViewHolder> {
|
||||||
|
@ -98,4 +123,10 @@ public class CallsActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
compositeDisposable.dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ public class SampleApplication extends Application {
|
||||||
int requestedApis = ApiAccess.API_DATABASE | ApiAccess.API_HISTORY | ApiAccess.API_NETWORK_BROADCAST;
|
int requestedApis = ApiAccess.API_DATABASE | ApiAccess.API_HISTORY | ApiAccess.API_NETWORK_BROADCAST;
|
||||||
|
|
||||||
String[] nodeURLs = new String[]{
|
String[] nodeURLs = new String[]{
|
||||||
|
"wss://miami.bitshares.apasia.tech/ws",
|
||||||
"wss://bitshares.crypto.fans/ws",
|
"wss://bitshares.crypto.fans/ws",
|
||||||
"wss://bitshares.openledger.info/ws",
|
"wss://bitshares.openledger.info/ws",
|
||||||
"wss://us.nodes.bitshares.ws",
|
"wss://us.nodes.bitshares.ws",
|
||||||
|
|
Loading…
Reference in a new issue