Fix card generation | Preparing Details fragments
Have to reinstall Windows, non usable commit as is
This commit is contained in:
parent
8c9c6b4cd0
commit
0ab4cb15a1
@ -15,12 +15,12 @@ import android.os.Looper;
|
|||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.design.widget.BottomNavigationView;
|
import android.support.design.widget.BottomNavigationView;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.CardView;
|
import android.support.v7.widget.CardView;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
@ -56,6 +56,7 @@ import com.nauk.moodl.DataManagers.CurrencyData.Transaction;
|
|||||||
import com.nauk.moodl.DataManagers.DatabaseManager;
|
import com.nauk.moodl.DataManagers.DatabaseManager;
|
||||||
import com.nauk.moodl.DataManagers.ExchangeManager.BinanceManager;
|
import com.nauk.moodl.DataManagers.ExchangeManager.BinanceManager;
|
||||||
import com.nauk.moodl.DataManagers.PreferencesManager;
|
import com.nauk.moodl.DataManagers.PreferencesManager;
|
||||||
|
import com.nauk.moodl.DetailsActivityPagerAdapter;
|
||||||
import com.nauk.moodl.LayoutManagers.TradeListAdapter;
|
import com.nauk.moodl.LayoutManagers.TradeListAdapter;
|
||||||
import com.nauk.moodl.LayoutManagers.TransactionListAdapter;
|
import com.nauk.moodl.LayoutManagers.TransactionListAdapter;
|
||||||
import com.nauk.moodl.PlaceholderManager;
|
import com.nauk.moodl.PlaceholderManager;
|
||||||
@ -72,7 +73,7 @@ import static java.lang.Math.abs;
|
|||||||
|
|
||||||
public class CurrencyDetailsActivity extends AppCompatActivity {
|
public class CurrencyDetailsActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private ViewFlipper viewFlipper;
|
private ViewPager viewPager;
|
||||||
private ListView transactionLayout;
|
private ListView transactionLayout;
|
||||||
private ListView tradeLayout;
|
private ListView tradeLayout;
|
||||||
private DatabaseManager databaseManager;
|
private DatabaseManager databaseManager;
|
||||||
@ -113,13 +114,13 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
|||||||
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.navigation_home:
|
case R.id.navigation_home:
|
||||||
viewFlipper.setDisplayedChild(0);
|
viewPager.setCurrentItem(0);
|
||||||
return true;
|
return true;
|
||||||
case R.id.navigation_dashboard:
|
case R.id.navigation_dashboard:
|
||||||
viewFlipper.setDisplayedChild(1);
|
viewPager.setCurrentItem(1);
|
||||||
return true;
|
return true;
|
||||||
case R.id.navigation_notifications:
|
case R.id.navigation_notifications:
|
||||||
viewFlipper.setDisplayedChild(2);
|
viewPager.setCurrentItem(2);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -141,7 +142,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
|||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
|
|
||||||
if(viewFlipper.getDisplayedChild() == 0)
|
if(viewPager.getCurrentItem() == 0)
|
||||||
{
|
{
|
||||||
finishAfterTransition();
|
finishAfterTransition();
|
||||||
}
|
}
|
||||||
@ -160,10 +161,21 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_currency_details);
|
setContentView(R.layout.activity_currency_details);
|
||||||
|
|
||||||
Intent intent = getIntent();
|
viewPager = findViewById(R.id.vfCurrencyDetails);
|
||||||
|
final DetailsActivityPagerAdapter adapter = new DetailsActivityPagerAdapter(getSupportFragmentManager(), 3);
|
||||||
|
|
||||||
|
viewPager.setAdapter(adapter);
|
||||||
|
viewPager.setOffscreenPageLimit(2);
|
||||||
|
|
||||||
|
BottomNavigationView navigation = findViewById(R.id.navigation_details);
|
||||||
|
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
|
||||||
|
|
||||||
|
/*Intent intent = getIntent();
|
||||||
|
|
||||||
currency = intent.getParcelableExtra("currency");
|
currency = intent.getParcelableExtra("currency");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
databaseManager = new DatabaseManager(this);
|
databaseManager = new DatabaseManager(this);
|
||||||
preferencesManager = new PreferencesManager(this);
|
preferencesManager = new PreferencesManager(this);
|
||||||
|
|
||||||
@ -173,7 +185,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
|||||||
displayLineChart = true;
|
displayLineChart = true;
|
||||||
flag_loading = false;
|
flag_loading = false;
|
||||||
|
|
||||||
viewFlipper = findViewById(R.id.vfCurrencyDetails);
|
viewPager = findViewById(R.id.vfCurrencyDetails);
|
||||||
transactionLayout = findViewById(R.id.listTransactions);
|
transactionLayout = findViewById(R.id.listTransactions);
|
||||||
tradeLayout = findViewById(R.id.listTrades);
|
tradeLayout = findViewById(R.id.listTrades);
|
||||||
lineChart = findViewById(R.id.chartPriceView);
|
lineChart = findViewById(R.id.chartPriceView);
|
||||||
@ -227,8 +239,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
updateChartTab(DAY, 1);
|
updateChartTab(DAY, 1);
|
||||||
|
|
||||||
BottomNavigationView navigation = findViewById(R.id.navigation_details);
|
|
||||||
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
|
|
||||||
|
|
||||||
hasBeenModified = false;
|
hasBeenModified = false;
|
||||||
|
|
||||||
@ -238,7 +249,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
|||||||
tradeDrawable.invalidateSelf();
|
tradeDrawable.invalidateSelf();
|
||||||
|
|
||||||
TradeUpdater updater = new TradeUpdater();
|
TradeUpdater updater = new TradeUpdater();
|
||||||
updater.execute();
|
updater.execute();*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshInfoTab()
|
private void refreshInfoTab()
|
||||||
@ -609,6 +620,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity {
|
|||||||
initializeBarChart(barChart);
|
initializeBarChart(barChart);
|
||||||
|
|
||||||
barChart.setData(generateVolumeChartSet());
|
barChart.setData(generateVolumeChartSet());
|
||||||
|
barChart.animateY(1000);
|
||||||
barChart.invalidate();
|
barChart.invalidate();
|
||||||
|
|
||||||
findViewById(R.id.chartVolumeView).setVisibility(View.VISIBLE);
|
findViewById(R.id.chartVolumeView).setVisibility(View.VISIBLE);
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.nauk.moodl.Activities.DetailsActivityFragments;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.nauk.moodl.DataManagers.CurrencyData.Currency;
|
||||||
|
import com.nauk.moodl.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Tiji on 13/05/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Home extends Fragment {
|
||||||
|
|
||||||
|
private View view;
|
||||||
|
private Currency currency;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
||||||
|
{
|
||||||
|
view = inflater.inflate(R.layout.fragment_home_detailsactivity, container, false);
|
||||||
|
|
||||||
|
currency = getActivity().getIntent().getParcelableExtra("currency");
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.nauk.moodl.Activities.DetailsActivityFragments;
|
||||||
|
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Tiji on 13/05/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Informations extends Fragment {
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.nauk.moodl.Activities.DetailsActivityFragments;
|
||||||
|
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Tiji on 13/05/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Transactions extends Fragment {
|
||||||
|
}
|
@ -1,7 +1,6 @@
|
|||||||
package com.nauk.moodl.Activities;
|
package com.nauk.moodl.Activities;
|
||||||
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.design.widget.AppBarLayout;
|
import android.support.design.widget.AppBarLayout;
|
||||||
@ -13,7 +12,7 @@ import android.view.MenuItem;
|
|||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
import com.nauk.moodl.PagerAdapter;
|
import com.nauk.moodl.HomeActivityPagerAdapter;
|
||||||
import com.nauk.moodl.R;
|
import com.nauk.moodl.R;
|
||||||
|
|
||||||
//Use WilliamChart for charts https://github.com/diogobernardino/WilliamChart
|
//Use WilliamChart for charts https://github.com/diogobernardino/WilliamChart
|
||||||
@ -64,7 +63,7 @@ public class HomeActivity extends AppCompatActivity {
|
|||||||
setContentView(R.layout.activity_currency_summary);
|
setContentView(R.layout.activity_currency_summary);
|
||||||
|
|
||||||
viewPager = findViewById(R.id.viewPager);
|
viewPager = findViewById(R.id.viewPager);
|
||||||
final PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager(), 3);
|
final HomeActivityPagerAdapter adapter = new HomeActivityPagerAdapter(getSupportFragmentManager(), 3);
|
||||||
|
|
||||||
viewPager.setAdapter(adapter);
|
viewPager.setAdapter(adapter);
|
||||||
viewPager.setOffscreenPageLimit(2);
|
viewPager.setOffscreenPageLimit(2);
|
||||||
|
@ -128,6 +128,8 @@ public class Summary extends Fragment {
|
|||||||
updateRunnable = new Runnable() {
|
updateRunnable = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
lastTimestamp = 0;
|
||||||
|
|
||||||
if (refreshLayout.isRefreshing())
|
if (refreshLayout.isRefreshing())
|
||||||
{
|
{
|
||||||
refreshLayout.setRefreshing(false);
|
refreshLayout.setRefreshing(false);
|
||||||
|
@ -13,6 +13,7 @@ import android.support.v7.widget.CardView;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
@ -54,7 +55,9 @@ public class CurrencyCardview extends CardView {
|
|||||||
|
|
||||||
((LineChart) findViewById(R.id.LineChartView)).setNoDataTextColor(currency.getChartColor());
|
((LineChart) findViewById(R.id.LineChartView)).setNoDataTextColor(currency.getChartColor());
|
||||||
|
|
||||||
findViewById(R.id.masterLayout).setOnClickListener(new View.OnClickListener() {
|
setupCardView(context);
|
||||||
|
|
||||||
|
setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(final View view) {
|
public void onClick(final View view) {
|
||||||
PreferencesManager preferencesManager = new PreferencesManager(context);
|
PreferencesManager preferencesManager = new PreferencesManager(context);
|
||||||
@ -119,7 +122,9 @@ public class CurrencyCardview extends CardView {
|
|||||||
|
|
||||||
((LineChart) findViewById(R.id.LineChartView)).setNoDataTextColor(currency.getChartColor());
|
((LineChart) findViewById(R.id.LineChartView)).setNoDataTextColor(currency.getChartColor());
|
||||||
|
|
||||||
findViewById(R.id.masterLayout).setOnClickListener(new View.OnClickListener() {
|
setupCardView(context);
|
||||||
|
|
||||||
|
setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(final View view) {
|
public void onClick(final View view) {
|
||||||
PreferencesManager preferencesManager = new PreferencesManager(context);
|
PreferencesManager preferencesManager = new PreferencesManager(context);
|
||||||
@ -174,6 +179,13 @@ public class CurrencyCardview extends CardView {
|
|||||||
updateColor(currency);
|
updateColor(currency);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupCardView(Context context)
|
||||||
|
{
|
||||||
|
setClickable(false);
|
||||||
|
setFocusable(false);
|
||||||
|
setBackgroundColor(context.getColor(R.color.summary_background));
|
||||||
|
}
|
||||||
|
|
||||||
private void setupLineChart(View view, final Currency currency)
|
private void setupLineChart(View view, final Currency currency)
|
||||||
{
|
{
|
||||||
LineChart lineChart = findViewById(R.id.LineChartView);
|
LineChart lineChart = findViewById(R.id.LineChartView);
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.nauk.moodl;
|
||||||
|
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v4.app.FragmentManager;
|
||||||
|
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||||
|
|
||||||
|
import com.nauk.moodl.Activities.DetailsActivityFragments.Home;
|
||||||
|
import com.nauk.moodl.Activities.DetailsActivityFragments.Informations;
|
||||||
|
import com.nauk.moodl.Activities.DetailsActivityFragments.Transactions;
|
||||||
|
import com.nauk.moodl.Activities.HomeActivityFragments.MarketCapitalization;
|
||||||
|
import com.nauk.moodl.Activities.HomeActivityFragments.Summary;
|
||||||
|
import com.nauk.moodl.Activities.HomeActivityFragments.Watchlist;
|
||||||
|
import com.nauk.moodl.DataManagers.CurrencyData.Currency;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Tiji on 13/05/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class DetailsActivityPagerAdapter extends FragmentStatePagerAdapter {
|
||||||
|
|
||||||
|
private int numOfTabs;
|
||||||
|
|
||||||
|
public DetailsActivityPagerAdapter(FragmentManager fm, int numOfTabs)
|
||||||
|
{
|
||||||
|
super(fm);
|
||||||
|
this.numOfTabs = numOfTabs;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Fragment getItem(int position) {
|
||||||
|
switch (position)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return new Home();
|
||||||
|
case 1:
|
||||||
|
return new Informations();
|
||||||
|
case 2:
|
||||||
|
return new Transactions();
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return numOfTabs;
|
||||||
|
}
|
||||||
|
}
|
@ -12,11 +12,11 @@ import com.nauk.moodl.Activities.HomeActivityFragments.Watchlist;
|
|||||||
* Created by Tiji on 13/04/2018.
|
* Created by Tiji on 13/04/2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class PagerAdapter extends FragmentStatePagerAdapter {
|
public class HomeActivityPagerAdapter extends FragmentStatePagerAdapter {
|
||||||
|
|
||||||
private int numOfTabs;
|
private int numOfTabs;
|
||||||
|
|
||||||
public PagerAdapter(FragmentManager fm, int numOfTabs)
|
public HomeActivityPagerAdapter(FragmentManager fm, int numOfTabs)
|
||||||
{
|
{
|
||||||
super(fm);
|
super(fm);
|
||||||
this.numOfTabs = numOfTabs;
|
this.numOfTabs = numOfTabs;
|
||||||
@ -27,14 +27,11 @@ public class PagerAdapter extends FragmentStatePagerAdapter {
|
|||||||
switch (position)
|
switch (position)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
Watchlist watchlist = new Watchlist();
|
return new Watchlist();
|
||||||
return watchlist;
|
|
||||||
case 1:
|
case 1:
|
||||||
Summary summary = new Summary();
|
return new Summary();
|
||||||
return summary;
|
|
||||||
case 2:
|
case 2:
|
||||||
MarketCapitalization marketCapitalization = new MarketCapitalization();
|
return new MarketCapitalization();
|
||||||
return marketCapitalization;
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
@ -6,7 +6,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
tools:context="com.nauk.moodl.Activities.CurrencyDetailsActivity">
|
tools:context="com.nauk.moodl.Activities.CurrencyDetailsActivity">
|
||||||
|
|
||||||
<ViewFlipper
|
<android.support.v4.view.ViewPager
|
||||||
android:id="@+id/vfCurrencyDetails"
|
android:id="@+id/vfCurrencyDetails"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@ -659,7 +659,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ViewFlipper>
|
</android.support.v4.view.ViewPager>
|
||||||
|
|
||||||
<android.support.design.widget.BottomNavigationView
|
<android.support.design.widget.BottomNavigationView
|
||||||
android:id="@+id/navigation_details"
|
android:id="@+id/navigation_details"
|
||||||
|
@ -1,34 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/masterLayout"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:card_view="http://schemas.android.com/tools"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:paddingBottom="4dp">
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
|
||||||
android:id="@+id/cardview"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="10dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:focusable="false"
|
|
||||||
android:backgroundTint="@color/cardview_background"
|
|
||||||
app:cardCornerRadius="2dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
card_view:cardElevation="@dimen/cardview_elevation">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/mainLinear"
|
android:id="@+id/mainLinear"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
app:cardCornerRadius="2dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:tag="mainLinear">
|
android:tag="mainLinear">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/currencyPortfolioDominance"
|
android:id="@+id/currencyPortfolioDominance"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -222,6 +210,4 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</android.support.v7.widget.CardView>
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
|
@ -1,32 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/masterLayout"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:paddingBottom="4dp"
|
|
||||||
android:tag="ParentCon">
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="10dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:backgroundTint="@color/listBackground2"
|
|
||||||
app:cardCornerRadius="2dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
android:tag="Parent">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/mainLinear"
|
android:id="@+id/mainLinear"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
app:cardCornerRadius="2dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:tag="mainLinear">
|
android:tag="mainLinear">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -211,6 +201,4 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</android.support.v7.widget.CardView>
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
|
358
app/src/main/res/layout/fragment_home_detailsactivity.xml
Normal file
358
app/src/main/res/layout/fragment_home_detailsactivity.xml
Normal file
@ -0,0 +1,358 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
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>
|
@ -77,7 +77,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="20dp">
|
android:paddingTop="25dp">
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/linearLayoutWatchlist"
|
<LinearLayout android:id="@+id/linearLayoutWatchlist"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -108,10 +108,6 @@
|
|||||||
android:textColor="@color/separationColor"
|
android:textColor="@color/separationColor"
|
||||||
style="@style/Widget.AppCompat.Button.Borderless"/>
|
style="@style/Widget.AppCompat.Button.Borderless"/>
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="10dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</android.support.v4.widget.NestedScrollView>
|
</android.support.v4.widget.NestedScrollView>
|
||||||
|
Loading…
Reference in New Issue
Block a user