Example usage for android.util SparseArray SparseArray

List of usage examples for android.util SparseArray SparseArray

Introduction

In this page you can find the example usage for android.util SparseArray SparseArray.

Prototype

public SparseArray() 

Source Link

Document

Creates a new SparseArray containing no mappings.

Usage

From source file:it.unicaradio.android.gui.Tabs.java

public static SparseArray<Tab> getTabs(Tabs tabsContainer) {
    SparseArray<Tab> tabs = new SparseArray<Tab>();

    for (int i = 0; i < tabsContainer.getChildCount(); i++) {
        View child = tabsContainer.getChildAt(i);
        if (child instanceof Tab) {
            Tab tab = (Tab) child;/*from   w w w.j a  v  a  2s.co m*/
            tabs.put(tab.getType(), tab);
        }
    }

    return tabs;
}

From source file:com.chess.genesis.dialog.GameStatsDialog.java

private static SparseArray<String[]> createMap() {
    final SparseArray<String[]> map = new SparseArray<String[]>();
    map.put(Piece.WHITE * Enums.WHITEMATE, WON_CHECK);
    map.put(Piece.WHITE * Enums.BLACKMATE, LOST_CHECK);
    map.put(Piece.WHITE * Enums.WHITERESIGN, LOST_RESIGN);
    map.put(Piece.WHITE * Enums.BLACKRESIGN, WON_RESIGN);
    map.put(Piece.WHITE * Enums.IMPOSSIBLE, TIED_IMP);
    map.put(Piece.WHITE * Enums.STALEMATE, TIED_STALE);
    map.put(Piece.WHITE * Enums.WHITEIDLE, LOST_IDLE);
    map.put(Piece.WHITE * Enums.BLACKIDLE, WON_IDLE);
    map.put(Piece.WHITE * Enums.DRAW, DRAW_GAME);

    map.put(Piece.BLACK * Enums.WHITEMATE, LOST_CHECK);
    map.put(Piece.BLACK * Enums.BLACKMATE, WON_CHECK);
    map.put(Piece.BLACK * Enums.WHITERESIGN, WON_RESIGN);
    map.put(Piece.BLACK * Enums.BLACKRESIGN, LOST_RESIGN);
    map.put(Piece.BLACK * Enums.IMPOSSIBLE, TIED_IMP);
    map.put(Piece.BLACK * Enums.STALEMATE, TIED_STALE);
    map.put(Piece.BLACK * Enums.WHITEIDLE, WON_IDLE);
    map.put(Piece.BLACK * Enums.BLACKIDLE, LOST_IDLE);
    map.put(Piece.BLACK * Enums.DRAW, DRAW_GAME);
    return map;/* ww w  . j ava  2s  . c om*/
}

From source file:me.fobid.example.fragmentpageradapter.ui.adapter.MainPagerAdapter.java

public MainPagerAdapter(FragmentManager fm) {
    super(fm);// ww w.j av a 2s  .co  m

    mFragments = new SparseArray<>();

    mFragments.put(0, new TextFragment());
    mFragments.put(1, new BackgroundFragment());
}

From source file:com.espian.ticktock.TitleCursorPagerAdapter.java

public TitleCursorPagerAdapter(FragmentActivity act) {
    super(act.getSupportFragmentManager(), CountdownFragment.class, EmptyFragment.class, null, null);
    noItemString = act.getString(R.string.no_items);
    mTitles = new SparseArray<String>();
}

From source file:com.taobao.luaview.view.adapter.LVPagerAdapter.java

public LVPagerAdapter(Globals globals, UDViewPager udListView) {
    this.mGlobals = globals;
    this.mInitProps = udListView;
    this.mViews = new SparseArray<WeakReference<View>>();
}

From source file:moe.yukinoneko.gcomic.module.main.MainPagerAdapter.java

public MainPagerAdapter(FragmentManager fm) {
    super(fm);
    mPages = new SparseArray<>();
}

From source file:com.google.android.apps.santatracker.dasherdancer.CharacterAdapter.java

public CharacterAdapter(Character[] characters) {
    mCharacters = characters;
    mViews = new SparseArray<ImageView>();
}

From source file:nz.ac.otago.psyanlab.common.designer.util.ArrayFragmentMapAdapter.java

public ArrayFragmentMapAdapter(FragmentManager fm, FragmentFactory factory, List<PageData> items) {
    super(fm);//from  w  ww.j  a va2 s  .  c  o  m
    mFactory = factory;
    mItems = items;
    mFragments = new SparseArray<Fragment>();
}

From source file:org.bwgz.quotation.activity.CursorLoaderManagerActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    loaderIdMap = new SparseArray<CursorLoaderListener>();
}

From source file:com.tortel.deploytrack.DeploymentFragmentAdapter.java

DeploymentFragmentAdapter(Context context, FragmentManager fm) {
    super(fm);/*from   ww  w  .j  a  va  2s. c  o m*/
    this.mContext = context.getApplicationContext();
    mDeploymentList = DatabaseManager.getInstance(mContext).getAllDeployments();
    mFragmentList = new SparseArray<>();
}