diff --git a/app/build.gradle b/app/build.gradle index f21d1f6..6a810b4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,7 +40,9 @@ dependencies { implementation 'com.squareup.retrofit2:converter-jackson:2.2.0' implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0' implementation 'org.apache.commons:commons-lang3:3.6' + implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3' implementation 'com.mattprecious.swirl:swirl:1.1.0' + //implementation 'com.github.lecho:hellocharts-library:1.5.8@aar' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' diff --git a/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java b/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java index 25bc71e..bc27cb0 100644 --- a/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java +++ b/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java @@ -102,7 +102,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity { Intent intent = getIntent(); //symbol = intent.getStringExtra("symbol"); - currency = (Currency) intent.getParcelableExtra("currency"); + currency = intent.getParcelableExtra("currency"); databaseManager = new DatabaseManager(this); @@ -131,7 +131,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity { setTitle(currency.getName()); - BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation_details); + BottomNavigationView navigation = findViewById(R.id.navigation_details); navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener); hasBeenModified = false; @@ -297,7 +297,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity { chartView.reset(); - chartView.setAxisBorderValues((float) valMin, (float) valMax); + chartView.setAxisBorderValues(valMin, valMax); chartView.setYLabels(AxisRenderer.LabelPosition.NONE); chartView.setYAxis(false); chartView.setXAxis(false); diff --git a/app/src/main/java/com/nauk/coinfolio/Activities/HomeActivity.java b/app/src/main/java/com/nauk/coinfolio/Activities/HomeActivity.java index f7ca4ed..bbce56b 100644 --- a/app/src/main/java/com/nauk/coinfolio/Activities/HomeActivity.java +++ b/app/src/main/java/com/nauk/coinfolio/Activities/HomeActivity.java @@ -4,6 +4,8 @@ import android.app.Dialog; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.graphics.Color; +import android.graphics.Typeface; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; @@ -14,11 +16,14 @@ import android.support.design.widget.BottomNavigationView; import android.support.design.widget.CollapsingToolbarLayout; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; -import android.support.v4.widget.NestedScrollView; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.graphics.Palette; import android.support.v7.widget.Toolbar; +import android.text.SpannableString; +import android.text.style.ForegroundColorSpan; +import android.text.style.RelativeSizeSpan; +import android.text.style.StyleSpan; import android.util.Log; import android.view.Gravity; import android.view.Menu; @@ -27,18 +32,24 @@ import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; -import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.ViewFlipper; +import com.github.mikephil.charting.animation.Easing; +import com.github.mikephil.charting.charts.PieChart; +import com.github.mikephil.charting.data.PieData; +import com.github.mikephil.charting.data.PieDataSet; +import com.github.mikephil.charting.data.PieEntry; +import com.github.mikephil.charting.utils.ColorTemplate; import com.luseen.spacenavigation.SpaceItem; import com.luseen.spacenavigation.SpaceNavigationView; import com.luseen.spacenavigation.SpaceOnClickListener; import com.nauk.coinfolio.DataManagers.BalanceManager; import com.nauk.coinfolio.DataManagers.CurrencyData.Currency; +import com.nauk.coinfolio.DataManagers.MarketCapManager; import com.nauk.coinfolio.DataManagers.PreferencesManager; import com.nauk.coinfolio.LayoutManagers.HomeLayoutGenerator; import com.nauk.coinfolio.R; @@ -47,6 +58,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; //Use WilliamChart for charts https://github.com/diogobernardino/WilliamChart @@ -64,9 +76,11 @@ public class HomeActivity extends AppCompatActivity { private PreferencesManager preferencesManager; private HomeLayoutGenerator layoutGenerator; private BalanceManager balanceManager; + private MarketCapManager marketCapManager; private int coinCounter; private int iconCounter; + private int marketCapCounter; private long lastTimestamp; private boolean detailsChecker; private boolean isDetailed; @@ -117,10 +131,11 @@ public class HomeActivity extends AppCompatActivity { generateSplash(); - //Objects initializatoin + //Objects initialization preferencesManager = new PreferencesManager(this); layoutGenerator = new HomeLayoutGenerator(this); balanceManager = new BalanceManager(this); + marketCapManager = new MarketCapManager(this); handler = new Handler(); updateRunnable = new Runnable() { @Override @@ -190,7 +205,21 @@ public class HomeActivity extends AppCompatActivity { new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { - updateAll(false); + switch (viewFlipper.getDisplayedChild()) + { + case 0: + Log.d(getResources().getString(R.string.debug), "Watchlist"); + refreshLayout.setRefreshing(false); + break; + case 1: + updateAll(false); + break; + case 2: + Log.d(getResources().getString(R.string.debug), "Market cap"); + refreshLayout.setRefreshing(false); + break; + } + } } ); @@ -221,7 +250,7 @@ public class HomeActivity extends AppCompatActivity { private void setupNavBar(Bundle savedInstanceState) { - final SpaceNavigationView spaceNavigationView = (SpaceNavigationView) findViewById(R.id.space); + final SpaceNavigationView spaceNavigationView = findViewById(R.id.space); spaceNavigationView.initWithSaveInstanceState(savedInstanceState); spaceNavigationView.addSpaceItem(new SpaceItem("Charts", R.drawable.ic_show_chart_black_24dp)); spaceNavigationView.addSpaceItem(new SpaceItem("Market Cap.", R.drawable.ic_pie_chart_black_24dp)); @@ -240,7 +269,7 @@ public class HomeActivity extends AppCompatActivity { nav.changeCurrentItem(-1); - ((NestedScrollView) findViewById(R.id.nestedScrollViewLayout)).setNestedScrollingEnabled(true); + findViewById(R.id.nestedScrollViewLayout).setNestedScrollingEnabled(true); ((AppBarLayout) findViewById(R.id.app_bar)).setExpanded(true, true); findViewById(R.id.switch_button).setVisibility(View.VISIBLE); @@ -255,8 +284,8 @@ public class HomeActivity extends AppCompatActivity { //0 : Unknown //1 : Market cap - ((NestedScrollView) findViewById(R.id.nestedScrollViewLayout)).setNestedScrollingEnabled(false); ((AppBarLayout) findViewById(R.id.app_bar)).setExpanded(false, true); + findViewById(R.id.nestedScrollViewLayout).setNestedScrollingEnabled(false); findViewById(R.id.switch_button).setVisibility(View.GONE); @@ -359,8 +388,6 @@ public class HomeActivity extends AppCompatActivity { updateViewButtonIcon(); } - - private void updateAll(boolean mustUpdate) { if(System.currentTimeMillis()/1000 - lastTimestamp > 60 || mustUpdate) @@ -470,6 +497,77 @@ public class HomeActivity extends AppCompatActivity { }); } + private void updateMarketCap() + { + marketCapCounter = 0; + + marketCapManager.updateTopCurrencies(new MarketCapManager.VolleyCallBack() { + @Override + public void onSuccess() + { + countCompletedMarketCapRequest(); + } + }); + + marketCapManager.updateMarketCap(new MarketCapManager.VolleyCallBack() { + @Override + public void onSuccess() { + countCompletedMarketCapRequest(); + } + }); + } + + private void countCompletedMarketCapRequest() + { + marketCapCounter++; + + if(marketCapCounter == 2) + { + findViewById(R.id.progressBarMarketCap).setVisibility(View.GONE); + + List entries = new ArrayList<>(); + + PieChart pieChart = findViewById(R.id.marketCapPieChart); + + float otherCurrenciesDominance = 0; + + for(Iterator i = marketCapManager.getDominance().keySet().iterator(); i.hasNext(); ) + { + String key = (String) i.next(); + Log.d(getResources().getString(R.string.debug), "Sym : " + key + " " + marketCapManager.getDominance().get(key)); + entries.add(new PieEntry(marketCapManager.getDominance().get(key), key)); + otherCurrenciesDominance += marketCapManager.getDominance().get(key); + } + + entries.add(new PieEntry(100-otherCurrenciesDominance, "Others")); + + PieDataSet set = new PieDataSet(entries, "Market Cap Dominance"); + PieData data = new PieData(set); + pieChart.setData(data); + + pieChart.setDrawSlicesUnderHole(true); + pieChart.setUsePercentValues(true); + pieChart.setTouchEnabled(false); + + pieChart.getDescription().setEnabled(false); + pieChart.setCenterText(generateCenterSpannableText()); + pieChart.setVisibility(View.VISIBLE); + pieChart.invalidate(); // refresh + } + } + + private SpannableString generateCenterSpannableText() { + + SpannableString s = new SpannableString("MPAndroidChart\ndeveloped by Philipp Jahoda"); + s.setSpan(new RelativeSizeSpan(1.7f), 0, 14, 0); + s.setSpan(new StyleSpan(Typeface.NORMAL), 14, s.length() - 15, 0); + s.setSpan(new ForegroundColorSpan(Color.GRAY), 14, s.length() - 15, 0); + s.setSpan(new RelativeSizeSpan(.8f), 14, s.length() - 15, 0); + s.setSpan(new StyleSpan(Typeface.ITALIC), s.length() - 14, s.length(), 0); + s.setSpan(new ForegroundColorSpan(ColorTemplate.getHoloBlue()), s.length() - 14, s.length(), 0); + return s; + } + private void countCoins(boolean isCoin, boolean isDetails) { if(isCoin) @@ -486,21 +584,8 @@ public class HomeActivity extends AppCompatActivity { { if(coinCounter == balanceManager.getTotalBalance().size() && detailsChecker) { - for (int i = 0; i < balanceManager.getTotalBalance().size(); i++) - { - final Currency localCurrency = balanceManager.getTotalBalance().get(i); - - if(balanceManager.getIconUrl(localCurrency.getSymbol()) != null) - { - getBitmapFromURL(balanceManager.getIconUrl(localCurrency.getSymbol()), new IconCallBack() { - @Override - public void onSuccess(Bitmap bitmapIcon) { - localCurrency.setIcon(bitmapIcon); - countIcons(); - } - }); - } - } + IconDownloader iconDownloader = new IconDownloader(); + iconDownloader.execute(); } else { @@ -559,6 +644,49 @@ public class HomeActivity extends AppCompatActivity { loadingDialog.show(); } + private class IconDownloader extends AsyncTask + { + @Override + protected void onPreExecute() + { + super.onPreExecute(); + } + + @Override + protected void onProgressUpdate(Integer... values) + { + super.onProgressUpdate(values); + } + + @Override + protected Void doInBackground(Void... params) + { + for (int i = 0; i < balanceManager.getTotalBalance().size(); i++) + { + final Currency localCurrency = balanceManager.getTotalBalance().get(i); + + if(balanceManager.getIconUrl(localCurrency.getSymbol()) != null) + { + getBitmapFromURL(balanceManager.getIconUrl(localCurrency.getSymbol()), new IconCallBack() { + @Override + public void onSuccess(Bitmap bitmapIcon) { + localCurrency.setIcon(bitmapIcon); + countIcons(); + } + }); + } + } + + return null; + } + + @Override + protected void onPostExecute(Void result) + { + + } + } + private class UiHeavyLoadCalculator extends AsyncTask { @@ -765,7 +893,9 @@ public class HomeActivity extends AppCompatActivity { } }); - balanceManager.updateMarketCap(new BalanceManager.VolleyCallBack() { + updateMarketCap(); + + /*marketCapManager.updateTopCurrencies(new BalanceManager.VolleyCallBack() { @Override public void onSuccess() { @@ -774,7 +904,7 @@ public class HomeActivity extends AppCompatActivity { @Override public void onError(String error) { - }}); + }});*/ return null; } diff --git a/app/src/main/java/com/nauk/coinfolio/Activities/SettingsActivity.java b/app/src/main/java/com/nauk/coinfolio/Activities/SettingsActivity.java index b97d755..40e91e8 100644 --- a/app/src/main/java/com/nauk/coinfolio/Activities/SettingsActivity.java +++ b/app/src/main/java/com/nauk/coinfolio/Activities/SettingsActivity.java @@ -2,8 +2,6 @@ package com.nauk.coinfolio.Activities; import android.Manifest; import android.annotation.TargetApi; -import android.app.DialogFragment; -import android.app.FragmentManager; import android.app.KeyguardManager; import android.content.Context; import android.content.Intent; @@ -21,7 +19,6 @@ import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; -import android.preference.PreferenceScreen; import android.preference.RingtonePreference; import android.security.keystore.KeyGenParameterSpec; import android.security.keystore.KeyPermanentlyInvalidatedException; diff --git a/app/src/main/java/com/nauk/coinfolio/DataManagers/BalanceManager.java b/app/src/main/java/com/nauk/coinfolio/DataManagers/BalanceManager.java index 1121550..94655ab 100644 --- a/app/src/main/java/com/nauk/coinfolio/DataManagers/BalanceManager.java +++ b/app/src/main/java/com/nauk/coinfolio/DataManagers/BalanceManager.java @@ -1,37 +1,26 @@ package com.nauk.coinfolio.DataManagers; import android.os.StrictMode; -import android.util.Base64; import android.util.Log; -import com.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; -import com.android.volley.toolbox.JsonArrayRequest; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; -import com.binance.api.client.BinanceApiClientFactory; -import com.binance.api.client.BinanceApiRestClient; -import com.binance.api.client.domain.account.Account; -import com.binance.api.client.domain.account.AssetBalance; import com.nauk.coinfolio.DataManagers.CurrencyData.Currency; import com.nauk.coinfolio.DataManagers.ExchangeManager.BinanceManager; import com.nauk.coinfolio.DataManagers.ExchangeManager.HitBtcManager; import com.nauk.coinfolio.R; -import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; -import java.util.Set; import java.util.regex.Pattern; /** @@ -296,27 +285,6 @@ public class BalanceManager { } } - public void updateMarketCap(final VolleyCallBack callBack) - { - StringRequest strRequest = new StringRequest(Request.Method.GET, detailUrl, - new Response.Listener() { - @Override - public void onResponse(String response) { - if (response.length() > 0) { - - } - } - }, - new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - - } - }); - - requestQueue.add(strRequest); - } - public void updateDetails(final IconCallBack callBack) { StringRequest strRequest = new StringRequest(Request.Method.GET, detailUrl, diff --git a/app/src/main/java/com/nauk/coinfolio/DataManagers/ExchangeManager/BinanceManager.java b/app/src/main/java/com/nauk/coinfolio/DataManagers/ExchangeManager/BinanceManager.java index 4c1a2df..a035ca1 100644 --- a/app/src/main/java/com/nauk/coinfolio/DataManagers/ExchangeManager/BinanceManager.java +++ b/app/src/main/java/com/nauk/coinfolio/DataManagers/ExchangeManager/BinanceManager.java @@ -1,8 +1,5 @@ package com.nauk.coinfolio.DataManagers.ExchangeManager; -import android.util.Log; - -import com.android.volley.RequestQueue; import com.binance.api.client.BinanceApiClientFactory; import com.binance.api.client.BinanceApiRestClient; import com.binance.api.client.domain.account.Account; diff --git a/app/src/main/java/com/nauk/coinfolio/DataManagers/MarketCapManager.java b/app/src/main/java/com/nauk/coinfolio/DataManagers/MarketCapManager.java new file mode 100644 index 0000000..80ea578 --- /dev/null +++ b/app/src/main/java/com/nauk/coinfolio/DataManagers/MarketCapManager.java @@ -0,0 +1,139 @@ +package com.nauk.coinfolio.DataManagers; + +import android.util.Log; + +import com.android.volley.Request; +import com.android.volley.RequestQueue; +import com.android.volley.Response; +import com.android.volley.VolleyError; +import com.android.volley.toolbox.StringRequest; +import com.android.volley.toolbox.Volley; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.regex.Pattern; + +/** + * Created by Guitoune on 02/03/2018. + */ + +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 android.content.Context context; + private RequestQueue requestQueue; + private String topRequestResult[]; + private long marketCap; + + public MarketCapManager(android.content.Context context) + { + this.context = context; + + requestQueue = Volley.newRequestQueue(context); + } + + public void updateTopCurrencies(final VolleyCallBack callBack) + { + StringRequest strRequest = new StringRequest(Request.Method.GET, topCurrenciesUrl, + new Response.Listener() { + @Override + public void onResponse(String response) { + if (response.length() > 0) { + processTopCurrencies(response); + } + + callBack.onSuccess(); + } + }, + new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + + } + }); + + requestQueue.add(strRequest); + } + + public void updateMarketCap(final VolleyCallBack callBack) + { + StringRequest strRequest = new StringRequest(Request.Method.GET, marketCapUrl, + new Response.Listener() { + @Override + public void onResponse(String response) { + if (response.length() > 0) { + processMarketCapData(response); + } + + callBack.onSuccess(); + } + }, + new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + + } + }); + + requestQueue.add(strRequest); + } + + private void processMarketCapData(String response) + { + try { + JSONObject jsonObject = new JSONObject(response); + + marketCap = new BigDecimal(jsonObject.getString("total_market_cap_usd")).longValue(); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + public HashMap getDominance() + { + HashMap dominance = new HashMap<>(); + + for(int i = 0; i < topRequestResult.length; i++) + { + try { + JSONObject jsonObject = new JSONObject(topRequestResult[i]); + + dominance.put(jsonObject.getString("symbol"), (Float.parseFloat(jsonObject.getString("market_cap_usd")) / marketCap)*100); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + return dominance; + } + + private void processTopCurrencies(String response) + { + response = response.substring(response.indexOf('[')+1, response.lastIndexOf(']')); + + topRequestResult = response.split(Pattern.quote("},")); + + for(int i = 0; i < topRequestResult.length; i++) + { + try { + topRequestResult[i] += "}"; + + JSONObject jsonObject = new JSONObject(topRequestResult[i]); + + Log.d("coinfolio", "Symbol : " + jsonObject.getString("symbol") + " " + jsonObject.getString("rank")); + + } catch (JSONException e) { + e.printStackTrace(); + } + } + } + + public interface VolleyCallBack + { + void onSuccess(); + } +} diff --git a/app/src/main/java/com/nauk/coinfolio/FingerprintToolkit/FingerprintDialogFragment.java b/app/src/main/java/com/nauk/coinfolio/FingerprintToolkit/FingerprintDialogFragment.java index 662c12d..86ab29e 100644 --- a/app/src/main/java/com/nauk/coinfolio/FingerprintToolkit/FingerprintDialogFragment.java +++ b/app/src/main/java/com/nauk/coinfolio/FingerprintToolkit/FingerprintDialogFragment.java @@ -1,30 +1,15 @@ package com.nauk.coinfolio.FingerprintToolkit; -import android.Manifest; -import android.app.AlertDialog; -import android.app.Dialog; import android.app.DialogFragment; -import android.app.KeyguardManager; -import android.content.Context; -import android.content.pm.PackageManager; -import android.graphics.Color; import android.graphics.PorterDuff; -import android.hardware.fingerprint.FingerprintManager; -import android.os.Build; import android.os.Bundle; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; -import android.support.v4.content.res.ResourcesCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.view.animation.Animation; import android.widget.Button; -import android.widget.LinearLayout; import android.widget.TextView; import com.mattprecious.swirl.SwirlView; -import com.nauk.coinfolio.Activities.SettingsActivity; import com.nauk.coinfolio.R; /** @@ -49,7 +34,7 @@ public class FingerprintDialogFragment extends DialogFragment{ //getDialog().getWindow().setLayout(getResources().getDimensionPixelSize(R.dimen.fingerprint_dialog_width), getResources().getDimensionPixelSize(R.dimen.fingerprint_dialog_height)); - ((Button) view.findViewById(R.id.cancelButton)).setOnClickListener(new View.OnClickListener() { + view.findViewById(R.id.cancelButton).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { dismiss(); diff --git a/app/src/main/java/com/nauk/coinfolio/FingerprintToolkit/FingerprintHandler.java b/app/src/main/java/com/nauk/coinfolio/FingerprintToolkit/FingerprintHandler.java index b52a472..bdbc661 100644 --- a/app/src/main/java/com/nauk/coinfolio/FingerprintToolkit/FingerprintHandler.java +++ b/app/src/main/java/com/nauk/coinfolio/FingerprintToolkit/FingerprintHandler.java @@ -7,8 +7,6 @@ import android.hardware.fingerprint.FingerprintManager; import android.os.CancellationSignal; import android.os.Handler; import android.support.v4.app.ActivityCompat; -import android.app.DialogFragment; -import android.widget.Toast; /** * Created by Guitoune on 28/02/2018. diff --git a/app/src/main/java/com/nauk/coinfolio/LayoutManagers/CurrencyAdapter.java b/app/src/main/java/com/nauk/coinfolio/LayoutManagers/CurrencyAdapter.java index 628eba2..5691fd8 100644 --- a/app/src/main/java/com/nauk/coinfolio/LayoutManagers/CurrencyAdapter.java +++ b/app/src/main/java/com/nauk/coinfolio/LayoutManagers/CurrencyAdapter.java @@ -36,8 +36,8 @@ public class CurrencyAdapter extends ArrayAdapter { if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.custom_currency_row, parent, false); } - TextView currencyName = (TextView) convertView.findViewById(R.id.currencyName); - TextView currencySymbol = (TextView) convertView.findViewById(R.id.currencySymbol); + TextView currencyName = convertView.findViewById(R.id.currencyName); + TextView currencySymbol = convertView.findViewById(R.id.currencySymbol); if (currencyName != null) currencyName.setText(currency.getName()); if(currencySymbol != null) diff --git a/app/src/main/java/com/nauk/coinfolio/LayoutManagers/HomeLayoutGenerator.java b/app/src/main/java/com/nauk/coinfolio/LayoutManagers/HomeLayoutGenerator.java index 286bfb6..81a6147 100644 --- a/app/src/main/java/com/nauk/coinfolio/LayoutManagers/HomeLayoutGenerator.java +++ b/app/src/main/java/com/nauk/coinfolio/LayoutManagers/HomeLayoutGenerator.java @@ -90,7 +90,7 @@ public class HomeLayoutGenerator { if(currency.getHistoryMinutes() != null) { List borders = getAxisBorders(currency); - LineChartView chartView = (LineChartView) view.findViewById(R.id.LineChartView); + LineChartView chartView = view.findViewById(R.id.LineChartView); chartView.setAxisBorderValues(borders.get(0).floatValue(), borders.get(1).floatValue()) .setYLabels(AxisRenderer.LabelPosition.NONE) @@ -141,7 +141,7 @@ public class HomeLayoutGenerator { if(currency.getHistoryMinutes() != null) { - ((LineChartView) view.findViewById(R.id.LineChartView)).setVisibility(View.VISIBLE); + view.findViewById(R.id.LineChartView).setVisibility(View.VISIBLE); ((LineChartView) view.findViewById(R.id.LineChartView)).show(); view.findViewById(R.id.errorTextView).setVisibility(View.GONE); } diff --git a/app/src/main/res/drawable/ic_remove_red_eye_black_24dp.xml b/app/src/main/res/drawable/ic_remove_red_eye_black_24dp.xml new file mode 100644 index 0000000..e02f1d1 --- /dev/null +++ b/app/src/main/res/drawable/ic_remove_red_eye_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/content_currency_summary.xml b/app/src/main/res/layout/content_currency_summary.xml index faeb8b6..aba6394 100644 --- a/app/src/main/res/layout/content_currency_summary.xml +++ b/app/src/main/res/layout/content_currency_summary.xml @@ -79,7 +79,8 @@ android:id="@+id/layoutProgressMarketCap" android:layout_width="match_parent" android:layout_height="match_parent" - android:visibility="visible"> + android:visibility="visible" + android:orientation="vertical"> + diff --git a/app/src/main/res/layout/fragment_fingerprint_scanner.xml b/app/src/main/res/layout/fragment_fingerprint_scanner.xml index 24fa4b7..c51bffb 100644 --- a/app/src/main/res/layout/fragment_fingerprint_scanner.xml +++ b/app/src/main/res/layout/fragment_fingerprint_scanner.xml @@ -1,6 +1,5 @@ + android:title="@string/title_watchlist" /> + android:icon="@drawable/ic_remove_red_eye_black_24dp" + android:title="@string/title_watchlist" /> Amount Purchased price CurrencyDetailsActivity - Charts + Watchlist Infos Transactions Home diff --git a/build.gradle b/build.gradle index e6b32bc..7221b2c 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,7 @@ allprojects { repositories { google() jcenter() + maven { url "https://jitpack.io" } } }