コード例 #1
0
  private void getInfoFromServer() {
    DescriptionCallBack callBack = new DescriptionCallBack(this, getActivity());
    Call<DescriptionData> call =
        LykkeApplication_.getInstance()
            .getRestApi()
            .getDescription(
                Constants.PART_AUTHORIZATION + userPref.authToken().get(),
                Constants.USER_AGENT,
                assetPair.getId());
    call.enqueue(callBack);

    Call<OneAssetPairData> callAssetPair =
        LykkeApplication_.getInstance()
            .getRestApi()
            .getAssetPair(Constants.USER_AGENT, assetPair.getId());
    callAssetPair.enqueue(
        new Callback<OneAssetPairData>() {
          @Override
          public void onResponse(Call<OneAssetPairData> call, Response<OneAssetPairData> response) {
            assetPair = response.body().getResult().getAssetPairs();
            initViews();
          }

          @Override
          public void onFailure(Call<OneAssetPairData> call, Throwable t) {}
        });
  }
コード例 #2
0
 private void getRates() {
   if (isShouldContinue) {
     AssetPairRateCallBack callBack = new AssetPairRateCallBack(this, getActivity());
     Call<RateData> call =
         LykkeApplication_.getInstance()
             .getRestApi()
             .getAssetPairsRate(
                 Constants.PART_AUTHORIZATION + userPref.authToken().get(),
                 Constants.USER_AGENT,
                 assetPair.getId());
     call.enqueue(callBack);
   }
 }