Search in sources :

Example 1 with DribbbleDataAdapter

use of com.marshalchen.common.demoofui.artbook.data.DribbbleDataAdapter in project UltimateAndroid by cymcsg.

the class FreeFlowArtbookActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.free_flow_artbook);
    container = (FreeFlowContainer) findViewById(R.id.container);
    Display display = getWindowManager().getDefaultDisplay();
    Point size = new Point();
    display.getSize(size);
    findViewById(R.id.load_more).setOnClickListener(this);
    //Our new layout
    custom = new ArtbookLayout();
    //Grid Layout
    grid = new VGridLayout();
    VGridLayout.LayoutParams params = new VGridLayout.LayoutParams(size.x / 2, size.x / 2);
    grid.setLayoutParams(params);
    //Vertical Layout
    VLayout vlayout = new VLayout();
    VLayout.LayoutParams params2 = new VLayout.LayoutParams(size.x);
    vlayout.setLayoutParams(params2);
    //HLayout
    HLayout hlayout = new HLayout();
    hlayout.setLayoutParams(new HLayout.LayoutParams(size.x));
    layouts = new FreeFlowLayout[] { custom, grid, vlayout, hlayout };
    adapter = new DribbbleDataAdapter(this);
    container.setLayout(layouts[currLayoutIndex]);
    container.setAdapter(adapter);
    fetch = new DribbbleFetch();
    fetch.load(this, itemsPerPage, pageIndex);
}
Also used : VGridLayout(com.marshalchen.common.uimodule.freeflow.layouts.VGridLayout) ArtbookLayout(com.marshalchen.common.demoofui.artbook.layouts.ArtbookLayout) HLayout(com.marshalchen.common.uimodule.freeflow.layouts.HLayout) LayoutParams(com.marshalchen.common.uimodule.freeflow.layouts.VGridLayout.LayoutParams) DribbbleFetch(com.marshalchen.common.demoofui.artbook.models.DribbbleFetch) VLayout(com.marshalchen.common.uimodule.freeflow.layouts.VLayout) Point(android.graphics.Point) LayoutParams(com.marshalchen.common.uimodule.freeflow.layouts.VGridLayout.LayoutParams) DribbbleDataAdapter(com.marshalchen.common.demoofui.artbook.data.DribbbleDataAdapter) Display(android.view.Display)

Aggregations

Point (android.graphics.Point)1 Display (android.view.Display)1 DribbbleDataAdapter (com.marshalchen.common.demoofui.artbook.data.DribbbleDataAdapter)1 ArtbookLayout (com.marshalchen.common.demoofui.artbook.layouts.ArtbookLayout)1 DribbbleFetch (com.marshalchen.common.demoofui.artbook.models.DribbbleFetch)1 HLayout (com.marshalchen.common.uimodule.freeflow.layouts.HLayout)1 VGridLayout (com.marshalchen.common.uimodule.freeflow.layouts.VGridLayout)1 LayoutParams (com.marshalchen.common.uimodule.freeflow.layouts.VGridLayout.LayoutParams)1 VLayout (com.marshalchen.common.uimodule.freeflow.layouts.VLayout)1