Moodl/app/src/main/java/com/nauk/coinfolio/PagerAdapter.java
Tanguy Herbron f0c4062871 Several fixes/improvements
- Add Watchlist charts
- Add Detail Activity for Watchlist coins
- Add padding for Watchlist
- Remove superfluous 0s when displaying balance/price
- Fix Summary Detail Button not changing form
- Fix app crash when Marketcap fragment is not fully loaded
- Fix separate Fragment update obligations
- Fix 0 coin in Detail activity when coming from Watchlist
2018-04-15 20:08:17 +02:00

50 lines
1.3 KiB
Java

package com.nauk.coinfolio;
import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import com.nauk.coinfolio.Activities.HomeActivityFragments.MarketCapitalization;
import com.nauk.coinfolio.Activities.HomeActivityFragments.Summary;
import com.nauk.coinfolio.Activities.HomeActivityFragments.Watchlist;
/**
* Created by Tiji on 13/04/2018.
*/
public class PagerAdapter extends FragmentStatePagerAdapter {
private int numOfTabs;
public PagerAdapter(FragmentManager fm, int numOfTabs)
{
super(fm);
this.numOfTabs = numOfTabs;
}
@Override
public Fragment getItem(int position) {
switch (position)
{
case 0:
Watchlist watchlist = new Watchlist();
return watchlist;
case 1:
Summary summary = new Summary();
return summary;
case 2:
MarketCapitalization marketCapitalization = new MarketCapitalization();
return marketCapitalization;
default:
return null;
}
}
@Override
public int getCount() {
return numOfTabs;
}
}