Java Code Examples for net.bither.bitherj.BitherjSettings#MarketType

The following examples show how to use net.bither.bitherj.BitherjSettings#MarketType . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BitherSetting.java    From bither-android with Apache License 2.0 6 votes vote down vote up
public static String getMarketName(BitherjSettings.MarketType marketType) {
    String name = "";
    switch (marketType) {
        case BITSTAMP:
            name = BitherApplication.mContext
                    .getString(R.string.market_name_bitstamp);
            break;
        case BITFINEX:
            name = BitherApplication.mContext
                    .getString(R.string.market_name_bitfinex);
            break;
        case COINBASE:
            name = BitherApplication.mContext.getString(R.string.market_name_coinbase);
            break;
        default:
            name = BitherApplication.mContext
                    .getString(R.string.market_name_bitstamp);
            break;
    }
    return name;
}
 
Example 2
Source File: HotActivity.java    From bither-android with Apache License 2.0 5 votes vote down vote up
public void notifPriceAlert(BitherjSettings.MarketType marketType) {
    if (mPager.getCurrentItem() != 0) {
        mPager.setCurrentItem(0);
    }
    Fragment fragment = getActiveFragment();
    if (fragment instanceof MarketFragment) {
        MarketFragment marketFragment = (MarketFragment) fragment;
        marketFragment.notifPriceAlert(marketType);
    }
}
 
Example 3
Source File: ExchangeUtil.java    From bither-android with Apache License 2.0 5 votes vote down vote up
public static double getRate(BitherjSettings.MarketType marketType) {
    Currency defaultCurrency = AppSharedPreference.getInstance()
            .getDefaultExchangeType();
    Currency currency = getExchangeType(marketType);
    double rate = 1;
    if (currency != null && getCurrenciesRate() != null && currency != defaultCurrency) {
        double preRate = getCurrenciesRate(currency);
        double defaultRate = getCurrenciesRate(defaultCurrency);
        rate = defaultRate / preRate;
    }
    return rate;
}
 
Example 4
Source File: ExchangeUtil.java    From bither-android with Apache License 2.0 5 votes vote down vote up
public static Currency getExchangeType(BitherjSettings.MarketType marketType) {
    switch (marketType) {
        case BITSTAMP:
        case BITFINEX:
        case COINBASE:
            return Currency.USD;
        default:
            break;
    }
    return Currency.CNY;

}
 
Example 5
Source File: MarketFragment.java    From bither-android with Apache License 2.0 4 votes vote down vote up
public void notifPriceAlert(BitherjSettings.MarketType marketType) {
    Market market = MarketUtil.getMarket(marketType);
    header.setMarket(market);
}
 
Example 6
Source File: Depth.java    From bither-android with Apache License 2.0 4 votes vote down vote up
public BitherjSettings.MarketType getMarketType() {
    return marketType;
}
 
Example 7
Source File: Depth.java    From bither-android with Apache License 2.0 4 votes vote down vote up
public void setMarketType(BitherjSettings.MarketType marketType) {
    this.marketType = marketType;
}
 
Example 8
Source File: MarketUtil.java    From bither-android with Apache License 2.0 4 votes vote down vote up
public static Market getDefaultMarket() {
    BitherjSettings.MarketType marketType = AppSharedPreference.getInstance()
            .getDefaultMarket();
    Market market = getMarket(marketType);
    return market;
}
 
Example 9
Source File: GetExchangeTrendApi.java    From bitherj with Apache License 2.0 4 votes vote down vote up
public GetExchangeTrendApi(BitherjSettings.MarketType marketType) {
    String url = Utils.format(BitherUrl.BITHER_TREND_URL,
            BitherjSettings.getMarketValue(marketType));
    setUrl(url);

}
 
Example 10
Source File: GetExchangeDepthApi.java    From bitherj with Apache License 2.0 4 votes vote down vote up
public GetExchangeDepthApi(BitherjSettings.MarketType marketType) {

        String url = Utils.format(BitherUrl.BITHER_DEPTH_URL,
                BitherjSettings.getMarketValue(marketType));
        setUrl(url);
    }
 
Example 11
Source File: GetKlineApi.java    From bitherj with Apache License 2.0 3 votes vote down vote up
public GetKlineApi(BitherjSettings.MarketType marketType, BitherjSettings.KlineTimeType klineTimeType) {

        String url = Utils.format(BitherUrl.BITHER_KLINE_URL,
                BitherjSettings.getMarketValue(marketType), klineTimeType.getValue());
        setUrl(url);

    }