Android Open Source - iPhoroidUI-demo List View Item Dao






From Project

Back to project page iPhoroidUI-demo.

License

The source code is released under:

Apache License

If you think the Android project iPhoroidUI-demo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (c) 2011 by KLab Inc., All rights reserved.
 *// www . ja v a2 s  .c om
 * Programmed by Naohide Sano
 */

package org.klab.ui_demo.dao;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.klab.ui_demo.model.Item;


/**
 * IF002.
 * PlayroomItem?DAO
 * ??????????????????????????????????.
 * 
 * @author <a href="mailto:sano-n@klab.jp">Naohide Sano</a> (sano-n)
 * @version 0.00 2011/06/16 sano-n initial version <br>
 */
public class ListViewItemDao extends ItemDao {

    public static int PAGE_SIZE = 10;

    /** ???????????????????? */
    private static ListViewItemDao instance = new ListViewItemDao();
    
    /**
     * ?????????????????
     */
    public static ListViewItemDao getInstance() {
        return instance;
    }
    
    /**
     * ?????????offset??????????????????????????.
     * ???????????????? Constants.MAX_SIZE_AT_ONCE ???????????????.
     * 
     * Gets 10 of items
     */
    public List<Item> getItems(int offset) throws IOException {
        return getItems(offset, PAGE_SIZE);
    }

    /**
     * ?????????offset??????????????????????????.
     * ?????????????????? size ???????????????.
     * 
     * Gets size of items
     */
    public List<Item> getItems(int offset, int size) throws IOException {
        List<Item> result = new ArrayList<Item>();
        for (int i = offset; i < Math.min(offset + size, 99); i++) {
            result.add(newItem(i));
        }
        return result;
    }
}

/* */




Java Source Code List

org.klab.ui_demo.CoverFlowImageAdapter.java
org.klab.ui_demo.FlowViewAndCoverFlowActivity.java
org.klab.ui_demo.FlowViewItemAdapter.java
org.klab.ui_demo.GridViewActivity.java
org.klab.ui_demo.GridViewItemAdapter.java
org.klab.ui_demo.ListViewActivity.java
org.klab.ui_demo.ListViewItemAdapter.java
org.klab.ui_demo.OptionsMenuUtil.java
org.klab.ui_demo.dao.ItemDao.java
org.klab.ui_demo.dao.ListViewItemDao.java
org.klab.ui_demo.model.Item.java
org.klab.ui_demo.net.HTTPClient.java