Several fixs

- Rework DetailsActivity code
- Fix Home and Watchlist UI generation
This commit is contained in:
Tanguy Herbron 2018-05-16 01:09:55 +02:00
parent a5f2d9a1fd
commit 8f45e65666
16 changed files with 1064 additions and 1987 deletions

View File

@ -33,6 +33,7 @@ import com.nauk.moodl.Activities.CurrencyDetailsActivity;
import com.nauk.moodl.DataManagers.CurrencyData.Currency;
import com.nauk.moodl.DataManagers.CurrencyData.CurrencyDataChart;
import com.nauk.moodl.DataManagers.PreferencesManager;
import com.nauk.moodl.LayoutManagers.CustomViewPager;
import com.nauk.moodl.PlaceholderManager;
import com.nauk.moodl.R;
@ -462,7 +463,8 @@ public class Home extends Fragment {
barChart.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
public boolean onTouch(View view, MotionEvent motionEvent)
{
return toucheEvent(motionEvent);
}
});
@ -478,12 +480,19 @@ public class Home extends Fragment {
private boolean toucheEvent(MotionEvent motionEvent)
{
if(motionEvent.getAction() == MotionEvent.ACTION_UP)
switch (motionEvent.getAction())
{
case MotionEvent.ACTION_DOWN:
((CustomViewPager) view.getParent()).setPagingEnabled(false);
break;
case MotionEvent.ACTION_UP:
((CustomViewPager) view.getParent()).setPagingEnabled(true);
lineChart.highlightValue(null);
updateFluctuation(lineChart.getData().getDataSets().get(0).getEntryForIndex(0).getY(), lineChart.getData().getDataSets().get(0).getEntryForIndex(lineChart.getData().getDataSets().get(0).getEntryCount() - 1).getY());
barChart.highlightValues(null);
hideDataIndicators();
break;
}
return false;
@ -518,7 +527,8 @@ public class Home extends Fragment {
lineChart.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
public boolean onTouch(View view, MotionEvent motionEvent)
{
return toucheEvent(motionEvent);
}
});

View File

@ -1,10 +1,153 @@
package com.nauk.moodl.Activities.DetailsActivityFragments;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.nauk.moodl.DataManagers.CurrencyData.Currency;
import com.nauk.moodl.DataManagers.PreferencesManager;
import com.nauk.moodl.PlaceholderManager;
import com.nauk.moodl.R;
import static com.nauk.moodl.MoodlBox.numberConformer;
/**
* Created by Tiji on 13/05/2018.
*/
public class Informations extends Fragment {
private Currency currency;
private View view;
private PreferencesManager preferencesManager;
private boolean isSnapshotUpdated;
private boolean isTickerUpdated;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
{
view = inflater.inflate(R.layout.fragment_informations_detailsactivity, container, false);
isSnapshotUpdated = false;
isTickerUpdated = false;
currency = getActivity().getIntent().getParcelableExtra("currency");
preferencesManager = new PreferencesManager(getContext());
updateInfoTab();
return view;
}
private void updateInfoTab()
{
currency.updateSnapshot(getContext(), new Currency.CurrencyCallBack() {
@Override
public void onSuccess(final Currency currency) {
isSnapshotUpdated = true;
dataCounter();
}
});
currency.updateTicker(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
@Override
public void onSuccess(Currency currency) {
isTickerUpdated = true;
dataCounter();
}
});
}
private void dataCounter()
{
if(isTickerUpdated && isSnapshotUpdated)
{
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
refreshInfoTab();
}
});
}
}
private void refreshInfoTab()
{
Drawable progressBarDrawable = ((ProgressBar) view.findViewById(R.id.percentageCoinEmited)).getProgressDrawable();
progressBarDrawable.mutate();
progressBarDrawable.setColorFilter(new PorterDuffColorFilter(currency.getChartColor(), PorterDuff.Mode.SRC_IN));
progressBarDrawable.invalidateSelf();
((ProgressBar) view.findViewById(R.id.percentageCoinEmited))
.setProgress((int) Math.round(currency.getMinedCoinSupply() / currency.getMaxCoinSupply() * 100));
if(currency.getAlgorithm() != null && !currency.getAlgorithm().equals(""))
{
((TextView) view.findViewById(R.id.txtViewAlgorithm))
.setText(currency.getAlgorithm());
}
if(currency.getProofType() != null && !currency.getProofType().equals(""))
{
((TextView) view.findViewById(R.id.txtViewProofType))
.setText(currency.getProofType());
}
if(currency.getStartDate() != null && !currency.getStartDate().equals(""))
{
((TextView) view.findViewById(R.id.txtViewStartDate))
.setText(currency.getStartDate());
}
if(currency.getDescription() != null)
{
((TextView) view.findViewById(R.id.txtViewDescription))
.setText(Html.fromHtml(currency.getDescription()));
}
((TextView) view.findViewById(R.id.txtViewDescription))
.setMovementMethod(LinkMovementMethod.getInstance());
((TextView) view.findViewById(R.id.txtViewPercentageCoinEmited))
.setText("Percentage of coin emited : " + numberConformer(currency.getMinedCoinSupply() / currency.getMaxCoinSupply() * 100) + "%");
if(currency.getMarketCapitalization() != 0)
{
((TextView) view.findViewById(R.id.txtViewMarketCapitalization))
.setText(PlaceholderManager.getValueString(numberConformer(currency.getMarketCapitalization()), getContext()));
view.findViewById(R.id.linearMarketCap).setVisibility(View.VISIBLE);
}
if(currency.getRank() != 0)
{
((TextView) view.findViewById(R.id.txtViewRank))
.setText(String.valueOf(currency.getRank()));
view.findViewById(R.id.linearRank).setVisibility(View.VISIBLE);
}
if(currency.getMaxCoinSupply() == 0)
{
((TextView) view.findViewById(R.id.txtViewTotalSupply))
.setText(PlaceholderManager.getSymbolString("Infinity", getActivity()));
}
else
{
((TextView) view.findViewById(R.id.txtViewTotalSupply))
.setText(PlaceholderManager.getSymbolString(numberConformer(currency.getMaxCoinSupply()), getActivity()));
}
((TextView) view.findViewById(R.id.txtViewCirculatingSupply))
.setText(PlaceholderManager.getSymbolString(numberConformer(currency.getMinedCoinSupply()), getActivity()));
}
}

View File

@ -1,10 +1,274 @@
package com.nauk.moodl.Activities.DetailsActivityFragments;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.ListView;
import android.widget.ProgressBar;
import com.nauk.moodl.DataManagers.CurrencyData.Currency;
import com.nauk.moodl.DataManagers.CurrencyData.Trade;
import com.nauk.moodl.DataManagers.CurrencyData.Transaction;
import com.nauk.moodl.DataManagers.DatabaseManager;
import com.nauk.moodl.DataManagers.ExchangeManager.BinanceManager;
import com.nauk.moodl.DataManagers.PreferencesManager;
import com.nauk.moodl.LayoutManagers.TradeListAdapter;
import com.nauk.moodl.LayoutManagers.TransactionListAdapter;
import com.nauk.moodl.R;
import java.util.ArrayList;
/**
* Created by Tiji on 13/05/2018.
*/
public class Transactions extends Fragment {
private Currency currency;
private View loadingFooter;
private View view;
private ListView tradeLayout;
private ListView transactionLayout;
private boolean flag_loading;
private BinanceManager binanceManager;
private DatabaseManager databaseManager;
private TradeListAdapter tradeListAdapter;
private ArrayList<com.nauk.moodl.DataManagers.CurrencyData.Trade> returnedTrades;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
view = inflater.inflate(R.layout.fragment_transactions_detailsactivity, container, false);
PreferencesManager preferencesManager = new PreferencesManager(getContext());
currency = getActivity().getIntent().getParcelableExtra("currency");
databaseManager = new DatabaseManager(getContext());
binanceManager = new BinanceManager(preferencesManager.getBinancePublicKey(), preferencesManager.getBinancePrivateKey());
tradeLayout = view.findViewById(R.id.listTrades);
transactionLayout = view.findViewById(R.id.listTransactions);
flag_loading = false;
TransactionUpdater transactionUpdater = new TransactionUpdater();
transactionUpdater.execute();
TradeUpdater updater = new TradeUpdater();
updater.execute();
return view;
}
private void loadingIndicatorGenerator()
{
loadingFooter = LayoutInflater.from(getContext()).inflate(R.layout.listview_loading_indicator, null, false);
Drawable drawable = ((ProgressBar) loadingFooter.findViewById(R.id.progressIndicator)).getIndeterminateDrawable();
drawable.mutate();
drawable.setColorFilter(new PorterDuffColorFilter(currency.getChartColor(), PorterDuff.Mode.SRC_IN));
drawable.invalidateSelf();
tradeLayout.addFooterView(loadingFooter);
}
private void drawTradeList(ArrayList<com.nauk.moodl.DataManagers.CurrencyData.Trade> trades)
{
if(returnedTrades.size() > 20)
{
tradeLayout.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView absListView, int i) {
}
@Override
public void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if(firstVisibleItem+visibleItemCount == totalItemCount && totalItemCount!=0)
{
if(!flag_loading && tradeLayout.getCount() != returnedTrades.size() - 1)
{
flag_loading = true;
TradeAdder tradeAdder = new TradeAdder();
tradeAdder.execute();
}
}
}
});
}
tradeListAdapter = new TradeListAdapter(getContext(), trades);
tradeLayout.setAdapter(tradeListAdapter);
tradeLayout.setTextFilterEnabled(false);
view.findViewById(R.id.tradeLoaderIndicator).setVisibility(View.GONE);
}
private class TradeAdder extends AsyncTask<Void, Integer, Void>
{
@Override
protected void onPreExecute()
{
super.onPreExecute();
loadingIndicatorGenerator();
}
@Override
protected Void doInBackground(Void... voids) {
final ArrayList<Trade> trades = new ArrayList<>();
for(int i = tradeLayout.getCount(); i < tradeLayout.getCount() + 20 && i < returnedTrades.size(); i++)
{
trades.add(returnedTrades.get(i));
}
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
tradeListAdapter.addAll(trades);
tradeListAdapter.notifyDataSetChanged();
flag_loading = false;
tradeLayout.removeFooterView(loadingFooter);
}
});
/*binanceManager.updateTrades(new BinanceManager.BinanceCallBack() {
@Override
public void onSuccess() {
ArrayList<com.nauk.moodl.DataManagers.CurrencyData.Trade> trades = binanceManager.getTrades();
final ArrayList<com.nauk.moodl.DataManagers.CurrencyData.Trade> returnedTrades = new ArrayList<>();
for(int i = trades.size() - 1; i > 0 ; i--)
{
returnedTrades.add(trades.get(i));
}
runOnUiThread(new Runnable() {
@Override
public void run() {
tradeListAdapter.addAll(returnedTrades);
tradeListAdapter.notifyDataSetChanged();
flag_loading = false;
tradeLayout.removeFooterView(loadingFooter);
}
});
}
@Override
public void onError(String error) {
}
}, currency.getSymbol(), tradeListAdapter.getItem(tradeListAdapter.getCount() - 1).getId());*/
return null;
}
}
private void drawTransactionList(ArrayList<Transaction> transactions)
{
TransactionListAdapter transactionListAdapter = new TransactionListAdapter(getContext(), transactions);
transactionLayout.setAdapter(transactionListAdapter);
transactionLayout.setTextFilterEnabled(false);
}
public class TransactionUpdater extends AsyncTask<Void, Integer, Void>
{
@Override
protected Void doInBackground(Void... voids) {
if(Looper.myLooper() == null)
{
Looper.prepare();
}
final ArrayList<Transaction> transactionList = databaseManager.getCurrencyTransactionsForSymbol(currency.getSymbol());
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
drawTransactionList(transactionList);
}
});
return null;
}
}
private class TradeUpdater extends AsyncTask<Void, Integer, Void>
{
@Override
protected void onPreExecute()
{
super.onPreExecute();
}
@Override
protected void onProgressUpdate(Integer... values)
{
super.onProgressUpdate(values);
}
@Override
protected Void doInBackground(Void... params)
{
binanceManager.updateTrades(new BinanceManager.BinanceCallBack() {
@Override
public void onSuccess() {
ArrayList<Trade> trades = binanceManager.getTrades();
returnedTrades = new ArrayList<>();
for(int i = trades.size() - 1; i >= 0 ; i--)
{
returnedTrades.add(trades.get(i));
}
try {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
ArrayList<Trade> trades = new ArrayList<>();
for(int i = 0; i < 20 && i < returnedTrades.size(); i++)
{
trades.add(returnedTrades.get(i));
}
drawTradeList(trades);
}
});
} catch (NullPointerException e) {
Log.d("moodl", "Transactions do not need to be updated anymore");
}
}
@Override
public void onError(String error) {
}
}, currency.getSymbol());
return null;
}
@Override
protected void onPostExecute(Void result)
{
}
}
}

View File

@ -13,6 +13,7 @@ import android.view.Window;
import android.view.WindowManager;
import com.nauk.moodl.HomeActivityPagerAdapter;
import com.nauk.moodl.LayoutManagers.CustomViewPager;
import com.nauk.moodl.R;
//Use WilliamChart for charts https://github.com/diogobernardino/WilliamChart
@ -26,7 +27,7 @@ import com.nauk.moodl.R;
public class HomeActivity extends AppCompatActivity {
private BottomNavigationView bottomNavigationView;
private ViewPager viewPager;
private CustomViewPager viewPager;
private BottomNavigationView.OnNavigationItemSelectedListener onNavigationItemSelectedListener

View File

@ -24,6 +24,7 @@ import com.nauk.moodl.Activities.SettingsActivity;
import com.nauk.moodl.DataManagers.CurrencyData.Currency;
import com.nauk.moodl.DataManagers.MarketCapManager;
import com.nauk.moodl.DataManagers.PreferencesManager;
import com.nauk.moodl.LayoutManagers.CustomViewPager;
import com.nauk.moodl.PlaceholderManager;
import com.nauk.moodl.R;
@ -257,11 +258,13 @@ public class MarketCapitalization extends Fragment {
{
case MotionEvent.ACTION_DOWN:
refreshLayout.setEnabled(false);
((CustomViewPager) view.getParent().getParent().getParent().getParent().getParent()).setPagingEnabled(false);
break;
case MotionEvent.ACTION_MOVE:
break;
default:
refreshLayout.setEnabled(true);
((CustomViewPager) view.getParent().getParent().getParent().getParent().getParent()).setPagingEnabled(true);
break;
}
return false;

View File

@ -568,7 +568,7 @@ public class Summary extends Fragment {
InputStream input = connection.getInputStream();
result = BitmapFactory.decodeStream(input);
} catch (IOException e) {
e.printStackTrace();
Log.d("moodl", "Error while downloading icon");
result = BitmapFactory.decodeResource(this.getResources(),
R.mipmap.ic_launcher_moodl);
result = Bitmap.createScaledBitmap(result, 50, 50, false);

View File

@ -134,10 +134,14 @@ public class Watchlist extends Fragment {
{
editModeEnabled = false;
LinearLayout watchlistLayout = Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist);
for(int i = 0; i < ((LinearLayout) Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist)).getChildCount(); i++)
{
((LinearLayout) Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist)).getChildAt(i).setClickable(true);
collapseW(((LinearLayout) Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist)).getChildAt(i).findViewById(R.id.deleteCardWatchlist));
View watchlistElement = watchlistLayout.getChildAt(i);
watchlistElement.setClickable(true);
collapseW(watchlistElement.findViewById(R.id.deleteCardWatchlist));
}
}
else
@ -146,14 +150,12 @@ public class Watchlist extends Fragment {
LinearLayout watchlistLayout = Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist);
Animation anim = getVerticalExpandAnimation(watchlistLayout.getChildAt(0));
for(int i = 0; i < ((LinearLayout) Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist)).getChildCount(); i++)
{
View watchlistElement = watchlistLayout.getChildAt(i);
watchlistElement.setClickable(false);
expandW(watchlistElement.findViewById(R.id.deleteCardWatchlist), anim);
expandW(watchlistElement.findViewById(R.id.deleteCardWatchlist));
}
}
}

View File

@ -25,6 +25,7 @@ import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
import com.nauk.moodl.Activities.CurrencyDetailsActivity;
import com.nauk.moodl.Activities.HomeActivityFragments.Summary;
import com.nauk.moodl.DataManagers.DatabaseManager;
import com.nauk.moodl.DataManagers.PreferencesManager;
import com.nauk.moodl.PlaceholderManager;
import com.nauk.moodl.R;
@ -100,6 +101,15 @@ public class CurrencyCardview extends CardView {
updateCardViewInfos(currency);
findViewById(R.id.deleteCardWatchlist).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
DatabaseManager databaseManager = new DatabaseManager(getContext());
databaseManager.deleteCurrencyFromWatchlist(currency.getSymbol());
collapseH(CurrencyCardview.this);
}
});
findViewById(R.id.LineChartView).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -114,6 +124,11 @@ public class CurrencyCardview extends CardView {
updateColor(currency);
}
private float convertDpToPx(float dp)
{
return dp * this.getResources().getDisplayMetrics().density;
}
public CurrencyCardview(@NonNull final Context context, final Currency currency, float totalValue, boolean isBalanceHidden)
{
super(context);
@ -181,9 +196,16 @@ public class CurrencyCardview extends CardView {
private void setupCardView(Context context)
{
ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(ViewGroup.MarginLayoutParams.MATCH_PARENT, ViewGroup.MarginLayoutParams.WRAP_CONTENT);
layoutParams.setMargins((int) convertDpToPx(10), 0, (int) convertDpToPx(10), (int) convertDpToPx(10));
setLayoutParams(layoutParams);
setRadius(convertDpToPx(2));
setClickable(false);
setFocusable(false);
setBackgroundColor(context.getColor(R.color.summary_background));
setCardBackgroundColor(context.getColor(R.color.white));
}
private void setupLineChart(View view, final Currency currency)

View File

@ -15,7 +15,7 @@ public class CustomViewPager extends ViewPager {
public CustomViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
this.enabled = false;
this.enabled = true;
}
@Override

View File

@ -10,656 +10,7 @@
android:id="@+id/vfCurrencyDetails"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="56dp">
<LinearLayout
android:id="@+id/chartsLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:text="Line chart"
android:id="@+id/lineChartButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:enabled="false"
style="@style/Widget.AppCompat.Button.Colored"/>
<Button
android:text="Candle stick chart"
android:id="@+id/candleStickChartButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
style="@style/Widget.AppCompat.Button.Colored"/>
</LinearLayout>
<LinearLayout
android:id="@+id/progressLayoutChart"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.405"
android:visibility="gone"
android:gravity="center">
<ProgressBar
android:id="@+id/progressBarChart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge"
android:layout_gravity="center"
android:background="@drawable/circular_progress_bar"/>
</LinearLayout>
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/chartPriceView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:transitionName="chart"
android:layout_weight="0.5"/>
<com.github.mikephil.charting.charts.CandleStickChart
android:id="@+id/chartCandleStickView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:visibility="gone"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.85"
android:orientation="horizontal">
<TextView
android:id="@+id/timestampHightlight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_weight="0.33"
android:text="\n" />
<TextView
android:id="@+id/priceHightlight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_weight="0.33"
android:text="\n" />
<TextView
android:id="@+id/volumeHightlight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_weight="0.33"
android:text="\n"/>
</LinearLayout>
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/chartVolumeView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:layout_marginTop="5dp" />
<LinearLayout
android:id="@+id/layoutChartButtons"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.82"
android:orientation="horizontal">
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="11.1"
android:autoSizeTextType="uniform"
android:maxLines="1"
android:text="@string/button1h"/>
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="11.1"
android:autoSizeTextType="uniform"
android:maxLines="1"
android:text="@string/button3h"/>
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="11.1"
android:enabled="false"
android:autoSizeTextType="uniform"
android:maxLines="1"
android:text="@string/button1d"/>
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="11.1"
android:autoSizeTextType="uniform"
android:maxLines="1"
android:text="@string/button3d"/>
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="11.1"
android:autoSizeTextType="uniform"
android:maxLines="1"
android:text="@string/button1w"/>
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="11.1"
android:autoSizeTextType="uniform"
android:maxLines="1"
android:text="@string/button1m"/>
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="11.1"
android:text="@string/button3m"/>
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="11.1"
android:autoSizeTextType="uniform"
android:maxLines="1"
android:text="@string/button6m"/>
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="11.1"
android:autoSizeTextType="uniform"
android:text="@string/button1y"/>
</LinearLayout>
<LinearLayout
android:id="@+id/llCharts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.71"
android:orientation="horizontal"
android:paddingStart="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.16">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:text="Beginning price"
android:layout_weight="0.5"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewPriceStart"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:layout_weight="0.5"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.16">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:text="Current price"
android:layout_weight="0.5"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewPriceNow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:layout_weight="0.5"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.16">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:text="Delta"
android:layout_weight="0.5"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewPercentage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:layout_weight="0.5"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.16">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:text="Total volume"
android:layout_weight="0.5"
android:textStyle="bold"/>
<TextView
android:id="@+id/totalVolume"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:layout_weight="0.5" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.16">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:text="Highest price"
android:layout_weight="0.5"
android:textStyle="bold" />
<TextView
android:id="@+id/highestPrice"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:layout_weight="0.5" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.16">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:text="Lowest price"
android:layout_weight="0.5"
android:textStyle="bold"/>
<TextView
android:id="@+id/lowestPrice"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:layout_weight="0.5" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ScrollView
android:id="@+id/infosLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="6dp">
<TextView
android:id="@+id/txtViewPercentageCoinEmited"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"/>
<ProgressBar
android:id="@+id/percentageCoinEmited"
android:layout_width="match_parent"
android:layout_height="5dp"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_margin="5dp"
android:background="@drawable/rounded_corners"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.5">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Total supply"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewTotalSupply"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.5">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Circulating supply"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewCirculatingSupply"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:id="@+id/linearMarketCap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="0.5"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Market capitalizaion"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewMarketCapitalization"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--"/>
</LinearLayout>
<LinearLayout
android:id="@+id/linearRank"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="0.5"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Rank"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewRank"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.5">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Algorithm"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewAlgorithm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.5">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Proof type"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewProofType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="0.5">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Start date"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewStartDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Description"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/transactionsLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:text="Transaction history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="@dimen/cardview_elevation"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5">
<ListView
android:id="@+id/listTransactions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>
</LinearLayout>
<TextView
android:text="Trade history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="@dimen/cardview_elevation" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<LinearLayout
android:id="@+id/tradeLoaderIndicator"
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="center"
android:layout_margin="10dp">
<ProgressBar
android:id="@+id/loadingIndicator"
android:layout_width="20dp"
android:layout_height="20dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Looking for trades..."/>
</LinearLayout>
<ListView
android:id="@+id/listTrades"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"/>
</LinearLayout>
</LinearLayout>
</com.nauk.moodl.LayoutManagers.CustomViewPager>
android:layout_marginBottom="56dp"/>
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation_details"

View File

@ -21,7 +21,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<android.support.v4.view.ViewPager
<com.nauk.moodl.LayoutManagers.CustomViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

View File

@ -1,22 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainLinear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
app:cardCornerRadius="2dp"
android:orientation="vertical"
android:tag="mainLinear">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ProgressBar
android:id="@+id/currencyPortfolioDominance"
android:layout_width="match_parent"
@ -209,5 +199,3 @@
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>

View File

@ -1,22 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainLinear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
app:cardCornerRadius="2dp"
android:orientation="vertical"
android:tag="mainLinear">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -200,5 +190,3 @@
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>

View File

@ -0,0 +1,223 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/infosLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="6dp">
<TextView
android:id="@+id/txtViewPercentageCoinEmited"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"/>
<ProgressBar
android:id="@+id/percentageCoinEmited"
android:layout_width="match_parent"
android:layout_height="5dp"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_margin="5dp"
android:background="@drawable/rounded_corners"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.5">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Total supply"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewTotalSupply"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.5">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Circulating supply"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewCirculatingSupply"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:id="@+id/linearMarketCap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="0.5"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Market capitalizaion"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewMarketCapitalization"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--"/>
</LinearLayout>
<LinearLayout
android:id="@+id/linearRank"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="0.5"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Rank"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewRank"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.5">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Algorithm"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewAlgorithm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.5">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Proof type"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewProofType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="0.5">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Start date"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewStartDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Description"
android:textStyle="bold"/>
<TextView
android:id="@+id/txtViewDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/transactionsLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:text="Transaction history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="@dimen/cardview_elevation"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5">
<ListView
android:id="@+id/listTransactions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>
</LinearLayout>
<TextView
android:text="Trade history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="@dimen/cardview_elevation" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<LinearLayout
android:id="@+id/tradeLoaderIndicator"
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="center"
android:layout_margin="10dp">
<ProgressBar
android:id="@+id/loadingIndicator"
android:layout_width="20dp"
android:layout_height="20dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Looking for trades..."/>
</LinearLayout>
<ListView
android:id="@+id/listTrades"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"/>
</LinearLayout>
</LinearLayout>