Default currencies and Snackbar
- Reimplemented Snackbar in case of error while refreshing and auto update if it's about exchanges' keys - Add Euro in addition to Dollar as a default currency
This commit is contained in:
parent
889fc3f889
commit
749c7792ba
@ -16,7 +16,6 @@ import android.support.v4.app.NavUtils;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
@ -300,7 +299,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
||||
updateChartTab(DAY, 1);
|
||||
break;
|
||||
case "3d":
|
||||
currency.updateHistoryHours(this, new Currency.CurrencyCallBack() {
|
||||
currency.updateHistoryHours(this, preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currency) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@ -313,7 +312,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
||||
});
|
||||
break;
|
||||
case "1w":
|
||||
currency.updateHistoryHours(this, new Currency.CurrencyCallBack() {
|
||||
currency.updateHistoryHours(this, preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currency) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@ -326,7 +325,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
||||
});
|
||||
break;
|
||||
case "1M":
|
||||
currency.updateHistoryHours(this, new Currency.CurrencyCallBack() {
|
||||
currency.updateHistoryHours(this, preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currency) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@ -339,7 +338,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
||||
});
|
||||
break;
|
||||
case "3M":
|
||||
currency.updateHistoryDays(this, new Currency.CurrencyCallBack() {
|
||||
currency.updateHistoryDays(this, preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currency) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@ -352,7 +351,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
||||
});
|
||||
break;
|
||||
case "6M":
|
||||
currency.updateHistoryDays(this, new Currency.CurrencyCallBack() {
|
||||
currency.updateHistoryDays(this, preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currency) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@ -365,7 +364,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
||||
});
|
||||
break;
|
||||
case "1y":
|
||||
currency.updateHistoryDays(this, new Currency.CurrencyCallBack() {
|
||||
currency.updateHistoryDays(this, preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currency) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@ -550,8 +549,8 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
||||
date = getDate(dataChartList.get(index).getTimestamp() * 1000);
|
||||
}
|
||||
|
||||
volumePlaceholder = getResources().getString(R.string.volumePlaceholder, numberConformer(barChart.getData().getDataSets().get(0).getEntryForIndex(index).getY()));
|
||||
pricePlaceholder = getResources().getString(R.string.pricePlaceholder, numberConformer(e.getY()));
|
||||
volumePlaceholder = getResources().getString(R.string.volumeDollarPlaceholder, numberConformer(barChart.getData().getDataSets().get(0).getEntryForIndex(index).getY()));
|
||||
pricePlaceholder = getResources().getString(R.string.priceDollarPlaceholder, numberConformer(e.getY()));
|
||||
timestampPlaceholder = getResources().getString(R.string.timestampPlaceholder, date);
|
||||
|
||||
((TextView) findViewById(R.id.volumeHightlight)).setText(volumePlaceholder);
|
||||
|
@ -121,7 +121,10 @@ public class HomeActivity extends AppCompatActivity {
|
||||
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
//bottomNavigationView.getMenu().getItem(position).setChecked(true);
|
||||
if(!bottomNavigationView.getMenu().getItem(position).isChecked())
|
||||
{
|
||||
bottomNavigationView.getMenu().getItem(position).setChecked(true);
|
||||
}
|
||||
|
||||
if(position % 2 == 0)
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ import com.github.mikephil.charting.data.PieEntry;
|
||||
import com.github.mikephil.charting.formatter.PercentFormatter;
|
||||
import com.nauk.coinfolio.Activities.SettingsActivity;
|
||||
import com.nauk.coinfolio.DataManagers.MarketCapManager;
|
||||
import com.nauk.coinfolio.DataManagers.PreferencesManager;
|
||||
import com.nauk.coinfolio.R;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
@ -44,6 +45,7 @@ public class MarketCapitalization extends Fragment {
|
||||
|
||||
private int marketCapCounter;
|
||||
|
||||
private PreferencesManager preferencesManager;
|
||||
private MarketCapManager marketCapManager;
|
||||
private HashMap<String, Integer> dominantCurrenciesColors;
|
||||
private SwipeRefreshLayout refreshLayout;
|
||||
@ -54,6 +56,7 @@ public class MarketCapitalization extends Fragment {
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
preferencesManager = new PreferencesManager(getContext());
|
||||
view = inflater.inflate(R.layout.fragment_marketcap_homeactivity, container, false);
|
||||
|
||||
setupDominantCurrenciesColors();
|
||||
@ -92,6 +95,8 @@ public class MarketCapitalization extends Fragment {
|
||||
public void onResume()
|
||||
{
|
||||
super.onResume();
|
||||
|
||||
updateMarketCap();
|
||||
}
|
||||
|
||||
private void setupDominantCurrenciesColors()
|
||||
@ -141,7 +146,7 @@ public class MarketCapitalization extends Fragment {
|
||||
public void onSuccess() {
|
||||
countCompletedMarketCapRequest();
|
||||
}
|
||||
});
|
||||
}, preferencesManager.getDefaultCurrency());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -249,8 +254,20 @@ public class MarketCapitalization extends Fragment {
|
||||
symbols.setGroupingSeparator(' ');
|
||||
formatter.setDecimalFormatSymbols(symbols);
|
||||
|
||||
((TextView) view.findViewById(R.id.marketCapTextView)).setText(getActivity().getResources().getString(R.string.market_cap_textview, formatter.format(marketCapManager.getMarketCap())));
|
||||
|
||||
((TextView) view.findViewById(R.id.dayVolumeTotalMarketCap)).setText(getActivity().getResources().getString(R.string.volume_market_cap_textview, formatter.format(marketCapManager.getDayVolume())));
|
||||
switch (preferencesManager.getDefaultCurrency())
|
||||
{
|
||||
case "EUR":
|
||||
((TextView) view.findViewById(R.id.marketCapTextView))
|
||||
.setText(getActivity().getResources().getString(R.string.market_cap_euros_textview, formatter.format(marketCapManager.getMarketCap())));
|
||||
((TextView) view.findViewById(R.id.dayVolumeTotalMarketCap))
|
||||
.setText(getActivity().getResources().getString(R.string.volume_euros_market_cap_textview, formatter.format(marketCapManager.getDayVolume())));
|
||||
break;
|
||||
default:
|
||||
((TextView) view.findViewById(R.id.marketCapTextView))
|
||||
.setText(getActivity().getResources().getString(R.string.market_cap_dollar_textview, formatter.format(marketCapManager.getMarketCap())));
|
||||
((TextView) view.findViewById(R.id.dayVolumeTotalMarketCap))
|
||||
.setText(getActivity().getResources().getString(R.string.volume_dollar_market_cap_textview, formatter.format(marketCapManager.getDayVolume())));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import android.graphics.Color;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.CollapsingToolbarLayout;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
@ -50,7 +52,6 @@ public class Summary extends Fragment {
|
||||
private PreferencesManager preferencesManager;
|
||||
private BalanceManager balanceManager;
|
||||
private HomeLayoutGenerator layoutGenerator;
|
||||
private View view;
|
||||
private SwipeRefreshLayout refreshLayout;
|
||||
private Dialog loadingDialog;
|
||||
|
||||
@ -67,17 +68,18 @@ public class Summary extends Fragment {
|
||||
protected float totalFluctuation;
|
||||
private long lastTimestamp;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
view = inflater.inflate(R.layout.fragment_summary_homeactivity, container, false);
|
||||
View fragmentView = inflater.inflate(R.layout.fragment_summary_homeactivity, container, false);
|
||||
|
||||
currencyLayout = view.findViewById(R.id.currencyListLayout);
|
||||
currencyLayout = fragmentView.findViewById(R.id.currencyListLayout);
|
||||
preferencesManager = new PreferencesManager(getActivity());
|
||||
balanceManager = new BalanceManager(getActivity());
|
||||
layoutGenerator = new HomeLayoutGenerator(getActivity());
|
||||
refreshLayout = view.findViewById(R.id.swiperefreshsummary);
|
||||
toolbarSubtitle = view.findViewById(R.id.toolbarSubtitle);
|
||||
refreshLayout = fragmentView.findViewById(R.id.swiperefreshsummary);
|
||||
toolbarSubtitle = fragmentView.findViewById(R.id.toolbarSubtitle);
|
||||
|
||||
totalValue = 0;
|
||||
totalFluctuation = 0;
|
||||
@ -114,12 +116,12 @@ public class Summary extends Fragment {
|
||||
);
|
||||
|
||||
handler.postDelayed(updateRunnable, 10000);
|
||||
toolbarLayout = view.findViewById(R.id.toolbar_layout);
|
||||
toolbarLayout = fragmentView.findViewById(R.id.toolbar_layout);
|
||||
toolbarLayout.setForegroundGravity(Gravity.CENTER);
|
||||
|
||||
Button addCurrencyButton = view.findViewById(R.id.buttonAddTransaction);
|
||||
Button addCurrencyButton = fragmentView.findViewById(R.id.buttonAddTransaction);
|
||||
|
||||
ImageButton settingsButton = view.findViewById(R.id.settings_button);
|
||||
ImageButton settingsButton = fragmentView.findViewById(R.id.settings_button);
|
||||
|
||||
settingsButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -142,7 +144,7 @@ public class Summary extends Fragment {
|
||||
|
||||
generateSplashScreen();
|
||||
|
||||
return view;
|
||||
return fragmentView;
|
||||
}
|
||||
|
||||
private void generateSplashScreen()
|
||||
@ -176,9 +178,9 @@ public class Summary extends Fragment {
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
updateAll(preferencesManager.mustUpdateSummary());
|
||||
|
||||
displayBalance(preferencesManager.isBalanceHidden());
|
||||
|
||||
updateAll(preferencesManager.mustUpdateSummary());
|
||||
}
|
||||
|
||||
private void updateAll(boolean mustUpdate)
|
||||
@ -197,7 +199,6 @@ public class Summary extends Fragment {
|
||||
resetCounters();
|
||||
DataUpdater updater = new DataUpdater();
|
||||
updater.execute();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -236,7 +237,7 @@ public class Summary extends Fragment {
|
||||
|
||||
final List<View> currencyView = new ArrayList<>();
|
||||
|
||||
Runnable newRunnabmle = new Runnable() {
|
||||
Runnable newRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for(int i = 0; i < balanceManager.getTotalBalance().size(); i++)
|
||||
@ -261,7 +262,7 @@ public class Summary extends Fragment {
|
||||
}
|
||||
};
|
||||
|
||||
newRunnabmle.run();
|
||||
newRunnable.run();
|
||||
}
|
||||
|
||||
private void countCoins(boolean isCoin, boolean isDetails)
|
||||
@ -293,7 +294,6 @@ public class Summary extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void countIcons()
|
||||
{
|
||||
int offset = 0;
|
||||
@ -351,8 +351,6 @@ public class Summary extends Fragment {
|
||||
{
|
||||
float totalFluctuationPercentage = totalFluctuation / (totalValue - totalFluctuation) * 100;
|
||||
|
||||
|
||||
|
||||
if(preferencesManager.isBalanceHidden())
|
||||
{
|
||||
toolbarLayout.setTitle(getResources().getString(R.string.currencyPercentagePlaceholder, String.format("%.2f", totalFluctuationPercentage)));
|
||||
@ -371,7 +369,15 @@ public class Summary extends Fragment {
|
||||
}
|
||||
else
|
||||
{
|
||||
toolbarLayout.setTitle(getResources().getString(R.string.currencyDollarPlaceholder, String.format("%.2f", totalValue)));
|
||||
switch (preferencesManager.getDefaultCurrency())
|
||||
{
|
||||
case "EUR":
|
||||
toolbarLayout.setTitle(getResources().getString(R.string.currencyEurosPlaceholder, String.format("%.2f", totalValue)));
|
||||
break;
|
||||
default:
|
||||
toolbarLayout.setTitle(getResources().getString(R.string.currencyDollarPlaceholder, String.format("%.2f", totalValue)));
|
||||
break;
|
||||
}
|
||||
toolbarLayout.setCollapsedTitleTextColor(Color.WHITE);
|
||||
toolbarLayout.setExpandedTitleColor(Color.WHITE);
|
||||
|
||||
@ -388,13 +394,29 @@ public class Summary extends Fragment {
|
||||
|
||||
if(totalFluctuation == 0)
|
||||
{
|
||||
toolbarSubtitle.setText(getResources().getString(R.string.currencyDollarPlaceholder, "0.00"));
|
||||
switch (preferencesManager.getDefaultCurrency())
|
||||
{
|
||||
case "EUR":
|
||||
toolbarSubtitle.setText(getResources().getString(R.string.currencyEurosPlaceholder, "0.00"));
|
||||
break;
|
||||
default:
|
||||
toolbarSubtitle.setText(getResources().getString(R.string.currencyDollarPlaceholder, "0.00"));
|
||||
break;
|
||||
}
|
||||
toolbarSubtitle.setTextColor(-1275068417);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
toolbarSubtitle.setText("US$" + String.format("%.2f", totalFluctuation) + " (" + String.format("%.2f", totalFluctuationPercentage) + "%)");
|
||||
switch (preferencesManager.getDefaultCurrency())
|
||||
{
|
||||
case "EUR":
|
||||
toolbarSubtitle.setText(String.format("%.2f", totalFluctuation) + "€ (" + String.format("%.2f", totalFluctuationPercentage) + "%)");
|
||||
break;
|
||||
default:
|
||||
toolbarSubtitle.setText("US$" + String.format("%.2f", totalFluctuation) + " (" + String.format("%.2f", totalFluctuationPercentage) + "%)");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -600,7 +622,7 @@ public class Summary extends Fragment {
|
||||
{
|
||||
for(int i = 0; i < balanceManager.getTotalBalance().size(); i++)
|
||||
{
|
||||
balance.get(i).updatePrice(getActivity(), new Currency.CurrencyCallBack() {
|
||||
balance.get(i).updatePrice(getActivity(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currency) {
|
||||
countCoins(true, false);
|
||||
@ -622,27 +644,34 @@ public class Summary extends Fragment {
|
||||
|
||||
public void onError(String error)
|
||||
{
|
||||
/*switch (error)
|
||||
View view = getActivity().findViewById(R.id.snackbar_placer);
|
||||
|
||||
switch (error)
|
||||
{
|
||||
case "com.android.volley.AuthFailureError":
|
||||
preferencesManager.disableHitBTC();
|
||||
Snackbar.make(findViewById(R.id.viewFlipperSummary), "HitBTC synchronization error : Invalid keys", Snackbar.LENGTH_LONG)
|
||||
Snackbar.make(view, "HitBTC synchronization error : Invalid keys", Snackbar.LENGTH_LONG)
|
||||
.show();
|
||||
|
||||
refreshLayout.setRefreshing(false);
|
||||
|
||||
updateAll(true);
|
||||
break;
|
||||
case "API-key format invalid.":
|
||||
preferencesManager.disableBinance();
|
||||
Snackbar.make(findViewById(R.id.viewFlipperSummary), "Binance synchronization error : Invalid keys", Snackbar.LENGTH_LONG)
|
||||
Snackbar.make(view, "Binance synchronization error : Invalid keys", Snackbar.LENGTH_LONG)
|
||||
.show();
|
||||
|
||||
updateAll(true);
|
||||
break;
|
||||
default:
|
||||
Snackbar.make(findViewById(R.id.viewFlipperSummary), "Unexpected error", Snackbar.LENGTH_LONG)
|
||||
Snackbar.make(view, "Unexpected error", Snackbar.LENGTH_LONG)
|
||||
.show();
|
||||
|
||||
Log.d("coinfolio", error);
|
||||
|
||||
updateAll(true);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -237,64 +237,7 @@ public class Watchlist extends Fragment {
|
||||
public void run() {
|
||||
for(final Currency currency : watchlistManager.getWatchlist())
|
||||
{
|
||||
View card = LayoutInflater.from(getContext()).inflate(R.layout.cardview_watchlist, null);
|
||||
|
||||
((TextView) card.findViewById(R.id.currencyFluctuationPercentageTextView)).setText(getResources().getString(R.string.currencyPercentagePlaceholder, numberConformer(currency.getDayFluctuationPercentage())));
|
||||
((TextView) card.findViewById(R.id.currencyFluctuationTextView)).setText(getResources().getString(R.string.currencyDollarParenthesisPlaceholder, numberConformer(currency.getDayFluctuation())));
|
||||
((TextView) card.findViewById(R.id.currencyNameTextView)).setText(currency.getName());
|
||||
((TextView) card.findViewById(R.id.currencySymbolTextView)).setText(getResources().getString(R.string.currencySymbolPlaceholder, currency.getSymbol()));
|
||||
((ImageView) card.findViewById(R.id.currencyIcon)).setImageBitmap(currency.getIcon());
|
||||
((TextView) card.findViewById(R.id.currencyValueTextView)).setText(getResources().getString(R.string.currencyDollarPlaceholder, numberConformer(currency.getValue())));
|
||||
|
||||
Drawable arrowDrawable = ((ImageView) card.findViewById(R.id.detailsArrow)).getDrawable();
|
||||
arrowDrawable.mutate();
|
||||
arrowDrawable.setColorFilter(new PorterDuffColorFilter(currency.getChartColor(), PorterDuff.Mode.SRC_IN));
|
||||
arrowDrawable.invalidateSelf();
|
||||
|
||||
updateColor(card, currency);
|
||||
|
||||
card.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
card.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final View view) {
|
||||
if(view.findViewById(R.id.collapsableLayout).getVisibility() == View.VISIBLE)
|
||||
{
|
||||
collapseView(view);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currency.getHistoryMinutes() == null) {
|
||||
currency.updateHistoryMinutes(getActivity(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currency) {
|
||||
extendView(view);
|
||||
setupLineChart(view, currency);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
extendView(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
card.findViewById(R.id.LineChartView).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(getActivity(), CurrencyDetailsActivity.class);
|
||||
intent.putExtra("currency", currency);
|
||||
getActivity().getApplicationContext().startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
if(currency.getHistoryMinutes() != null)
|
||||
{
|
||||
setupLineChart(card, currency);
|
||||
}
|
||||
|
||||
watchlistViews.add(card);
|
||||
watchlistViews.add(getCurrencyCardFor(currency));
|
||||
}
|
||||
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@ -317,6 +260,86 @@ public class Watchlist extends Fragment {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private View getCurrencyCardFor(final Currency currency)
|
||||
{
|
||||
View card = LayoutInflater.from(getContext()).inflate(R.layout.cardview_watchlist, null);
|
||||
|
||||
switch (preferencesManager.getDefaultCurrency())
|
||||
{
|
||||
case "EUR":
|
||||
((TextView) card.findViewById(R.id.currencyFluctuationTextView))
|
||||
.setText(getResources().getString(R.string.currencyEurosParenthesisPlaceholder, numberConformer(currency.getDayFluctuation())));
|
||||
((TextView) card.findViewById(R.id.currencyValueTextView))
|
||||
.setText(getResources().getString(R.string.currencyEurosPlaceholder, numberConformer(currency.getValue())));
|
||||
break;
|
||||
default :
|
||||
((TextView) card.findViewById(R.id.currencyFluctuationTextView))
|
||||
.setText(getResources().getString(R.string.currencyDollarParenthesisPlaceholder, numberConformer(currency.getDayFluctuation())));
|
||||
((TextView) card.findViewById(R.id.currencyValueTextView))
|
||||
.setText(getResources().getString(R.string.currencyDollarPlaceholder, numberConformer(currency.getValue())));
|
||||
break;
|
||||
}
|
||||
|
||||
((TextView) card.findViewById(R.id.currencyFluctuationPercentageTextView))
|
||||
.setText(getResources().getString(R.string.currencyPercentagePlaceholder, numberConformer(currency.getDayFluctuationPercentage())));
|
||||
((TextView) card.findViewById(R.id.currencyNameTextView))
|
||||
.setText(currency.getName());
|
||||
((TextView) card.findViewById(R.id.currencySymbolTextView))
|
||||
.setText(getResources().getString(R.string.currencySymbolPlaceholder, currency.getSymbol()));
|
||||
((ImageView) card.findViewById(R.id.currencyIcon)).setImageBitmap(currency.getIcon());
|
||||
|
||||
Drawable arrowDrawable = ((ImageView) card.findViewById(R.id.detailsArrow)).getDrawable();
|
||||
arrowDrawable.mutate();
|
||||
arrowDrawable.setColorFilter(new PorterDuffColorFilter(currency.getChartColor(), PorterDuff.Mode.SRC_IN));
|
||||
arrowDrawable.invalidateSelf();
|
||||
|
||||
updateColor(card, currency);
|
||||
|
||||
card.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
card.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final View view) {
|
||||
if(view.findViewById(R.id.collapsableLayout).getVisibility() == View.VISIBLE)
|
||||
{
|
||||
collapseView(view);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currency.getHistoryMinutes() == null) {
|
||||
currency.updateHistoryMinutes(getActivity(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currency) {
|
||||
extendView(view);
|
||||
setupLineChart(view, currency);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
extendView(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
card.findViewById(R.id.LineChartView).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(getActivity(), CurrencyDetailsActivity.class);
|
||||
intent.putExtra("currency", currency);
|
||||
getActivity().getApplicationContext().startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
if(currency.getHistoryMinutes() != null)
|
||||
{
|
||||
setupLineChart(card, currency);
|
||||
}
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
private LineData generateData(Currency currency)
|
||||
{
|
||||
LineDataSet dataSet;
|
||||
@ -456,7 +479,7 @@ public class Watchlist extends Fragment {
|
||||
protected Void doInBackground(Void... voids) {
|
||||
for(final Currency currency : watchlistManager.getWatchlist())
|
||||
{
|
||||
currency.updatePrice(getActivity(), new Currency.CurrencyCallBack() {
|
||||
currency.updatePrice(getActivity(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(final Currency sucessCurrency) {
|
||||
if(getIconUrl(sucessCurrency.getSymbol()) != null)
|
||||
|
@ -80,7 +80,7 @@ public class RecordTransactionActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
currency.getTimestampPrice(this, new Currency.PriceCallBack() {
|
||||
currency.getTimestampPrice(this, preferenceManager.getDefaultCurrency(), new Currency.PriceCallBack() {
|
||||
@Override
|
||||
public void onSuccess(String price) {
|
||||
purchasedPrice.setText(price);
|
||||
@ -119,7 +119,7 @@ public class RecordTransactionActivity extends AppCompatActivity {
|
||||
calendar.set(Calendar.MINUTE, minute);
|
||||
purchasedDate.setText(sdf.format(calendar.getTime()));
|
||||
|
||||
currency.getTimestampPrice(RecordTransactionActivity.this, new Currency.PriceCallBack() {
|
||||
currency.getTimestampPrice(RecordTransactionActivity.this, preferenceManager.getDefaultCurrency(), new Currency.PriceCallBack() {
|
||||
@Override
|
||||
public void onSuccess(String price) {
|
||||
purchasedPrice.setText(price);
|
||||
|
@ -31,6 +31,7 @@ import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import com.nauk.coinfolio.DataManagers.PreferencesManager;
|
||||
import com.nauk.coinfolio.FingerprintToolkit.FingerprintDialogFragment;
|
||||
import com.nauk.coinfolio.FingerprintToolkit.FingerprintHandler;
|
||||
import com.nauk.coinfolio.R;
|
||||
@ -230,6 +231,20 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
||||
return isChecked;
|
||||
}
|
||||
});
|
||||
|
||||
bindPreferenceSummaryToValue(findPreference("default_currency"));
|
||||
findPreference("default_currency").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object o) {
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
|
||||
editor.putBoolean("refresh_default_currency", true);
|
||||
editor.apply();
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -96,7 +96,7 @@ public class BalanceManager {
|
||||
|
||||
hitBtcManagers.clear();
|
||||
|
||||
if(publicKey != null && privateKey != null && preferenceManager.isHitBTCActivated())
|
||||
if(preferenceManager.isHitBTCActivated() && publicKey != null && privateKey != null)
|
||||
{
|
||||
hitBtcManagers.add(new HitBtcManager(context, publicKey, privateKey));
|
||||
}
|
||||
@ -106,7 +106,7 @@ public class BalanceManager {
|
||||
|
||||
binanceManagers.clear();
|
||||
|
||||
if(publicKey != null && privateKey != null && preferenceManager.isBinanceActivated())
|
||||
if(preferenceManager.isBinanceActivated() && publicKey != null && privateKey != null)
|
||||
{
|
||||
binanceManagers.add(new BinanceManager(publicKey, privateKey));
|
||||
}
|
||||
@ -121,6 +121,8 @@ public class BalanceManager {
|
||||
{
|
||||
boolean isUpdated = false;
|
||||
|
||||
balanceCounter = 0;
|
||||
|
||||
manualBalances = databaseManager.getAllCurrenciesFromManualCurrency();
|
||||
|
||||
if(binanceManagers.size() > 0)
|
||||
|
@ -64,11 +64,11 @@ public class Currency implements Parcelable {
|
||||
|
||||
//public Currency(int id, String symbol, String name, String algorithm, String proofType, )
|
||||
|
||||
public void getTimestampPrice(android.content.Context context, final PriceCallBack callBack, long timestamp)
|
||||
public void getTimestampPrice(android.content.Context context, String toSymbol, final PriceCallBack callBack, long timestamp)
|
||||
{
|
||||
dataRetriver = new CurrencyDataRetriever(context);
|
||||
|
||||
dataRetriver.getPriceTimestamp(symbol, new CurrencyDataRetriever.DataChartCallBack() {
|
||||
dataRetriver.getPriceTimestamp(symbol, toSymbol, new CurrencyDataRetriever.DataChartCallBack() {
|
||||
@Override
|
||||
public void onSuccess(List<CurrencyDataChart> dataChart) {}
|
||||
|
||||
@ -97,11 +97,11 @@ public class Currency implements Parcelable {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void updatePrice(android.content.Context context, final CurrencyCallBack callBack)
|
||||
public void updatePrice(android.content.Context context, String toSymbol, final CurrencyCallBack callBack)
|
||||
{
|
||||
dataRetriver = new CurrencyDataRetriever(context);
|
||||
|
||||
dataRetriver.updatePrice(symbol, new CurrencyDataRetriever.PriceCallBack() {
|
||||
dataRetriver.updatePrice(symbol, toSymbol, new CurrencyDataRetriever.PriceCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currencyInfo) {
|
||||
if(currencyInfo != null)
|
||||
@ -117,11 +117,11 @@ public class Currency implements Parcelable {
|
||||
});
|
||||
}
|
||||
|
||||
public void updateHistoryMinutes(android.content.Context context, final CurrencyCallBack callBack)
|
||||
public void updateHistoryMinutes(android.content.Context context, String toSymbol, final CurrencyCallBack callBack)
|
||||
{
|
||||
dataRetriver = new CurrencyDataRetriever(context);
|
||||
|
||||
dataRetriver.updateHistory(symbol, new CurrencyDataRetriever.DataChartCallBack() {
|
||||
dataRetriver.updateHistory(symbol, toSymbol, new CurrencyDataRetriever.DataChartCallBack() {
|
||||
@Override
|
||||
public void onSuccess(List<CurrencyDataChart> dataChart) {
|
||||
setHistoryMinutes(dataChart);
|
||||
@ -134,10 +134,10 @@ public class Currency implements Parcelable {
|
||||
}, CurrencyDataRetriever.MINUTES);
|
||||
}
|
||||
|
||||
public void updateHistoryHours(android.content.Context context, final CurrencyCallBack callBack)
|
||||
public void updateHistoryHours(android.content.Context context, String toSymbol, final CurrencyCallBack callBack)
|
||||
{
|
||||
dataRetriver = new CurrencyDataRetriever(context);
|
||||
dataRetriver.updateHistory(symbol, new CurrencyDataRetriever.DataChartCallBack() {
|
||||
dataRetriver.updateHistory(symbol, toSymbol, new CurrencyDataRetriever.DataChartCallBack() {
|
||||
@Override
|
||||
public void onSuccess(List<CurrencyDataChart> dataChart) {
|
||||
setHistoryHours(dataChart);
|
||||
@ -150,10 +150,10 @@ public class Currency implements Parcelable {
|
||||
}, CurrencyDataRetriever.HOURS);
|
||||
}
|
||||
|
||||
public void updateHistoryDays(android.content.Context context, final CurrencyCallBack callBack)
|
||||
public void updateHistoryDays(android.content.Context context, String toSymbol, final CurrencyCallBack callBack)
|
||||
{
|
||||
dataRetriver = new CurrencyDataRetriever(context);
|
||||
dataRetriver.updateHistory(symbol, new CurrencyDataRetriever.DataChartCallBack() {
|
||||
dataRetriver.updateHistory(symbol, toSymbol, new CurrencyDataRetriever.DataChartCallBack() {
|
||||
@Override
|
||||
public void onSuccess(List<CurrencyDataChart> dataChart) {
|
||||
setHistoryDays(dataChart);
|
||||
|
@ -44,7 +44,7 @@ public class CurrencyDataRetriever {
|
||||
requestQueue = Volley.newRequestQueue(context);
|
||||
}
|
||||
|
||||
private void getPriceTimestamp(final String symbolCurrencyFrom, String symbolCurrencyTo, final DataChartCallBack callBack, long timestamp)
|
||||
public void getPriceTimestamp(final String symbolCurrencyFrom, String symbolCurrencyTo, final DataChartCallBack callBack, long timestamp)
|
||||
{
|
||||
final String requestUrl = "https://min-api.cryptocompare.com/data/pricehistorical?fsym=" + symbolCurrencyFrom + "&tsyms=" + symbolCurrencyTo + "&ts=" + timestamp;
|
||||
|
||||
@ -74,7 +74,7 @@ public class CurrencyDataRetriever {
|
||||
return result;
|
||||
}
|
||||
|
||||
private void updateHistory(final String symbolCurrencyFrom, String symbolCyrrencyTo, final DataChartCallBack callBack, int timeUnit)
|
||||
public void updateHistory(final String symbolCurrencyFrom, String symbolCyrrencyTo, final DataChartCallBack callBack, int timeUnit)
|
||||
{
|
||||
String requestUrl = getRequestUrl(timeUnit, symbolCurrencyFrom, symbolCyrrencyTo);
|
||||
|
||||
@ -95,7 +95,7 @@ public class CurrencyDataRetriever {
|
||||
requestQueue.add(stringRequest);
|
||||
}
|
||||
|
||||
private void updatePrice(final String symbolCurrencyFrom, String symbolCurrencyTo, final PriceCallBack callBack)
|
||||
public void updatePrice(final String symbolCurrencyFrom, String symbolCurrencyTo, final PriceCallBack callBack)
|
||||
{
|
||||
String requestUrl = priceUrl + symbolCurrencyFrom + "&tsyms=" + symbolCurrencyTo;
|
||||
|
||||
|
@ -145,7 +145,6 @@ public class DatabaseManager extends SQLiteOpenHelper{
|
||||
while(resultatList.moveToNext())
|
||||
{
|
||||
currencyList.add(new Currency(resultatList.getString(1), resultatList.getDouble(3)));
|
||||
Log.d("coinfolio", "Database output : " + resultatList.getString(1));
|
||||
}
|
||||
|
||||
resultatList.close();
|
||||
|
@ -23,7 +23,7 @@ import java.util.regex.Pattern;
|
||||
public class MarketCapManager {
|
||||
|
||||
private static final String topCurrenciesUrl = "https://api.coinmarketcap.com/v1/ticker/?limit=9";
|
||||
private static final String marketCapUrl = "https://api.coinmarketcap.com/v1/global/";
|
||||
private static final String marketCapUrl = "https://api.coinmarketcap.com/v1/global/?convert=";
|
||||
private RequestQueue requestQueue;
|
||||
private String topRequestResult[];
|
||||
private long marketCap;
|
||||
@ -57,9 +57,11 @@ public class MarketCapManager {
|
||||
requestQueue.add(strRequest);
|
||||
}
|
||||
|
||||
public void updateMarketCap(final VolleyCallBack callBack)
|
||||
public void updateMarketCap(final VolleyCallBack callBack, String toSymbol)
|
||||
{
|
||||
StringRequest strRequest = new StringRequest(Request.Method.GET, marketCapUrl,
|
||||
String requestString = marketCapUrl + toSymbol;
|
||||
|
||||
StringRequest strRequest = new StringRequest(Request.Method.GET, requestString,
|
||||
new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
|
@ -34,6 +34,18 @@ public class PreferencesManager {
|
||||
return preferencesList.getBoolean("DetailOption", true);
|
||||
}
|
||||
|
||||
public void disableRefreshDefaultCurrency()
|
||||
{
|
||||
SharedPreferences.Editor editor = settingPreferences.edit();
|
||||
editor.putBoolean("refresh_default_currency", false);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public String getDefaultCurrency()
|
||||
{
|
||||
return settingPreferences.getString("default_currency", "USD");
|
||||
}
|
||||
|
||||
public String getHitBTCPublicKey()
|
||||
{
|
||||
return settingPreferences.getString("hitbtc_publickey", null);
|
||||
|
@ -7,6 +7,7 @@ import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@ -24,6 +25,7 @@ import com.github.mikephil.charting.data.LineDataSet;
|
||||
import com.nauk.coinfolio.Activities.CurrencyDetailsActivity;
|
||||
import com.nauk.coinfolio.DataManagers.CurrencyData.Currency;
|
||||
import com.nauk.coinfolio.DataManagers.CurrencyData.CurrencyDataChart;
|
||||
import com.nauk.coinfolio.DataManagers.PreferencesManager;
|
||||
import com.nauk.coinfolio.R;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
@ -53,11 +55,13 @@ public class HomeLayoutGenerator {
|
||||
view.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final View view) {
|
||||
PreferencesManager preferencesManager = new PreferencesManager(context);
|
||||
|
||||
if (view.findViewById(R.id.collapsableLayout).getVisibility() == View.VISIBLE) {
|
||||
collapseView(view);
|
||||
} else {
|
||||
if (currency.getHistoryMinutes() == null) {
|
||||
currency.updateHistoryMinutes(context, new Currency.CurrencyCallBack() {
|
||||
currency.updateHistoryMinutes(context, preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Currency currency) {
|
||||
//setupLineChart(view, currency);
|
||||
@ -202,6 +206,28 @@ public class HomeLayoutGenerator {
|
||||
double value = currency.getValue() * currency.getBalance();
|
||||
double percentage = value / totalValue * 100;
|
||||
DecimalFormat df = new DecimalFormat(".##");
|
||||
PreferencesManager preferencesManager = new PreferencesManager(context);
|
||||
|
||||
switch (preferencesManager.getDefaultCurrency())
|
||||
{
|
||||
case "EUR":
|
||||
((TextView) view.findViewById(R.id.currencyValueOwnedTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyEurosParenthesisPlaceholder, numberConformer(currency.getValue() * currency.getBalance())));
|
||||
((TextView) view.findViewById(R.id.currencyValueTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyEurosPlaceholder, numberConformer(currency.getValue())));
|
||||
((TextView) view.findViewById(R.id.currencyFluctuationTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyEurosParenthesisPlaceholder, numberConformer(currency.getDayFluctuation())));
|
||||
break;
|
||||
default:
|
||||
((TextView) view.findViewById(R.id.currencyValueOwnedTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyDollarParenthesisPlaceholder, numberConformer(currency.getValue() * currency.getBalance())));
|
||||
((TextView) view.findViewById(R.id.currencyValueTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyDollarPlaceholder, numberConformer(currency.getValue())));
|
||||
((TextView) view.findViewById(R.id.currencyFluctuationTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyDollarParenthesisPlaceholder, numberConformer(currency.getDayFluctuation())));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
((ImageView) view.findViewById(R.id.currencyIcon))
|
||||
.setImageBitmap(currency.getIcon());
|
||||
@ -211,15 +237,8 @@ public class HomeLayoutGenerator {
|
||||
.setText(context.getResources().getString(R.string.currencySymbolPlaceholder, currency.getSymbol()));
|
||||
((TextView) view.findViewById(R.id.currencyOwnedTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyBalancePlaceholder, numberConformer(currency.getBalance()), currency.getSymbol()));
|
||||
((TextView) view.findViewById(R.id.currencyValueOwnedTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyDollarParenthesisPlaceholder, numberConformer(currency.getValue() * currency.getBalance())));
|
||||
|
||||
((TextView) view.findViewById(R.id.currencyValueTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyDollarPlaceholder, numberConformer(currency.getValue())));
|
||||
((TextView) view.findViewById(R.id.currencyFluctuationPercentageTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyPercentagePlaceholder, numberConformer(currency.getDayFluctuationPercentage())));
|
||||
((TextView) view.findViewById(R.id.currencyFluctuationTextView))
|
||||
.setText(context.getResources().getString(R.string.currencyDollarParenthesisPlaceholder, numberConformer(currency.getDayFluctuation())));
|
||||
|
||||
Drawable arrowDrawable = ((ImageView) view.findViewById(R.id.detailsArrow)).getDrawable();
|
||||
arrowDrawable.mutate();
|
||||
|
@ -13,8 +13,14 @@
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:layout_marginBottom="56dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/summary_background">
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
android:id="@+id/snackbar_placer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -32,22 +32,19 @@
|
||||
<!-- Example settings for Data & Sync -->
|
||||
<string name="pref_header_data_sync">Data & sync</string>
|
||||
|
||||
<string name="pref_title_sync_frequency">Sync frequency</string>
|
||||
<string-array name="pref_sync_frequency_titles">
|
||||
<item>15 minutes</item>
|
||||
<item>30 minutes</item>
|
||||
<item>1 hour</item>
|
||||
<item>3 hours</item>
|
||||
<item>6 hours</item>
|
||||
<item>Never</item>
|
||||
<string name="pref_title_default_currency">Default currency</string>
|
||||
<string-array name="pref_default_currencies_titles">
|
||||
<item>USD</item>
|
||||
<item>EUR</item>
|
||||
<item>BTC</item>
|
||||
<item>ETH</item>
|
||||
</string-array>
|
||||
<string-array name="pref_sync_frequency_values">
|
||||
<item>15</item>
|
||||
<item>30</item>
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>-1</item>
|
||||
|
||||
<string-array name="pref_default_currencies_values">
|
||||
<item>USD</item>
|
||||
<item>EUR</item>
|
||||
<item>BTC</item>
|
||||
<item>ETH</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="list_preference_entries">
|
||||
@ -142,12 +139,17 @@
|
||||
<string name="currencyBalancePlaceholder">%1$s%2$s</string>
|
||||
<string name="currencyDollarParenthesisPlaceholder">(US$%1$s)</string>
|
||||
<string name="currencyDollarPlaceholder">US$%1$s</string>
|
||||
<string name="currencyEurosParenthesisPlaceholder">(%1$s€)</string>
|
||||
<string name="currencyEurosPlaceholder">%1$s€</string>
|
||||
<string name="currencyPercentagePlaceholder">%1$s%%</string>
|
||||
<string name="fluctuationDollarPercentagePlaceholder">US$%1$s (%2$s%)</string>
|
||||
<string name="fluctuationEurosPercentagePlaceholder">%1$s€ (%2$s%)</string>
|
||||
|
||||
<!--DetailsActivity placeholders-->
|
||||
<string name="volumePlaceholder">Volume\nUS$%1$s</string>
|
||||
<string name="pricePlaceholder">Price\nUS$%1$s</string>
|
||||
<string name="volumeDollarPlaceholder">Volume\nUS$%1$s</string>
|
||||
<string name="priceDollarPlaceholder">Price\nUS$%1$s</string>
|
||||
<string name="volumeEurosPlaceholder">Volume\n%1$s€</string>
|
||||
<string name="priceEurosPlaceholder">Price\n%1$s€</string>
|
||||
<string name="timestampPlaceholder">Date\n%1$s</string>
|
||||
|
||||
<string name="title_activity_main">MainActivity</string>
|
||||
@ -156,8 +158,10 @@
|
||||
<string name="fingerprint_dialog_title">Verify your fingerprint to continue</string>
|
||||
|
||||
|
||||
<string name="market_cap_textview">Total Market Capitalization :\nUS$%1$s</string>
|
||||
<string name="volume_market_cap_textview">24h volume :\nUS$%1$s</string>
|
||||
<string name="market_cap_dollar_textview">Total Market Capitalization :\nUS$%1$s</string>
|
||||
<string name="volume_dollar_market_cap_textview">24h volume :\nUS$%1$s</string>
|
||||
<string name="market_cap_euros_textview">Total Market Capitalization :\n%1$s€</string>
|
||||
<string name="volume_euros_market_cap_textview">24h volume :\n%1$s€</string>
|
||||
<string name="title_activity_scrolling">ScrollingActivity</string>
|
||||
|
||||
</resources>
|
||||
|
@ -3,14 +3,14 @@
|
||||
<!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
|
||||
dismiss it. -->
|
||||
<!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
|
||||
<ListPreference
|
||||
<!--<ListPreference
|
||||
android:defaultValue="180"
|
||||
android:entries="@array/pref_sync_frequency_titles"
|
||||
android:entryValues="@array/pref_sync_frequency_values"
|
||||
android:key="sync_frequency"
|
||||
android:negativeButtonText="@null"
|
||||
android:positiveButtonText="@null"
|
||||
android:title="@string/pref_title_sync_frequency" />
|
||||
android:entries="@array/pref_sync_frequency_titles"
|
||||
android:entryValues="@array/pref_sync_frequency_values"
|
||||
android:key="sync_frequency"
|
||||
android:negativeButtonText="@null"
|
||||
android:positiveButtonText="@null"
|
||||
android:title="@string/pref_title_sync_frequency" />-->
|
||||
|
||||
<!-- This preference simply launches an intent when selected. Use this UI sparingly, per
|
||||
design guidelines. -->
|
||||
|
@ -5,6 +5,16 @@
|
||||
android:key="hide_balance"
|
||||
android:title="@string/pref_title_hide_balance" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="USD"
|
||||
android:entries="@array/pref_default_currencies_titles"
|
||||
android:entryValues="@array/pref_default_currencies_values"
|
||||
android:key="default_currency"
|
||||
android:negativeButtonText="@null"
|
||||
android:positiveButtonText="@null"
|
||||
android:title="@string/pref_title_default_currency" />
|
||||
|
||||
|
||||
<!-- NOTE: EditTextPreference accepts EditText attributes. -->
|
||||
<!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->
|
||||
<!--<EditTextPreference
|
||||
|
Loading…
Reference in New Issue
Block a user