コード例 #1
0
 @Override
 public void onStart() {
   super.onStart();
   Category category = CategoryHelper.getCategoryByNickname(getActivity(), holdOrderInfo.id);
   if (category != null) {
     TradeMobClickHelper.onMarketClosePage(getActivity(), category.id, holdOrderInfo.dir);
   }
 }
コード例 #2
0
 @OnClick(R.id.bt_submit)
 public void onSubmitClick() {
   if (checkIsValidate()) {
     TradeMobClickHelper.onMarketCloseSubmit(
         getActivity(),
         CategoryHelper.getCategoryByNickname(getActivity(), holdOrderInfo.id).id,
         holdOrderInfo.dir,
         numberEditView.getText().toString(),
         spreadSwitchView.isToggleOn() ? spreadEditView.getText().toString() : "0");
     showOpenDialog();
   }
 }
コード例 #3
0
  private void subscribeQuoteData() {
    Category category = CategoryHelper.getCategoryByNickname(getActivity(), holdOrderInfo.id);
    if (category == null) return;
    List<Category> categories = new ArrayList();
    categories.add(category);
    MessageProxy.getInstance()
        .subscribe(
            categories,
            new MessageProxy.OnQuoteListener() {
              @Override
              public void onNewQuote(final Quote quoteTemp) {
                handler.post(
                    new Runnable() {
                      @Override
                      public void run() {
                        if (quoteTemp != null && (quoteTemp.id).equals(holdOrderInfo.id)) {
                          quote = quoteTemp;
                          if (closeView != null) {
                            closeView.setTextColor(
                                getResources()
                                    .getColor(
                                        TradeUtil.getTextColorOfTradePrice(
                                            (holdOrderInfo.dir == 1 ? quote.sell : quote.buy)
                                                - quote.preClose)));
                            double closeValue = holdOrderInfo.dir == 1 ? quote.sell : quote.buy;
                            closeView.setText(
                                goodsInfo == null
                                    ? (closeValue + "")
                                    : TradeUtil.formatExchangePrice(
                                        closeValue, goodsInfo.minPriceUnit));
                          }
                          setFlowProfit();
                        }
                      }
                    });
              }

              @Override
              public void onQiankun(Qiankun qiankun) {}
            });
  }